forked from pohuigin/idl_objects
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsolmon_config__define.pro
369 lines (261 loc) · 9.61 KB
/
solmon_config__define.pro
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
; =========================================================================
;+
; Project : SOLAR MONITOR
;
; Name : SOLMON_CONFIG__DEFINE
;
; Purpose : Define a SOLAR MONITOR instrument configuration object
;
; Category : Ancillary Synoptic Objects
;
; Syntax : IDL> solmon=obj_new('solmon_config')
;
; History : Written 11-Jul-2007, Paul Higgins, (ARG/TCD)
; Beta Version 12-Jul-2007, Paul Higgins, (ARG/TCD)
; --Added SOLMON_CONFIG::DATA_PROCESS
; Edit 6-Nov-2008, Paul Higgins, (ARG/TCD)
; --Changed XRT bit in SOLMON_CONFIG::DATA_PROCESS to use external proc.
; Edit 26-Jan-2009, Paul Higgins, (ARG/TCD)
; --Changed XRT bit in SOLMON_CONFIG::DATA_PROCESS to use internal proc.
;
; Contact : P.A. Higgins: pohuigin {at} gmail {dot} com
; P. Gallagher: peter.gallagher {at} tcd {dot} ie
;-
; =========================================================================
;-------------------------------------------------------------------->
FUNCTION solmon_config::INIT
self.use_config = ptr_new(/allocate)
;--<< CHANGE THIS VALUE TO 1 FOR THIS CONFIG FILE TO BE USED OR 0 TO TURN IT OFF. >>
*(self.use_config) = 1
return,1
end
;-------------------------------------------------------------------->
PRO solmon_config::config,instrument=instrument,filter=filter,sat_prop,filter_prop
if keyword_set(instrument) then begin
;--<< BEGIN INSTRUMENT DEFINITIONS >>
;--<< HMI PROPERTIES >>
if instrument eq 'hmi' then begin
filter_prop=''
sat_prop={explot:{grid:1,center:1,drange:1}, $
plot_prop:{grid:15,center:[0,0],drange:[-1000,1000]}, $
fspan:{url:'http://www.solarmonitor.org', $
ftype:'*_fd_*.fts*', $
path:['/data/','insert','/fits/shmi']}, $
xstd:4050,ystd:4050,loadct:0,hasfilter:0,unisize:1,arch_type:2}
endif
;--<< XRT PROPERTIES >>
if instrument eq 'xrt' then begin
filter_prop=''
sat_prop={explot:{log:1,grid:1,center:1,drange:''}, $
plot_prop:{log:1,grid:15,center:[0,0],drange:['','']}, $
fspan:{url:'http://www.solarmonitor.org',ftype:'*_fd_*.fts*',path:['/data/','insert','/fits/hxrt']}, $
xstd:2100,ystd:2100,loadct:3,hasfilter:0,unisize:1,arch_type:2}
endif
;--<< GONG PROPERTIES >>
if instrument eq 'gong' then begin
filter_prop=''
sat_prop={explot:{log:'',grid:1,center:1,drange:1}, $
plot_prop:{log:'',grid:15,center:[0,0],drange:[-100,100]}, $
fspan:{url:'http://www.solarmonitor.org',ftype:'*_fd_*.fts*',path:['/data/','insert','/fits/gong']}, $
xstd:1100,ystd:1100,loadct:0,hasfilter:0,unisize:0,arch_type:2}
endif
;--<< NSOGONG PROPERTIES >>
if instrument eq 'nsogong' then begin
filter_prop=''
sat_prop={explot:{dmin:1,dmax:1,log:'',grid:1,center:1}, $
plot_prop:{dmin:-200,dmax:200,log:'',grid:15,center:[0,0]}, $
fspan:{url:'http://gong.nso.edu',ftype:'bb*.fits*',path:['/Daily_Images/bb/fits/','insert','']}, $
xstd:1100,ystd:1100,loadct:0,hasfilter:0,unisize:0,arch_type:2}
endif
;--<< BBSO PROPERTIES >>
if instrument eq 'bbso' then begin
filter_prop=''
sat_prop={explot:{log:'',grid:1,center:1}, $
plot_prop:{log:'',grid:15,center:[0,0]}, $
fspan:{url:'http://www.solarmonitor.org',ftype:'*_fd_*.fts*',path:['/data/','insert','/fits/bbso']}, $
xstd:2100,ystd:2100,loadct:3,hasfilter:0,unisize:0,arch_type:2}
endif
;--<< SXI PROPERTIES >>
if instrument eq 'sxi' then begin
filter_prop=''
sat_prop={explot:{log:1,grid:1,center:1}, $
plot_prop:{log:1,grid:15,center:[0,0]}, $
fspan:{url:'http://www.solarmonitor.org',ftype:'*_fd_*.fts*',path:['/data/','insert','/fits/gsxi']}, $
xstd:1100,ystd:1100,loadct:3,hasfilter:0,unisize:0,arch_type:2}
endif
;--<< EIT PROPERTIES >>
if instrument eq 'eit' then begin
filter_prop={f195:['8','195',''],f171:['1','171',''],f304:['3','304',''],f284:['3','284','']}
sat_prop={explot:{log:1,grid:1,center:1}, $
plot_prop:{log:1,grid:15,center:[0,0]}, $
fspan:{url:'http://www.solarmonitor.org', $
ftype:['*','insert', '*_fd_','*.fts*'], $
path:['/data/','insert','/fits/seit']}, $
xstd:1100,ystd:1100,loadct:8,hasfilter:1,def_filt:'195',unisize:1,arch_type:2}
endif
;--<< MDI PROPERTIES >>
if instrument eq 'mdi' then begin
filter_prop={fmaglc:['0','maglc',''],figram:['1','igram','']}
sat_prop={explot:{grid:1,center:1}, $
plot_prop:{grid:15,center:[0,0]}, $
fspan:{url:'http://www.solarmonitor.org', $
ftype:['*','insert','*_fd_','*.fts*'], $
path:['/data/','insert','/fits/smdi']}, $
xstd:1100,ystd:1100,loadct:0,hasfilter:1,def_filt:'maglc',unisize:1,arch_type:2}
endif
;--<< GRIANMDI PROPERTIES >>
if instrument eq 'grianmdi' then begin
filter_prop={fmaglc:['0','maglc',''],figram:['1','igram','']}
sat_prop={explot:{grid:1,center:1}, $
plot_prop:{grid:15,center:[0,0]}, $
fspan:{url:'', $
ftype:['*','insert','*_fd_','*.fts*'], $
path:['~/Sites/data/','insert','/fits/smdi']}, $
xstd:1100,ystd:1100,loadct:0,hasfilter:1,def_filt:'maglc',unisize:1,arch_type:0}
endif
;--<< ARCHMDI PROPERTIES >>
if instrument eq 'archmdi' then begin
filter_prop={fmaglc:['0','fd','/mdi_mag'],figram:['1','int','/mdi_int']}
sat_prop={explot:{dmin:1,dmax:1,grid:1,center:1}, $
plot_prop:{dmin:-200,dmax:200,grid:15,center:[0,0]}, $
fspan:{url:'http://solarmonitor.org', $
ftype:['*_','insert','_*.fits'], $
path:'insert'}, $
xstd:1100,ystd:1100,loadct:0,hasfilter:1,def_filt:'maglc',unisize:1,arch_type:1}
endif
;--<< TRACE PROPERTIES >>
if instrument eq 'trace' then begin
filter_prop=''
sat_prop={explot:{log:1,grid:1,center:1}, $
plot_prop:{log:1,grid:15,center:[0,0]}, $
fspan:{url:'http://www.solarmonitor.org',ftype:'*_fd_*.fts*',path:['/data/','insert','/fits/trce']}, $
xstd:1100,ystd:1100,loadct:8,hasfilter:0,unisize:0,arch_type:2}
endif
;--<< DEIT PROPERTIES >>
if instrument eq 'deit' then begin
filter_prop={f195:['8','195',''],f171:['1','171',''],f304:['3','304',''],f284:['8','284','']}
sat_prop={explot:{log:1,grid:1,center:1}, $
plot_prop:{log:1,grid:15,center:[0,0]}, $
fspan:{url:'', $
ftype:['*','insert','*_fd_','*.fts*'], $
path:['~/data/eit']}, $
xstd:1100,ystd:1100,loadct:0,hasfilter:1,def_filt:'195',unisize:0,arch_type:0}
endif
;--<< DXRT PROPERTIES >>
if instrument eq 'dxrt' then begin
filter_prop=''
sat_prop={explot:{log:1,grid:1,center:1}, $
plot_prop:{log:1,grid:15,center:[0,0]}, $
fspan:{url:'',ftype:'*.fits',path:'~/data/xrt'}, $
xstd:2100,ystd:2100,loadct:3,hasfilter:0,unisize:0,arch_type:0}
endif
;--<< DDXRT PROPERTIES >>
if instrument eq 'ddxrt' then begin
filter_prop=''
sat_prop={explot:{log:1,grid:1,center:1}, $
plot_prop:{log:1,grid:15,center:[0,0]}, $
fspan:{url:'',ftype:'*.fits',path:''}, $
xstd:2100,ystd:2100,loadct:3,hasfilter:0,unisize:0,arch_type:0}
endif
;--<< DMDI PROPERTIES >>
if instrument eq 'dmdi' then begin
filter_prop={fmaglc:['0','fd',''],figram:['1','int','']}
sat_prop={explot:{dmin:1,dmax:1,grid:1,center:1}, $
plot_prop:{dmin:-300,dmax:300,grid:15,center:[0,0]}, $
fspan:{url:'', $
ftype:['*_','insert','_*0.fits*'],path:'~/idl/solarmonitor'}, $
xstd:1100,ystd:1100,loadct:0,hasfilter:1,def_filt:'maglc',unisize:1,arch_type:0}
endif
;--<< DEITTEMP PROPERTIES >>
if instrument eq 'deittemp' then begin
filter_prop=''
sat_prop={explot:{dmin:1,center:1}, $
plot_prop:{dmin:900000,center:[0,0]}, $
fspan:{url:'', $
ftype:['solmon_eit_temp*.fits'],path:'~/idl/solarmonitor'}, $
xstd:1100,ystd:1100,loadct:0,hasfilter:0,unisize:1,arch_type:0}
endif
;--<< END INSTRUMENT DEFINITIONS >>
endif
print,' '
print,'Configuration Complete.'
print,' '
return
end
;----------------------------------------------->
function solmon_config::data_process,maparr
for i=0,n_elements(maparr)-1 do begin
map=maparr[i]
data=map.data
;--<< Process MDI-MAGLC >>
if self->get(/instrument) eq 'mdi' and self->get(/filter) eq 'maglc' then begin
data=data > (-100.) < 100.
endif
;--<< >>
;--<< Process MDI-IGRAM >>
if self->get(/instrument) eq 'mdi' and self->get(/filter) eq 'igram' then begin
; data=YOUR_FAVORITE_PROCESS(data)
endif
;--<< >>
;--<< Process DMDI-IGRAM >>
if self->get(/instrument) eq 'dmdi' and self->get(/filter) eq 'igram' then begin
endif
;--<< >>
;--<< Process EIT-284 >>
if self->get(/instrument) eq 'eit' and self->get(/filter) eq '284' then begin
;meandata=mean(data[where(data gt 0)])
data=exp(data^(.25)) > 0. < 10.
eit_colors,284
endif
;--<< >>
;--<< Process XRT >>
if self->get(/instrument) eq 'xrt' then begin
data=data > 1.
xoff=10
yoff=-15
map.xc=map.xc+xoff
map.yc=map.yc+yoff
; map2index,map,index
; retval=xrt_kludge_pointing(index)
; index2map,retval,map.data,newmap
; map=newmap
endif
;--<< >>
map.data=data
maparr[i]=map
endfor
maparr_process=maparr
return,maparr_process
end
;----------------------------------------------->
function solmon_config::alterpath,fpath
;--<< Alter NSOGONG >>
if self->get(/instrument) eq 'nsogong' then begin
npath=n_elements(fpath)
for i=0,npath-1 do begin
thisfpath=fpath[i]
thispath=str_sep(fpath[i],'/')
thisdate=thispath[n_elements(thispath)-1]
thispath[n_elements(thispath)-1]=time2file(file2time(thisdate),/date,/year2digit)
fpath[i]=strjoin(thispath,'/')
endfor
endif
;--<< >>
fpathnew=fpath
return, fpathnew
end
;----------------------------------------------->
function solmon_config::movie_process,dataset ;DEFUNCT!!!!
;--<< Process DEITTEMP >>
if self->get(/instrument) eq 'deittemp' then begin
dataset=dataset > 900000
endif
;--<< >>
dataset_process=dataset
return,dataset_process
end
;----------------------------------------------->
PRO solmon_config__Define
self = {solmon_config, use_config: ptr_new()}
END
;----------------------------------------------->