-
Notifications
You must be signed in to change notification settings - Fork 1
/
jdrap.cl
executable file
·119 lines (88 loc) · 2.27 KB
/
jdrap.cl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#
# Ver. Jul06
#
procedure jdrap
int iw = 1 {prompt="From waveplate position number iw"}
int fw = 8 {prompt="to waveplate position number fw"}
bool contiguous = yes {prompt="Positions of wave-plate are contiguous?"}
struct *flist1
struct *flist2
struct *flist3
begin
string line,fileout
string imagem,lista
string diret,raiz
string dia,mes,ano
string lixo1
int i, nw
#LOOP OF THE WP POSITIONS
for (i = iw; i <= fw; i += 1) {
nw = i
if (contiguous == no) {
if (i >= 5 && i <=8) {
nw = nw+4
}
}
if (nw <= 9) {
raiz = "0"//nw
} else {
raiz = ""//nw
}
#ATUALIZAR
diret = "p"//raiz//"0"
# diret = "0"//raiz//"0"
fileout = "../jd0"//raiz
print ""
print "# Processing images for waveplate position # "//nw
chdir (diret)
print "# Erasing first image..."
#ATUALIZAR
del (files="p*0000",go_ahead=yes, verify=no, >& "dev$null")
# del (files="0*0000",go_ahead=yes, verify=no, >& "dev$null")
#ATUALIZAR
imdel (images="p*.fits",go_ahead=yes,
# imdel (images="0*.fits",go_ahead=yes,
verify=no, >& "dev$null")
#$
print "# Performing bit swap"
#Search for first image
lista = mktemp("lista")
#ATUALIZAR
files("p*", > lista)
# files("0*", > lista)
flist3 = lista
lixo1 = fscan(flist3, imagem)
delete (lista, ver-, >& "dev$null")
#$
#ATUALIZAR
del (files="pp*,hp*",go_ahead=yes, verify=no, >& "dev$null")
# del (files="p0*,h0*",go_ahead=yes, verify=no, >& "dev$null")
swap(files=imagem,tcheck=no)
print ("# Calculating JD and writing it to file jd0"//raiz)
# Set the observatory name
hedit(images=imagem,fields="OBSERVAT",value="LNA",add=yes,del-,ver-,sho+, >& "dev$null")
#$
# Correct the date format
imgets(imagem,"DATE-OBS")
line = imgets.value
dia = substr(line,1,2)
mes = substr(line,4,5)
ano = substr(line,7,10)
hedit(images=imagem,fields="DATE-OBS",value=ano//"-"//mes//"-"//dia,
add-,del-,ver-,sho+, >& "dev$null")
#$
setjd(images=imagem,date="DATE-OBS",exposure="exptime",ra="",dec="",epoch="",
jd="jd",hjd="",ljd="",utdate+,uttime+,listo-, >& "dev$null")
#$
imgets(imagem,"JD")
delete (fileout, ver-, >& "dev$null")
#$
print(imgets.value, > fileout)
imdel(imagem,go_ahead=yes,verify=no, >& "dev$null")
#$
chdir ("..")
#$
}
flist3 = ""
beep
end