IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27526


Ignore:
Timestamp:
Mar 30, 2010, 9:40:04 AM (16 years ago)
Author:
eugene
Message:

updates from trunk

Location:
branches/eam_branches/20100225
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20100225

  • branches/eam_branches/20100225/Ohana

  • branches/eam_branches/20100225/Ohana/src/relphot/src/StarOps.c

    r27517 r27526  
    194194  Nsecfilt = catalog[0].Nsecfilt;
    195195
     196# define PSFQUALSTATS 1
    196197  for (i = 0; i < Ncatalog; i++) {
    197198    for (j = 0; j < catalog[i].Naverage; j++) {
     
    213214
    214215          // XXX only apply this filter for psphot data from GPC1 for now...
    215           if (0 && (catalog[i].measure[m].photcode > 10000) && (catalog[i].measure[m].photcode < 10500)) {
     216          if (PSFQUALSTATS && (catalog[i].measure[m].photcode > 10000) && (catalog[i].measure[m].photcode < 10500)) {
    216217              if (catalog[i].measure[m].psfQual < 0.85) continue;
    217218          }
     
    235236      // update average flags based on the detection stats. 
    236237      // XXX we need to clean this up -- this is a serious set of hacks...
    237       if (0) {
     238      if (PSFQUALSTATS) {
    238239        int Galaxy2MASS, GalaxySDSS, goodPS1, nEXT, nPSF, good2MASS;
    239240
  • branches/eam_branches/20100225/ippScripts/scripts/automate_stacks.pl

    r27517 r27526  
    5555
    5656# Grab options
    57 my ( $date, $camera, $dbname, $logfile, $verbose);
     57my ( $date, $camera, $dbname, $logfile, $verbose, $manual);
    5858my ( $help, $isburning, $force_stack_count, $test_mode, $this_target_only, $this_filter_only);
    5959my ( $check_registration, $define_burntool, $queue_burntool, $check_chips, $queue_chips);
     
    125125my %comment_list= ();
    126126my %stackable_list = ();
     127my %reduction_class = ();
    127128my $retention_time = 9000;
    128129
     
    168169                $stackable_list{$this_target} = ${ $tentry }{value};
    169170            }
     171            elsif (${ $tentry }{name} eq 'REDUCTION') {
     172                $reduction_class{$this_target} = ${ $tentry }{value};
     173            }
    170174        }
    171175    }
     
    307311        $Nsummit_exps++;
    308312        if ($summit_fault) {
    309             print STDERR "check_summit_copy: $date $exp_name has summit_fault $summit_fault";
     313            print STDERR "check_summit_copy: $date $exp_name has summit_fault $summit_fault";
    310314            if ($exp_type ne 'OBJECT') {
    311315                print STDERR " (but I don't care).\n";
     
    450454    my $target = shift;
    451455
    452     my ($label,$workdir,$obs_mode,$object,$comment,$tess_id,$dist_group,$data_group) = get_tool_parameters($date,$target);
     456    my ($label,$workdir,$obs_mode,$object,$comment,$tess_id,$dist_group,$data_group,$reduction) = get_tool_parameters($date,$target);
    453457
    454458    my $select =  "-dateobs_begin ${date}T00:00:00 -dateobs_end ${date}T23:59:59 ";
     
    469473        $cmd .= " -comment '$comment' ";
    470474    }
     475    if (defined($reduction)) {
     476        $cmd .= " -set_reduction $reduction ";
     477    }
    471478    $cmd .= " $select ";
    472479    if ($debug == 1) {
     
    484491    my $db = init_gpc_db();
    485492    $date =~ s/-//g;
    486     my ($label,$workdir,$obs_mode,$object,$comment,$tess_id,$dist_group,$data_group) = get_tool_parameters($date,$target);
     493    my ($label,$workdir,$obs_mode,$object,$comment,$tess_id,$dist_group,$data_group,$reduction) = get_tool_parameters($date,$target);
    487494
    488495    my $sth = "SELECT exp_id from chipRun where data_group = '$data_group' AND exp_id = $exp_id";
     
    543550        my ($Nexposures,$Nimfiles,$Nburntooled,$Nalready) = pre_chip_queue($date,$target);
    544551        if ($Nexposures == 0) {
    545             print STDERR "execute_chips: Target $target on $date had no exposures.\n";
     552            print STDERR "execute_chips: Target $target on $date had no exposures.\n";
     553            next;
     554        }
     555        if ($Nalready != 0) {
     556            print STDERR "execute_chips: Not queueing $target on $date due to already existing exposures.\n";
    546557            next;
    547558        }
    548         if ($Nalready != 0) {
    549             print STDERR "execute_chips: Not queueing $target on $date due to already existing exposures.\n";
    550             next;
    551         }
    552559        if ($Nimfiles != $Nburntooled) {
    553             print STDERR "execute_chips: Target $target on $date is not fully burntooled.\n";
     560            print STDERR "execute_chips: Target $target on $date is not fully burntooled.\n";
    554561            $metadata_out{nsState} = 'NEEDSBURNING';
    555562            next;
     
    574581    my $filter = shift;
    575582
    576     my ($label,$workdir,$obs_mode,$object,$comment,$tess_id,$dist_group,$data_group) = get_tool_parameters($date,$target);
     583    my ($label,$workdir,$obs_mode,$object,$comment,$tess_id,$dist_group,$data_group,$reduction) = get_tool_parameters($date,$target);
    577584
    578585    my $select =  "-select_dateobs_begin ${date}T00:00:00 -select_dateobs_end ${date}T23:59:59 ";
     
    603610    my $db = init_gpc_db();
    604611    $date =~ s/-//g;
    605     my ($label,$workdir,$obs_mode,$object,$comment,$tess_id,$dist_group,$data_group) = get_tool_parameters($date,$target);
     612    my ($label,$workdir,$obs_mode,$object,$comment,$tess_id,$dist_group,$data_group,$reduction) = get_tool_parameters($date,$target);
    606613
    607614    my $sth = "SELECT skycell_id from stackRun where data_group = '$data_group' AND skycell_id = '$skycell' AND filter = '$filter'";
     
    616623    my $filter = shift;
    617624
    618     my ($label,$workdir,$obs_mode,$object,$comment,$tess_id,$dist_group,$data_group) = get_tool_parameters($date,$target);
     625    my ($label,$workdir,$obs_mode,$object,$comment,$tess_id,$dist_group,$data_group,$reduction) = get_tool_parameters($date,$target);
    619626    # check warp stage == chip stage
    620627    my $db = init_gpc_db();
     
    716723    my $cleaning_date = $dt->ymd;
    717724
    718     my ($label,$workdir,$obs_mode,$object,$comment,$tess_id,$dist_group,$data_group) = get_tool_parameters($cleaning_date,$target);
     725    my ($label,$workdir,$obs_mode,$object,$comment,$tess_id,$dist_group,$data_group,$reduction) = get_tool_parameters($cleaning_date,$target);
    719726
    720727    my $args .= " -dbname gpc1 -updaterun -set_state goto_cleaned -state full -data_group $data_group ";
     
    779786    my $data_group = "${target}.${trunc_date}";
    780787    my $tess_id = $tessID_list{$target};
    781 
    782     return($label,$workdir,$obs_mode,$object,$comment,$tess_id,$dist_group,$data_group);
     788    my $reduction = $reduction_class{$target};
     789    return($label,$workdir,$obs_mode,$object,$comment,$tess_id,$dist_group,$data_group,$reduction);
    783790}
    784791
  • branches/eam_branches/20100225/ippTasks/detrend.cleanup.pro

    r25324 r27526  
    66check.globals
    77
    8 book init detCleanupProcessedImfile
    9 book init detCleanupProcessedExp
     8book init detCleanupProcessed
     9book init detCleanupResid
     10
    1011book init detCleanupStackedImfile
    1112book init detCleanupNormStatImfile
    1213book init detCleanupNormImfile
    1314book init detCleanupNormExp
    14 book init detCleanupResidImfile
    15 book init detCleanupResidExp
     15
    1616
    1717macro detclean.reset
    18   book init detCleanupProcessedImfile
    19   book init detCleanupProcessedExp
     18  book init detCleanupProcessed
     19  book init detCleanupResid
     20
    2021  book init detCleanupStackedImfile
    21 
    2222  book init detCleanupNormStatImfile
    2323  book init detCleanupNormImfile
    2424  book init detCleanupNormExp
    25 
    26   book init detCleanupResidImfile
    27   book init detCleanupResidExp
    2825end
    2926
    3027macro detclean.status
    31   echo detCleanupProcessedImfile
    32   book listbook detCleanupProcessedImfile
    33   echo detCleanupProcessedExp
    34   book listbook detCleanupProcessedExp
    35   echo detCleanupStackedImfile
     28  book listbook detCleanupProcessed
     29  book listbook detCleanupResid
     30
    3631  book listbook detCleanupStackedImfile
    37 
    3832  book listbook detCleanupNormStatImfile
    3933  book listbook detCleanupNormImfile
    4034  book listbook detCleanupNormExp
    41   book listbook detCleanupResidImfile
    42   book listbook detCleanupResidExp
     35
    4336end
    4437
    4538macro detclean.on
    46   task detrend.cleanup.process.load
     39  task detrend.cleanup.processed.load
    4740    active true
    4841  end
    49   task detrend.cleanup.process.run
    50     active true
    51   end
    52   task detrend.cleanup.processexp.load
    53     active true
    54   end
    55   task detrend.cleanup.processexp.run
    56     active true
    57   end
    58   task detrend.cleanup.stack.load
    59     active true
    60   end
    61   task detrend.cleanup.stack.run
    62     active true
    63   end
    64 
    65   task detrend.cleanup.norm.load
    66     active true
    67   end
    68   task detrend.cleanup.norm.run
    69     active true
    70   end
    71   task detrend.cleanup.normexp.load
    72     active true
    73   end
    74   task detrend.cleanup.normexp.run
    75     active true
    76   end
    77   task detrend.cleanup.normstat.load
    78     active true
    79   end
    80   task detrend.cleanup.normstat.run
     42  task detrend.cleanup.processed.run
    8143    active true
    8244  end
     
    8850    active true
    8951  end
    90   task detrend.cleanup.residexp.load
    91     active true
    92   end
    93   task detrend.cleanup.residexp.run
    94     active true
    95   end
     52
     53#  task detrend.cleanup.stack.load
     54#    active true
     55#  end
     56#  task detrend.cleanup.stack.run
     57#    active true
     58#  end
     59#  task detrend.cleanup.norm.load
     60#    active true
     61#  end
     62#  task detrend.cleanup.norm.run
     63#    active true
     64#  end
     65#  task detrend.cleanup.normexp.load
     66#    active true
     67#  end
     68#  task detrend.cleanup.normexp.run
     69#    active true
     70#  end
     71#  task detrend.cleanup.normstat.load
     72#    active true
     73#  end
     74#  task detrend.cleanup.normstat.run
     75#    active true
     76#  end
    9677end
    9778
    9879macro detclean.off
    99   task detrend.cleanup.process.load
    100     active false
    101   end
    102   task detrend.cleanup.process.run
    103     active false
    104   end
    105   task detrend.cleanup.processexp.load
    106     active false
    107   end
    108   task detrend.cleanup.processexp.run
    109     active false
    110   end
     80  task detrend.cleanup.processed.load
     81    active false
     82  end
     83  task detrend.cleanup.processed.run
     84    active false
     85  end
     86
     87  task detrend.cleanup.resid.load
     88    active false
     89  end
     90  task detrend.cleanup.resid.run
     91    active false
     92  end
     93
    11194  task detrend.cleanup.stack.load
    11295    active false
     
    133116    active false
    134117  end
    135   task detrend.cleanup.resid.load
    136     active false
    137   end
    138   task detrend.cleanup.resid.run
    139     active false
    140   end
    141   task detrend.cleanup.residexp.load
    142     active false
    143   end
    144   task detrend.cleanup.residexp.run
    145     active false
    146   end
     118
    147119end
    148120
    149121
    150122# these variables will cycle through the known database names
    151 $detCleanupProcessedImfile_DB = 0
    152 $detCleanupProcessedExp_DB = 0
     123$detCleanupProcessed_DB = 0
     124$detCleanupResid_DB = 0
     125
    153126$detCleanupStackedImfile_DB = 0
    154127$detCleanupNormStatImfile_DB = 0
    155128$detCleanupNormImfile_DB = 0
    156129$detCleanupNormExp_DB = 0
    157 $detCleanupResidImfile_DB = 0
    158 $detCleanupResidExp_DB = 0
    159 
    160 ######## cleanup process imfile ########
    161 task           detrend.cleanup.process.load
     130
     131######## cleanup processed imfile/exp ########
     132task           detrend.cleanup.processed.load
    162133  host         local
    163134
     
    169140
    170141  stdout NULL
    171   stderr $LOGDIR/detrend.cleanup.process.imfile.log
    172 
    173   task.exec
    174     $run = dettool -pendingcleanup_processedimfile
     142  stderr $LOGDIR/detrend.cleanup.processed.log
     143
     144  task.exec
     145    $run = dettool -pendingcleanup_processedexp
    175146    if ($DB:n == 0)
    176147      option DEFAULT
    177148    else
    178149      # save the DB name for the exit tasks
    179       option $DB:$detCleanupProcessedImfile_DB
    180       $run = $run -dbname $DB:$detCleanupProcessedImfile_DB
    181       $detCleanupProcessedImfile_DB ++
    182       if ($detCleanupProcessedImfile_DB >= $DB:n) set detCleanupProcessedImfile_DB = 0
     150      option $DB:$detCleanupProcessed_DB
     151      $run = $run -dbname $DB:$detCleanupProcessed_DB
     152      $detCleanupProcessed_DB ++
     153      if ($detCleanupProcessed_DB >= $DB:n) set detCleanupProcessed_DB = 0
    183154    end
    184155    add_poll_args run
     
    189160  task.exit    0
    190161    # convert 'stdout' to book format
    191     ipptool2book stdout detCleanupProcessedImfile -key det_id:exp_id:class_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     162    ipptool2book stdout detCleanupProcessed -key det_id:exp_id -uniq -setword dbname $options:0 -setword pantaskState INIT
    192163    if ($VERBOSE > 2)
    193       book listbook detCleanupProcessedImfile
     164      book listbook detCleanupProcessed
    194165    end
    195166
    196167    # delete existing entries in the appropriate pantaskStates
    197     process_cleanup detCleanupProcessedImfile
     168    process_cleanup detCleanupProcessed
    198169  end
    199170
     
    214185
    215186# run the ipp_cleanup.pl script on pending images
    216 task           detrend.cleanup.process.run
     187task           detrend.cleanup.processed.run
    217188  periods      -poll $RUNPOLL
    218189  periods      -exec $RUNEXEC
     
    221192
    222193  task.exec
    223     book npages detCleanupProcessedImfile -var N
     194    book npages detCleanupProcessed -var N
    224195    if ($N == 0) break
    225196    if ($NETWORK == 0) break
    226197   
    227     # look for new images in detCleanupProcessedImfile (pantaskState == INIT)
    228     book getpage detCleanupProcessedImfile 0 -var pageName -key pantaskState INIT
     198    # look for new images in detCleanupProcessed (pantaskState == INIT)
     199    book getpage detCleanupProcessed 0 -var pageName -key pantaskState INIT
    229200    if ("$pageName" == "NULL") break
    230201
    231     book setword detCleanupProcessedImfile $pageName pantaskState RUN
    232     book getword detCleanupProcessedImfile $pageName det_id   -var DET_ID   
    233     book getword detCleanupProcessedImfile $pageName exp_id   -var EXP_ID   
    234     book getword detCleanupProcessedImfile $pageName class_id -var CLASS_ID
    235     book getword detCleanupProcessedImfile $pageName camera   -var CAMERA
    236     book getword detCleanupProcessedImfile $pageName data_state    -var CLEANUP_MODE
    237     book getword detCleanupProcessedImfile $pageName dbname   -var DBNAME
    238 
    239     # specify choice of local or remote host based on camera and chip (class_id)
     202    book setword detCleanupProcessed $pageName pantaskState RUN
     203    book getword detCleanupProcessed $pageName det_id   -var DET_ID   
     204    book getword detCleanupProcessed $pageName exp_id   -var EXP_ID   
     205    book getword detCleanupProcessed $pageName camera   -var CAMERA
     206    book getword detCleanupProcessed $pageName data_state    -var CLEANUP_MODE
     207    book getword detCleanupProcessed $pageName dbname   -var DBNAME
     208
     209    # specify choice of local or remote host based on camera and diff (class_id)
    240210    set.host.for.camera $CAMERA FPA
    241211
    242     stdout $LOGDIR/detrend.cleanup.process.imfile.log
    243     stderr $LOGDIR/detrend.cleanup.process.imfile.log
     212    stdout $LOGDIR/detrend.cleanup.processed.log
     213    stderr $LOGDIR/detrend.cleanup.processed.log
    244214
    245215    # XXX is everything listed here needed?
    246     $run = ipp_cleanup.pl --stage detrend.process.imfile --stage_id $DET_ID --camera $CAMERA --mode $CLEANUP_MODE
     216    $run = ipp_cleanup.pl --stage detrend.processed --stage_id $DET_ID.$EXP_ID --camera $CAMERA --mode $CLEANUP_MODE --dbname $DBNAME
    247217    add_standard_args run
    248218
     
    259229  # default exit status
    260230  task.exit    default
    261     process_exit detCleanupProcessedImfile $options:0 $JOB_STATUS
     231    process_exit detCleanupProcessed $options:0 $JOB_STATUS
    262232  end
    263233
     
    266236    showcommand crash
    267237    echo "hostname: $JOB_HOSTNAME"
    268     book setword detCleanupProcessedImfile $options:0 pantaskState CRASH
     238    book setword detCleanupProcessed $options:0 pantaskState CRASH
    269239  end
    270240
     
    272242  task.exit    timeout
    273243    showcommand timeout
    274     book setword detCleanupProcessedImfile $options:0 pantaskState TIMEOUT
    275   end
    276 end
    277  
    278 
    279 ######## cleanup process exp ########
    280 task           detrend.cleanup.processexp.load
     244    book setword detCleanupProcessed $options:0 pantaskState TIMEOUT
     245  end
     246end
     247
     248
     249
     250######## cleanup resid imfile/exp ########
     251task           detrend.cleanup.resid.load
    281252  host         local
    282253
     
    288259
    289260  stdout NULL
    290   stderr $LOGDIR/detrend.cleanup.process.exp.log
    291 
    292   task.exec
    293     $run = dettool -pendingcleanup_processedexp
     261  stderr $LOGDIR/detrend.cleanup.resid.log
     262
     263  task.exec
     264    $run = dettool -pendingcleanup_residexp
    294265    if ($DB:n == 0)
    295266      option DEFAULT
    296267    else
    297268      # save the DB name for the exit tasks
    298       option $DB:$detCleanupProcessedExp_DB
    299       $run = $run -dbname $DB:$detCleanupProcessedExp_DB
    300       $detCleanupProcessedExp_DB ++
    301       if ($detCleanupProcessedExp_DB >= $DB:n) set detCleanupProcessedExp_DB = 0
     269      option $DB:$detCleanupResid_DB
     270      $run = $run -dbname $DB:$detCleanupResid_DB
     271      $detCleanupResid_DB ++
     272      if ($detCleanupResid_DB >= $DB:n) set detCleanupResid_DB = 0
    302273    end
    303274    add_poll_args run
     
    308279  task.exit    0
    309280    # convert 'stdout' to book format
    310     ipptool2book stdout detCleanupProcessedExp -key det_id:exp_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     281    ipptool2book stdout detCleanupResid -key det_id:iteration:exp_id -uniq -setword dbname $options:0 -setword pantaskState INIT
    311282    if ($VERBOSE > 2)
    312       book listbook detCleanupProcessedExp
     283      book listbook detCleanupResid
    313284    end
    314285
    315286    # delete existing entries in the appropriate pantaskStates
    316     process_cleanup detCleanupProcessedExp
     287    process_cleanup detCleanupResid
    317288  end
    318289
     
    333304
    334305# run the ipp_cleanup.pl script on pending images
    335 task           detrend.cleanup.processexp.run
     306task           detrend.cleanup.resid.run
    336307  periods      -poll $RUNPOLL
    337308  periods      -exec $RUNEXEC
     
    340311
    341312  task.exec
    342     book npages detCleanupProcessedExp -var N
     313    book npages detCleanupResid -var N
    343314    if ($N == 0) break
    344315    if ($NETWORK == 0) break
    345316   
    346     # look for new images in detCleanupProcessedExp (pantaskState == INIT)
    347     book getpage detCleanupProcessedExp 0 -var pageName -key pantaskState INIT
     317    # look for new images in detCleanupResid (pantaskState == INIT)
     318    book getpage detCleanupResid 0 -var pageName -key pantaskState INIT
    348319    if ("$pageName" == "NULL") break
    349320
    350     book setword detCleanupProcessedExp $pageName pantaskState RUN
    351     book getword detCleanupProcessedExp $pageName det_id   -var DET_ID   
    352     book getword detCleanupProcessedExp $pageName exp_id   -var EXP_ID   
    353     book getword detCleanupProcessedExp $pageName camera -var CAMERA
    354     book getword detCleanupProcessedExp $pageName data_state -var CLEANUP_MODE
    355     book getword detCleanupProcessedExp $pageName dbname -var DBNAME
    356 
    357     # specify choice of local or remote host based on camera and chip (class_id)
     321    book setword detCleanupResid $pageName pantaskState RUN
     322    book getword detCleanupResid $pageName det_id   -var DET_ID   
     323    book getword detCleanupResid $pageName exp_id   -var EXP_ID   
     324    book getword detCleanupResid $pageName iteration -var ITERATION     
     325    book getword detCleanupResid $pageName camera -var CAMERA
     326    book getword detCleanupResid $pageName data_state -var CLEANUP_MODE
     327    book getword detCleanupResid $pageName dbname -var DBNAME
     328
     329    # specify choice of local or remote host based on camera and diff (class_id)
    358330    set.host.for.camera $CAMERA FPA
    359331
    360     stdout $LOGDIR/detrend.cleanup.process.exp.log
    361     stderr $LOGDIR/detrend.cleanup.process.exp.log
     332    stdout $LOGDIR/detrend.cleanup.resid.log
     333    stderr $LOGDIR/detrend.cleanup.resid.log
    362334
    363335    # XXX is everything listed here needed?
    364     $run = ipp_cleanup.pl --stage detrend.process.exp --stage_id $DET_ID --camera $CAMERA --mode $CLEANUP_MODE
     336    $run = ipp_cleanup.pl --stage detrend.resid --stage_id $DET_ID.$EXP_ID  --camera $CAMERA --mode $CLEANUP_MODE --dbname $DBNAME
    365337    add_standard_args run
    366338
     
    377349  # default exit status
    378350  task.exit    default
    379     process_exit detCleanupProcessedExp $options:0 $JOB_STATUS
     351    process_exit detCleanupResid $options:0 $JOB_STATUS
    380352  end
    381353
     
    384356    showcommand crash
    385357    echo "hostname: $JOB_HOSTNAME"
    386     book setword detCleanupProcessedExp $options:0 pantaskState CRASH
     358    book setword detCleanupResid $options:0 pantaskState CRASH
    387359  end
    388360
     
    390362  task.exit    timeout
    391363    showcommand timeout
    392     book setword detCleanupProcessedExp $options:0 pantaskState TIMEOUT
     364    book setword detCleanupResid $options:0 pantaskState TIMEOUT
    393365  end
    394366end
     
    402374  periods      -timeout 30
    403375  npending     1
    404   active       true
     376  active       false
    405377
    406378  stdout NULL
     
    449421end
    450422
     423
    451424# run the ipp_cleanup.pl script on pending images
    452425task           detrend.cleanup.stack.run
     
    521494  periods      -timeout 30
    522495  npending     1
    523   active       true
     496  active       false
    524497
    525498  stdout NULL
     
    573546  periods      -exec $RUNEXEC
    574547  periods      -timeout 60
    575   active       true
     548  active       false
    576549
    577550  task.exec
     
    636609  periods      -timeout 30
    637610  npending     1
    638   active       true
     611  active       false
    639612
    640613  stdout NULL
     
    688661  periods      -exec $RUNEXEC
    689662  periods      -timeout 60
    690   active       true
     663  active       false
    691664
    692665  task.exec
     
    752725  periods      -timeout 30
    753726  npending     1
    754   active       true
     727  active       false
    755728
    756729  stdout NULL
     
    804777  periods      -exec $RUNEXEC
    805778  periods      -timeout 60
    806   active       true
     779  active       false
    807780
    808781  task.exec
     
    860833 
    861834
    862 ######## cleanup resid imfile ########
    863 task           detrend.cleanup.resid.load
    864   host         local
    865 
    866   periods      -poll $LOADPOLL
    867   periods      -exec $LOADEXEC
    868   periods      -timeout 30
    869   npending     1
    870   active       true
    871 
    872   stdout NULL
    873   stderr $LOGDIR/detrend.cleanup.resid.imfile.log
    874 
    875   task.exec
    876     $run = dettool -pendingcleanup_residimfile
    877     if ($DB:n == 0)
    878       option DEFAULT
    879     else
    880       # save the DB name for the exit tasks
    881       option $DB:$detCleanupResidImfile_DB
    882       $run = $run -dbname $DB:$detCleanupResidImfile_DB
    883       $detCleanupResidImfile_DB ++
    884       if ($detCleanupResidImfile_DB >= $DB:n) set detCleanupResidImfile_DB = 0
    885     end
    886     add_poll_args run
    887     command $run
    888   end
    889 
    890   # success
    891   task.exit    0
    892     # convert 'stdout' to book format
    893     ipptool2book stdout detCleanupResidImfile -key det_id:iteration:exp_id:class_id -uniq -setword dbname $options:0 -setword pantaskState INIT
    894     if ($VERBOSE > 2)
    895       book listbook detCleanupResidImfile
    896     end
    897 
    898     # delete existing entries in the appropriate pantaskStates
    899     process_cleanup detCleanupResidImfile
    900   end
    901 
    902   # locked list
    903   task.exit    default
    904     showcommand failure
    905   end
    906 
    907   task.exit    crash
    908     showcommand crash
    909   end
    910 
    911   # operation times out?
    912   task.exit    timeout
    913     showcommand timeout
    914   end
    915 end
    916 
    917 # run the ipp_cleanup.pl script on pending images
    918 task           detrend.cleanup.resid.run
    919   periods      -poll $RUNPOLL
    920   periods      -exec $RUNEXEC
    921   periods      -timeout 60
    922   active       true
    923 
    924   task.exec
    925     book npages detCleanupResidImfile -var N
    926     if ($N == 0) break
    927     if ($NETWORK == 0) break
    928    
    929     # look for new images in detCleanupResidImfile (pantaskState == INIT)
    930     book getpage detCleanupResidImfile 0 -var pageName -key pantaskState INIT
    931     if ("$pageName" == "NULL") break
    932 
    933     book setword detCleanupResidImfile $pageName pantaskState RUN
    934     book getword detCleanupResidImfile $pageName det_id   -var DET_ID   
    935     book getword detCleanupResidImfile $pageName exp_id   -var EXP_ID   
    936     book getword detCleanupResidImfile $pageName class_id -var CLASS_ID
    937     book getword detCleanupResidImfile $pageName iteration -var ITERATION     
    938     book getword detCleanupResidImfile $pageName camera -var CAMERA
    939     book getword detCleanupResidImfile $pageName data_state -var CLEANUP_MODE
    940     book getword detCleanupResidImfile $pageName dbname -var DBNAME
    941 
    942     # specify choice of local or remote host based on camera and chip (class_id)
    943     set.host.for.camera $CAMERA FPA
    944 
    945     stdout $LOGDIR/detrend.cleanup.resid.imfile.log
    946     stderr $LOGDIR/detrend.cleanup.resid.imfile.log
    947 
    948     # XXX is everything listed here needed?
    949     $run = ipp_cleanup.pl --stage detrend.resid.imfile --stage_id $DET_ID  --camera $CAMERA --mode $CLEANUP_MODE
    950     add_standard_args run
    951 
    952     # save the pageName for future reference below
    953     options $pageName
    954 
    955     # create the command line
    956     if ($VERBOSE > 1)
    957       echo command $run
    958     end
    959     command $run
    960   end
    961 
    962   # default exit status
    963   task.exit    default
    964     process_exit detCleanupResidImfile $options:0 $JOB_STATUS
    965   end
    966 
    967   # locked list
    968   task.exit    crash
    969     showcommand crash
    970     echo "hostname: $JOB_HOSTNAME"
    971     book setword detCleanupResidImfile $options:0 pantaskState CRASH
    972   end
    973 
    974   # operation timed out?
    975   task.exit    timeout
    976     showcommand timeout
    977     book setword detCleanupResidImfile $options:0 pantaskState TIMEOUT
    978   end
    979 end
    980  
    981 
    982 ######## cleanup resid exp ########
    983 task           detrend.cleanup.residexp.load
    984   host         local
    985 
    986   periods      -poll $LOADPOLL
    987   periods      -exec $LOADEXEC
    988   periods      -timeout 30
    989   npending     1
    990   active       true
    991 
    992   stdout NULL
    993   stderr $LOGDIR/detrend.cleanup.resid.exp.log
    994 
    995   task.exec
    996     $run = dettool -pendingcleanup_residexp
    997     if ($DB:n == 0)
    998       option DEFAULT
    999     else
    1000       # save the DB name for the exit tasks
    1001       option $DB:$detCleanupResidExp_DB
    1002       $run = $run -dbname $DB:$detCleanupResidExp_DB
    1003       $detCleanupResidExp_DB ++
    1004       if ($detCleanupResidExp_DB >= $DB:n) set detCleanupResidExp_DB = 0
    1005     end
    1006     add_poll_args run
    1007     command $run
    1008   end
    1009 
    1010   # success
    1011   task.exit    0
    1012     # convert 'stdout' to book format
    1013     ipptool2book stdout detCleanupResidExp -key det_id:iteration:exp_id -uniq -setword dbname $options:0 -setword pantaskState INIT
    1014     if ($VERBOSE > 2)
    1015       book listbook detCleanupResidExp
    1016     end
    1017 
    1018     # delete existing entries in the appropriate pantaskStates
    1019     process_cleanup detCleanupResidExp
    1020   end
    1021 
    1022   # locked list
    1023   task.exit    default
    1024     showcommand failure
    1025   end
    1026 
    1027   task.exit    crash
    1028     showcommand crash
    1029   end
    1030 
    1031   # operation times out?
    1032   task.exit    timeout
    1033     showcommand timeout
    1034   end
    1035 end
    1036 
    1037 # run the ipp_cleanup.pl script on pending images
    1038 task           detrend.cleanup.residexp.run
    1039   periods      -poll $RUNPOLL
    1040   periods      -exec $RUNEXEC
    1041   periods      -timeout 60
    1042   active       true
    1043 
    1044   task.exec
    1045     book npages detCleanupResidExp -var N
    1046     if ($N == 0) break
    1047     if ($NETWORK == 0) break
    1048    
    1049     # look for new images in detCleanupResidExp (pantaskState == INIT)
    1050     book getpage detCleanupResidExp 0 -var pageName -key pantaskState INIT
    1051     if ("$pageName" == "NULL") break
    1052 
    1053     book setword detCleanupResidExp $pageName pantaskState RUN
    1054     book getword detCleanupResidExp $pageName det_id    -var DET_ID   
    1055     book getword detCleanupResidExp $pageName exp_id    -var EXP_ID   
    1056     book getword detCleanupResidExp $pageName iteration -var ITERATION
    1057     book getword detCleanupResidExp $pageName camera    -var CAMERA
    1058     book getword detCleanupResidExp $pageName data_state        -var CLEANUP_MODE
    1059     book getword detCleanupResidExp $pageName dbname    -var DBNAME
    1060 
    1061     # specify choice of local or remote host based on camera and chip (class_id)
    1062     set.host.for.camera $CAMERA FPA
    1063 
    1064     stdout $LOGDIR/detrend.cleanup.resid.exp.log
    1065     stderr $LOGDIR/detrend.cleanup.resid.exp.log
    1066 
    1067     # XXX is everything listed here needed?
    1068     $run = ipp_cleanup.pl --stage detrend.resid.exp --stage_id $DET_ID --camera $CAMERA --mode $CLEANUP_MODE
    1069     add_standard_args run
    1070 
    1071     # save the pageName for future reference below
    1072     options $pageName
    1073 
    1074     # create the command line
    1075     if ($VERBOSE > 1)
    1076       echo command $run
    1077     end
    1078     command $run
    1079   end
    1080 
    1081   # default exit status
    1082   task.exit    default
    1083     process_exit detCleanupResidExp $options:0 $JOB_STATUS
    1084   end
    1085 
    1086   # locked list
    1087   task.exit    crash
    1088     showcommand crash
    1089     echo "hostname: $JOB_HOSTNAME"
    1090     book setword detCleanupResidExp $options:0 pantaskState CRASH
    1091   end
    1092 
    1093   # operation timed out?
    1094   task.exit    timeout
    1095     showcommand timeout
    1096     book setword detCleanupResidExp $options:0 pantaskState TIMEOUT
    1097   end
    1098 end
  • branches/eam_branches/20100225/ippTasks/nightly_stacks.pro

    r27517 r27526  
    605605    host $host
    606606#    set.host.for.camera GPC1 $class_id
    607     $logfile = "burntool_logs/$class_id.$start_date.log"
     607    $logfile = "/data/${host}.0/burntool_logs/$class_id.$start_date.log"
    608608
    609609    $run = ipp_apply_burntool.pl --class_id $class_id --dateobs_begin $start_date --dateobs_end $end_date --dbname gpc1 --logfile $logfile
  • branches/eam_branches/20100225/ippToPsps/scripts/pspsSchema2xml.pl

    r27517 r27526  
    8989
    9090            while (<FILE>) {
    91                 if ($_ =~ m/.*CREATE TABLE.*$tableName/) {
     91                if ($_ =~ m/.*CREATE TABLE\s+dbo\.$tableName\s*\(/i) {
    9292
    9393                    close (FILE);
     
    209209        }
    210210
    211         if($reading && $_ =~ m/^\)/) {$reading = 0;}
     211        if($reading && $_ =~ m/^\s*\)\s*/) {$reading = 0;}
    212212
    213213        if(!$reading) {next;}
     
    218218        if (!$line) {next;}
    219219        if (length($line) < 5) {next;}
    220         if ($line =~ m/^--/) {next;}
     220        if ($line =~ m/^\s*--/) {next;}
    221221        if ($line =~ m/\/\*/) {next;}
    222222        if ($line =~ m/\*\//) {next;}
  • branches/eam_branches/20100225/ippTools/share/magicdstool_getskycells.sql

    r26557 r27526  
     1-- Input warps
    12SELECT DISTINCT
    23    diffSkyfile.diff_id,
    3     diffRun.tess_id, 
     4    diffRun.tess_id,
    45    diffSkyfile.skycell_id,
    56    diffSkyfile.path_base,
     
    89JOIN magicRun USING(magic_id)
    910JOIN magicInputSkyfile USING(magic_id)
    10 JOIN diffRun ON magicRun.diff_id = diffRun.diff_id
     11JOIN diffRun USING(diff_id)
    1112JOIN diffSkyfile
    1213    ON magicRun.diff_id = diffSkyfile.diff_id
     
    1718    -- Want input warps only
    1819    AND diffInputSkyfile.warp1 IS NOT NULL
     20    AND magicRun.inverse = 0
    1921JOIN warpSkyCellMap
    2022    ON warpSkyCellMap.warp_id = diffInputSkyfile.warp1
     
    2729    diffSkyfile.fault = 0
    2830    AND diffSkyfile.quality = 0
    29     AND magic_ds_id = %lld
     31    -- WHERE hook %s
     32UNION
     33-- Reference warps
     34SELECT DISTINCT
     35    diffSkyfile.diff_id,
     36    diffRun.tess_id,
     37    diffSkyfile.skycell_id,
     38    diffSkyfile.path_base,
     39    diffSkyfile.data_state
     40FROM magicDSRun
     41JOIN magicRun USING(magic_id)
     42JOIN magicInputSkyfile USING(magic_id)
     43JOIN diffRun USING(diff_id)
     44JOIN diffSkyfile
     45    ON magicRun.diff_id = diffSkyfile.diff_id
     46    AND magicInputSkyfile.node = diffSkyfile.skycell_id
     47JOIN diffInputSkyfile
     48    ON diffInputSkyfile.diff_id = diffSkyfile.diff_id
     49    AND diffInputSkyfile.skycell_id = diffSkyfile.skycell_id
     50    AND diffInputSkyfile.warp2 IS NOT NULL
     51    AND magicRun.inverse = 1
     52JOIN warpSkyCellMap
     53    ON warpSkyCellMap.warp_id = diffInputSkyfile.warp2
     54    AND warpSkyCellMap.skycell_id = diffInputSkyfile.skycell_id
     55JOIN warpSkyfile
     56    ON warpSkyfile.warp_id = warpSkyCellMap.warp_id
     57    AND warpSkyfile.skycell_id = warpSkyCellMap.skycell_id
     58    AND warpSkyfile.quality = 0
     59WHERE
     60    diffSkyfile.fault = 0
     61    AND diffSkyfile.quality = 0
     62    -- WHERE hook %s
  • branches/eam_branches/20100225/ippTools/src/magicdstool.c

    r27517 r27526  
    11351135
    11361136    psMetadata *where = psMetadataAlloc();
     1137    PXOPT_COPY_S64(config->args, where, "-magic_ds_id", "magicDSRun.magic_ds_id", "==");
    11371138    PXOPT_COPY_STR(config->args, where, "-class_id",    "warpSkyCellMap.class_id", "==");
    11381139    PXOPT_COPY_STR(config->args, where, "-skycell_id",  "warpSkyCellMap.skycell_id", "==");
     
    11461147    }
    11471148
     1149    psString whereClause = NULL;
    11481150    if (psListLength(where->list)) {
    1149         psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
    1150         psStringAppend(&query, " AND %s", whereClause);
    1151         psFree(whereClause);
     1151        whereClause = psDBGenerateWhereConditionSQL(where, NULL);
     1152        psStringPrepend(&whereClause, "\n AND ");
    11521153    }
    11531154    psFree(where);
    11541155
    1155     if (!p_psDBRunQueryF(config->dbh, query, magic_ds_id)) {
     1156    if (!p_psDBRunQueryF(config->dbh, query, whereClause, whereClause)) {
    11561157        psError(PS_ERR_UNKNOWN, false, "database error");
    11571158        psFree(query);
  • branches/eam_branches/20100225/ippconfig/recipes/nightly_science.config

    r27517 r27526  
    119119  STACKABLE BOOL FALSE
    120120END
    121 TARGETS METADATA
    122   NAME STR microtest
     121# This is a hack, and I freely admit it.
     122TARGETS METADATA
     123  NAME STR microtestMD01
     124  TESS STR MD01
     125  OBJECT STR MD01%
     126  COMMENT STR Microtest Obs%
     127  STACKABLE BOOL TRUE
     128END
     129TARGETS METADATA
     130  NAME STR microtestMD01.noPattern
     131  TESS STR MD01
     132  OBJECT STR MD01%
     133  COMMENT STR Microtest Obs%
     134  REDUCTION STR STDSCIENCE.V0
     135  STACKABLE BOOL TRUE
     136END
     137TARGETS METADATA
     138  NAME STR microtestMD02
     139  TESS STR MD02
     140  OBJECT STR MD02%
     141  COMMENT STR Microtest Obs%
     142  STACKABLE BOOL TRUE
     143END
     144TARGETS METADATA
     145  NAME STR microtestMD02.noPattern
     146  TESS STR MD02
     147  OBJECT STR MD02%
     148  COMMENT STR Microtest Obs%
     149  REDUCTION STR STDSCIENCE.V0
     150  STACKABLE BOOL TRUE
     151END
     152TARGETS METADATA
     153  NAME STR microtestMD03
     154  TESS STR MD03
     155  OBJECT STR MD03%
     156  COMMENT STR Microtest Obs%
     157  STACKABLE BOOL TRUE
     158END
     159TARGETS METADATA
     160  NAME STR microtestMD03.noPattern
     161  TESS STR MD03
     162  OBJECT STR MD03%
     163  COMMENT STR Microtest Obs%
     164  REDUCTION STR STDSCIENCE.V0
     165  STACKABLE BOOL TRUE
     166END
     167TARGETS METADATA
     168  NAME STR microtestMD04
    123169  TESS STR MD04
    124   COMMENT STR Microtest Obs%
    125   STACKABLE BOOL TRUE
    126 END
    127 # TARGETS METADATA
    128 #  NAME STR CMB
    129 #  TESS STR RINGS.V0
    130 #  COMMENT STR CMB_Cold%
    131 #  STACKABLE BOOL FALSE
    132 # END
    133 # TARGETS METADATA
    134 #  NAME STR SVS
    135 #  TESS STR RINGS.V0
    136 #  COMMENT STR SVS%
    137 #  STACKABLE BOOL FALSE
    138 # END
     170  OBJECT STR MD04%
     171  COMMENT STR Microtest Obs%
     172  STACKABLE BOOL TRUE
     173END
     174TARGETS METADATA
     175  NAME STR microtestMD04.noPattern
     176  TESS STR MD04
     177  OBJECT STR MD04%
     178  COMMENT STR Microtest Obs%
     179  REDUCTION STR STDSCIENCE.V0
     180  STACKABLE BOOL TRUE
     181END
     182TARGETS METADATA
     183  NAME STR microtestMD05
     184  TESS STR MD05
     185  OBJECT STR MD05%
     186  COMMENT STR Microtest Obs%
     187  STACKABLE BOOL TRUE
     188END
     189TARGETS METADATA
     190  NAME STR microtestMD05.noPattern
     191  TESS STR MD05
     192  OBJECT STR MD05%
     193  COMMENT STR Microtest Obs%
     194  REDUCTION STR STDSCIENCE.V0
     195  STACKABLE BOOL TRUE
     196END
     197TARGETS METADATA
     198  NAME STR microtestMD06
     199  TESS STR MD06
     200  OBJECT STR MD06%
     201  COMMENT STR Microtest Obs%
     202  STACKABLE BOOL TRUE
     203END
     204TARGETS METADATA
     205  NAME STR microtestMD06.noPattern
     206  TESS STR MD06
     207  OBJECT STR MD06%
     208  COMMENT STR Microtest Obs%
     209  REDUCTION STR STDSCIENCE.V0
     210  STACKABLE BOOL TRUE
     211END
     212TARGETS METADATA
     213  NAME STR microtestMD07
     214  TESS STR MD07
     215  OBJECT STR MD07%
     216  COMMENT STR Microtest Obs%
     217  STACKABLE BOOL TRUE
     218END
     219TARGETS METADATA
     220  NAME STR microtestMD07.noPattern
     221  TESS STR MD07
     222  OBJECT STR MD07%
     223  COMMENT STR Microtest Obs%
     224  REDUCTION STR STDSCIENCE.V0
     225  STACKABLE BOOL TRUE
     226END
     227TARGETS METADATA
     228  NAME STR microtestMD08
     229  TESS STR MD08
     230  OBJECT STR MD08%
     231  COMMENT STR Microtest Obs%
     232  STACKABLE BOOL TRUE
     233END
     234TARGETS METADATA
     235  NAME STR microtestMD08.noPattern
     236  TESS STR MD08
     237  OBJECT STR MD08%
     238  COMMENT STR Microtest Obs%
     239  REDUCTION STR STDSCIENCE.V0
     240  STACKABLE BOOL TRUE
     241END
     242TARGETS METADATA
     243  NAME STR microtestMD09
     244  TESS STR MD09
     245  OBJECT STR MD09%
     246  COMMENT STR Microtest Obs%
     247  STACKABLE BOOL TRUE
     248END
     249TARGETS METADATA
     250  NAME STR microtestMD09.noPattern
     251  TESS STR MD09
     252  OBJECT STR MD09%
     253  COMMENT STR Microtest Obs%
     254  REDUCTION STR STDSCIENCE.V0
     255  STACKABLE BOOL TRUE
     256END
     257TARGETS METADATA
     258  NAME STR microtestMD10
     259  TESS STR MD10
     260  OBJECT STR MD10%
     261  COMMENT STR Microtest Obs%
     262  STACKABLE BOOL TRUE
     263END
     264TARGETS METADATA
     265  NAME STR microtestMD10.noPattern
     266  TESS STR MD10
     267  OBJECT STR MD10%
     268  COMMENT STR Microtest Obs%
     269  REDUCTION STR STDSCIENCE.V0
     270  STACKABLE BOOL TRUE
     271END
  • branches/eam_branches/20100225/ippconfig/recipes/psphot.config

    r27508 r27526  
    7070MOMENTS_AR_MAX                      F32   1.5             # maximum axial ratio: 1 / AR < (sx / sy) < AR
    7171MOMENTS_GAUSS_SIGMA                 F32   4.0             # XXX this is now autoscaled
     72
     73# calculate difference stats?
     74DIFF_STATS                          BOOL  FALSE
    7275
    7376# basic object statistics
     
    264267PSPHOT.CR.NSIGMA.LIMIT              F32   3.0  # sources with crNsigma greater that this get tagged as likely cosmic rays
    265268PSPHOT.EXT.NSIGMA.LIMIT             F32   3.0  # sources with extNsigma greater that this get tagged as likely extended sources
    266 PSPHOT.EXT.NSIGMA.MOMENTS           F32   2.0  # sources with extNsigma greater that this get tagged as likely extended sources
     269PSPHOT.EXT.NSIGMA.MOMENTS           F32   3.0  # sources with extNsigma greater that this get tagged as likely extended sources
    267270PSPHOT.CR.GROW                      S32   1               # Number of pixels to grow CR mask
    268271PSPHOT.CR.NSIGMA.SOFTEN             F32   0.0025          # Softening parameter for weights
  • branches/eam_branches/20100225/ppViz

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/20100225/ppViz/src/ppVizPattern

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/20100225/pstamp/scripts/pstampparse.pl

    r27517 r27526  
    233233    # user requested us to search all components. Set to ""
    234234    $search_component = "" if $search_component eq "all";
     235
     236    if (!check_image_type($stage)) {
     237        print STDERR "invalid IMG_TYPE for row $rownum\n" if $verbose;
     238        insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST);
     239        $num_jobs++;
     240        next;
     241    }
    235242
    236243    if ((($job_type eq "stamp") or ($req_type eq "bycoord")) and ! validROI($row)) {
     
    958965}
    959966
     967sub check_image_type
     968{
     969    my $img_type = shift;
     970    if (!$img_type) {
     971            print STDERR "NULL IMG_TYPE supplied\n";
     972            return 0;
     973    }
     974    if (($img_type eq "raw") or ($img_type eq "chip") or ($img_type eq "warp") or
     975        ($img_type eq "stack") or ($img_type eq "diff")) {
     976        return 1;
     977    } else {
     978        print STDERR "$img_type is not a valid IMG_TYPE\n";
     979        return 0;
     980    }
     981}
     982
    960983sub my_die
    961984{
  • branches/eam_branches/20100225/tools/neb-ds9.pl

    r26670 r27526  
    22
    33use Getopt::Std;
    4 getopts('AM',\%opt);
     4use File::Temp qw( tempfile );
     5getopts('AMDRC',\%opt);
    56
    67$cmd = 'ds9  -scale mode zscale ';
    7 
     8if (exists($opt{M})) {
     9    $cmd .= ' -mosaic wcs ';
     10}
    811if (exists($opt{A})) {
    912    $cmd .= " -wcs align yes ";
     13}
     14
     15if (exists($opt{C})) {
     16    $cmd .= " -frame new rgb -rgb system image ";
     17    @color = ("-red","-blue","-green");
    1018}
    1119
     
    1624            $cmd .= "-medatacube $real_file ";
    1725        }
     26        elsif (($real_file =~ /cmf$/)) {
     27            my $head_name = $real_file;
     28            $head_name =~ s/.*XY(\d\d).*/XY$1.psf/;
     29            my ($tempFile, $tempName) = tempfile("/tmp/ds9.$$.XXXX",
     30                                                 UNLINK => 1, SUFFIX => '.reg' );
     31           
     32            if (exists($opt{R})) {
     33                system("fdump $real_file $head_name | awk '{print(\"FK5;point(\",\$15,\$16,\") # point=boxcircle text = {\",\$8,\"}\"}' > $tempName");
     34                $cmd .= " -regions format xy -regions $tempName ";
     35            }
     36            else {
     37                system("echo '# Region file format: DS9 version 4.1' > $tempName");
     38                system("echo 'global color=green dashlist=8 3 width=1 font=\"helvetica 10 normal\" select=1 highlite=1 dash=0 fixed=0 edit=1 move=1 delete=1 include=1 source=1' >> $tempName");
     39               
     40                system("fdump $real_file $head_name | awk '{print(\"image;ellipse(\",\$2,\$3,\$22,\$23,\$24,\") # text = {\",\$8,\"\}\")}' >> $tempName");
     41                $cmd .= " -regions format ds9 -regions $tempName ";
     42            }
     43
     44
     45        }
    1846        else {
     47            if (exists($opt{C})) {
     48                if ($#color == -1) {
     49                    next;
     50                }
     51                else {
     52                    $c = shift(@color);
     53                    $cmd .= " $c ";
     54                }
     55            }
    1956            $cmd .= " $real_file ";
    2057        }
    2158    }
    2259}
    23 #$cmd .= "  -zoom to fit -regions format xy -regions system wcs -regions load targets.reg  ";
    2460system("$cmd");
  • branches/eam_branches/20100225/tools/wiki_nightly_stacks_table.pl

    r26710 r27526  
    2222$db = init_gpc_db();
    2323
    24 @targets = ('M31','MD01','MD02','MD03','MD04','MD05','MD06','MD07','MD08','MD09','MD10');
     24@targets = ('M31','MD01','MD02','MD03','MD04','MD05','MD06','MD07','MD08','MD09','MD10','ThreePi','STS','SweetSpot');
    2525
    2626# potential targets
    2727if (exists($opt{P})) {
    2828    foreach $t (@targets) {
    29         $sth = "select filter,DATE_FORMAT(rawExp.dateobs,'%Y-%m-%d') AS day,count(filter) FROM rawExp JOIN newExp using(exp_id) WHERE rawExp.fault = 0 AND exp_type = 'OBJECT' AND comment LIKE '${t}%' AND dateobs >= '2009-12-08T00:00:00' GROUP BY day,filter";
     29        $comment = $t;
     30        if ($comment eq 'ThreePi') {
     31            $comment = '3Pi';
     32        }
     33        $sth = "select filter,DATE_FORMAT(rawExp.dateobs,'%Y-%m-%d') AS day,count(filter) FROM rawExp JOIN newExp using(exp_id) WHERE rawExp.fault = 0 AND exp_type = 'OBJECT' AND comment LIKE '%${comment}%' AND dateobs >= '2010-02-12T00:00:00' GROUP BY day,filter";
    3034        $data_ref = $db->selectall_arrayref( $sth );
    3135        foreach $rr (@{ $data_ref }) {
     
    6367#queued in chip
    6468
    65 $sth = "select rawExp.dateobs,chipRun.state,rawExp.filter,count(chipRun.state),chipRun.data_group,chipRun.dist_group from chipRun JOIN rawExp using (exp_id)  where chipRun.label LIKE '%nightlystack' GROUP BY data_group,filter,state ORDER BY dateobs";
     69$sth = "select rawExp.dateobs,chipRun.state,rawExp.filter,count(chipRun.state),chipRun.data_group,chipRun.dist_group from chipRun JOIN rawExp using (exp_id)  where chipRun.label LIKE '%nightlyscience' GROUP BY data_group,filter,state ORDER BY dateobs";
    6670
    6771$data_ref = $db->selectall_arrayref( $sth );
     
    133137
    134138#warps
    135 $sth = "select rawExp.dateobs,warpRun.state,rawExp.filter,count(warpRun.state),warpRun.data_group,warpRun.dist_group from warpRun JOIN fakeRun using (fake_id) JOIN camRun using (cam_id) JOIN chipRun using (chip_id) JOIN rawExp using (exp_id)  where warpRun.label LIKE '%nightlystack' GROUP BY data_group,filter,state ORDER BY data_group,filter";
     139$sth = "select rawExp.dateobs,warpRun.state,rawExp.filter,count(warpRun.state),warpRun.data_group,warpRun.dist_group from warpRun JOIN fakeRun using (fake_id) JOIN camRun using (cam_id) JOIN chipRun using (chip_id) JOIN rawExp using (exp_id)  where warpRun.label LIKE '%nightlyscience' GROUP BY data_group,filter,state ORDER BY data_group,filter";
    136140$data_ref = $db->selectall_arrayref( $sth );
    137141
     
    175179
    176180
    177 $sth = "select state,count(skycell_id),data_group,dist_group,filter from stackRun where label LIKE '%nightlystack' group by data_group,filter,state";
     181$sth = "select state,count(skycell_id),data_group,dist_group,filter from stackRun where label LIKE '%nightlyscience' group by data_group,filter,state";
    178182$data_ref = $db->selectall_arrayref( $sth );
    179183
     
    245249# distribution
    246250
    247 $sth = "select distRun.data_group,dist_group,filter,count(stage_id) from distRun JOIN stackRun ON (stage_id = stack_id) where distRun.label LIKE '%.nightlystack' AND distRun.state = 'full' GROUP BY distRun.data_group,filter";
     251$sth = "select distRun.data_group,dist_group,filter,count(stage_id) from distRun JOIN stackRun ON (stage_id = stack_id) where distRun.label LIKE '%.nightlyscience' AND distRun.state = 'full' GROUP BY distRun.data_group,filter";
    248252
    249253$data_ref = $db->selectall_arrayref( $sth );
     
    284288# faulted distributed
    285289
    286 $sth = "select * from rcDSFileset join distRun using(dist_id) where rcDSFileset.fault > 0 and date(registered) >= '2010-01-01' AND label LIKE 'M%.nightlystack' order by fs_id asc";
     290$sth = "select * from rcDSFileset join distRun using(dist_id) where rcDSFileset.fault > 0 and date(registered) >= '2010-01-01' AND label LIKE 'M%.nightlyscience' order by fs_id asc";
    287291$data_ref = $db->selectall_arrayref( $sth );
    288292
Note: See TracChangeset for help on using the changeset viewer.