SOT SolarSoftDemo fgdemo01a_remote ; ; We want to produce a co-aligned movie of SOT Filtergraph magnetogram and Ca II H line ; images of the large sunspot on Nov 9, 2006 from 11:30 UT to 15:00 UT. ; The first step is to find all relevant FG observations for the time interval of interest. ; In using SolarSoft, there are usually several ways to accomplish a given task. In this case, ; we make use of the SolarSoft routine sot_umodes.pro and sot_cat.pro to identify all unique ; observational modes that were executed during the time interval: ; Searching the SOT catalog for observations of interest ; The key routine for catalog searches is sot_cat.pro. It is quite versatile. This program ; returns SOT catalog records in a structure array: time0 = '09-dec-2006 11:30' time1 = '09-dec-2006 15:00' n_samp = 03 sot_cat, time0, time1, cat, /level0 ; At this point we note that there are two versions of the SOT catalog. One is the quicklook ; catalog and the other is the level0 catalog. The quicklook catalog is created from the quicklook ; data in near real time and incomplete. By default sot_cat searches the quicklook catalog. ; If the data of interest is over two weeks old, then the level0 flag should be used in the call ; to sot_cat, as shown. help, cat ; Notice that for this 3.5 hr period, 103 catalog records were found, each corresponding ; to a single FITS file in the archive. In order to winnow this down to the particular type of ; observations we are interested in, we use the routine sot_umodes.pro to identify all unique ; observational modes that were executed during the time interval: modes = sot_umodes(time0, time1, mcount=mc, info=info, incat=cat) ; We print out the unique modes found to see what is available: help, modes prstr, modes ; data in near real time and incomplete. By default sot_cat searches the quicklook catalog. ; If the data of interest is over two weeks old, then the level0 flag should be used in the call ; to sot_cat, as shown. help, cat ; Notice that for this 3.5 hr period, 103 catalog records were found, each corresponding ; to a single FITS file in the archive. In order to winnow this down to the particular type of ; observations we are interested in, we use the routine sot_umodes.pro to identify all unique ; observational modes that were executed during the time interval: modes = sot_umodes(time0, time1, mcount=mc, info=info, incat=cat) ; We print out the unique modes found to see what is available: help, modes prstr, modes ;For fetching files from a remote database, we use the "hinode_server_select" routine. ; Choices for the location keyword are "lmsal", "oslo", "darts", and "gsfc". ; Choose the one closest to your location as measured in a network-distance metric. hinode_server_select, /lmsal ; The modes we are after for the magnetograms are ones with the SOT catalog 'wave' tag set to ; "TF Fe I 6302". so our next step is to call sot_cat.pro again, this time using the 'search_arry' ; input parameter to restrict the search to particular values of any of the SOT catalog tag list. ; We also specify the NAXIS1 and NAXIS2 keywords to be 2048 and 1024, respectively: sot_cat, time0, time1, cat, urls, /urls, /level0, search_array=['wave=TF*Fe*I*6302','naxis1=2048','naxis2=1024'] help, cat ; We use the SSW routine timegrid.pro to sub-sample these images: n_rec = n_elements(cat) t_grid = timegrid(cat(0).date_obs, cat(n_rec-1).date_obs, nsamp=n_samp) ss_samp = tim2dset(anytim(cat.date_obs,/ints), anytim(t_grid,/ints)) cat_samp = cat(ss_samp) urls_samp = urls(ss_samp) help, urls_samp ; At this point we have identified the set of files we wish to analyze, and we have located them ; at an accessible server. dir_local = './demo_' + strtrim(long(anytim(!stime)),2) if file_exist(dir_local) eq 0 then spawn, 'mkdir ' + dir_local spawn,'rm -f ' + dir_local + './demo/*.gz' cd, dir_local sock_copy, urls_samp cd, '../' files_samp = file_list(dir_local, '*.fits*') ; We next 'prep' the full set of images, using FG_PREP.PRO: fg_prep, files_samp, -1, index_out, data_out, /despike n_img = n_elements(index_out) ; Finally, we remove instances of incomplete images: percent_zero = dblarr(n_img) for i=0,n_img-1 do percent_zero(i) = (n_elements(where(data_out(*,*,1,i) eq 0)) / (2048d0*1024d0)) * 100 ss_good = where(percent_zero lt 5, n_good) index_mag = index_out(ss_good) data_mag = reform(data_out(*,*,1,ss_good)) ; We next search for and process the Ca I images using the same steps, but simply specifying the ; appropriate Ca mode: prstr, modes ; Printing out the previously obtained mode vector again, we see that the only Ca images are specified by ; the SOT catalog 'wave' tag set to "CA II H line". We again use the 'search_array' input parameter to ; restrict the search to this wave value: sot_cat, time0, time1, cat, urls, /urls, /level0, search_array=['wave=Ca*II*H*line','naxis1=2048','naxis2=1024'] help, cat ; This time we sub-select from all of the avaliable Ca images to the closest in time to the magnetogram set: ss_samp_ca = tim2dset(anytim(cat.date_obs,/ints), anytim(index_mag.date_obs,/ints)) cat_samp_ca = cat(ss_samp_ca) urls_samp_ca = urls(ss_samp_ca) help, urls_samp_ca ; We have now identified the set of files we wish to analyze, and we have located them at an ; accessible server. dir_local = './demo_' + strtrim(long(anytim(!stime)),2) if file_exist(dir_local) eq 0 then spawn, 'mkdir ' + dir_local spawn,'rm -f ' + dir_local + './demo/*.gz' cd, dir_local sock_copy, urls_samp_ca cd, '../' files_samp_ca = file_list(dir_local, '*.fits*') ; We again 'prep' the images, using FG_PREP.PRO: STOP fg_prep, files_samp_ca, -1, index_ca, data_ca, /despike n_img_ca = n_elements(index_ca) ; Again we remove instances of incomplete images: percent_zero = dblarr(n_img_ca) for i=0,n_img_ca-1 do percent_zero(i) = (n_elements(where(data_ca(*,*,i) eq 0)) / (2048d0*1024d0)) * 100 ss_good_ca = where(percent_zero lt 5, n_good_ca) index_ca = index_out(ss_good_ca) data_ca = reform(data_out(*,*,ss_good_ca)) end