IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 5, 2006, 5:20:43 PM (20 years ago)
Author:
eugene
Message:

substantial work to use current db tables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/detrend.resid.pro

    r9104 r9338  
    44# dettool -toresid -simple
    55# 0    bias 1      850131b mc       o_850131b.mc.fit PPIMAGE_O 1.492870 2.848350 292.565582
    6 # ITER TYPE DET_ID EXP_KEY CLASS_ID URI-IN           
     6# ITER TYPE DET_ID EXP_TAG CLASS_ID URI-IN           
    77
    88# detrend_create_resid.pl 1      0    850131b mc       bias bias_mc_1_0.fit o_850131b.mc.fit 850131b
    9 # detrend_create_resid.pl DET_ID ITER EXP_KEY CLASS_ID TYPE (URI-DET)       (URL-IN)         (EXP_KEY)
     9# detrend_create_resid.pl DET_ID ITER EXP_TAG CLASS_ID TYPE (URI-DET)       (URL-IN)         (EXP_TAG)
    1010# URL-DET: $TYPE\_$CLASS_ID\_$DET_ID\_$ITER.fit
    1111
    1212## these tasks use the queue DetrendResidImfiles
    1313## the DetrendResidImfiles queue contains:
    14 ## STATE ITER TYPE DET_ID EXP_KEY CLASS_ID URI_IN
     14## STATE ITER TYPE DET_ID EXP_TAG CLASS_ID URI_IN
    1515
    1616queueinit DetrendResidImfiles
     
    5252      $DET_TYPE = $word:1
    5353      $DET_ID   = $word:2
    54       $EXP_KEY  = $word:3
     54      $EXP_TAG  = $word:3
    5555      $CLASS_ID = $word:4
    5656      $URI_IN   = $word:5
    57       ## XXX need to include the detID and iter in the key (if we have two running at the same time...)
     57      $CAMERA   = $word:13
     58      ## must include the detID and iter in the key (if we have two running at the same time...)
    5859      ## Also needed to be in the output file (or path)
    59       queuepush DetrendResidImfiles -uniq -key 1:3:4:5 "NEW $ITER $DET_TYPE $DET_ID $EXP_KEY $CLASS_ID $URI_IN"
     60      queuepush DetrendResidImfiles -uniq -key 1:3:4:5 "NEW $ITER $DET_TYPE $DET_ID $EXP_TAG $CLASS_ID $URI_IN $CAMERA"
    6061    end
    6162
     
    9798
    9899    ## the DetrendResidImfiles queue contains:
    99     ## STATE ITER TYPE DET_ID EXP_KEY CLASS_ID URI_IN
     100    ## STATE ITER TYPE DET_ID EXP_TAG CLASS_ID URI_IN
    100101    ## NOTE: the queue has the STATE prepended
    101102    list word -split $line
     
    103104    $DET_TYPE = $word:1
    104105    $DET_ID   = $word:2
    105     $EXP_KEY  = $word:3
     106    $EXP_TAG  = $word:3
    106107    $CLASS_ID = $word:4
    107108    $URI_IN   = $word:5
    108109    $CAMERA   = $word:6
    109110
    110     stdout $EXP_KEY.detresid.$DET_ID.$ITER.$CLASS_ID.log
    111     stderr $EXP_KEY.detresid.$DET_ID.$ITER.$CLASS_ID.log
     111    $DET_DIR = `dirname $URI_IN`
     112    $LOG_DIR = $WORKDIR/$DET_DIR
     113
     114    stdout $LOG_DIR/$EXP_TAG.detresid.$DET_ID.$ITER.$CLASS_ID.log
     115    stderr $LOG_DIR/$EXP_TAG.detresid.$DET_ID.$ITER.$CLASS_ID.log
    112116
    113117    # specify choice of remote host:
     
    120124    # create example job options as a demonstration
    121125    options "$line"
    122     # detrend_create_resid.pl DET_ID ITER EXP_KEY CLASS_ID TYPE (URI-DET) (URL-IN) (EXP_KEY ???)
    123     # $URL_DET = isp.$DET_TYPE.$DET_ID.$ITER.$CLASS_ID.fits
    124     $URL_DET = $CAMERA.$DET_TYPE.$DET_ID.$ITER.$CLASS_ID.fits
    125     echo command detrend_create_resid.pl --det_id $DET_ID --iteration $ITER --exp_id $EXP_KEY --class_id $CLASS_ID --det_type $DET_TYPE --detrend $URL_DET --input_uri $URI_IN
    126     command detrend_create_resid.pl --det_id $DET_ID --iteration $ITER --exp_id $EXP_KEY --class_id $CLASS_ID --det_type $DET_TYPE --detrend $URL_DET --input_uri $URI_IN
     126    # detrend_create_resid.pl DET_ID ITER EXP_TAG CLASS_ID TYPE (URI-DET) (URL-IN) (EXP_TAG ???)
     127    # need to parse the subdir path for the detrend URL
     128    $DET_URL = $DET_DIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.$CLASS_ID.fits
     129    echo command detrend_resid.pl --det_id $DET_ID --iteration $ITER --exp_tag $EXP_TAG --class_id $CLASS_ID --det_type $DET_TYPE --detrend $DET_URL --input_uri $URI_IN
     130    command detrend_resid.pl --det_id $DET_ID --iteration $ITER --exp_tag $EXP_TAG --class_id $CLASS_ID --det_type $DET_TYPE --detrend $DET_URL --input_uri $URI_IN
    127131  end
    128132
     
    172176      $ITER     = $word:1
    173177      $DET_TYPE = $word:2
    174       $EXP_KEY  = $word:3
     178      $EXP_TAG  = $word:3
    175179      $INCLUDE  = $word:4
    176       queuepush DetrendResidExposures -uniq -key 1:2:4 "NEW $DET_ID $ITER $DET_TYPE $EXP_KEY $INCLUDE"
     180      queuepush DetrendResidExposures -uniq -key 1:2:4 "NEW $DET_ID $ITER $DET_TYPE $EXP_TAG $INCLUDE"
    177181    end
    178182
     
    214218
    215219    ## the DetrendResidExposures queue contains:
    216     ## STATE ITER TYPE DET_ID EXP_KEY CLASS_ID URI_IN
     220    ## STATE ITER TYPE DET_ID EXP_TAG CLASS_ID URI_IN
    217221    ## NOTE: the queue has the STATE prepended
    218222    list word -split $line
     
    220224    $ITER     = $word:1
    221225    $DET_TYPE = $word:2
    222     $EXP_KEY  = $word:3
     226    $EXP_TAG  = $word:3
    223227    $INCLUDE  = $word:4
    224228
    225     stdout $EXP_KEY.detresid.$DET_ID.$ITER.log
    226     stderr $EXP_KEY.detresid.$DET_ID.$ITER.log
     229    # XXX add $WORKDIR/$LOG_DIR
     230    stdout $EXP_TAG.detresid.$DET_ID.$ITER.log
     231    stderr $EXP_TAG.detresid.$DET_ID.$ITER.log
    227232
    228233    # specify choice of remote host:
     
    233238    end
    234239
     240    ### XXX artificially reject a few randomly
     241    if ($ITER == 0)
     242      $drop = (rnd(0) < 0.33)
     243    else
     244      $drop = ("$INCLUDE" == "F")
     245    end
     246
    235247    # create example job options as a demonstration
    236248    options "$line"
    237     echo command detrend_reject_imfile.pl --det_id $DET_ID --iteration $ITER --exp_id $EXP_KEY --det_type $DET_TYPE
    238     command detrend_reject_imfile.pl --det_id $DET_ID --iteration $ITER --exp_id $EXP_KEY --det_type $DET_TYPE
     249    if ($drop)
     250      echo command detrend_reject_imfile.pl --det_id $DET_ID --iteration $ITER --exp_tag $EXP_TAG --det_type $DET_TYPE --reject
     251      command detrend_reject_imfile.pl --det_id $DET_ID --iteration $ITER --exp_tag $EXP_TAG --det_type $DET_TYPE --reject
     252    else
     253      echo command detrend_reject_imfile.pl --det_id $DET_ID --iteration $ITER --exp_tag $EXP_TAG --det_type $DET_TYPE
     254      command detrend_reject_imfile.pl --det_id $DET_ID --iteration $ITER --exp_tag $EXP_TAG --det_type $DET_TYPE
     255    end
    239256  end
    240257
Note: See TracChangeset for help on using the changeset viewer.