pro read_erbe_s7 ;=============================================================================== ; Program: read_erbe_s7 ; ; Version: 1.0 ; ; Date: July 15, 1999 ; ; ; Function: Open and read ERBE s7 data files. ; Write certain parameters of a user specified day to ; the output file (s7.rpt). ; A call to dialog_pickfile is used to create a dialog ; box for user filename choice. This routine assumes ; that files are in the current directory. The 'PATH' ; parameter may be modified to indicate an alternate ; directory for data files. ; The user will be prompted which day the user would ; like to read. ; ; *** Please see the README file for further details*** ; ; variables: ; ; Name Type Description ; ---- ---- ----------- ; lun int input file identifyer ; wlun int output file identifyer ; realmth strarr list of the names of each month ; header structure Used to read in file header ; sf_temp_32 lonarr Used to read in 32-bit scale factors ; sf_temp_16 intarr Used to read in 16-bit scale factors ; os_temp_32 lonarr Used to read in 32-bit off-sets ; os_temp_16 intarr Used to read in 16-bit off-sets ; var_list strarr list of variables contained in the file ; start_rec int first record number in file ; j int Counter for the number of records read in ; record structure returns scaled data from the read routine ; (see grab_data routine for a more detailed description) ; ; Invocation: IDL> read_erbe_s7 ; ; Language/Compiler Version: ; ; Point of Contact: Comments or questions should be directed to: ; ; EOSDIS Langley DAAC ; Science, Users and Data Services Office ; NASA Langley Research Center ; Mail Code 157D ; 2 South Wright Street ; Hampton, Virginia 23681-2199 ; U.S.A. ; ; E-mail: larc@eos.nasa.gov ; Phone: (757)864-8656 ; FAX: (757)864-8807 ;=============================================================================== forward_function grab_data ; ; OPEN INPUT AND OUTPUT FILES ; input_file = dialog_pickfile (title='Select input data file', filter = 's7*',$ path='') output_file = 's7.rpt' print,'Name of report file: ',output_file print,' ' openr,lun,input_file,/get_lun openw,wlun,output_file,/get_lun ; ; INITIALIZE CONSTANTS ; realmth=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'] header={subsystem:0,product:0,spacecraft:0,date:intarr(3),$ processed_date:intarr(7),zeros:bytarr(4)} ; ; SET UP ARRAYS TO READ RECORDS COUNTS AND SCALE FACTORS INTO ; records_count=intarr(45) ;The first 31 are the number of records for each day ;the rest are blank sf_temp_32 = lonarr(15) sf_temp_16=intarr(60) os_temp_32 = lonarr(15) os_temp_16 = intarr(60) ; ; READ AND PRINT FILE HEADER ; readu, lun, header ;find the date jday=(header.date[0]*10000l)+(header.date[1])+(header.date[2]/1000l) caldat, jday, month, day, year, hour, minute, second print, 'Start date of record', month, day, year printf, wlun, input_file printf, wlun, " ******** Data Recorded Year and Month ********" printf, wlun, "" printf, wlun, " The data recorded in the Year of ", year printf, wlun, " The data recorded in the Month of ", realmth[fix(month)-1] printf, wlun, "" printf, wlun, "" ;Save the headers: printf, wlun, "HEADER DATA" printf, wlun, " Subsystem = ",header.subsystem printf, wlun, " Product Code = ",header.product printf, wlun, " Space Craft = ",header.spacecraft printf, wlun, " Date Processed = ",header.processed_date[1:3] printf, wlun, " " printf, wlun, " " ; ; READ THE RECORDS COUNT FROM THE FILE ; readu, lun,records_count ; ; READ SCALE FACTORS AND OFFSETS FROM FILE ; ; read all scale factors readu, lun, sf_temp_32, sf_temp_16 ;Read all offsets readu, lun, os_temp_32, os_temp_16 ; GET WHICH DATA SHOULD BE READ FROM USER ; print, " ENTER WHICH DAY OF THE MONTH TO READ (1-31)" region_gui,reg_list num_recs=total(records_count[reg_list-1]) print, " CHOOSE THE VARIABLES TO BE SAVED" make_list,var_list selectTool,var_list,selected_vars print_var=var_list[selected_vars] ; ; LOOP THROUGH USERS CHOICE OF RECORDS TO BE READ ; j=1l nprint_reg=0 average_format='(7f12.3)' date_format="(a6,a3,1x,i2,', ',i4)" while (not eof(lun)) and (nprint_reg lt num_recs) do begin if (not eof(lun)) and (((j-1) mod 100) eq 0) then $ print, "Begin to read record number = ",j,' to ', j+99 if eof(lun) then begin print, "" print," HA! HA! I reach the end of the file" print,"" print, "last record number = ",j goto, endfile endif ; ; CALL ROUTINE TO READ AND SCALE NEXT DATA RECORD AND ; RETURN DATA STRUCTURE ; record=grab_data(lun, sf_temp_32,sf_temp_16,os_temp_32,os_temp_16) ; ; OUTPUT DATA ; caldat, record.julian_day+record.julian_time, month, day, year is_print_reg=where(day eq reg_list) if (is_print_reg[0] ne -1) then begin nprint_reg=nprint_reg+1 printf, wlun, "====================================================================" printf, wlun, 'RECORD NUMBER',j printf, wlun, 'Date: ',realmth[month-1],day,year,format=date_format for ii=0,n_elements(print_var)-1 do begin printf,wlun,' ',print_var[ii] void=execute('printf,wlun, record.'+print_var[ii]+',format=average_format') endfor endif ; ; NEXT RECORD ; j=j+1 endwhile ;end of reading records endfile: print, "Finished after record number ", j close,lun close,wlun free_lun,lun free_lun,wlun print, "" print," Work Done" print,"" end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Function: This subroutine will read a record and return a data structures ; to the main routine. ; ; Variables: Name Type In/Out Description ; ---- ---- ------ ----------- ; lun int in Input file unit number ; sf_temp_32 float in Scale factor for 32-bit data ; sf_temp_16 float in Scale factor for 16-bit data ; os_temp_32 float in Off-set for 32-bit data ; os_temp_16 float in Off-set for 16-bit data ; record structure out data structure ;;record= $ ;julian_day:0.0d, $ ; Julian Day ;julian_time:0.0d, $ ; Julian Time ;earth_sun_dis:0.0d, $ ; Earth - sun distance ;sc_pos_x:dblarr(2), $ ; S/C position, x ;sc_pos_y:dblarr(2), $ ; S/C position, y ;sc_pos_z:dblarr(2), $ ; S/C position, z ;sc_vel_x:dblarr(2), $ ; S/C velocity, x ;sc_vel_y:dblarr(2), $ ; S/C velocity, y ;sc_vel_z:dblarr(2), $ ; S/C velocity, z ;sc_nadir_col:fltarr(2), $ ; S/C nadir, colatitude ;sc_nadir_lon:fltarr(2), $ ; S/C nadir, longitude ;sun_pos_col:0.0, $ ; Sun position, colatitude ;sun_pos_lon:0.0, $ ; Sun position, longitude ;orbit_num:0.0, $ ; Orbit number ;wfov_rad_tot:fltarr(4), $ ; WFOV, filtered, radiometric, total ;wfov_rad_sw:fltarr(4), $ ; WFOV, filtered, radiometric, shortwave ;mfov_rad_tot:fltarr(4), $ ; MFOV, filtered, radiometric, total ;mfov_rad_sw:fltarr(4), $ ; MFOV, filtered, radiometric, shortwave ;wfov_unfil_sw:fltarr(4), $ ; WFOV, unfiltered, radiometric, total ;wfov_unfil_lw:fltarr(4), $ ; WFOV, unfiltered, radiometric, shortwave ;mfov_unfil_sw:fltarr(4), $ ; MFOV, unfiltered, radiometric, total ;mfov_unfil_lw:fltarr(4), $ ; MFOV, unfiltered, radiometric, shortwave ;wfov_toa_nf_sw:0.0, $ ; WFOV, TOA estimate, Numerical filter, shortwave ;wfov_toa_nf_lw:0.0, $ ; WFOV, TOA estimate, Numerical filter, longwave ;mfov_toa_nf_sw:0.0, $ ; MFOV, TOA estimate, Numerical filter, shortwave ;mfov_toa_nf_lw:0.0, $ ; MFOV, TOA estimate, Numerical filter, longwave ;wfov_toa_sf_sw:0.0, $ ; WFOV, TOA estimate, Shape factor, shortwave ;wfov_toa_sf_lw:0.0, $ ; WFOV, TOA estimate, Shape factor, longwave ;mfov_toa_sf_sw:0.0, $ ; MFOV, TOA estimate, Shape factor, shortwave ;mfov_toa_sf_lw:0.0, $ ; MFOV, TOA estimate, Shape factor, longwave ;fov_colat:fltarr(4), $ ; FOV, colatitude ;fov_lon:fltarr(4), $ ; FOV, longitude ;flag_nonscan_ops_mode:intarr(2), $ ; Flag, nonscanner, operations mode ;flag_nonscan_toa:0, $ ; Flag, nonscanner, TOA estimate ;orbit_no_sf:0, $ ; Orbit number, scale factor ;spare:0} ; Not usedS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; function grab_data,lun, sf_temp_32,sf_temp_16,os_temp_32,os_temp_16 ; ; INITIALIZE A FUNCTION TO HOLD THE DATA ; record= { $ julian_day:0.0d, $ ; 1 julian_time:0.0d, $ ; 2 earth_sun_dis:0.0d, $ ; 3 sc_pos_x:dblarr(2), $ ; 4-5 sc_pos_y:dblarr(2), $ ; 6-7 sc_pos_z:dblarr(2), $ ; 8-9 sc_vel_x:dblarr(2), $ ; 10-11 sc_vel_y:dblarr(2), $ ; 12-13 sc_vel_z:dblarr(2), $ ; 14-15 sc_nadir_col:fltarr(2), $ ; 16-17 sc_nadir_lon:fltarr(2), $ ; 18-19 sun_pos_col:0.0, $ ; 20.0 sun_pos_lon:0.0, $ ; 21 orbit_num:0, $ ; 22 wfov_rad_tot:fltarr(4), $ ; 23-26 wfov_rad_sw:fltarr(4), $ ; 27-30 mfov_rad_tot:fltarr(4), $ ; 31-34 mfov_rad_sw:fltarr(4), $ ; 35-38 wfov_unfil_sw:fltarr(4), $ ; 39-42 wfov_unfil_lw:fltarr(4), $ ; 43-46 mfov_unfil_sw:fltarr(4), $ ; 47-50 mfov_unfil_lw:fltarr(4), $ ; 51-54 wfov_toa_nf_sw:0.0, $ ; 55 wfov_toa_nf_lw:0.0, $ ; 56 mfov_toa_nf_sw:0.0, $ ; 57 mfov_toa_nf_lw:0.0, $ ; 58 wfov_toa_sf_sw:0.0, $ ; 59 wfov_toa_sf_lw:0.0, $ ; 60.0 mfov_toa_sf_sw:0.0, $ ; 61 mfov_toa_sf_lw:0.0, $ ; 62 fov_colat:fltarr(4), $ ; 63-66 fov_lon:fltarr(4), $ ; 67-70 flag_nonscan_ops_mode:intarr(2), $ ; 71-72 flag_nonscan_toa:0, $ ; 73 orbit_no_sf:0, $ ; 74 spare:0} ; 75 ; ; DECLARE TEMPORARY ARRAYS TO READ THE DATA INTO ; temp_32 = lonarr(15) ;for 32-bits data temp_16=intarr(60) ;for 16-bits data ; ; DECLARE TEMPORARY ARRAYS TO HOLD THE SCALED DATA ; f_temp_32 = dblarr(15) ;for final 32-bits data f_temp_16=fltarr(60) ;for final 16-bits data ; ; READ THE DATA RECORD ; readu, lun, temp_32, temp_16 ; ; SCALE THE 32-BIT DATA ; tagged = where(temp_32 eq (2^31 - 1), count) if (count ne n_elements(temp_32)) then begin f_temp_32=double (temp_32) / sf_temp_32 - os_temp_32 if (count gt 0) then f_temp_32[tagged] = (2^31 - 1) endif ; ; SCALE THE 16-BIT DATA ; tagged = where(temp_16 eq (2^15 - 1), count) if (count ne n_elements(temp_16)) then begin f_temp_16=float (temp_16) / sf_temp_16 - os_temp_16 if (count gt 0) then f_temp_16[tagged] = (2^15 - 1) endif ; ; SAVE THE RECOVERED DATA TO RECORD STRUCTURE ; record.julian_day=f_temp_32[0] record.julian_time=f_temp_32[1] record.earth_sun_dis=f_temp_32[2] record.sc_pos_x=f_temp_32[3:4] record.sc_pos_y=f_temp_32[5:6] record.sc_pos_z=f_temp_32[7:8] record.sc_vel_x=f_temp_32[9:10] record.sc_vel_y=f_temp_32[11:12] record.sc_vel_z=f_temp_32[13:14] record.sc_nadir_col=f_temp_16[0:1] record.sc_nadir_lon=f_temp_16[2:3] record.sun_pos_col=f_temp_16[4] record.sun_pos_lon=f_temp_16[5] record.orbit_num=f_temp_16[6] record.wfov_rad_tot=f_temp_16[7:10] record.wfov_rad_sw=f_temp_16[11:14] record.mfov_rad_tot=f_temp_16[15:18] record.mfov_rad_sw=f_temp_16[19:22] record.wfov_unfil_sw=f_temp_16[23:26] record.wfov_unfil_lw=f_temp_16[27:30] record.mfov_unfil_sw=f_temp_16[31:34] record.mfov_unfil_lw=f_temp_16[35:38] record.wfov_toa_nf_sw=f_temp_16[39] record.wfov_toa_nf_lw=f_temp_16[40] record.mfov_toa_nf_sw=f_temp_16[41] record.mfov_toa_nf_lw=f_temp_16[42] record.wfov_toa_sf_sw=f_temp_16[43] record.wfov_toa_sf_lw=f_temp_16[44] record.mfov_toa_sf_sw=f_temp_16[45] record.mfov_toa_sf_lw=f_temp_16[46] record.fov_colat=f_temp_16[47:50] record.fov_lon=f_temp_16[51:54] record.flag_nonscan_ops_mode=f_temp_16[55:56] record.flag_nonscan_toa=f_temp_16[57] record.orbit_no_sf=f_temp_16[58] record.spare=f_temp_16[59] return,record end Pro make_list,var_list ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Function: This program will set up a list of variables for the S7 product ; ; Variables: Name Type In/Out Description ; ---- ---- ------ ----------- ; var_list structure out a list of variables available ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; var_list =[$ 'julian_day', $ ; 1 'julian_time', $ ; 2 'earth_sun_dis', $ ; 3 'sc_pos_x', $ ; 4-5 'sc_pos_y', $ ; 6-7 'sc_pos_z', $ ; 8-9 'sc_vel_x', $ ; 10-11 'sc_vel_y', $ ; 12-13 'sc_vel_z', $ ; 14-15 'sc_nadir_col', $ ; 16-17 'sc_nadir_lon', $ ; 18-19 'sun_pos_col', $ ; 20.0 'sun_pos_lon', $ ; 21 'orbit_num', $ ; 22 'wfov_rad_tot', $ ; 23-26 'wfov_rad_sw', $ ; 27-30 'mfov_rad_tot', $ ; 31-34 'mfov_rad_sw', $ ; 35-38 'wfov_unfil_sw', $ ; 39-42 'wfov_unfil_lw', $ ; 43-46 'mfov_unfil_sw', $ ; 47-50 'mfov_unfil_lw', $ ; 51-54 'wfov_toa_nf_sw', $ ; 55 'wfov_toa_nf_lw', $ ; 56 'mfov_toa_nf_sw', $ ; 57 'mfov_toa_nf_lw', $ ; 58 'wfov_toa_sf_sw', $ ; 59 'wfov_toa_sf_lw', $ ; 60.0 'mfov_toa_sf_sw', $ ; 61 'mfov_toa_sf_lw', $ ; 62 'fov_colat', $ ; 63-66 'fov_lon', $ ; 67-70 'flag_nonscan_ops_mode', $ ; 71-72 'flag_nonscan_toa', $ ; 73 'orbit_no_sf' ] ; 74 return end Pro selectTool,title,selected_vars,help=help ;================================================================================= ; Program: selectTool ; ; Version: 1.0 ; ; Date: August 5, 1999 ; ; Purpose/Function: ; This procedure will make a gui to display for a user to choose variables ; from a list of variable names. ; ; Variables: ; title strarr List of variables ; vars intarr Indices of variables chosen (common) ; selected_vars intarr Indices of variables chosen (returned) ; state structure Holds internal GUI information ; ; state structure Holds internal GUI information ; ; ; Invocation: idl> selectTool, parameter_list,index_list ; ; ; Language/Compiler Version: ; This program has been tested on the systems listed below. ; Computer Operating System IDL Version ; --------------- ---------------- ----------- ; Sun, Ultra-4 Solaris 5.6 5.2 ; ; ; Updates: ; ;================================================================================= common selectTool, vars,help_string ;Create a GUI base base=widget_base(/column,title='Choose the variables to be read',mbar=menubase) ;Set up the menu bar void=cw_pdmenu(menubase,/mbar,['1\File','2\Abort Read'],/return_name) ;Create a subBase to put buttons at the top subBaseB=widget_base(base,column=3) void=widget_button(subBaseB,value='Done') void=widget_button(subBaseB,value='Help') void=widget_button(subBaseB,value='Select All') ;Create a subBase for the variable list subBase=widget_base(base,/row) listID=widget_list(subBase,value=Title,ysize=7,/multiple) ;Draw the window widget_control,base,/realize ;Initialize the UValue structure state={listID:listID, all:indgen(n_elements(title))} widget_control,base,set_uvalue=state xmanager,'selectTool',base ;,cleanup='vtClean' selected_vars=vars return End Pro selectTool_event,event ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This procedure manages events generated by the selectTool GUI ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; common selectTool,vars widget_control,event.top,get_uvalue=state thisType=widget_info(event.id,/name) widget_control,event.top,get_uvalue=state ;if (thisType eq 'BUTTON') then widget_control,event.id,get_value=thisValue if (thisType eq'LIST') then thisValue='LIST' else $ if (thisType eq 'BUTTON') then widget_control,event.id,get_value=thisValue $ else thisValue=event.value case thisValue of 'Quit':Begin widget_control,event.top,/destroy retall end 'Help': begin print,'' print,' Select the variables to be saved.' if (!d.name eq 'X') then begin print,' Holding down the Shift key and clicking an item selects the range ' print,' from the previously selected item to the new item. Holding down the' print,' mouse button when selecting items also selects a range. Holding ' print,' down the Control key and clicking an item toggles that item between' print,' the selected and unselected state.' print,'' endif else if (!d.name eq 'WIN') or (!d.name eq 'MAC') then begin print,' Holding down the Shift key and clicking an item selects the range ' print,' from the previously selected item to the new item. Holding down the' print,' Control key and clicking an item toggles that item between the ' print,' selected and unselected state.' print,'' endif end 'LIST': 'Done': Begin widget_control,event.top,get_uvalue=state vars=widget_info(state.listID,/list_select) if (vars[0] eq -1) then begin print,'NOT DONE. No variables were selected.' endif else widget_control,event.top,/destroy END 'Exit': Begin widget_control,event.top,/destroy return end 'Select All':widget_control,state.listID,set_list_select=state.all 'Abort Read': begin widget_control,event.top,/destroy retall end else: print,'Unknown Event' endcase return end Pro Region_gui, reg_list ;================================================================================= ; Program: Region_gui ; ; Version: 1.0 ; ; Date: August 11, 1999 ; ; Purpose/Function: ; This procedure will make a gui for a user to choose which records. ; ; Variables: ; title strarr List of variables ; vars intarr Indices of variables chosen (common) ; selected_vars intarr Indices of variables chosen (returned) ; state structure Holds internal GUI information ; ; state structure Holds internal GUI information ; ; ; Invocation: idl> selectTool, parameter_list,index_list ; ; ; Language/Compiler Version: ; This program has been tested on the systems listed below. ; Computer Operating System IDL Version ; --------------- ---------------- ----------- ; Sun, Ultra-4 Solaris 5.6 5.2 ; ; ; Updates: ; ;================================================================================= ;Create a GUI base base=widget_base(/column,title='Choose the day (1-31)s to be read',mbar=menubase) ;Set up the menu bar void=cw_pdmenu(menubase,/mbar,['1\File','2\Abort Read'],/return_name,uvalue=99) ;Create a subBase to put buttons at the top subBaseA=widget_base(base,column=3) void=widget_button(subBaseA,value='Done') void=widget_button(subBaseA,value='Help') void=widget_button(subBaseA,value='Read to End-Of-File') subBaseAA=widget_base(base,/row) void=widget_label(subBaseAA,value='You may enter a group of consecutive days, or a list of days') ;Create a subBase for the user-entered fields subBaseB=widget_base(base,column=2) cat1ID=cw_bgroup(subbaseB,['Consecutive Days ','List of Days'],$ /exclusive,/return_name,column=2) subBaseBB=widget_base(base,column=2,/base_align_right) startRegId=cw_field(subBaseBB,title='Start Day',xsize=4,/integer) endRegId=cw_field(subBaseBB,title='End Day',xsize=4,/integer) ;numRegId=cw_field(subBaseBB,title='Number or Days',xsize=4,/integer) listRegId=cw_field(subBaseBB,title='List of Days',xsize=4,/string) widget_control,startRegId,sensitive=0 widget_control,endRegId,sensitive=0 ;widget_control,numRegId,sensitive=0 widget_control,listRegId,sensitive=0 ;Draw the window widget_control,base,/realize ;Initialize the UValue structure state={startRegId:startRegId, endRegid:endRegId, listRegId:listRegId,$ method:'',ptr_regList:ptr_new(/allocate_heap)}; ,reg_list=intarr(10000)} widget_control,base,set_uvalue=state xmanager,'region_gui',base ;,cleanup='vtClean' reg_list=(*state.ptr_RegList) ptr_free,state.ptr_RegList return end Pro Region_gui_event,event ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This procedure manages events generated by the Region GUI ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; thisType=widget_info(event.id,/name) widget_control,event.top,get_uvalue=state ;if (thisType eq 'BUTTON') then widget_control,event.id,get_value=thisValue if (thisType eq 'BUTTON') then widget_control,event.id,get_value=thisValue $ else thisValue=event.value thisValue=strtrim(thisValue,2) case thisValue of 'Consecutive Days': begin widget_control,state.StartRegId,/sensitive widget_control,state.EndRegId,/sensitive ;widget_control,state.NumRegId,sensitive=0 widget_control,state.ListRegId,sensitive=0 state.method='c' widget_control,event.top,set_uvalue=state end 'List of Days': begin ;widget_control,state.NumRegId,/sensitive widget_control,state.ListRegId,/sensitive widget_control,state.StartRegId,sensitive=0 widget_control,state.EndRegId,sensitive=0 state.method='l' widget_control,event.top,set_uvalue=state end 'Done': begin if state.method eq 'l' then begin ;widget_control,state.NumRegId,get_value=numReg widget_control,state.ListRegId,get_value=regString space_sep=strpos(regString[0],' ') comma_sep=strpos(regString[0],',') if (space_sep[0] ne -1) then regString=str_sep(regString[0],' ') $ else if (comma_sep[0] ne -1) then regString=str_sep(regString[0],',') regList=fix(regString) if ptr_valid(state.ptr_regList) then $ *(state.ptr_regList)=regList else $ state.ptr_regList=ptr_new(regList) endif else if (state.method eq 'c') then begin widget_control,state.StartRegId,get_value=StartReg widget_control,state.EndRegId,get_value=EndReg regList=(StartReg)+indgen(EndReg-StartReg+1) if ptr_valid(state.ptr_regList) then $ *(state.ptr_regList)=regList else $ state.ptr_regList=ptr_new(regList) endif else begin print, 'Reading all files' if ptr_valid(state.ptr_regList) then $ *(state.ptr_regList)=indgen(10000) else $ state.ptr_regList=ptr_new(indgen(10000)) endelse widget_control,event.top,set_uvalue=state widget_control,event.top,/destroy end 'Help': begin print, 'You may choose a consecutive group of days or you may list days' print, '1) Click on the box for the method for choosing days.' print, '2) Enter day (1-31) into the active text boxes' print, ' (list of days or start and end days)' print, '3) Press the done button' end 'Read to End-Of-File':begin if ptr_valid(state.ptr_regList) then $ *(state.ptr_regList)=indgen(31) else $ state.ptr_regList=ptr_new(indgen(31)) widget_control,event.top,set_uvalue=state widget_control,event.top,/destroy end 'Abort Read': begin widget_control,event.top,/destroy retall end else:print, 'Unknown Event' endcase return end