Function index2satpix, index0 ;+ ;NAME: ; index2satpix ;PURPOSE: ; For given level_1 index structure(s), this function goes back to ; the level_0 images and runs SXT_PREP ; to return the maps of saturated pixels. ; ;CALLING SEQUENCE: ; satpix = index2satpix(index) ;INPUT: ; item - The index structure (Level_1 indexes, in most cases). ; The structure can be the roadmap, or observing log. ; ;OPTIONAL INPUT (keyword): ; ;OUTPUT: ; returns - map(s) of saturated pixels (output from SXT_PREP). ; ;Calling : index2lev0file.pro, gt_serialnum.pro, sxt_prep. ; ;HISTORY: ; Written 06-Aug-2010 (Aki Takeda) as a modified version of ; index2unc.pro ; 27-Jun-2011 (Aki T.) added set-up procedure for YLstone. ;- ;************** setup environment ***************** m_name=get_host(/short) print,'*********************************' print,'machine name : ',m_name print,'*********************************' ; case m_name of 'ylstone': yl_setup_yls 'helios': yl_setup_helio else : yl_setup_helic endcase ; nn=n_elements(index0) xs=max(gt_shape(index0,/x)) ys=max(gt_shape(index0,/y)) satpix_arr=bytarr(xs,ys,nn) ; ;----- search level_0 files ----- l0files=index2lev0file(index0) ; for i=0,nn-1 do begin ;----- read level_0 files ----- rd_xda,l0files(i),-1,ichk,/nodata ss=where(gt_serialnum(ichk) eq gt_serialnum(index0(i))) if ss(0) ne -1 then begin rd_xda,l0files(i),ss,ii,dd ;***** non-statistical errors ***** choose_sfc,ii sxt_prep,ii,dd,iout,dout,unc0,satpix0,/float,/dc_interp,/dc_orbit_correct, $ /sxt_cleanx,rest_low8=yn_lw8,/ssc_norm xx=gt_shape(iout,/x) yy=gt_shape(iout,/y) satpix_arr(0:xx-1,0:yy-1,i)=satpix0 endif endfor ; satpix=satpix_arr if (nn eq 1) then satpix = satpix_arr(0) ;turn it into a scalar ; return, satpix ; end