IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 49


Ignore:
Timestamp:
Feb 14, 2003, 2:08:17 AM (23 years ago)
Author:
eugene
Message:

ccd name abstraction for megacam

Location:
trunk/Ohana/src/shell/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/shell/src/getfocus

    r16 r49  
    1414   breaksw;
    1515  case -*:
    16    goto escape
     16   goto usage
    1717   breaksw;
    1818  default:
     
    2323end
    2424
    25 if ($#args != 3) goto escape
     25if ($#args != 3) goto usage
    2626
    2727# kill off other processes with this name, and their children
     
    4545set datdir  = `gconfig DATDIR`
    4646set confdir = `gconfig CONFDIR`
     47set ccds    = `gconfig FOCUS-CCDS-LIST`
     48set ccdn    = `gconfig FOCUS-CCDN-LIST`
    4749
    4850# sextractor needs full paths to:
     
    7678if ("$mode" == "on") goto mef
    7779if ("$mode" == "off") goto split
    78 echo "invalid mode $mode in getfocus"
    79 exit 1;
     80goto usage
    8081
    8182### SPLIT mode
     
    8384
    8485# make sure all four files exist
    85 foreach ccd (01 04 07 10)
     86foreach ccd ($ccdn)
    8687 block $fdir/$name/$name$ccd.fits -t 60 || goto failure;
    8788end
    8889
    89 foreach ccd (01 04 07 10)
     90# run sextractor on each chip
     91foreach ccd ($ccdn)
    9092 sex $fdir/$name/$name$ccd.fits \
    9193    -c $sexconf \
     
    9698    mv $temp.$ccd $temp.sdat.$ccd &
    9799end
    98 # sextract writes output to catalog while processing;
    99 # mv to real file *after* sextract is done
    100100
    101 foreach ccd (01 04 07 10)
     101# wait for results, extract stellar objects
     102foreach ccd ($ccdn)
    102103 block $temp.sdat.$ccd -t 60 || goto failure;
    103104 awk '($6 > -14) && ($6 < -8){print $0}' $temp.sdat.$ccd | sort -k 6n | head -300 | sort -k 2n > $temp.$ccd.sdat
    104105 rm -f $temp.sdat.$ccd
    105106end
     107# result i in $temp.$ccd.sdat ($ccd from $ccdn)
    106108
     109# create mana script & run it
    107110rm -f $temp.pro
    108 set ccd=00
     111set ccd = $ccdn[1]
    109112echo "plotfocus $temp $temp.ppm $name $fdir/$name/$name$ccd.fits" >> $temp.pro
    110113mana --norc --only $script $temp.pro
     
    115118cp $output1 $output2
    116119
     120# cleanup temp files
    117121rm -f $temp $temp.sdat $temp.pro $temp.ppm
    118 foreach ccd (01 04 07 10)
    119  rm -f $temp.$ccd.sdat
     122foreach ccd ($ccdn)
     123 rm -f $temp.$ccd.sdat $temp.$ccd.fits
    120124end
    121125exit 0;
     
    124128mef:
    125129 
     130# wait for file to appear
    126131block $fdir/$name.fits -t 60 || goto failure;
    127132
     133# extract section of each image to $temp.$ccd.fits ($ccd in $ccdn)
    128134rm -f $temp.pro
    129 foreach ccd (01 04 07 10)
    130  echo "split $fdir/$name.fits $ccd $temp.$ccd.fits" >> $temp.pro
     135set i = 1
     136while ($i <= $#ccds)
     137 $ccdnum = $ccdn[$i]
     138 $ccdnam = $ccns[$i]
     139 echo "split $fdir/$name.fits $ccdnam $temp.$ccdnum.fits" >> $temp.pro
    131140end
    132 
    133141mana --norc --only $script $temp.pro
    134142
    135 foreach ccd (01 04 07 10)
     143# run sextractor on each chip
     144foreach ccd ($ccdn)
    136145 sex $temp.$ccd.fits \
    137146    -c $sexconf \
     
    142151    mv $temp.$ccd $temp.sdat.$ccd &
    143152end
    144 # sextract writes output to catalog while processing;
    145 # mv to real file *after* sextract is done
    146153
    147 foreach ccd (01 04 07 10)
    148  block $temp.sdat.$ccd -t 30 || goto failure;
     154# wait for results, extract stellar objects
     155foreach ccd ($ccdn)
     156 block $temp.sdat.$ccd -t 60 || goto failure;
    149157 awk '($6 > -14) && ($6 < -8){print $0}' $temp.sdat.$ccd | sort -k 6n | head -300 | sort -k 2n > $temp.$ccd.sdat
    150158 rm -f $temp.sdat.$ccd
    151159end
    152160
     161# create mana script & run it
    153162rm -f $temp.pro
    154 set ccd=01
     163set ccd = $ccdn[1]
    155164echo "plotfocus $temp $temp.ppm $name $temp.$ccd.fits" >> $temp.pro
    156165mana --norc --only $script $temp.pro
     
    161170cp $output1 $output2
    162171
     172# cleanup temp files
    163173rm -f $temp $temp.sdat $temp.pro $temp.ppm
    164 foreach ccd (01 04 07 10)
     174foreach ccd ($ccdn)
    165175 rm -f $temp.$ccd.sdat $temp.$ccd.fits
    166176end
     
    168178
    169179failure:
    170  echo "****** error with focus"
     180 echo "****** error with focus ******"
    171181 rm -f $temp $temp.sdat $temp.pro
    172  foreach ccd (01 04 07 10)
     182 foreach ccd ($ccdn)
    173183  rm -f $temp.$ccd.sdat $temp.$ccd.fits
    174184 end
    175185 exit 1;
    176186
    177 escape:
     187usage:
    178188 echo "USAGE: getfocus (fdir) (file) (mode)"
    179189 echo "(mode) may be 'on' for mef, 'off' for split"
    180190 exit 2;
    181 
    182 
    183  sex $temp.$ccd.fits -c $config -CATALOG_NAME $temp.sdat
    184  sort -k 2n $temp.sdat | head -300 > $temp.$ccd.sdat
    185 
    186 rm -f $temp.pro
    187 rm -f $temp.ppm
    188 echo "plotfocus $temp $temp.ppm $name $fdir/$name.fits" >> $temp.pro
    189 mana --norc --only $script $temp.pro
    190 if ($status) goto failure
    191 
  • trunk/Ohana/src/shell/src/getseeing

    r16 r49  
    3535set mode=$3
    3636
    37 set ccd=03
    38 
    39 set datdir  = `gconfig DATDIR`
    40 set confdir = `gconfig CONFDIR`
     37set pixscale = `gconfig ASEC_PIX`
     38set ccd      = `gconfig SEEING_REF_CCD`
     39set datdir   = `gconfig DATDIR`
     40set confdir  = `gconfig CONFDIR`
    4141
    4242# sextractor needs full paths to:
     
    6565rm -f $temp $temp.fits $temp.stats $temp.pro $temp.cat
    6666if ($mef) then
     67 set Nextend = `echo $file | fields NEXTEND | awk '{print $2}'`
     68 if ($Nextend > 50) set ccd = amp26
    6769 echo "subraster.mef   $file $ccd $temp.fits $temp.stats" > $temp.pro
    6870else
     
    8082    -STARNNW_NAME    $sexnnw \
    8183    -CATALOG_NAME    $temp.cat
    82 set fwhm=`seeingstats $temp.cat | awk '{print $1*0.2}'`
    83 set filter=`echo $temp.fits | fields FILTER`
     84
     85set fwhm   = `seeingstats $temp.cat | awk -v scale=$pixscale '{print $1*scale}'`
     86set filter = `echo $temp.fits | fields FILTER`
    8487
    8588# send output (screen || $output & QSO)
Note: See TracChangeset for help on using the changeset viewer.