-
Notifications
You must be signed in to change notification settings - Fork 3
/
aia_fits_to_gifs.pro
60 lines (45 loc) · 1.42 KB
/
aia_fits_to_gifs.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
PRO aia_fits_to_gifs, dir = dir, OUTPLOT = outplot
dir = '/Volumes/sdo-aia/hsi_flare_20110716_/'
;fileset = file_search(dir + 'ssw_cutout_20110716_*')
fileset = 'ssw_cutout'
wave_ =['131','171','193','211','335','94']
nwave =n_elements(wave_)
nfiles = fltarr(nwave)
FOR i = 0, nwave-1 DO BEGIN
files = file_search(dir + fileset + '*' + wave_[i] + '_.fts')
nfiles[i] = n_elements(files)
ENDFOR
;the number of files need to be the same!
print, nfiles
file_list = strarr(nfiles[0], nwave)
FOR i = 0, nwave-1 DO BEGIN
files = file_search(dir + fileset + '*' + wave_[i] + '_.fts')
nfiles[i] = n_elements(files)
times = anytim(aiacutout_to_time(files))
s = sort(times)
files = files[s]
file_list[*,i] = files
ENDFOR
FOR j = 0, nwave-1 DO BEGIN
aia_lct, rr, gg, bb, wavelnth=wave_[j], /load
FOR i = 0, nfiles[0]-1 DO BEGIN
curfile = file_list[i,j]
read_sdo, curfile, header, data
wcs = fitshead2wcs( header )
wcs2map, data, wcs, map, id = header.wavelnth
IF keyword_set(OUTPLOT) THEN BEGIN
set_plot, 'z'
device, set_resolution = [600, 600]
ENDIF
cur_time = anytim(map.time)
plot_map, map, charsize = 1.5
legend, wave_[j], box = 0, charsize = 1.5
IF keyword_set(OUTPLOT) THEN BEGIN
tvlct, r, g, b, /get
outfile = 'dem_' + wave_[j] + '_' + break_time(cur_time) + '_' + num2str(i, padchar = '0', length = 3) + '.png'
write_png, outfile, tvrd(), r,g,b
set_plot, 'x'
ENDIF
ENDFOR
ENDFOR
END