Changeset 49
- Timestamp:
- Feb 14, 2003, 2:08:17 AM (23 years ago)
- Location:
- trunk/Ohana/src/shell/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/shell/src/getfocus
r16 r49 14 14 breaksw; 15 15 case -*: 16 goto escape16 goto usage 17 17 breaksw; 18 18 default: … … 23 23 end 24 24 25 if ($#args != 3) goto escape25 if ($#args != 3) goto usage 26 26 27 27 # kill off other processes with this name, and their children … … 45 45 set datdir = `gconfig DATDIR` 46 46 set confdir = `gconfig CONFDIR` 47 set ccds = `gconfig FOCUS-CCDS-LIST` 48 set ccdn = `gconfig FOCUS-CCDN-LIST` 47 49 48 50 # sextractor needs full paths to: … … 76 78 if ("$mode" == "on") goto mef 77 79 if ("$mode" == "off") goto split 78 echo "invalid mode $mode in getfocus" 79 exit 1; 80 goto usage 80 81 81 82 ### SPLIT mode … … 83 84 84 85 # make sure all four files exist 85 foreach ccd ( 01 04 07 10)86 foreach ccd ($ccdn) 86 87 block $fdir/$name/$name$ccd.fits -t 60 || goto failure; 87 88 end 88 89 89 foreach ccd (01 04 07 10) 90 # run sextractor on each chip 91 foreach ccd ($ccdn) 90 92 sex $fdir/$name/$name$ccd.fits \ 91 93 -c $sexconf \ … … 96 98 mv $temp.$ccd $temp.sdat.$ccd & 97 99 end 98 # sextract writes output to catalog while processing;99 # mv to real file *after* sextract is done100 100 101 foreach ccd (01 04 07 10) 101 # wait for results, extract stellar objects 102 foreach ccd ($ccdn) 102 103 block $temp.sdat.$ccd -t 60 || goto failure; 103 104 awk '($6 > -14) && ($6 < -8){print $0}' $temp.sdat.$ccd | sort -k 6n | head -300 | sort -k 2n > $temp.$ccd.sdat 104 105 rm -f $temp.sdat.$ccd 105 106 end 107 # result i in $temp.$ccd.sdat ($ccd from $ccdn) 106 108 109 # create mana script & run it 107 110 rm -f $temp.pro 108 set ccd =00111 set ccd = $ccdn[1] 109 112 echo "plotfocus $temp $temp.ppm $name $fdir/$name/$name$ccd.fits" >> $temp.pro 110 113 mana --norc --only $script $temp.pro … … 115 118 cp $output1 $output2 116 119 120 # cleanup temp files 117 121 rm -f $temp $temp.sdat $temp.pro $temp.ppm 118 foreach ccd ( 01 04 07 10)119 rm -f $temp.$ccd.sdat 122 foreach ccd ($ccdn) 123 rm -f $temp.$ccd.sdat $temp.$ccd.fits 120 124 end 121 125 exit 0; … … 124 128 mef: 125 129 130 # wait for file to appear 126 131 block $fdir/$name.fits -t 60 || goto failure; 127 132 133 # extract section of each image to $temp.$ccd.fits ($ccd in $ccdn) 128 134 rm -f $temp.pro 129 foreach ccd (01 04 07 10) 130 echo "split $fdir/$name.fits $ccd $temp.$ccd.fits" >> $temp.pro 135 set i = 1 136 while ($i <= $#ccds) 137 $ccdnum = $ccdn[$i] 138 $ccdnam = $ccns[$i] 139 echo "split $fdir/$name.fits $ccdnam $temp.$ccdnum.fits" >> $temp.pro 131 140 end 132 133 141 mana --norc --only $script $temp.pro 134 142 135 foreach ccd (01 04 07 10) 143 # run sextractor on each chip 144 foreach ccd ($ccdn) 136 145 sex $temp.$ccd.fits \ 137 146 -c $sexconf \ … … 142 151 mv $temp.$ccd $temp.sdat.$ccd & 143 152 end 144 # sextract writes output to catalog while processing;145 # mv to real file *after* sextract is done146 153 147 foreach ccd (01 04 07 10) 148 block $temp.sdat.$ccd -t 30 || goto failure; 154 # wait for results, extract stellar objects 155 foreach ccd ($ccdn) 156 block $temp.sdat.$ccd -t 60 || goto failure; 149 157 awk '($6 > -14) && ($6 < -8){print $0}' $temp.sdat.$ccd | sort -k 6n | head -300 | sort -k 2n > $temp.$ccd.sdat 150 158 rm -f $temp.sdat.$ccd 151 159 end 152 160 161 # create mana script & run it 153 162 rm -f $temp.pro 154 set ccd =01163 set ccd = $ccdn[1] 155 164 echo "plotfocus $temp $temp.ppm $name $temp.$ccd.fits" >> $temp.pro 156 165 mana --norc --only $script $temp.pro … … 161 170 cp $output1 $output2 162 171 172 # cleanup temp files 163 173 rm -f $temp $temp.sdat $temp.pro $temp.ppm 164 foreach ccd ( 01 04 07 10)174 foreach ccd ($ccdn) 165 175 rm -f $temp.$ccd.sdat $temp.$ccd.fits 166 176 end … … 168 178 169 179 failure: 170 echo "****** error with focus "180 echo "****** error with focus ******" 171 181 rm -f $temp $temp.sdat $temp.pro 172 foreach ccd ( 01 04 07 10)182 foreach ccd ($ccdn) 173 183 rm -f $temp.$ccd.sdat $temp.$ccd.fits 174 184 end 175 185 exit 1; 176 186 177 escape:187 usage: 178 188 echo "USAGE: getfocus (fdir) (file) (mode)" 179 189 echo "(mode) may be 'on' for mef, 'off' for split" 180 190 exit 2; 181 182 183 sex $temp.$ccd.fits -c $config -CATALOG_NAME $temp.sdat184 sort -k 2n $temp.sdat | head -300 > $temp.$ccd.sdat185 186 rm -f $temp.pro187 rm -f $temp.ppm188 echo "plotfocus $temp $temp.ppm $name $fdir/$name.fits" >> $temp.pro189 mana --norc --only $script $temp.pro190 if ($status) goto failure191 -
trunk/Ohana/src/shell/src/getseeing
r16 r49 35 35 set mode=$3 36 36 37 set ccd=0338 39 set datdir = `gconfig DATDIR`40 set confdir = `gconfig CONFDIR`37 set pixscale = `gconfig ASEC_PIX` 38 set ccd = `gconfig SEEING_REF_CCD` 39 set datdir = `gconfig DATDIR` 40 set confdir = `gconfig CONFDIR` 41 41 42 42 # sextractor needs full paths to: … … 65 65 rm -f $temp $temp.fits $temp.stats $temp.pro $temp.cat 66 66 if ($mef) then 67 set Nextend = `echo $file | fields NEXTEND | awk '{print $2}'` 68 if ($Nextend > 50) set ccd = amp26 67 69 echo "subraster.mef $file $ccd $temp.fits $temp.stats" > $temp.pro 68 70 else … … 80 82 -STARNNW_NAME $sexnnw \ 81 83 -CATALOG_NAME $temp.cat 82 set fwhm=`seeingstats $temp.cat | awk '{print $1*0.2}'` 83 set filter=`echo $temp.fits | fields FILTER` 84 85 set fwhm = `seeingstats $temp.cat | awk -v scale=$pixscale '{print $1*scale}'` 86 set filter = `echo $temp.fits | fields FILTER` 84 87 85 88 # send output (screen || $output & QSO)
Note:
See TracChangeset
for help on using the changeset viewer.
