Skip to content

Commit

Permalink
Developing new ST code.
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel-gutierrez committed Sep 13, 2018
1 parent 0a265ab commit b354c43
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 72 deletions.
6 changes: 5 additions & 1 deletion RPI/ST_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from PIL import Image
from astropy.io import fits, ascii
from astropy.table import Table
import platform


# Define directories and names.
Expand Down Expand Up @@ -67,7 +68,10 @@ def generate_fits(pic_name, fits_name):
imagebw = image.convert('L')
xsize, ysize = imagebw.size
fits1 = imagebw.getdata()
fits2 = np.array(fits1)
if platform.machine().endswith('64'):
fits2 = np.array(fits1, dtype=np.int32)
else:
fits2 = np.array(fits1)
fits3 = fits2.reshape(ysize, xsize)
fits4 = np.flipud(fits3)
fits5 = fits.PrimaryHDU(data=fits4)
Expand Down
Binary file modified RPI/ST_functions.pyc
Binary file not shown.
17 changes: 12 additions & 5 deletions RPI/StarTracker_dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@
import ST_functions
import sys

# 2.- Define directories, names and important values.
# 2.- Define directories, names and constants values.
DIRs = ST_functions.names_and_dir()
values = ST_functions.st_constants()
DIR_this = DIRs[0]
DIR_img_fits = DIRs[1]
DIR_sext = DIRs[4]
fits_name = DIRs[7]
const = ST_functions.st_constants()
x_pix = const[0]
y_pix = const[1]
cmos2pix = const[2]

# 3.- Receives and reviews the initial data.
st_args = sys.argv
Expand All @@ -15,9 +22,9 @@
print 'REVIEW - 1:'
print 'Initial arguments:', st_args
print 'Image name:', pic_name
print 'DIR_this: ', DIRs[0]
print 'DIR_this: ', DIR_this
print '-.'*30

# 4.- Generate FITS image and execute SExtractor.
ST_functions.generate_fits(pic_name, DIRs[7])
ST_functions.apply_sext(DIRs[4], DIRs[1], DIRs[7], values[0], values[1], values[2])
ST_functions.generate_fits(pic_name, fits_name)
ST_functions.apply_sext(DIR_sext, DIR_img_fits, fits_name, x_pix, y_pix, cmos2pix)
41 changes: 15 additions & 26 deletions RPI/matched.mtA
Original file line number Diff line number Diff line change
@@ -1,26 +1,15 @@
22 -2.1929822 -10.7684896 -15.25
21 -10.6300902 -9.8507087 -15.29
19 -0.4830134 -10.5062277 -15.31
38 -10.6804413 -10.0149165 -14.82
2 -11.7165657 -8.9782499 -19.46
29 10.0023915 -9.0089073 -15.04
12 0.1820083 -9.8885718 -15.59
20 4.3660296 -7.9901726 -15.29
25 -4.5341186 -8.3101184 -15.08
23 5.5597333 -8.1675374 -15.16
5 6.8780819 -6.2555519 -16.91
17 -1.1981218 -6.2849416 -15.36
34 -6.4376292 -5.9304149 -14.90
4 8.4969438 -2.6723617 -16.94
16 -2.5599836 -2.2249477 -15.38
27 5.2499586 -1.6897941 -15.07
10 -9.1471438 -0.1416222 -15.68
13 2.5872863 -1.5274179 -15.49
33 8.8529413 3.9096972 -14.94
3 4.5800340 7.4713270 -18.02
36 8.2034494 10.2596579 -14.83
28 -13.3827055 12.0059405 -15.06
32 -6.4770882 11.4875572 -14.94
15 6.3422426 12.5401079 -15.42
26 1.2503962 13.0822319 -15.08
8 2.0448815 14.0547275 -16.06
18 0.5622723 -0.6335934 -3.49
17 1.9196683 -0.7562286 -3.49
4 1.3976861 -0.6159840 -5.39
28 1.9464988 -0.3341956 -3.08
2 0.7790984 -0.1708433 -6.43
0 0.5442654 -0.0233846 -7.39
8 1.2940721 -0.1952576 -4.76
22 -0.0649805 -0.0653321 -3.20
11 1.4649359 0.3234496 -4.27
32 -0.1009828 0.4401427 -2.70
31 -0.9993047 0.4649924 -2.87
10 2.0448476 0.2277873 -4.66
16 0.8856512 0.7390555 -3.54
36 0.5309574 0.8054759 -2.60
19 -0.1592725 0.9137135 -3.36
41 changes: 15 additions & 26 deletions RPI/matched.mtB
Original file line number Diff line number Diff line change
@@ -1,26 +1,15 @@
80 -2.1894800 -10.7687100 4.68
81 -10.6334900 -9.8562700 4.69
82 -0.4787100 -10.5075000 4.82
83 -10.6837300 -10.0207200 5.07
84 -11.7166200 -8.9811900 0.85
85 10.0128700 -9.0159400 4.86
86 0.1838400 -9.8835200 5.18
87 4.3668300 -7.9896900 4.99
88 -4.5334200 -8.3053100 5.48
89 5.5603100 -8.1665600 5.77
90 6.8762400 -6.2540300 4.38
91 -1.2005300 -6.2824600 5.00
92 -6.4353300 -5.9273500 5.10
93 8.4988600 -2.6758000 3.00
94 -2.5624700 -2.2233700 4.64
95 5.2468600 -1.6939300 4.88
96 -9.1457000 -0.1422900 4.28
97 2.5826500 -1.5288200 4.94
98 8.8508700 3.9029500 5.18
99 4.5791400 7.4649300 1.65
100 8.2044600 10.2574000 5.40
101 -13.4092900 12.0218200 5.28
102 -6.4843100 11.4865300 5.58
103 6.3449800 12.5413600 4.76
104 1.2467200 13.0832800 5.02
105 2.0449700 14.0589600 4.54
91 0.5471900 -0.7071300 3.86
94 1.7805200 -0.6646200 3.12
95 1.5190400 -0.5517900 3.87
96 1.6595800 -0.5096600 2.64
97 0.7166400 -0.2700000 3.96
98 0.6476100 -0.2476700 3.56
99 0.8828600 -0.1045000 3.82
100 -0.0920300 0.0529800 3.87
101 1.3751700 0.2834900 3.19
102 -0.0060200 0.4403600 3.69
103 -1.0329500 0.4109600 4.00
104 1.7474500 0.3142800 2.84
107 1.0778000 0.8066400 3.87
108 0.5154100 0.8895500 2.95
114 -0.3321300 1.1703200 3.89
39 changes: 25 additions & 14 deletions RPI/matched.unA
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
0 -2.0339852 0.6479962 -23.64
1 12.5033342 0.4910460 -23.03
6 -6.2665929 -12.3249197 -16.44
7 -4.9979104 -13.3809785 -16.36
9 11.8735490 2.2530666 -15.75
11 -11.2721916 -14.6331736 -15.64
14 12.9274930 6.5759288 -15.45
18 -12.5556589 -11.2763499 -15.34
24 11.1334403 -3.1668245 -15.11
30 8.7170998 12.2989798 -15.01
31 11.3255580 3.6066312 -14.98
35 14.2710658 -4.2981280 -14.89
37 12.1662956 7.0121500 -14.83
39 -7.1269694 -9.9846061 -14.81
1 1.0084412 -0.6586548 -6.45
3 1.1692754 -0.5354503 -6.01
5 1.8894888 -0.5204633 -5.08
6 -0.6800145 0.1520393 -5.08
7 1.1564407 0.2574522 -4.85
9 0.4660393 -1.0757530 -4.73
12 0.5814427 1.0393806 -4.13
13 2.4303813 -0.1384507 -3.92
14 1.5298255 -0.0212328 -3.62
15 0.8634740 1.0287352 -3.58
20 -0.4927698 -0.0933012 -3.36
21 0.6129247 -0.5917001 -3.25
23 1.1132520 -0.9201871 -3.14
24 2.7685273 0.0973993 -3.14
25 2.8514480 -0.4806456 -3.14
26 1.3397552 -0.7122189 -3.08
27 1.1975058 0.4519925 -3.08
29 -0.1049627 0.1966717 -2.94
30 -0.8463262 0.7856600 -2.94
33 0.3629265 -0.8528921 -2.70
34 2.6466560 0.4055963 -2.70
35 2.5084843 0.0389084 -2.70
37 0.6715802 0.9958731 -2.60
38 2.2516688 0.7014763 -2.60
39 1.2897244 -0.2325959 -2.60
24 changes: 24 additions & 0 deletions RPI/matched.unB
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
80 -0.8421400 -1.7455500 0.46
81 0.6277500 -1.5129700 3.27
82 -1.1406900 -1.7394700 3.92
83 1.7380000 -1.9072800 -0.72
84 -0.5687500 -1.2649400 3.56
85 -0.7571800 -1.3225300 3.70
86 1.3884800 -1.5562500 3.85
87 -1.0311500 -1.2504100 3.95
88 -0.2377600 -1.1109100 4.00
89 -1.3380700 -1.2190300 3.31
90 -1.1505000 -0.9212000 3.41
92 1.7235100 -1.1262300 3.96
93 -0.2238400 -0.5597100 3.24
105 1.5832600 0.6319600 3.31
106 -1.3229100 0.6819400 3.50
109 -1.2821500 1.0386000 3.73
110 0.3248700 1.1177300 3.54
111 0.1808300 1.1382300 3.73
112 1.7506400 1.1471600 0.12
113 -1.7766700 1.1465100 3.60
115 1.8323300 1.2378500 3.60
116 1.6883500 1.3724300 2.79
117 1.1722000 1.5125800 3.93
118 -0.9226300 1.5433000 3.04

0 comments on commit b354c43

Please sign in to comment.