pro dsatt ; Build and array of structures containing the attributes of the primary data ; sets in a DISR gse directory ; Assume that you run this with the current directory just above the DB ; directory ; @c_system.inc @c_header.inc ; Define the main structure to hold the data for the table strucdef={meas,filename:'',setname:'',ccdtemp:0.0,exptime:0.0,setnumber:0, $ time:0.0,cyclenum:0,meastype:0,targetaz:0.0,actualaz:0.0,lampstate:'', $ ccdstatus: -1,ccdflags:'',procflags:'',null1:0.0,null2:0.0,numcol:0, $ irstatus: -1,irflags:'',irtemp1:0.0,irtemp2:0.0,rotations:0,regions:0, $ bins:0} ; Change to Full directory cd,'DB/Full' filelist=t_getfil('*MMX*') sizelist=size(filelist) numfull=0 if sizelist(0) ne 0 then begin numfull=sizelist(1) datafull=replicate({meas},sizelist(1)) for i=0,sizelist(1)-1 do begin d_rhead,filelist(i),h datafull(i).filename=d_value(h,H_FILENAME) datafull(i).setname=d_value(h,H_SET_NAME) datafull(i).ccdtemp=d_value(h,H_CCDTEMP) datafull(i).exptime=d_value(h,H_EXPTIME) datafull(i).setnumber=d_value(h,H_SET_NUMBER) datafull(i).time=d_value(h,H_MISSION_TIME) datafull(i).cyclenum=d_value(h,H_CYCLE_NUMBER) datafull(i).meastype=d_value(h,H_MEAS_TYPE) datafull(i).targetaz=d_value(h,H_TARGET_AZ) datafull(i).actualaz=d_value(h,H_ACTUAL_AZ) datafull(i).lampstate=d_value(h,H_LAMP_STATE) datafull(i).ccdstatus=d_value(h,H_CCD_STATUS) datafull(i).ccdflags=d_value(h,H_CCD_FLAGS) datafull(i).procflags=d_value(h,H_PROC_FLAGS) datafull(i).null1=d_value(h,H_NULL_PIXEL2) datafull(i).null2=d_value(h,H_NULL_PIXEL3) endfor print,'Processed ',numfull,' full CCD files.' endif ; Change to Image directory cd,'../Image' filelist=t_getfil('*MMX*') sizelist=size(filelist) numimage=0 if sizelist(0) ne 0 then begin numimage=sizelist(1) dataimage=replicate({meas},sizelist(1)) for i=0,sizelist(1)-1 do begin d_rhead,filelist(i),h dataimage(i).filename=d_value(h,H_FILENAME) dataimage(i).setname=d_value(h,H_SET_NAME) dataimage(i).ccdtemp=d_value(h,H_CCDTEMP) dataimage(i).exptime=d_value(h,H_EXPTIME) dataimage(i).setnumber=d_value(h,H_SET_NUMBER) dataimage(i).time=d_value(h,H_MISSION_TIME) dataimage(i).cyclenum=d_value(h,H_CYCLE_NUMBER) dataimage(i).meastype=d_value(h,H_MEAS_TYPE) dataimage(i).targetaz=d_value(h,H_TARGET_AZ) dataimage(i).actualaz=d_value(h,H_ACTUAL_AZ) dataimage(i).lampstate=d_value(h,H_LAMP_STATE) dataimage(i).ccdstatus=d_value(h,H_CCD_STATUS) dataimage(i).ccdflags=d_value(h,H_CCD_FLAGS) dataimage(i).procflags=d_value(h,H_PROC_FLAGS) dataimage(i).null1=d_value(h,H_NULL_PIXEL2) dataimage(i).null2=d_value(h,H_NULL_PIXEL3) endfor print,'Processed ',numimage,' image files.' endif ; Change to Solar directory cd,'../Solar' filelist=t_getfil('*MMX*') sizelist=size(filelist) numsolar=0 if sizelist(0) ne 0 then begin numsolar=sizelist(1) datasolar=replicate({meas},sizelist(1)) for i=0,sizelist(1)-1 do begin d_rhead,filelist(i),h datasolar(i).filename=d_value(h,H_FILENAME) datasolar(i).setname=d_value(h,H_SET_NAME) datasolar(i).ccdtemp=d_value(h,H_CCDTEMP) datasolar(i).exptime=d_value(h,H_EXPTIME) datasolar(i).setnumber=d_value(h,H_SET_NUMBER) datasolar(i).time=d_value(h,H_MISSION_TIME) datasolar(i).cyclenum=d_value(h,H_CYCLE_NUMBER) datasolar(i).meastype=d_value(h,H_MEAS_TYPE) datasolar(i).targetaz=d_value(h,H_TARGET_AZ) datasolar(i).actualaz=d_value(h,H_ACTUAL_AZ) datasolar(i).lampstate=d_value(h,H_LAMP_STATE) datasolar(i).ccdstatus=d_value(h,H_CCD_STATUS) datasolar(i).ccdflags=d_value(h,H_CCD_FLAGS) datasolar(i).procflags=d_value(h,H_PROC_FLAGS) datasolar(i).null1=d_value(h,H_NULL_PIXEL2) datasolar(i).null2=d_value(h,H_NULL_PIXEL3) endfor print,'Processed ',numsolar,' solar files.' endif ; Change to Strip directory cd,'../Strip' filelist=t_getfil('*MMX*') sizelist=size(filelist) numstrip=0 if sizelist(0) ne 0 then begin numstrip=sizelist(1) datastrip=replicate({meas},sizelist(1)) for i=0,sizelist(1)-1 do begin d_rhead,filelist(i),h datastrip(i).filename=d_value(h,H_FILENAME) datastrip(i).setname=d_value(h,H_SET_NAME) datastrip(i).ccdtemp=d_value(h,H_CCDTEMP) datastrip(i).exptime=d_value(h,H_EXPTIME) datastrip(i).setnumber=d_value(h,H_SET_NUMBER) datastrip(i).time=d_value(h,H_MISSION_TIME) datastrip(i).cyclenum=d_value(h,H_CYCLE_NUMBER) datastrip(i).meastype=d_value(h,H_MEAS_TYPE) datastrip(i).targetaz=d_value(h,H_TARGET_AZ) datastrip(i).actualaz=d_value(h,H_ACTUAL_AZ) datastrip(i).lampstate=d_value(h,H_LAMP_STATE) datastrip(i).ccdstatus=d_value(h,H_CCD_STATUS) datastrip(i).ccdflags=d_value(h,H_CCD_FLAGS) datastrip(i).procflags=d_value(h,H_PROC_FLAGS) datastrip(i).null1=d_value(h,H_NULL_PIXEL2) datastrip(i).null2=d_value(h,H_NULL_PIXEL3) endfor print,'Processed ',numstrip,' strip files.' endif ; Change to Visible directory cd,'../Visible' filelist=t_getfil('*MMX*') sizelist=size(filelist) numvisible=0 if sizelist(0) ne 0 then begin numvisible=sizelist(1) datavisible=replicate({meas},sizelist(1)) for i=0,sizelist(1)-1 do begin d_rhead,filelist(i),h datavisible(i).filename=d_value(h,H_FILENAME) datavisible(i).setname=d_value(h,H_SET_NAME) datavisible(i).ccdtemp=d_value(h,H_CCDTEMP) datavisible(i).exptime=d_value(h,H_EXPTIME) datavisible(i).setnumber=d_value(h,H_SET_NUMBER) datavisible(i).time=d_value(h,H_MISSION_TIME) datavisible(i).cyclenum=d_value(h,H_CYCLE_NUMBER) datavisible(i).meastype=d_value(h,H_MEAS_TYPE) datavisible(i).targetaz=d_value(h,H_TARGET_AZ) datavisible(i).actualaz=d_value(h,H_ACTUAL_AZ) datavisible(i).lampstate=d_value(h,H_LAMP_STATE) datavisible(i).ccdstatus=d_value(h,H_CCD_STATUS) datavisible(i).ccdflags=d_value(h,H_CCD_FLAGS) datavisible(i).procflags=d_value(h,H_PROC_FLAGS) datavisible(i).null1=d_value(h,H_NULL_PIXEL2) datavisible(i).null2=d_value(h,H_NULL_PIXEL3) endfor print,'Processed ',numvisible,' visible files.' endif ; Change to Dark directory cd,'../Dark' filelist=t_getfil('*MMX*') sizelist=size(filelist) numdark=0 if sizelist(0) ne 0 then begin numdark=sizelist(1) datadark=replicate({meas},sizelist(1)) for i=0,sizelist(1)-1 do begin d_rhead,filelist(i),h datadark(i).filename=d_value(h,H_FILENAME) datadark(i).setname=d_value(h,H_SET_NAME) datadark(i).ccdtemp=d_value(h,H_CCDTEMP) datadark(i).exptime=d_value(h,H_EXPTIME) datadark(i).setnumber=d_value(h,H_SET_NUMBER) datadark(i).time=d_value(h,H_MISSION_TIME) datadark(i).cyclenum=d_value(h,H_CYCLE_NUMBER) datadark(i).meastype=d_value(h,H_MEAS_TYPE) datadark(i).targetaz=d_value(h,H_TARGET_AZ) datadark(i).actualaz=d_value(h,H_ACTUAL_AZ) datadark(i).lampstate=d_value(h,H_LAMP_STATE) datadark(i).ccdstatus=d_value(h,H_CCD_STATUS) datadark(i).ccdflags=d_value(h,H_CCD_FLAGS) datadark(i).procflags=d_value(h,H_PROC_FLAGS) datadark(i).null1=d_value(h,H_NULL_PIXEL2) datadark(i).null2=d_value(h,H_NULL_PIXEL3) endfor print,'Processed ',numdark,' dark files.' endif data=replicate({meas},numfull+numimage+numsolar+numstrip+numvisible+numdark) if numfull ne 0 then data(0:numfull-1)=datafull if numimage ne 0 then data(numfull:numfull+numimage-1)=dataimage if numsolar ne 0 then data(numfull+numimage:numfull+numimage+numsolar-1)=datasolar if numstrip ne 0 then data(numfull+numimage+numsolar:numfull+numimage+numsolar+numstrip-1)=datastrip if numvisible ne 0 then data(numfull+numimage+numsolar+numstrip:numfull+numimage+numsolar+ $ numstrip+numvisible-1)=datavisible if numdark ne 0 then data(numfull+numimage+numsolar+numstrip+numvisible: $ numfull+numimage+numsolar+numstrip+numvisible+numdark-1)=datadark numtot=numfull+numimage+numsolar+numstrip+numvisible+numdark ; Sort the data sets into time order t=sort(data.time) data=data(t) cd,'..' cd,'..' ; Get the measurement names openr,1,'/users/ldoose/idl_programs/meas_types' name='' & index=0 & measname=strarr(24) for i=0,21 do begin readf,1,index,name measname(index)=strtrim(name,2) endfor close,1 ; Open the output file openw,unit,'ccd_data_set_attr',width=150,/get_lun cd,curr=curr printf,unit,systime(),' ',curr printf,unit,' BSLSLO' printf,unit,' PUSQSP' printf,unit,' No. Time Type Exp.Tm. Lamps Cycle No. Temp. TargAZ AzErr RMLRYTSt Flags Null1 Null2' print,systime(),' ',curr print,' BSLSLO' print,' PUSQSP' print,' No. Time Type Exp.Tm. Lamps Cycle No. Temp. TargAz AzErr RMLRYTSt Flags Null1 Null2' for i=0,numtot-1 do begin if (i gt 0) then begin if (data(i).cyclenum ne data(i-1).cyclenum) then printf,unit,'' if (data(i).cyclenum ne data(i-1).cyclenum) then print,'' endif mn=fix(data(i).time/60.) sec=data(i).time-60.*mn azerr=data(i).actualaz-data(i).targetaz if azerr gt 180. then azerr=azerr-360. if azerr lt -180. then azerr=azerr+360. printf,unit,i+1,mn,sec, $ measname(data(i).meastype),data(i).exptime,data(i).lampstate, $ data(i).cyclenum,data(i).setnumber,data(i).ccdtemp,data(i).targetaz, $ azerr,data(i).procflags, $ data(i).ccdstatus,data(i).ccdflags,data(i).null1, $ data(i).null2,format="(i4,1x,i4,':',f4.1,1x,a8,1x,f7.1,1x,a4,1x" $ +",i4,1x,i4,1x,f6.2,1x,f6.1,1x,f6.1,1x,a6,1x,i1,1x,a3,1x,f7.0,1x,f7.0)" print,i+1,mn,sec, $ measname(data(i).meastype),data(i).exptime,data(i).lampstate, $ data(i).cyclenum,data(i).setnumber,data(i).ccdtemp,data(i).targetaz, $ azerr,data(i).procflags, $ data(i).ccdstatus,data(i).ccdflags,data(i).null1, $ data(i).null2,format="(i4,1x,i4,':',f4.1,1x,a8,1x,f7.1,1x,a4,1x" $ +",i4,1x,i4,1x,f6.2,1x,f6.1,1x,f6.1,1x,a6,1x,i1,1x,a3,1x,f7.0,1x,f7.0)" endfor close,unit ; IR section ; Change to Ir directory cd,'DB/Ir' filelist=t_getfil('*MMX*') sizelist=size(filelist) numir=0 if sizelist(0) ne 0 then begin numir=sizelist(1) datair=replicate({meas},sizelist(1)) for i=0,sizelist(1)-1 do begin d_rhead,filelist(i),h datair(i).filename=d_value(h,H_FILENAME) datair(i).setname=d_value(h,H_SET_NAME) datair(i).setnumber=d_value(h,H_SET_NUMBER) datair(i).time=d_value(h,H_MISSION_TIME) datair(i).cyclenum=d_value(h,H_CYCLE_NUMBER) datair(i).meastype=d_value(h,H_MEAS_TYPE) ; datair(i).targetaz=d_value(h,H_TARGET_AZ) datair(i).actualaz=d_value(h,H_ACTUAL_AZ) datair(i).lampstate=d_value(h,H_LAMP_STATE) datair(i).irstatus=d_value(h,H_IR_STATUS) datair(i).irflags=d_value(h,H_IR_FLAGS) datair(i).irtemp1=d_value(h,H_IR_CHP_TMPB) datair(i).irtemp2=d_value(h,H_IR_CHP_TMPE) datair(i).exptime=d_value(h,H_IR_COL_TIME) datair(i).rotations=d_value(h,H_NUM_ROT) datair(i).regions=d_value(h,H_NUM_REGIONS) datair(i).bins=d_value(h,H_NUM_BINS) endfor print,' ' print,'Processed ',numir,' IR files.' endif t=sort(datair.time) datair=datair(t) cd,'..' cd,'..' openw,unit,'ir_data_set_attr',width=150,/get_lun printf,unit,systime(),' ',curr print,systime(),' ',curr printf,unit,'' print,'' printf,unit,' No. Time Type Col.Tm. Lamps Cycle No. Temp. Az St Flags Rots Regions Bins' print,' No. Time Type Col.Tm. Lamps Cycle No. Temp. Az St Flags Rots Regions Bins' for i=0,numir-1 do begin if (i gt 0) then begin if (datair(i).cyclenum ne datair(i-1).cyclenum) then printf,unit,'' if (datair(i).cyclenum ne datair(i-1).cyclenum) then print,'' endif mn=fix(datair(i).time/60.) sec=datair(i).time-60.*mn print,i+1,mn,sec, $ measname(datair(i).meastype),datair(i).exptime,datair(i).lampstate, $ datair(i).cyclenum,datair(i).setnumber,(datair(i).irtemp1+datair(i).irtemp2)/2., $ datair(i).actualaz, $ datair(i).irstatus,datair(i).irflags,datair(i).rotations,datair(i).regions, $ datair(i).bins,format="(i4,1x,i4,':',f4.1,1x,a8,1x,f9.3,1x,a4,1x" $ +",i4,1x,i4,1x,f6.2,1x,f6.1,1x,i1,3x,a2,2x,i2,5x,i2,4x,i2)" printf,unit,i+1,mn,sec, $ measname(datair(i).meastype),datair(i).exptime,datair(i).lampstate, $ datair(i).cyclenum,datair(i).setnumber,(datair(i).irtemp1+datair(i).irtemp2)/2., $ datair(i).actualaz, $ datair(i).irstatus,datair(i).irflags,datair(i).rotations,datair(i).regions, $ datair(i).bins,format="(i4,1x,i4,':',f4.1,1x,a8,1x,f9.3,1x,a4,1x" $ +",i4,1x,i4,1x,f6.2,1x,f6.1,1x,i1,3x,a2,2x,i2,5x,i2,4x,i2)" endfor close,unit return end