#! /bin/csh -f # set echo # call with tape dir and range of "filexxx" numbers for directory names in # $2 should be first and $3 should be final. All directories in that # range with names "filexxx" will be examined for a file named "00*.fits" and # if found, the FSN will be taken from the fits file name and it will be processed. # e.g. import_lev0_CIF_from_tmp.csh tape_070102 58 59 # set echo echo $0 $* >>log_run set TAPEDIR = $1 shift set FFN = $1 set LFFN = $FFN shift if ($#argv >= 1) then set LFFN = $1 shift endif # setup for CIF set PROG = hmi_ground set LEVEL = lev0 set SERIES = egse_hmifsfm set FLAGS = "fsn_key=FSN keymap=/home/jsoc/hmi/ground/jsd/lev0.keymap" set IMPORT_LEV0 = /home/phil/jsoc/bin/$JSOC_MACHINE/import_egse_lev0 set FN = $FFN while ($FN <= $LFFN) set DNAME = "file"$FN set LEV0_PATH = $TAPEDIR/$DNAME if (-d $LEV0_PATH) then set FITSNAME = `/bin/ls $LEV0_PATH/00*.fits` if ($status == 0) then if (-e $FITSNAME) then set FITSNAME = `basename $FITSNAME` set FSN = `basename $FITSNAME .fits` @ FSN = $FSN + 0 set DSDSNAME = $LEV0_PATH/$FITSNAME echo " " echo Do $LEV0_PATH with $FITSNAME $IMPORT_LEV0 in=$LEV0_PATH/$FITSNAME out=hmi_ground.lev0 "dsds=$DSDSNAME" $FLAGS echo -n "import done: " show_keys "ds=hmi_ground.lev0[$FSN]" key=FSN,T_OBS seg=file -p -q else echo " " echo No file found in $LEV0_PATH endif endif else echo " " echo No dir found $LEV0_PATH endif @ FN = $FN + 1 end