IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30586


Ignore:
Timestamp:
Feb 11, 2011, 4:29:48 PM (15 years ago)
Author:
watersc1
Message:

Trying to merge back into trunk.

Location:
branches/czw_branch/20101203
Files:
17 deleted
139 edited
70 copied

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20101203

  • branches/czw_branch/20101203/DataStoreServer/scripts/dsreg

    r29743 r30586  
    338338                ## then copy or symlink the files into place
    339339                foreach my $ref (@files) {
    340                     my $src = (defined $abspath ? '' : "$datapath/") . "$ref->{file}";
     340                    my $src_path = (defined $abspath ? '' : "$datapath/") . "$ref->{file}";
    341341                    my $filename = fileparse($ref->{file}, ());
    342342                    my $dest = "$fileset_dir/$filename";
    343343
     344                    my $src = $ipprc->file_resolve($src_path);
     345                    if (!$src) {
     346                        print STDERR "failed to resolve file $src_path\n";
     347                        exit $PS_EXIT_SYS_ERROR;
     348                    }
    344349                    if ( !-e $src or !-r $src) {
    345350                        print STDERR "source file $src does not exist or is not accessible\n";
  • branches/czw_branch/20101203/Nebulous/bin/neb-cull

    r25121 r30586  
    1717
    1818my ($min_copies, $server, $volume, $one_only);
    19 
     19my ($soft_volume);
    2020$server = $ENV{'NEB_SERVER'} unless $server;
    2121
     
    2525    'volume|v=s'    => \$volume,
    2626    'one_only|o'    => \$one_only,
     27    'soft_volume'   => \$soft_volume,
    2728) || pod2usage( 2 );
    2829
     
    4243    unless defined $neb;
    4344
     45if ($volume) {
     46    unless (($soft_volume)) {
     47        $volume = '~' . $volume;
     48    }
     49}
     50
    4451$volume ||= "any";
    4552$min_copies ||= 2;
     
    4855push @cull_args, $key;
    4956push @cull_args, $volume;
     57
     58# print "$key $volume\n";
     59# print "@cull_args\n";
     60
    5061
    5162if ($one_only) {
     
    95106
    96107Symbolic name of the volume to create the new instance on.
     108
     109Optional.
     110
     111=item * --soft_volume
     112
     113Treat the specified volume name as soft, and allow an instance to be culled
     114from another volume if the specified volume does not have an instance.
    97115
    98116Optional.
  • branches/czw_branch/20101203/Ohana/src/addstar/src/resort_catalog.c

    r30118 r30586  
    123123    N++;
    124124  }
    125   N++;
     125  // N++;
    126126  average[currentAve].Nmeasure = N;
    127127  // MARKTIME("update Nmeasure : %f sec\n", dtime);
  • branches/czw_branch/20101203/Ohana/src/libdvo/src/dvo_util.c

    r27435 r30586  
    255255      dvo_catalog_free (&catalog);
    256256  }
     257  size_t NInvalidDetID = 0;
    257258  if (Ndetect) {
    258259      dvoDetection *sorted;
     
    262263      off_t i;
    263264      for (i = 0; i < Ndetect; i++) {
    264            sorted[detections[i].meas.detID] = detections[i];
     265
     266          if (detections[i].meas.detID < 0 || detections[i].meas.detID > (*pMaxDetID + 1))
     267              NInvalidDetID++;
     268          else
     269              sorted[detections[i].meas.detID] = detections[i];
    265270      }
    266271      *results = sorted;
     
    271276  FREE(detections);
    272277
     278  if (NInvalidDetID) fprintf (stderr, "ERROR: Encountered %ld invalid detection IDs\n", NInvalidDetID);
     279
    273280  return (Ndetect);
    274281
  • branches/czw_branch/20101203/Ohana/src/tools/src/roc.c

    r30118 r30586  
    44# include <regex.h>
    55
    6 # define myAssert(LOGIC,MSG) { if (!(LOGIC)) { fprintf (stderr, "%s\n", MSG); abort(); } }
     6// # define myAssert(LOGIC,MSG) { if (!(LOGIC)) { fprintf (stderr, "%s\n", MSG); abort(); } }
     7# define myAssert(LOGIC,MSG) { if (!(LOGIC)) { fprintf (stderr, "%s\n", MSG); exit(1); } }
    78
    89# define ROC_HEADER_SIZE  0x1000
     
    3031
    3132  usage();
    32   exit (1);
     33  exit (2);
    3334}
    3435
    3536int roc_create (int argc, char **argv) {
    3637
    37   int i, j, n, Ninput, result, Nblocks, header_size, size_off, Noff, Nbytes, Nread;
     38  int i, j, n, Ninput, result, Nblocks, header_size, size_off;
     39  int status, Noff, Nbytes, Nread, Nwrite;
    3840  off_t maxSize, *sizes, *bytes_read;
    3941  char value;
     
    121123  myAssert (target, "failed to open output");
    122124
    123   fwrite (header, 1, header_size, target);
     125  Nwrite = fwrite (header, 1, header_size, target);
     126  myAssert (Nwrite == header_size, "failed to write header");
    124127
    125128  ALLOCATE (inputData, char *, Ninput);
     
    134137      Nbytes = fread (inputData[i], 1, Nread, input[i]);
    135138      myAssert (Nbytes == Nread, "failed to read data");
     139
    136140      if (Nread < ROC_BLOCKSIZE) {
    137141        // if we have reached the end of the file, fill in the rest with NULLs
     
    149153    }
    150154
    151     fwrite (outputData, 1, ROC_BLOCKSIZE, target);
    152   }
     155    Nwrite = fwrite (outputData, 1, ROC_BLOCKSIZE, target);
     156    myAssert (Nwrite == ROC_BLOCKSIZE, "failed to write data block");
     157  }
     158
     159  status = fclose (target);
     160  myAssert (!status, "failed to close rocfile");
    153161
    154162  exit (0);
     
    157165int roc_repair (int argc, char **argv) {
    158166
    159   int i, j, n, Ninput, Nblocks, header_size, Nbytes, Nread, Nfile, Nwrite;
     167  int i, j, n, Ninput, Nblocks, header_size, Nbytes;
     168  int status, Nread, Nfile, Nwrite;
    160169  off_t *sizes, *bytes_read;
    161170  char value;
     
    201210  // read the full header
    202211  fseeko (target, 0, SEEK_SET);
    203   fread (header, 1, header_size, target);
     212  Nread = fread (header, 1, header_size, target);
     213  myAssert (Nread == header_size, "failed to read header");
    204214
    205215  ptr = header;
     
    252262      Nbytes = fread (inputData[i], 1, Nread, input[i]);
    253263      myAssert (Nbytes == Nread, "failed to read data");
     264
    254265      if (Nread < ROC_BLOCKSIZE) {
    255266        // if we have reached the end of the file, fill in the rest with NULLs
     
    258269      bytes_read[i] += Nread;
    259270    }
    260     fread (targetData, 1, ROC_BLOCKSIZE, target);
     271    Nread = fread (targetData, 1, ROC_BLOCKSIZE, target);
     272    myAssert (Nread == ROC_BLOCKSIZE, "failed to read from target");
    261273   
    262274    for (j = 0; j < ROC_BLOCKSIZE; j++) {
     
    278290  for (i = 0; i < Ninput; i++) {
    279291    if (i == Nfile) continue;
    280     fclose(input[i]);
    281   }
    282   fclose (output);
    283   fclose (target);
     292    status = fclose(input[i]);
     293    myAssert (!status, "failed to close input");
     294  }
     295  status = fclose (output);
     296  myAssert (!status, "failed to close output file");
     297
     298  status = fclose (target);
     299  myAssert (!status, "failed to close rocfile");
    284300
    285301  exit (0);
  • branches/czw_branch/20101203/PS-IPP-Config/lib/PS/IPP/Config.pm

    r30118 r30586  
    10481048}
    10491049
     1050sub magic_filename
     1051{
     1052    my $file = shift;
     1053    my $prefix = shift;
     1054    my $dirname = dirname($file);
     1055    my $base = basename($file);
     1056
     1057    return "$dirname/$prefix$base";
     1058}
     1059
     1060sub destreaked_filename
     1061{
     1062    my $self  = shift;
     1063    my $file  = shift;
     1064
     1065    return magic_filename($file, "SR_");
     1066}
     1067sub recovery_filename
     1068{
     1069    my $self  = shift;
     1070    my $file  = shift;
     1071
     1072    return magic_filename($file, "REC_");
     1073}
     1074
    10501075# Return an EXTNAME From the EXTNAME.RULE table in the camera configuration
    10511076sub extname_rule
  • branches/czw_branch/20101203/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm

    r29424 r30586  
    1717                    resolve_project
    1818                    getCamRunByCamID
     19                    runToolAndParse
    1920                    parse_md_fast
    2021                    );
  • branches/czw_branch/20101203/PS-IPP-PStamp/lib/PS/IPP/PStamp/RequestFile.pm

    r28048 r30586  
    2929                    $PSTAMP_SELECT_INVERSE
    3030                    $PSTAMP_SELECT_UNCONV
     31                    $PSTAMP_REQUEST_UNCENSORED
     32                    $PSTAMP_REQUIRE_UNCENSORED
    3133                    $PSTAMP_USE_IMFILE_ID
    3234                    $PSTAMP_NO_WAIT_FOR_UPDATE
     
    4446                    $PSTAMP_NO_JOBS_QUEUED
    4547                    $PSTAMP_NO_OVERLAP
     48                    $PSTAMP_NOT_AUTHORIZED
    4649                    );
    4750our %EXPORT_TAGS = (standard => [@EXPORT_OK]);
     
    6467our $PSTAMP_USE_IMFILE_ID    = 16384;
    6568
    66 our $PSTAMP_NO_WAIT_FOR_UPDATE  = 32768;
     69our $PSTAMP_NO_WAIT_FOR_UPDATE = 32768;
     70our $PSTAMP_REQUEST_UNCENSORED = 1 << 16;
     71our $PSTAMP_REQUIRE_UNCENSORED = 1 << 17;
    6772
    6873# job and result codes
     
    8287our $PSTAMP_NO_JOBS_QUEUED   = 27;
    8388our $PSTAMP_NO_OVERLAP       = 28;
     89our $PSTAMP_NOT_AUTHORIZED   = 29;
    8490
    8591
     
    119125PSTAMP_NO_JOBS_QUEUED
    120126PSTAMP_NO_OVERLAP
     127PSTAMP_NOT_AUTHORIZED
    121128);
    122129
  • branches/czw_branch/20101203/dbconfig/changes.txt

    r30118 r30586  
    19961996
    19971997ALTER TABLE rawImfile ADD column video_cells TINYINT AFTER burntool_state;
     1998
     1999ALTER TABLE pstampDataStore ADD COLUMN need_magic INT;
  • branches/czw_branch/20101203/dbconfig/pstamp.md

    r29287 r30586  
    88    uri         STR         255
    99    pollInterval S32        0
     10    need_magic  S32         0
    1011END
    1112
  • branches/czw_branch/20101203/ippMonitor/Makefile.in

    r29651 r30586  
    4343$(DESTWWW)/ipp.stack.dat \
    4444$(DESTWWW)/ipp.stack.php \
     45$(DESTWWW)/ipp.dvodb.dat \
     46$(DESTWWW)/ipp.dvodb.php \
    4547$(DESTWWW)/phptest.php \
    4648$(DESTWWW)/site.php \
     
    5557$(DESTWWW)/czartool_labels.php \
    5658$(DESTWWW)/czartool_getplot.php \
     59$(DESTWWW)/czartool_exposures.php \
    5760$(DESTWWW)/histogram.php \
    5861$(DESTWWW)/show_and_delete_image.php \
    5962$(DESTWWW)/scatterPlot.php \
     63$(DESTWWW)/rawBurntoolState.php \
    6064$(DESTWWW)/plotHistogram.php \
    6165$(DESTWWW)/columns_in_db.php \
     
    6468$(DESTWWW)/warpProcessedExp.php \
    6569$(DESTWWW)/diskUsage.php \
    66 $(DESTWWW)/version.php
     70$(DESTWWW)/version.php
     71
     72
     73
    6774
    6875DEFSRC = \
     
    210217$(DESTWWW)/exposureStatus.php \
    211218$(DESTWWW)/mopsStatus.php \
    212 $(DESTWWW)/gpc1MysqlProcessList.php
     219$(DESTWWW)/gpc1MysqlProcessList.php \
     220$(DESTWWW)/minidvodbRun.php \
     221$(DESTWWW)/minidvodbCopy.php \
     222$(DESTWWW)/minidvodbProcessed.php \
     223$(DESTWWW)/addRunRun.php \
     224$(DESTWWW)/addRunProcessed.php
     225
     226
    213227
    214228PICTURES = \
  • branches/czw_branch/20101203/ippMonitor/def/diffProcessedSkyfile_Images.d

    r27892 r30586  
    1111# IMAGE VAR basename filerule camera class_id
    1212IMAGE JPEG2 $diffSkyfile.path_base PPSUB.OUTPUT.JPEG2 GPC1 NONE
     13
     14# if no query restrictions are supplied, we want to limit the query or it is extremely long running:
     15UNRESTRICTED AND diffRun.diff_id = 0
    1316
    1417# XXX need to get camera from lookup
  • branches/czw_branch/20101203/ippMonitor/def/magicProcessedMasks_Images.d

    r27892 r30586  
    1111ARGS  ARG7 magicRun.magic_id=$magicRun.magic_id
    1212ARGS  ARG7 camera=GPC1
    13 ARGS  ARG7 basename=$magicRun.workdir/$magicRun.exp_id/$magicRun.exp_id.mgc.$magicRun.magic_id.verify/$magicRun.exp_id
     13#ARGS  ARG7 basename=$magicRun.workdir/$magicRun.exp_id/$magicRun.exp_id.mgc.$magicRun.magic_id.verify/$magicRun.exp_id
     14ARGS  ARG7 basename=$magicMask.path_base
    1415
    1516#        field                   size  format  name           show     link to         extras
     
    2526FIELD    magicMask.fault,        5,   %d,     Fault
    2627FIELD    magicRun.workdir,       5,   %s,     Label, none
     28FIELD    magicMask.path_base,    5,   %s,     Label, none
    2729
    2830TAIL PHP insert_image ('MAGIC.ORIGINAL.PNG', 'width=49%');
  • branches/czw_branch/20101203/ippMonitor/def/mopsStatus.d

    r29483 r30586  
    1 TABLE rawExp LEFT JOIN chipRun using(exp_id) LEFT JOIN camRun using(chip_id) LEFT JOIN fakeRun using(cam_id) LEFT JOIN warpRun using(fake_id) LEFT JOIN diffInputSkyfile AS diffInput ON diffInput.warp1 = warp_id LEFT JOIN diffRun AS diffInputRun ON diffInput.diff_id = diffInputRun.diff_id LEFT JOIN diffInputSkyfile AS diffTemplate ON diffTemplate.warp2 = warp_id LEFT JOIN diffRun AS diffTemplateRun ON diffTemplate.diff_id = diffTemplateRun.diff_id LEFT JOIN publishRun ON stage_id=diffInput.diff_id
     1TABLE rawExp LEFT JOIN chipRun using(exp_id) LEFT JOIN camRun using(chip_id) LEFT JOIN fakeRun using(cam_id) LEFT JOIN warpRun using(fake_id) LEFT JOIN diffInputSkyfile AS diffInput ON diffInput.warp1 = warp_id LEFT JOIN diffRun AS diffInputRun ON diffInput.diff_id = diffInputRun.diff_id LEFT JOIN diffInputSkyfile AS diffTemplate ON diffTemplate.warp2 = warp_id LEFT JOIN diffRun AS diffTemplateRun ON diffTemplate.diff_id = diffTemplateRun.diff_id LEFT JOIN publishRun ON stage_id=diffInput.diff_id AND (client_id=1 OR client_id=5) LEFT JOIN publishRun AS pubRun2 ON pubRun2.stage_id=diffTemplate.diff_id AND (pubRun2.client_id=1 OR pubRun2.client_id=5) LEFT JOIN magicDSRun ON magicDSRun.magic_ds_id=camRun.magicked
    22TITLE MOPS Status
    33FILE mopsStatus.php
     
    1010OP OP1 ($row[8]>$row[9]?$row[8]. "(1)":($row[9]!=0?$row[9]. "(2)":"0"))
    1111# $diffInput.diff_id+$diffTemplate.diff_id
    12 OP OP2 $row[8]+$row[9]
    13 #  "[".$diffInput.diff_id."]:[".$tdiff_id."]"
     12# PUB ID
     13OP OP2 ($row[12]>$row[13]?$row[12]. "(I)":($row[13]!=0?$row[13]. "(T)":"0"))
     14#($row[13]>$row[14])
    1415
    1516#     field                    width format  name          show         link to                   extras
    16 FIELD dateobs,                 15,   %T,     Date Obs
     17FIELD dateobs,                 13,   %T,     Date Obs
    1718FIELD exp_name,                5,    %s,     Exp Name
    1819FIELD rawExp.exp_id,           5,    %d,     Exp ID
    1920FIELD chipRun.data_group,      5,    %s,     Data grp
    2021FIELD chip_id,                 5,    %d,     Chip ID (Stage 1)
    21 FIELD cam_id,                  5,    %d,     Cam ID (Stage 2)
     22FIELD camRun.cam_id AS camID,                  5,    %d,     Cam ID (Stage 2)
    2223FIELD fake_id,                 5,    %d,     Fake ID (Stage 3)
    2324FIELD warp_id,                 5,    %d,     Warp ID (Stage 4)
     
    2526FIELD diffTemplate.diff_id AS tdiff_id,    5,    %d,     tdiff_id, none
    2627FIELD *,                       5,    %s,     Diff ID (Stage 5),         op=OP1
    27 #FIELD *,                      5,    %d,     Diff ID (Stage 5),         op=OP2
    28 FIELD camRun.magicked,         5,    %d,     Cam Magicked (Stage 6)
    29 FIELD publishRun.pub_id,       5,    %d,     Pub ID (Stage 7)
     28FIELD camRun.magicked,         5,    %d,     Magick ID (Stage 6)
     29FIELD magicDSRun.magic_ds_id,       5,    %d, DestreakID (Stage 7)
     30FIELD publishRun.pub_id AS pubId1,       5,    %d,     pubId1, none
     31FIELD pubRun2.pub_id AS pubId2,       5,    %d,     pubId2, none
     32FIELD *,                        10, %s, Pub ID, op=OP2
    3033FIELD filter,                  5,    %s,     Filter
    3134FIELD object,                  15,    %s,     Object
     35FIELD obs_mode,                5,    %s,     Obs Mode
    3236FIELD comment,                 40,    %s,     Comment
    3337
    34 FIELD diffInput.diff_id AS ddiffId,       5,    %s,     ddiffId,        none
    35 FIELD diffTemplate.diff_id AS tdiffId,    5,    %s,     tdiffId,        none
     38#FIELD diffInput.diff_id AS ddiffId,       5,    %s,     ddiffId,       none
     39#FIELD diffTemplate.diff_id AS tdiffId,    5,    %s,     tdiffId,       none
    3640
    3741MODE summary
  • branches/czw_branch/20101203/ippMonitor/raw/czartool_labels.php

    r30118 r30586  
    6464include 'version.php';
    6565echo "</p>";
    66 echo "<p  align=\"center\"> Current status of the IPP as of $lastUpdateTime (faults are shown in parentheses). <br>Documentation can be found <a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/Processing\">here</a> and cluster load monitored <a href=\"http://ganglia.pan-starrs.ifa.hawaii.edu/?r=hour&s=descending&c=IPP%2520Production\">here</a><br>Current nightly science status: $nsStatus<br>Use <a href=\"$link\"> $plotTypeLink</a> plots <br/><a href=\"http://ipp004.ifa.hawaii.edu/clusterMonitor/top.html\">Who uses the cluster?</a><br><a href=\"http://ipp004.ifa.hawaii.edu/ippMetrics\">IPP Metrics</a><br/><a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/PS1_IPP_CzarLogs\">Czar log pages</a></p>";
    67 
     66echo "<p  align=\"center\"> Current status of the IPP as of $lastUpdateTime (faults are shown in parentheses). <br>Documentation can be found <a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/Processing\">here</a> and cluster load monitored <a href=\"http://ganglia.pan-starrs.ifa.hawaii.edu/?r=hour&s=descending&c=IPP%2520Production\">here</a><br>Current nightly science status: $nsStatus<br>Use <a href=\"$link\"> $plotTypeLink</a> plots <br/><a href=\"http://ipp004.ifa.hawaii.edu/clusterMonitor/top.html\">Who uses the cluster?</a><br><a href=\"http://ipp004.ifa.hawaii.edu/ippMetrics\">IPP Metrics</a><br/><a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/PS1_IPP_CzarLogs\">Czar log pages</a><br><a href=\"czartool_exposures.php?pass=$pass&proj=$proj\">Exposure summary</a></p>";
    6867
    6968// deal with reverts: turn on or off if requested and pass current revert state for this stage onto labels table later
     
    182181            echo "<td> \n";
    183182              $today = date("Y-m-d");
    184               showSummitData($gpc1db, $today);
     183              createSummitDataTable($gpc1db, $today);
    185184            echo "</td>\n";
    186185          echo "</tr>\n";
     
    189188    echo "</tr>\n";
    190189
    191 
    192190    # 4th row
     191    echo "<tr>\n";
     192      echo "<td> \n";
     193        echo "<table>\n";
     194          echo "<tr valign=top>\n";
     195            echo "<td> \n";
     196              # storage plot
     197              echo "<img src=\"czartool_getplot.php?type=s\"><br>";
     198            echo "</td>\n";
     199            echo "<td>\n";
     200              createDatesTable($czardb);
     201            echo "</td>\n";
     202          echo "</tr>\n";
     203        echo "</table>\n";
     204      echo "</td> \n";
     205    echo "</tr>\n";
     206
     207    # 5th row
    193208    echo "<tr>\n";
    194209      echo "<td>\n";
     
    196211          echo "<tr valign=top>\n";
    197212            echo "<td> \n";
    198               # storage plot
    199               echo "<img src=\"czartool_getplot.php?type=s\"><br>";
     213              if ($selectedServer && !$serverCmd) showServerStatus($selectedServer);
    200214            echo "</td>\n";
    201215            echo "<td>\n";
     
    206220                showReplicationsStatus($REPL_HOST_GPC1, $REPL_USER_GPC1, $REPL_PASSWORD_GPC1, $REPL_DBNAME_GPC1);
    207221                showReplicationsStatus($REPL_HOST_NEBULOUS, $REPL_USER_NEBULOUS, $REPL_PASSWORD_NEBULOUS, $REPL_DBNAME_NEBULOUS);
     222
    208223              echo "</table>";
    209224            echo "</td>\n";
     
    213228    echo "</tr>\n";
    214229
    215     # 5th row
    216     echo "<tr>\n";
    217       echo "<td> \n";
    218         echo "<table>\n";
    219           echo "<tr valign=top>\n";
    220             echo "<td> \n";
    221               # server output
    222               if ($selectedServer && !$serverCmd) showServerStatus($selectedServer);
    223             echo "</td>\n";
    224             echo "<td>\n";
    225             echo "</td>\n";
    226           echo "</tr>\n";
    227         echo "</table>\n";
    228       echo "</td> \n";
    229     echo "</tr>\n";
    230 
    231230  echo "</table>\n";
    232231
     
    236235###########################################################################
    237236#
    238 # Checks summitExp table agains rawExp table
    239 #
    240 ###########################################################################
    241 function showSummitData($gpc1db, $date) {
     237# Creates a table of summitExp against rawExp
     238#
     239###########################################################################
     240function createSummitDataTable($gpc1db, $date) {
    242241
    243242    $sql = "SELECT DISTINCT exp_type FROM summitExp WHERE dateobs > '$date'";
     
    590589###########################################################################
    591590#
     591# Populates a tables with the current dates listed in the server_dates table
     592#
     593###########################################################################
     594function createDatesTable($db) {
     595
     596    $class = "list";
     597    echo "<table class=$class>\n";
     598    echo "<tr><td></td>\n";
     599    write_header_cell($class, "Server");
     600    write_header_cell($class, "Dates");
     601    echo "</tr>\n";
     602
     603    createServerDateRow($db, "stdscience");
     604    createServerDateRow($db, "registration");
     605
     606    echo "</table>\n";
     607}
     608
     609
     610###########################################################################
     611#
     612# Checks the status of all the pantasks servers
     613#
     614###########################################################################
     615function createServerDateRow($db, $server) {
     616
     617    $sql = "SELECT date FROM server_dates WHERE server LIKE '$server' ORDER BY date";
     618    if ($debug) {echo "$sql<br>";}
     619
     620    $qry = $db->query($sql);
     621    if (dberror($qry)) {echo "<b>error with $sql </b><br>\n";}
     622    $dates = "";
     623    $firstIn = true;
     624    while ($qry->fetchInto($row)) {
     625
     626        if ($firstIn) {
     627
     628            $dates = $row[0];
     629            $firstIn = false;
     630        }
     631        else $dates = $dates . ", " . $row[0];
     632    }
     633
     634    $class = "list";
     635    echo "<tr><td></td>\n";
     636    write_table_cell($class, '%s', "", $server);
     637    write_table_cell($class, '%s', "", $dates);
     638    echo "</tr>\n";
     639
     640}
     641
     642###########################################################################
     643#
    592644# Checks the status of all the pantasks servers
    593645#
     
    633685            ."&plottype=".$plotType;
    634686
    635         $link = ""; # TODO removed links temporarily
    636             write_table_cell($class, '%s', $link, $server);
     687        #$link = ""; # TODO removed links temporarily
     688        write_table_cell($class, '%s', $link, $server);
    637689        write_table_cell($class, '%s', "", $alive ? "yes" : "NO");
    638690
  • branches/czw_branch/20101203/ippMonitor/raw/ipp.load.dat

    r28451 r30586  
    2323menulink  | menuselect   | link    | New Imfile                   | newImfile.php                   
    2424menulink  | menuselect   | link    | Raw Imfile                   | rawImfile.php                   
     25menutop   | menutop      | plain   | &nbsp;                       |
     26menulink  | menuselect   | link    | Burntool State               | rawBurntoolState.php                         
  • branches/czw_branch/20101203/ippMonitor/raw/ipp.menu.dat

    r28601 r30586  
    2323menutop   | menutop      | link    | Stack Steps                  | ipp.stack.php
    2424menutop   | menutop      | link    | Distribution                 | ipp.dist.php
     25menutop   | menutop      | link    | dvoDB                        | ipp.dvodb.php
    2526menutop   | menutop      | link    | Calibration                  | ipp.cal.php
    2627menutop   | menutop      | link    | Plots                        | ipp.plots.php
  • branches/czw_branch/20101203/ippMonitor/raw/ipp.php

    r28688 r30586  
    390390  if ($sortKey == "") {
    391391    if ($_SERVER[REQUEST_METHOD] == 'GET') {
    392       $sortKey = $_GET['rsort'];
     392      $sortVal = $_GET['rsort'];
    393393    } else {
    394       $sortKey = $_POST['rsort'];
     394      $sortVal = $_POST['rsort'];
    395395    }
    396396    if ($sortVal != "") {
     
    529529    $value = $_POST[$htmlkey];
    530530  }
     531  # a search restriction may include an SQL wild-card.  we have to mangle these so that the http
     532  # does not get converted to a special character
     533  $value = preg_replace ('|%|', '%25', $value);
    531534  if ($value != "") {
    532535    if ($line) {
  • branches/czw_branch/20101203/ippMonitor/scripts/generate

    r29485 r30586  
    5858        if ($key eq "FIELD") {
    5959            ($field, $width, $format, $name, $show, $link, $extras) = split (/,\s+/, $value, 7);
    60             if (! $name) { die "table $ARGV[0] missing required elements\n"; }
     60            if (! $name) { die "table $ARGV[0] missing required elements: $value\n"; }
    6161            if ($field =~ m|\S+\s+as\s+\S+|) {
    6262                ($fieldreal) = $field =~ m|\S+\s+as\s+(\S+)|;
  • branches/czw_branch/20101203/ippScripts/Build.PL

    r30018 r30586  
    5858        scripts/magic_tree.pl
    5959        scripts/magic_process.pl
     60        scripts/magic_cleanup.pl
    6061        scripts/magic_destreak.pl
    6162        scripts/magic_destreak_revert.pl
  • branches/czw_branch/20101203/ippScripts/scripts/addstar_run.pl

    r29006 r30586  
    7171    defined $camera;
    7272if ($minidvodb && !defined($minidvodb_group)) {
    73                 my_die( "missing minidvodb_group", $add_id, 3 );
    74             }
     73                my_die( "missing minidvodb_group", $add_id, 3 );
     74            }
    7575my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $add_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration
    7676
     
    113113
    114114if (defined $dvodbReal) {
    115         if ($minidvodb) {
    116            
    117             if (!defined($minidvodb_name)) {
    118                 #take the active one, if it's not defined on the command line
    119                 #reverts would have this already set, for example.
    120                 my $command = "addtool -listminidvodbrun ";
    121                 $command .= " -minidvodb_group $minidvodb_group" if defined $minidvodb_group;
    122                 $command .= " -state 'active' -limit 1";
    123                 $command .= " -dbname $dbname" if defined $dbname;
    124                 print $command;
    125                 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    126                     run(command => $command, verbose => $verbose);
    127                 &my_die( "Unable to get active minidvodb_name", $add_id, $PS_EXIT_SYS_ERROR) unless $success;
    128                 my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
    129                     &my_die("Unable to parse metadata config", $add_id, $PS_EXIT_PROG_ERROR);
    130 
    131                 my $components = parse_md_list($metadata) or
    132                     &my_die("Unable to parse metadata list", $add_id, $PS_EXIT_PROG_ERROR);
    133                 my $comp = $$components[0];
    134                 $minidvodb_path = $comp->{minidvodb_path};
    135                 $minidvodb_name = $comp->{minidvodb_name};
    136        
    137                 if (!defined($minidvodb_path)) {
    138                     &my_die("Unable to parse minidvodb_path", $add_id, $PS_EXIT_PROG_ERROR);
    139                 }
    140                 if (!defined($minidvodb_name)) {
    141                     &my_die("Unable to parse minidvodb_name", $add_id, $PS_EXIT_PROG_ERROR);
    142                 }
    143             }
    144             # tack on the minidvodb part to the db.
    145 #           $dvodbReal = $dvodbReal . '/' . $minidvodb_name . '/';
    146 #we don't need this now that I fixed the paths     
    147            
    148         }
     115        if ($minidvodb) {
     116
     117            #if (!defined($minidvodb_name)) {
     118                #take the active one, if it's not defined on the command line
     119                #reverts would have this already set, for example.
     120                my $command = "addtool -listminidvodbrun ";
     121                $command .= " -minidvodb_group $minidvodb_group" if defined $minidvodb_group;
     122                $command .= " -minidvodb_name $minidvodb_name" if defined $minidvodb_name;
     123                $command .= " -state 'active' -limit 1";
     124                $command .= " -dbname $dbname" if defined $dbname;
     125                print $command;
     126                my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     127                    run(command => $command, verbose => $verbose);
     128                &my_die( "Unable to get active minidvodb_name", $add_id, $PS_EXIT_SYS_ERROR) unless $success;
     129                my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
     130                    &my_die("Unable to parse metadata config", $add_id, $PS_EXIT_PROG_ERROR);
     131
     132                my $components = parse_md_list($metadata) or
     133                    &my_die("Unable to parse metadata list", $add_id, $PS_EXIT_PROG_ERROR);
     134                my $comp = $$components[0];
     135                $minidvodb_path = $comp->{minidvodb_path};
     136                $minidvodb_name = $comp->{minidvodb_name};
     137
     138                if (!defined($minidvodb_path)) {
     139                    &my_die("Unable to parse minidvodb_path", $add_id, $PS_EXIT_PROG_ERROR);
     140                }
     141                if (!defined($minidvodb_name)) {
     142                    &my_die("Unable to parse minidvodb_name", $add_id, $PS_EXIT_PROG_ERROR);
     143                }
     144            #}
     145            # tack on the minidvodb part to the db.
     146#           $dvodbReal = $dvodbReal . '/' . $minidvodb_name . '/';
     147#we don't need this now that I fixed the paths
     148
     149        }
    149150        else {
    150151
     
    153154
    154155unless ($no_op) {
    155             print $dvodbReal;
     156            print $dvodbReal;
    156157
    157158        ## addstar can either save the full set of detections, or just
     
    222223        $command .= " -addprocessedexp";
    223224        $command .= " -fault $exit_code";
    224         $command .= " -dvodb_path $minidvodb_path" if defined $minidvodb_path;
     225        $command .= " -dvodb_path $minidvodb_path" if defined $minidvodb_path;
    225226        $command .= " -path_base $outroot" if defined $outroot;
    226227        $command .= (" -dtime_addstar " . ((DateTime->now->mjd - $mjd_start) * 86400));
    227         $fpaCommand .= " -minidvodb_name $minidvodb_name" if defined $minidvodb_name;
     228        $fpaCommand .= " -minidvodb_name $minidvodb_name" if defined $minidvodb_name;
    228229        $command .= " -dbname $dbname" if defined $dbname;
    229230        system ($command);
  • branches/czw_branch/20101203/ippScripts/scripts/dist_advancerun.pl

    r28963 r30586  
    2323use PS::IPP::Config 1.01 qw( :standard );
    2424
    25 my $ipprc = PS::IPP::Config->new(); # IPP configuration
    2625
    2726use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
     
    2928
    3029# Parse the command-line arguments
    31 my ($dist_id, $stage, $stage_id, $outdir, $clean);
     30my ($dist_id, $stage, $stage_id, $outdir, $clean, $camera);
    3231my ($dbname, $save_temps, $verbose, $no_update, $no_op, $logfile);
    3332
    3433GetOptions(
    35            'dist_id=s'  => \$dist_id,# Magic destreak run identifier
     34           'dist_id=s'      => \$dist_id,# Magic destreak run identifier
     35           'camera=s'       => \$camera,
    3636           'stage=s'        => \$stage,      # raw, chip, warp, or diff
    3737           'stage_id=s'     => \$stage_id,   # exp_id, chip_id, warp_id, or diff_id
     
    5353    defined $stage_id and
    5454    defined $outdir;
     55
     56my $ipprc = PS::IPP::Config->new($camera); # IPP configuration
    5557
    5658$ipprc->redirect_output($logfile) if $logfile;
     
    134136}
    135137
    136 # XXX should we create a file rule for this?
    137 my $dbinfo_file = "$outdir/dbinfo.$stage.$stage_id.mdc";
    138 
    139 {
    140     my $command = "$tool_cmd $exportarg -outfile $dbinfo_file";
     138
     139# work around the fact that $ipprc->file_create does not actually create a file on disk
     140# unless the scheme is nebulous
     141sub create_file {
     142    my $rule = shift;
     143    my $path_base = shift;
     144    my $ref = shift;
     145
     146    my $file;
     147
     148    my $error;
     149    $file = $ipprc->prepare_output($rule, $path_base, undef, 1, \$error)
     150        or &my_die("Unable to prepare outut for $rule", $dist_id, $PS_EXIT_SYS_ERROR);
     151
     152    my $scheme = file_scheme($file);
     153    $scheme = "" if !$scheme;
     154
     155    my $resolved;
     156    if ($scheme) {
     157        $ipprc->file_create($file)
     158            or &my_die("Unable to create $file", $dist_id, $PS_EXIT_SYS_ERROR);
     159
     160        $resolved = $ipprc->file_resolve($file)
     161            or &my_die("Unable to resolve $file", $dist_id, $PS_EXIT_SYS_ERROR);
     162
     163        if ($scheme eq 'neb') {
     164            &my_die("$resolved not found", $dist_id, $PS_EXIT_SYS_ERROR) unless ($resolved and -e $resolved);
     165    }
     166    } else {
     167        $resolved = $file;
     168    }
     169    $$ref = $resolved;
     170
     171    return $file
     172}
     173
     174my $dbinfo_root = "$outdir/dbinfo.$stage.$stage_id";
     175my $resolved;
     176my $dbinfo_file = create_file("DIST.OUTPUT.DBINFO", $dbinfo_root, \$resolved);
     177
     178{
     179    my $command = "$tool_cmd $exportarg -outfile $resolved";
    141180    $command .= " -clean" if ((defined $clean) and ($stage ne "raw"));
    142181    $command .= " -dbname $dbname" if defined $dbname;
     
    149188    }
    150189}
    151 my $dirinfo = "$outdir/dirinfo.$stage.$stage_id.mdc";
     190
     191my $dirinfo_root = "$outdir/dirinfo.$stage.$stage_id";
     192my $dirinfo = create_file("DIST.OUTPUT.DIRINFO", $dirinfo_root, \$resolved);
     193
    152194{
    153195    my $command = "$tool_cmd $list_mode";
     
    168210        &my_die("Unable to parse metadata list", $dist_id, $PS_EXIT_UNKNOWN_ERROR);
    169211
    170     open MANIFEST, ">$dirinfo" or
    171         &my_die("Unable to open dirinfo file $dirinfo",  $dist_id, $PS_EXIT_UNKNOWN_ERROR);
     212    open MANIFEST, ">$resolved" or
     213        &my_die("Unable to open dirinfo file $resolved",  $dist_id, $PS_EXIT_UNKNOWN_ERROR);
    172214
    173215    my $destdir;
     
    197239        &my_die("unable to find path",  $dist_id, $PS_EXIT_UNKNOWN_ERROR) if !$path;
    198240        my $component_dir = find_componentdir($destdir, $path);
    199 #        print MANIFEST "$component METADATA\n";
    200241        print MANIFEST "\t" , "$component", "\tSTR\t", $component_dir, "\n";
    201242    }
     
    217258    }
    218259}
    219 
    220260
    221261exit 0;
  • branches/czw_branch/20101203/ippScripts/scripts/dist_bundle.pl

    r30118 r30586  
    1616
    1717use IPC::Cmd 0.36 qw( can_run run );
    18 use File::Temp qw( tempfile );
     18use File::Temp qw( tempfile tempdir );
    1919use File::Basename qw( basename );
    2020use Digest::MD5::File qw( file_md5_hex );
     
    7171# Parse the command-line arguments
    7272my ($camera, $stage, $stage_id, $component, $path_base, $chip_path_base, $alt_path_base, $clean);
    73 my ($outdir, $run_state, $data_state, $magicked, $no_magic, $poor_quality, $results_file, $prefix);
     73my ($outroot, $run_state, $data_state, $magicked, $no_magic, $poor_quality, $results_file, $prefix);
    7474my ($dbname, $save_temps, $verbose, $no_update, $logfile);
    7575
     
    8888           'magicked'       => \$magicked,   # magicked state for this component
    8989           'alt_path_base=s'=> \$alt_path_base,  # path to alternate inputs
    90            'outdir=s'       => \$outdir,     # "directory" for outputs
     90           'outroot=s'      => \$outroot,    # outroot
    9191           'prefix=s'       => \$prefix,     # "prefix" to apply to filenames
    9292           'clean'          => \$clean,      # create clean distribution
     
    9999
    100100pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    101 pod2usage( -msg => "Required options: --camera --stage --stage_id --component --path_base --outdir",
     101pod2usage( -msg => "Required options: --camera --stage --stage_id --component --path_base --outroot",
    102102           -exitval => 3) unless
    103103    defined $camera and
     
    106106    defined $component and
    107107    defined $path_base and
    108     defined $outdir;
     108    defined $outroot;
    109109
    110110$ipprc->redirect_output($logfile) if $logfile;
     
    116116$ipprc->define_camera($camera);
    117117
    118 # create the output directories if it is not a nebulous path and it doesn't exist
    119 if (index($outdir, "neb://") != 0) {
    120     if (! -e $outdir ) {
    121         my $code = system "mkdir -p $outdir";
    122         &my_die("cannot create output directory $outdir", $component,
    123                 $code >> 8) if $code;
    124     }
    125 }
     118$ipprc->outroot_prepare($outroot);
    126119
    127120# Get the list of data products for this component
     
    138131# set up directory for temporary files
    139132
    140 my $tmpdir  = "$outdir/tmpdir.$component.$$";
    141 if (-e $tmpdir) {
    142     if (-d $tmpdir) {
    143         my $rc = system "rm -r $tmpdir";
    144         &my_die("cannot rm $tmpdir return code: $rc", $component, $PS_EXIT_UNKNOWN_ERROR) if $rc;
    145     } else {
    146         unlink $tmpdir or &my_die("cannot delete $tmpdir", $component, $PS_EXIT_UNKNOWN_ERROR);
    147     }
    148 }
    149 mkdir $tmpdir or &my_die("cannot create temporary directory $tmpdir", $component,
    150                        $PS_EXIT_UNKNOWN_ERROR);
     133my $temproot = metadataLookupStr($ipprc->{_siteConfig}, "TEMP.DIR");
     134$temproot = "/tmp" if !defined $temproot;
     135&my_die("directory for TEMP.DIR $temproot does not exist", $component, $PS_EXIT_CONFIG_ERROR) if ! -e $temproot;
     136
     137my $tmpdir  = tempdir("$temproot/dist.XXXX", CLEANUP => !$save_temps);
    151138
    152139#
     
    349336if ($num_files) {
    350337    # create the tarfile
    351     # XXX TODO: create a file rule for the tar file name
    352     my $tbase = basename($path_base);
    353     $tbase .= ".$component" if $component;
    354     $file_name = ($prefix ? $prefix : "") . "$tbase.tgz";
    355     my $tarfile = "$outdir/$file_name";
     338#    my $tbase = basename($path_base);
     339#    $tbase .= ".$component" if $component;
     340#    $file_name = ($prefix ? $prefix : "") . "$tbase.tgz";
     341    my $error;
     342    my $output_tarfile;
     343    my $rule;
     344    if ($stage eq 'chip' or $stage eq 'chip_bg' or $stage eq 'raw') {
     345        $rule = "DIST.OUTPUT.CHIP.BUNDLE";
     346    } else {
     347        $rule = "DIST.OUTPUT.BUNDLE";
     348    }
     349    $output_tarfile = $ipprc->prepare_output($rule, $outroot, $component, 1, \$error)
     350            or &my_die("Failed to prepare output tarfile: $error", $component, $error);
     351    $file_name = basename($output_tarfile);
     352
     353
     354    my $scheme = file_scheme($output_tarfile);
     355
     356    my $tarfile;
     357    if ($scheme) {
     358        $ipprc->file_create($output_tarfile)
     359            or &my_die("Failed to create $output_tarfile: $error", $component, $error);
     360        $tarfile = $ipprc->file_resolve($output_tarfile);
     361
     362        if ($scheme eq 'neb') {
     363            &my_die("output file $output_tarfile not found", $component, $PS_EXIT_SYS_ERROR)
     364                unless ($tarfile and -e $tarfile);
     365        }
     366    } else {
     367        # no scheme the filename and the resolved filename are the same
     368        $tarfile = $output_tarfile;
     369    }
    356370
    357371    my $command = "tar -C $tmpdir --owner=ipp --group=users -czhf $tarfile .";
  • branches/czw_branch/20101203/ippScripts/scripts/dist_component.pl

    r27718 r30586  
    2121use PS::IPP::Metadata::Config;
    2222use PS::IPP::Metadata::List qw( parse_md_list );
    23 
    2423use PS::IPP::Config 1.01 qw( :standard );
    25 
    26 my $ipprc = PS::IPP::Config->new(); # IPP configuration
    2724
    2825use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
     
    7774    defined $outdir;
    7875
     76my $ipprc = PS::IPP::Config->new($camera); # IPP configuration
    7977$ipprc->redirect_output($logfile) if $logfile;
     78
     79my $temproot = metadataLookupStr($ipprc->{_siteConfig}, "TEMP.DIR");
     80
     81$temproot = "/tmp" if !defined $temproot;
    8082
    8183if (($stage eq 'raw') and !$clean and !defined $chip_path_base) {
     
    8587my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files
    8688
    87 my ($rf, $rf_name) = tempfile("/tmp/bundleresults.$dist_id.$component.XXXX", UNLINK => !$save_temps);
     89my ($rf, $rf_name) = tempfile("$temproot/bundleresults.$dist_id.$component.XXXX", UNLINK => !$save_temps);
    8890close $rf;
     91
     92my $basename = basename($path_base);
     93my $outroot = "$outdir/$basename";
    8994
    9095my ($file_name, $bytes, $md5sum);
     
    9297    my $command = "$dist_make_bundle --camera $camera --stage $stage --stage_id $stage_id";
    9398    $command .= " --results_file $rf_name";
    94     $command .= " --component $component --path_base $path_base --outdir $outdir";
     99    $command .= " --component $component --path_base $path_base --outroot $outroot";
    95100    $command .= " --chip_path_base $chip_path_base" if $chip_path_base;
    96101    $command .= " --state $run_state" if defined $run_state;
     
    136141    &my_die("undefined file md5sum from dist_bundle.pl", $dist_id, $component, $outdir, $PS_EXIT_PROG_ERROR) unless defined $md5sum;
    137142}
     143
    138144
    139145{
  • branches/czw_branch/20101203/ippScripts/scripts/dist_defineruns.pl

    r29068 r30586  
    4242
    4343# Parse the command-line arguments
    44 my ($stage, $stage_limit, $dist_root, $no_magic);
     44my ($stage, $stage_limit, $dist_root, $workdir, $no_magic);
    4545my ($dbname, $save_temps, $verbose, $no_update, $logfile);
    4646my @labels;
     
    4949           'stage=s'        => \$stage,      # stage to queue
    5050           'label=s'        => \@labels,     # labels
     51           'workdir=s'      => \$workdir,     # workdir
    5152           'stage_limit=s'  => \$stage_limit,# maximum number of runs queued for each stage
    52            'dist_root=s'    => \$dist_root,  # root of distribution work area
     53#           'dist_root=s'    => \$dist_root,  # root of distribution work area
    5354           'no_magic'       => \$no_magic,   # queue runs without requiring magic (for testing only)
    5455           'dbname=s'       => \$dbname,     # Database name
     
    6667$ipprc->redirect_output($logfile) if $logfile;
    6768
    68 if (!$dist_root) {
    69     $dist_root = metadataLookupStr($ipprc->{_siteConfig}, "DISTRIBUTION_ROOT");
    70     &my_die("failed to find DISTRIBUTION_ROOT in site configuration", $PS_EXIT_CONFIG_ERROR) if !$dist_root;
     69if (!$workdir) {
     70    print "workdir not supplied will use DISTRIBUTION_ROOT\n";
     71    # old method where we set workdir based on a config file
     72    if (!$dist_root) {
     73        $dist_root = metadataLookupStr($ipprc->{_siteConfig}, "DISTRIBUTION_ROOT");
     74        &my_die("failed to find DISTRIBUTION_ROOT in site configuration", $PS_EXIT_CONFIG_ERROR) if !$dist_root;
     75    }
     76
     77    my ($day, $month, $year) = (gmtime)[3,4,5];
     78    my $datestr = sprintf "%04d%02d%02d", $year+1900, $month + 1, $day;
     79
     80    $workdir = $dist_root . "/$datestr";
     81
     82    print "workdir is $workdir\n";
    7183}
    72 
    73 my ($day, $month, $year) = (gmtime)[3,4,5];
    74 my $datestr = sprintf "%04d%02d%02d", $year+1900, $month + 1, $day;
    75 
    76 my $workdir = "$dist_root/$datestr";
    77 
    78 print "workdir is $workdir\n";
    7984
    8085# if stage is not supplied as an argument, loop over all stages
     
    9095        my $command = "$disttool -definebyquery -stage $stage -workdir $workdir -label $label";
    9196        $command .= " -no_magic" if $no_magic;
    92         $command .= " -dry_run" if $no_update;
     97        $command .= " -pretend" if $no_update;
    9398        $command .= " -limit $stage_limit" if $stage_limit;
    9499        $command .= " -set_label $label";
  • branches/czw_branch/20101203/ippScripts/scripts/dist_make_fileset.pl

    r28963 r30586  
    9696# make sure that the database info file for this run exists
    9797my $dbinfo_file = "$dist_dir/dbinfo.$stage.$stage_id.mdc";
    98 if (! -e "$dbinfo_file" ) {
     98if (! $ipprc->file_exists($dbinfo_file) ) {
    9999    &my_die("dbinfo file for dist run $dbinfo_file not found", $dist_id, $dest_id, $PS_EXIT_UNKNOWN_ERROR);
    100100}
     
    103103# make sure that the dirinfo file for this run exists
    104104my $dirinfo_file = "$dist_dir/dirinfo.$stage.$stage_id.mdc";
    105 if (! -e "$dirinfo_file" ) {
     105if (!$ipprc->file_exists($dirinfo_file)) {
    106106    &my_die("dirinfo file for dist run $dirinfo_file not found", $dist_id, $dest_id, $PS_EXIT_UNKNOWN_ERROR);
    107107}
     
    277277    $command .= " -dbname $dbname" if $dbname;
    278278
    279     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    280         run(command => $command, verbose => $verbose);
    281     unless ($success) {
    282         $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    283         print STDERR "Unable to perform $command error_code: $error_code\n";
     279    if (!$no_update) {
     280        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     281            run(command => $command, verbose => $verbose);
     282        unless ($success) {
     283            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     284            print STDERR "Unable to perform $command error_code: $error_code\n";
     285        }
     286    } else {
     287        print STDERR "skipping $command\n";
    284288    }
    285289    exit $fault;
  • branches/czw_branch/20101203/ippScripts/scripts/ipp_apply_burntool_single.pl

    r29982 r30586  
    7474unless ($success) {
    7575    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    76     &my_die("Unable to perform ppConfigDump: $error_code", 0, 0, $class_id, $PS_EXIT_SYS_ERROR);
     76    &my_die("Unable to perform ppConfigDump: $error_code", $exp_id, $class_id, $PS_EXIT_SYS_ERROR);
    7777}
    7878
    7979my $recipeData = $mdcParser->parse(join "", @$stdout_buf) or
    80     &my_die("Unable to parse metadata config doc", 0, 0, $class_id, $PS_EXIT_SYS_ERROR);
     80    &my_die("Unable to parse metadata config doc", $exp_id, $class_id, $PS_EXIT_SYS_ERROR);
    8181
    8282my $burntoolStateGood = 999;
     
    8787}
    8888if ($burntoolStateGood == 999) {
    89     &my_die("Failed to determine BURNTOOL.STATE.GOOD", $burntoolStateGood, $class_id, 0, $PS_EXIT_SYS_ERROR);
     89    &my_die("Failed to determine BURNTOOL.STATE.GOOD", $exp_id, $class_id, $PS_EXIT_SYS_ERROR);
    9090}
    9191my $outState = -1 * abs($burntoolStateGood);
     
    178178        my $exp_id = shift;
    179179        my $class_id = shift;
    180         vsystem("$regtool -dbname $dbname -updateprocessedimfile -exp_id $exp_id -class_id $class_id -burntool_state -3",1);
     180        vsystem("$regtool -dbname $dbname -updateprocessedimfile -exp_id $exp_id -class_id $class_id -burntool_state 0 -set_state pending_burntool",1);
    181181    }
    182182    printf STDERR "$message\n";
  • branches/czw_branch/20101203/ippScripts/scripts/ipp_cleanup.pl

    r29892 r30586  
    167167#            addFilename (\@files, "PPIMAGE.OUTPUT.MASK", $path_base, $class_id);
    168168#            addFilename (\@files, "PPIMAGE.OUTPUT.VARIANCE", $path_base, $class_id);
    169             addFilename (\@files, "PPIMAGE.CHIP", $path_base, $class_id);
    170             addFilename (\@files, "PPIMAGE.CHIP.MASK", $path_base, $class_id);
    171             addFilename (\@files, "PPIMAGE.CHIP.VARIANCE", $path_base, $class_id);
     169            addFilename (\@files, "PPIMAGE.CHIP", $path_base, $class_id, 1);
     170            addFilename (\@files, "PPIMAGE.CHIP.MASK", $path_base, $class_id, 1);
     171            addFilename (\@files, "PPIMAGE.CHIP.VARIANCE", $path_base, $class_id, 1);
    172172            if ($mode eq "goto_purged") {
    173173                # additional files to remove for 'purge' mode
     
    429429
    430430                # delete the temporary image datafiles
    431                 addFilename(\@files, "PSWARP.OUTPUT", $path_base, $skycell_id );
    432                 addFilename(\@files, "PSWARP.OUTPUT.MASK", $path_base, $skycell_id);
    433                 addFilename(\@files, "PSWARP.OUTPUT.VARIANCE", $path_base, $skycell_id);
     431                addFilename(\@files, "PSWARP.OUTPUT", $path_base, $skycell_id, 1);
     432                addFilename(\@files, "PSWARP.OUTPUT.MASK", $path_base, $skycell_id, 1);
     433                addFilename(\@files, "PSWARP.OUTPUT.VARIANCE", $path_base, $skycell_id, 1);
    434434#            addFilename(\@files, "PSWARP.OUTPUT.SOURCES", $path_base, $skycell_id);
    435435                if ($mode eq "goto_purged") {
     
    706706            my @files = ();
    707707            # delete the temporary image datafiles
    708             addFilename(\@files, "PPSUB.OUTPUT", $path_base, $skycell_id);
    709             addFilename(\@files, "PPSUB.OUTPUT.MASK", $path_base, $skycell_id);
    710             addFilename(\@files, "PPSUB.OUTPUT.VARIANCE", $path_base, $skycell_id);
    711 
    712             addFilename(\@files, "PPSUB.INVERSE", $path_base, $skycell_id);
    713             addFilename(\@files, "PPSUB.INVERSE.MASK", $path_base, $skycell_id);
    714             addFilename(\@files, "PPSUB.INVERSE.VARIANCE", $path_base, $skycell_id);
     708            addFilename(\@files, "PPSUB.OUTPUT", $path_base, $skycell_id, 1);
     709            addFilename(\@files, "PPSUB.OUTPUT.MASK", $path_base, $skycell_id, 1);
     710            addFilename(\@files, "PPSUB.OUTPUT.VARIANCE", $path_base, $skycell_id, 1);
     711
     712            addFilename(\@files, "PPSUB.INVERSE", $path_base, $skycell_id, 1);
     713            addFilename(\@files, "PPSUB.INVERSE.MASK", $path_base, $skycell_id, 1);
     714            addFilename(\@files, "PPSUB.INVERSE.VARIANCE", $path_base, $skycell_id, 1);
    715715
    716716            addFilename(\@files, "PPSUB.INPUT.CONV", $path_base, $skycell_id);
     
    20482048    my $path_base  = shift; # base filename
    20492049    my $class_id   = shift; # class_id, if needed
     2050    my $recovery   = shift; # is there is a recovery file to clean?
    20502051
    20512052    my $file = $ipprc->filename($filerule, $path_base, $class_id);
    20522053
    20532054    push @$files, $file;
     2055   
     2056    if ($recovery) {
     2057        # need to clean up the recovery file (the pixels censored by streaksremove)
     2058        $file = $ipprc->recovery_filename($file);
     2059        push @$files, $file;
     2060    }
    20542061    return 1;
    20552062}
  • branches/czw_branch/20101203/ippScripts/scripts/magic_destreak.pl

    r30118 r30586  
    6565           'cam_reduction=s'=> \$cam_reduction,  # reduction class from camera stage (for chip and raw)
    6666           'outroot=s'      => \$outroot,     # "directory" for temporary images (may be nebulous)
    67            'recoveryroot=s' => \$recoveryroot,# "directory" for saving the images of excised pixels
     67           'recoveryroot=s' => \$recoveryroot,# "prefix" for saving the images of excised pixels
    6868           'replace=s'      => \$replace,    # replace the input images with the results.
    6969           'magicked=s'     => \$magicked,   # magicked state of the run
     
    190190my $recovery_path_base;
    191191if ($recoveryroot) {
    192     if (!inNebulous($recoveryroot)) {
    193         if (! -e $recoveryroot ) {
    194             my $code = system "mkdir -p $recoveryroot";
    195             &my_die("cannot create output directory $recoveryroot", $magic_ds_id, $component,
    196                     $code >> 8) if $code;
    197         }
    198     }
    199     # note: trailing / is necessary
    200     $recovery_path_base = "$recoveryroot/$basename/";
     192    # recoveryroot is a path to prepend to the basenames of the input files
     193    if (inNebulous($recoveryroot)) {
     194        # if recoveryroot is a nebulous path we ignore the actual path and put the files in the
     195        # the same "directory" as the input files
     196        $recoveryroot = "$dirname/REC_";
     197        $recovery_path_base = $recoveryroot . $basename;
     198    } else {
     199        # otherwise we put the files in recoveryroot.
     200        # Regardless, we prefix the basename with 'REC_'
     201        $ipprc->outroot_prepare($recoveryroot);
     202        $recovery_path_base = "$recoveryroot/REC_$basename";
     203    }
    201204}
    202205
     
    601604    $command   .= " -magic_ds_id $magic_ds_id";
    602605    $command   .= " -component $component";
     606    $command .= " -backup_path_base $backup_path_base" if $backup_path_base;
     607    $command .= " -recovery_path_base $recovery_path_base" if $recovery_path_base;
    603608    $command   .= " -fault $exit_code";
    604609    $command   .= " -dbname $dbname" if defined $dbname;
  • branches/czw_branch/20101203/ippScripts/scripts/magic_destreak_cleanup.pl

    r29829 r30586  
    233233                $bmask   = $ipprc->filename("$name.MASK", $backup_path_base);
    234234                $bweight = $ipprc->filename("$name.VARIANCE", $backup_path_base);
    235                 $bsources = $ipprc->filename("$name.SOURCES", $backup_path_base);
     235                # bills 2011-01-24
     236                # don't clean up the uncensored sources file
     237                # $bsources = $ipprc->filename("$name.SOURCES", $backup_path_base);
    236238            }
    237239            if ($recovery_path_base) {
     
    251253                $bmask   = $ipprc->filename("$name.MASK", $backup_path_base);
    252254                $bweight = $ipprc->filename("$name.VARIANCE", $backup_path_base);
    253                 $bsources = $ipprc->filename("$name.SOURCES", $backup_path_base);
     255                # bills 2011-01-24
     256                # don't clean up the uncensored sources file
     257                # $bsources = $ipprc->filename("$name.SOURCES", $backup_path_base);
    254258            }
    255259            if ($recovery_path_base) {
  • branches/czw_branch/20101203/ippScripts/scripts/magic_destreak_defineruns.pl

    r30118 r30586  
    4242
    4343# Parse the command-line arguments
    44 my ($stage, $stage_limit, $workdir);
     44my ($stage, $stage_limit, $workdir, $recoveryroot);
    4545my ($dbname, $save_temps, $verbose, $no_update, $logfile);
    4646my @labels;
     
    5151           'stage_limit=s'  => \$stage_limit,# maximum number of runs queued for each stage
    5252           'workdir=s'      => \$workdir,    # output destination
     53           'recoveryroot=s' => \$recoveryroot, # recovery pixels destination
    5354           'dbname=s'       => \$dbname,     # Database name
    5455           'verbose'        => \$verbose,    # Print stuff?
     
    7879    foreach my $label (@labels) {
    7980        my $command = "$magicdstool -definebyquery -stage $stage -workdir $workdir -label $label";
     81        $command .= " -recoveryroot $recoveryroot" if $recoveryroot;
    8082        $command .= " -pretend" if $no_update;
    8183        $command .= " -limit $stage_limit" if $stage_limit;
  • branches/czw_branch/20101203/ippScripts/scripts/magic_destreak_revert.pl

    r30118 r30586  
    3939# Parse the command-line arguments
    4040my ($magic_ds_id, $camera, $streaks, $stage, $stage_id, $component, $uri, $path_base, $bothways, $cam_path_base, $cam_reduction, $magicked, $run_state);
    41 my ($outroot, $recoveryroot, $replace, $release, $bytes, $md5sum);
     41my ($outroot, $recovery_path_base, $replace, $release, $bytes, $md5sum);
    4242my ($dbname, $save_temps, $verbose, $no_update, $no_op, $logfile);
    4343
     
    5353           'cam_reduction=s'=> \$cam_reduction,  # reduction class of the associated camera run
    5454           'outroot=s'      => \$outroot,     # "directory" for temporary images (may be nebulous)
    55            'recoveryroot=s' => \$recoveryroot,# "directory" for saving the images of excised pixels
     55           'recovery_path_base=s' => \$recovery_path_base,# "directory" for saving the images of excised pixels
    5656           'replace=s'      => \$replace,    # replace the input images with the results.
    5757           'bothways=s'     => \$bothways,   # run has inverse files (bothways diff)
     
    130130
    131131# default value is "NULL" do not use it
    132 if (defined($recoveryroot) and ($recoveryroot eq "NULL")) {
    133     $recoveryroot = undef;
     132if (defined($recovery_path_base) and ($recovery_path_base eq "NULL")) {
     133    $recovery_path_base = undef;
    134134}
    135135
     
    149149}
    150150
    151 my $recovery_path_base;
    152 if ($recoveryroot) {
    153     # note: trailing / is necessary
    154     $recovery_path_base = "$recoveryroot/$basename/";
    155 }
    156 
    157151
    158152my ($image, $mask, $ch_mask, $weight, $sources, $astrom);
    159153my ($bimage, $bmask, $bch_mask, $bweight, $bsources, $bastrom);
     154my ($rimage, $rmask, $rch_mask, $rweight);
    160155
    161156if ($stage eq "raw") {
     
    214209    $bch_mask= $ipprc->filename("PPIMAGE.CHIP.MASK", $backup_path_base, $class_id);
    215210    $bweight = $ipprc->filename("PPIMAGE.CHIP.VARIANCE", $backup_path_base, $class_id);
     211
     212    $rimage  = $ipprc->filename("PPIMAGE.CHIP", $recovery_path_base, $class_id);
     213    # This is somewhat kludgey but it works whether the mask is camera mask or chip mask
     214    $rmask   = dirname($recovery_path_base) . "/REC_" . basename($mask);
     215    $rch_mask= $ipprc->filename("PPIMAGE.CHIP.MASK", $recovery_path_base, $class_id);
     216    $rweight = $ipprc->filename("PPIMAGE.CHIP.VARIANCE", $recovery_path_base, $class_id);
    216217} elsif ($stage eq "camera") {
    217218    $astrom =  $ipprc->filename("PSASTRO.OUTPUT", $path_base);
     
    226227    $bweight = $ipprc->filename("PSWARP.OUTPUT.VARIANCE", $backup_path_base);
    227228    $bsources = $ipprc->filename("PSWARP.OUTPUT.SOURCES", $backup_path_base);
     229    $rimage  = $ipprc->filename("PSWARP.OUTPUT", $recovery_path_base);
     230    $rmask   = $ipprc->filename("PSWARP.OUTPUT.MASK", $recovery_path_base);
     231    $rweight = $ipprc->filename("PSWARP.OUTPUT.VARIANCE", $recovery_path_base);
    228232} elsif ($stage eq "diff") {
    229233    my $name = "PPSUB.OUTPUT";
     
    236240    $bweight = $ipprc->filename("$name.VARIANCE", $backup_path_base);
    237241    $bsources = $ipprc->filename("$name.SOURCES", $backup_path_base);
     242    if ($recovery_path_base) {
     243        $rimage  = $ipprc->filename($name, $recovery_path_base);
     244        $rmask   = $ipprc->filename("$name.MASK", $recovery_path_base);
     245        $rweight = $ipprc->filename("$name.VARIANCE", $recovery_path_base);
     246    }
    238247}
    239248
    240249revert_files($replace, $image, $mask, $weight, $sources, $astrom, $bimage, $bmask, $bweight, $bsources, $bastrom);
     250if ($recovery_path_base) {
     251    delete_recovery_files($rimage, $rmask, $rweight, $rch_mask);
     252}
    241253
    242254if ($stage eq "diff" and $bothways) {
     
    251263    $bsources = $ipprc->filename("$name.SOURCES", $backup_path_base);
    252264    revert_files($replace, $image, $mask, $weight, $sources, undef, $bimage, $bmask, $bweight, $bsources, undef);
     265    if ($recovery_path_base) {
     266        $rimage  = $ipprc->filename($name, $recovery_path_base);
     267        $rmask   = $ipprc->filename("$name.MASK", $recovery_path_base);
     268        $rweight = $ipprc->filename("$name.VARIANCE", $recovery_path_base);
     269        delete_recovery_files($rimage, $rmask, $rweight);
     270    }
    253271}
    254272
     
    426444
    427445
    428 sub file_check
    429 {
    430     my $file = shift;           # Name of file
    431     &my_die("Unable to find output file: $file", $magic_ds_id, $component, $PS_EXIT_SYS_ERROR) unless
    432         $ipprc->file_exists($file);
     446sub delete_recovery_files
     447{
     448    foreach my $file (@_) {
     449        if ($ipprc->file_exists($file)) {
     450            if (!$ipprc->file_delete($file)) {
     451                &my_die("failed to delete recovery file $file", $magic_ds_id, $component, $PS_EXIT_UNKNOWN_ERROR);
     452            }
     453        }
     454    }
    433455}
    434456
  • branches/czw_branch/20101203/ippScripts/scripts/nightly_science.pl

    r30017 r30586  
    4444my ( $date, $datetime, $camera, $dbname, $logfile, $verbose, $manual);
    4545my ( $help, $isburning, $force_stack_count, $force_diff_count, $test_mode, $this_target_only, $this_filter_only, $this_mode_only, $check_mode);
    46 my ( $registration_status, $burntool_status, $observing_status);
     46my ( $registration_status, $burntool_status, $observing_status, $old_date);
    4747my ( $check_registration, $define_burntool, $queue_burntool, $check_chips, $queue_chips);
    4848my ( $check_stacks, $queue_stacks, $check_sweetspot, $queue_sweetspot, $check_diffs, $queue_diffs, $clean_old);
     
    6666    'registraion_status'   => \$registration_status,
    6767    'burntool_status'      => \$burntool_status,
     68    'old_date=s'           => \$old_date,
    6869    'check_stacks'         => \$check_stacks,
    6970    'queue_stacks'         => \$queue_stacks,
     
    134135unless ($success) {
    135136    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    136     &my_die("Unable to perform ppConfigDump: $error_code", $date, $PS_EXIT_SYS_ERROR);
     137    &my_die("Unable to perform ppConfigDump: $error_code", 0, 0, $date, $PS_EXIT_SYS_ERROR);
    137138}
    138139
     
    278279
    279280$metadata_out{nsObservingState} = &get_observing_state($date);
     281$metadata_out{nsRegistrationState} = &get_registration_state($date);
    280282#
    281283# Mode selection
     
    396398    exit(0);
    397399}
    398 exit(10);
     400
    399401if (defined($check_confirm_stacks) || defined($test_mode)) {
    400402    $metadata_out{nsStackState} = 'CONFIRM_STACKING';
     
    409411    exit(0);
    410412}
    411 
     413exit(10);
    412414if (defined($check_sweetspot) || defined($test_mode) || defined($check_mode)) {
    413415    $metadata_out{nsSSState} = 'CHECKSWEETSPOT';
     
    10971099    my $pretend = shift;
    10981100
     1101    my $Npotential = 0;
     1102    my $Nqueued = 0;
     1103    my $is_processing = 0;
     1104    my $is_registering;
     1105    if ($metadata_out{nsRegistrationState} eq 'REGISTERED') {
     1106        $is_registering = 0;
     1107    }
     1108    else {
     1109        $is_registering = 1;
     1110    }
     1111
    10991112    foreach my $target (sort (keys %science_config)) {
    11001113        if ($science_config{$target}{STACKABLE} == 1) {
     
    11051118                        print STDERR "execute_stacks: Target $target on $date is not fully processed. ($NprocChips $NprocWarps)\n";
    11061119                    }
     1120                    $is_processing = 1;
    11071121                    $metadata_out{nsStackState} = 'FORCETOWARP';
    11081122                    next;
     
    11201134                    next;
    11211135                }
     1136                $Npotential++;
    11221137                if ($Nalready != 0) {
     1138                    $Nqueued++;
    11231139                    if ($debug == 1) {
    11241140                        print STDERR "execute_stacks: Not queueing $target in filter $filter on $date due to already existing stacks.\n";
     
    11371153                    }
    11381154                    stack_queue($date,$target,$filter);
     1155                    $Nqueued ++;
    11391156                }
    11401157                if (defined($pretend)) {
     
    11521169        }
    11531170    }
     1171    $metadata_out{nsStackPotential} = $Npotential;
     1172    $metadata_out{nsStackQueued}    = $Nqueued;
     1173    if (($Npotential == $Nqueued)&&($metadata_out{nsObservingState} eq 'END_OF_NIGHT')&&($is_processing == 0)&&($is_registering == 0)) {
     1174        $metadata_out{nsStackState} = 'FINISHED_STACKS';
     1175    }   
    11541176}
    11551177
     
    12311253    my ($label,$workdir,$obs_mode,$object,$comment,$tess_id,$dist_group,$data_group,$reduction) = get_tool_parameters($date,$target);
    12321254
    1233     my $sth = "SELECT diff_id from diffRun JOIN diffInputSkyfile USING(diff_id) where data_group = '$data_group' AND warp1 = $warp_id_1 AND warp2 = $warp_id_2";
     1255    my $count = 0;
     1256   
     1257    my $sth = "SELECT DISTINCT diff_id from diffRun JOIN diffInputSkyfile USING(diff_id) where data_group = '$data_group' AND warp1 = $warp_id_1 AND warp2 = $warp_id_2";
    12341258    my $data_ref = $db->selectall_arrayref( $sth );
    1235 
    1236     return($#{ $data_ref } + 1);
     1259    $count += $#{ $data_ref } + 1;
     1260
     1261    $sth = "SELECT DISTINCT diff_id from diffRun JOIN diffInputSkyfile USING(diff_id) where data_group = '$data_group' AND warp1 = $warp_id_2 AND warp2 = $warp_id_1";
     1262    $data_ref = $db->selectall_arrayref( $sth );
     1263    $count += $#{ $data_ref } + 1;
     1264
     1265    return($count);
    12371266}
    12381267
     
    12721301    my $pretend = shift;
    12731302
     1303    my $Npotential = 0;
     1304    my $Nnoexp     = 0;
     1305    my $is_processing = 0;
     1306    my $is_registering;
     1307    if ($metadata_out{nsRegistrationState} eq 'REGISTERED') {
     1308        $is_registering = 0;
     1309    }
     1310    else {
     1311        $is_registering = 1;
     1312    }
     1313
    12741314    foreach my $target (sort (keys %science_config)) {
    12751315        if ($science_config{$target}{DIFFABLE} == 1) {
    12761316            foreach my $filter (@filter_list) {
     1317                $Npotential ++;
    12771318                my ($NprocChips,$NprocWarps) = pre_diff_queue($date,$observing_state,$target,$filter);
    12781319                if ((!defined($force_diff_count))&&($NprocChips != $NprocWarps)) {
     
    12801321                        print STDERR "execute_diffs: Target $target on $date is not fully processed. ($NprocChips $NprocWarps)\n";
    12811322                    }
    1282                     $metadata_out{nsDiffState} = 'FORCETOWARP';
    1283                     next;
    1284                 }
     1323                    $is_processing = 1;
     1324                }
    12851325                if ($NprocChips == 0) {
     1326                    $Nnoexp ++;
    12861327                    if ($debug == 1) {
    12871328                        print STDERR "execute_diffs: Target $target in filter $filter on $date has no exposures.\n";
     
    13111352        }
    13121353    }
     1354    if ($debug == 1) {
     1355        print "$metadata_out{nsObservingState} $metadata_out{nsDiffPotential} $metadata_out{nsDiffQueued} $is_processing $is_registering\n";
     1356    }
     1357
     1358    if ($metadata_out{nsObservingState} eq 'END_OF_NIGHT') {
     1359        if ($is_processing == 1) {
     1360            $metadata_out{nsDiffState} = 'DIFFING';
     1361        }
     1362        elsif ($is_registering == 0) {
     1363            if ($Npotential == $Nnoexp) {
     1364                $metadata_out{nsDiffState} = 'FINISHED_DIFFS';
     1365            }
     1366            elsif ($metadata_out{nsDiffPotential} == $metadata_out{nsDiffQueued}) {
     1367                $metadata_out{nsDiffState} = 'FINISHED_DIFFS';
     1368            }
     1369        }
     1370        else {
     1371            $metadata_out{nsDiffState} = 'DIFFING';
     1372        }
     1373    }
     1374    else {
     1375        $metadata_out{nsDiffState} = 'DIFFING';
     1376    }
     1377
     1378#     if (($Npotential == $Nnoexp)&&($metadata_out{nsObservingState} eq 'END_OF_NIGHT')&&($is_processing == 0)) {
     1379#       $metadata_out{nsDiffState} = 'FINISHED_DIFFS';
     1380#     }
     1381
     1382#     if ($is_processing == 1) {
     1383#       $metadata_out{nsDiffState} = 'DIFFING';
     1384#     }
    13131385}
    13141386
     
    13261398
    13271399    my $object_ref = $db->selectall_arrayref( $obj_sth );
     1400
     1401    my $Npotential = 0;
     1402    my $Nqueued = 0;
    13281403   
    13291404    foreach my $object_row (@{ $object_ref }) {
    13301405        my $this_object = shift @{ $object_row };
    1331         my $input_sth = "select exp_id,warp_id,dateobs from warpRun JOIN fakeRun USING(fake_id) JOIN camRun USING(cam_id) JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id) ";
    1332         $input_sth .= " WHERE warpRun.state = 'full' AND warpRun.label = '$label' AND warpRun.data_group = '$data_group' AND rawExp.filter = '$filter' AND rawExp.object = '$this_object' ";
    1333         $input_sth .= " ORDER BY dateobs ";
     1406#       my $input_sth = "select exp_id,warp_id,dateobs,rawExp.comment from warpRun JOIN fakeRun USING(fake_id) JOIN camRun USING(cam_id) JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id) ";
     1407#       $input_sth .= " WHERE warpRun.state = 'full' AND warpRun.label = '$label' AND warpRun.data_group = '$data_group' AND rawExp.filter = '$filter' AND rawExp.object = '$this_object' ";
     1408#       $input_sth .= " ORDER BY dateobs ";
    13341409       
     1410        my $input_sth = "select exp_id,warp_id,dateobs,rawExp.comment,warpRun.state AS warp_state FROM ";
     1411        $input_sth .=   " rawExp LEFT JOIN chipRun USING (exp_id) LEFT JOIN camRun USING (chip_id) LEFT JOIN fakeRun USING (cam_id) LEFT JOIN warpRun USING (fake_id) ";
     1412        $input_sth .=   " WHERE chipRun.label = '$label' AND chipRun.data_group = '$data_group' AND rawExp.filter = '$filter' AND rawExp.object = '$this_object' ";
     1413        $input_sth .=   " ORDER BY dateobs ";
     1414
    13351415        my $warps = $db->selectall_arrayref( $input_sth );
     1416
     1417        # Each comment should only appear once. Therefore, if we see it more than once, we assume the first is extra.
     1418        my %comment_hash = ();
     1419        foreach my $this_warp (@{ $warps }) {
     1420            my $this_comment = ${ $this_warp }[3];
     1421            my $this_exp_id  = ${ $this_warp }[0];
     1422            $comment_hash{$this_comment} = $this_exp_id;
     1423        }
    13361424       
    13371425        if (($#{ $warps } + 1) % 2 != 0) {
    1338             print STDERR "diff_queue: Number of input warps to make diffs is not even for target $target and object $this_object! $#{ $warps }\n";
    1339             next;
     1426            print STDERR "diff_queue: Number of input warps to make diffs is not even for target $target and object $this_object! $#{ $warps } ";
     1427            if ($#{ $warps} + 1 == 1) {
     1428                print STDERR ": I can do no diffs with only one exposure.\n";
     1429                next;
     1430            }
     1431            else {
     1432                print STDERR ": I should declare an exposure to be faulty.\n";
     1433                my @keep_warps = ();
     1434#               print "@{ $warps }\n";
     1435                foreach my $this_warp (@{ $warps }) {
     1436                    my $this_comment = ${ $this_warp }[3];
     1437                    my $this_exp_id  = ${ $this_warp }[0];
     1438                    if ($comment_hash{$this_comment} == $this_exp_id) {
     1439                        push @keep_warps, $this_warp;
     1440                    }
     1441                    else {
     1442                        print STDERR "diff_queue: excluding $this_exp_id for $this_object\n";
     1443                    }
     1444                }
     1445                @{ $warps } = @keep_warps;
     1446#               print "@{ $warps }\n";
     1447            }
    13401448        }
    13411449       
    13421450        while ($#{ $warps } > -1) {
    13431451            my $input_warp = shift @{ $warps };
     1452            my $input_exp_id = ${ $input_warp }[0];
     1453            my $input_comment = ${ $input_warp }[3];
     1454
     1455           
    13441456            my $template_warp = shift @{ $warps };
    1345             my $input_exp_id = ${ $input_warp }[0];
     1457
    13461458            my $template_exp_id = ${ $template_warp }[0];
    13471459           
    13481460            my $input_warp_id = ${ $input_warp }[1];
    13491461            my $template_warp_id = ${ $template_warp }[1];
     1462
     1463            my $input_warp_state = ${ $input_warp }[4];
     1464            my $template_warp_state = ${ $template_warp }[4];
    13501465           
     1466            $Npotential++;
     1467
     1468            unless (defined($input_warp_id) && defined($template_warp_id) &&
     1469                    ($input_warp_state eq 'full')&&($template_warp_state eq 'full')) {
     1470                print STDERR "Diff for this $date $target $input_exp_id $template_exp_id not fully processed\n";
     1471                next;
     1472            }
     1473
    13511474            if (verify_uniqueness_diff($input_warp_id,$template_warp_id,$date,$target) != 0) {
    1352                 print STDERR "Diffs already queued for this $date $target $input_exp_id $template_exp_id\n";
     1475                $Nqueued++;
     1476                print STDERR "Diffs already queued for this $date $target $input_exp_id $template_exp_id ($input_warp_id $template_warp_id) $this_object $input_comment\n";
    13531477                next;
    13541478            }
     
    13661490                $cmd .= ' -pretend ';
    13671491                print STDERR "diff_queue: $cmd\n";
     1492                print STDERR " $input_warp_id $template_warp_id\n";
    13681493            }
    13691494           
     
    13751500                    &my_die("Unable to perform difftool: $error_code", 0,0,$date, $PS_EXIT_SYS_ERROR);
    13761501                }
    1377             }
    1378         }
    1379     }
     1502                $Nqueued++;
     1503            }
     1504        }
     1505    }
     1506    $metadata_out{nsDiffPotential} += $Npotential;
     1507    $metadata_out{nsDiffQueued}    += $Nqueued;
     1508#      if (($metadata_out{nsDiffPotential} == $metadata_out{nsDiffQueued})&&($metadata_out{nsObservingState} eq 'END_OF_NIGHT')) {
     1509#       $metadata_out{nsDiffState} = 'FINISHED_DIFFS';
     1510#      }       
     1511
    13801512}
    13811513           
     
    14931625        }
    14941626    }   
    1495 
     1627#    print "$datetime $eon_dt\n";
    14961628    if (DateTime->compare($datetime,$eon_dt) < 1) {
    14971629        return("OBSERVING");
     
    15011633    }
    15021634}
     1635
     1636# This basically does the end of night check, but does it "the hard way," to prevent the time from fooling us.
     1637sub get_registration_state {
     1638    my $date = shift;
     1639
     1640    foreach my $eon (keys %eon_config) {
     1641        my $command = "$regtool -processedexp -simple ";
     1642        $command .= " -dbname $dbname ";
     1643        $command .= " -dateobs_begin ${date}T00:00:00 -dateobs_end ${date}T23:59:59 ";
     1644        $command .= " -object $eon_config{$eon}{OBJECT} " if defined($eon_config{$eon}{OBJECT});
     1645        $command .= " -obs_mode $eon_config{$eon}{OBSMODE} " if defined($eon_config{$eon}{OBSMODE});
     1646        $command .= " -exp_type $eon_config{$eon}{EXPTYPE} " if defined($eon_config{$eon}{EXPTYPE});
     1647        $command .= " -comment $eon_config{$eon}{COMMENT} " if defined($eon_config{$eon}{COMMENT});
     1648
     1649        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     1650            run ( command => $command, verbose => $verbose );
     1651        unless ($success) {
     1652            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     1653            &my_die("Unable to perform regtool: $error_code", 0,0,$date, $PS_EXIT_SYS_ERROR);
     1654        }
     1655        my @eon_exposures = split /\n/, (join '', @$stdout_buf);
     1656        if ($#eon_exposures >= 0) {
     1657            return("REGISTERED");
     1658        }
     1659    }   
     1660    return("NOT_REGISTERED");
     1661}
     1662
     1663   
    15031664
    15041665sub get_tool_parameters {
     
    16201781    my $stage = shift; # stage name
    16211782    my $stage_id = shift; #  identifier
     1783    my $date = shift;
    16221784    my $exit_code = shift; # Exit code
    1623     # outputImage and path_base are globals
    16241785
    16251786    carp($msg);
  • branches/czw_branch/20101203/ippScripts/scripts/publish_file.pl

    r30118 r30586  
    4242
    4343# Parse the command-line arguments
    44 my ( $pub_id, $camera, $stage, $stage_id, $fileset, $format, $product, $workdir );
     44my ( $pub_id, $camera, $stage, $stage_id, $fileset, $format, $product, $workdir, $need_magic );
    4545my ( $dbname, $verbose, $no_update, $no_op, $save_temps, $redirect );
    4646my ( $output_format );
     
    5454    'fileset=s'         => \$fileset,     # Fileset name
    5555    'workdir=s'         => \$workdir,     # Working directory
     56    'need-magic'        => \$need_magic,  # do we require censored detections?
    5657    'dbname=s'          => \$dbname,    # Database name
    5758    'verbose'           => \$verbose,   # Print to stdout
     
    166167    foreach my $comp ( @$components ) {
    167168        my $path_base = $comp->{path_base}; # Base name for file
     169        if (!$need_magic and $comp->{magicked}) {
     170            # This client is authorized to receive uncensored detections
     171            # Get the uri for the "backup" files
     172            print "Using uncensored input from $path_base\n";
     173            $path_base = $ipprc->destreaked_filename($path_base);
     174        }
    168175        next if defined $comp->{quality} and $comp->{quality} > 0;
    169176        print "Warning: mis-matched comments\n" if defined $comment and $comment ne $comp->{comment};
     
    181188            $filename = $ipprc->filename( "PSPHOT.OUT.CMF.MEF", "$path_base.pos" );
    182189        }
    183         $filename = $ipprc->file_resolve($filename);
     190        &my_die("input file does not exist: $filename", $pub_id, $PS_EXIT_SYS_ERROR) if !$ipprc->file_exists($filename);
     191        my $resolved = $ipprc->file_resolve($filename);
     192       
     193        &my_die("unable to resolve input file: $filename", $pub_id, $PS_EXIT_SYS_ERROR) if !$resolved;
     194
     195        $filename = $resolved;
    184196
    185197        my $data = { zp => $zp,
  • branches/czw_branch/20101203/ippScripts/scripts/register_exp.pl

    r30047 r30586  
    348348    if (defined $exp_id and not $no_update) {
    349349        my $command = "$regtool -addprocessedexp -exp_id $exp_id -fault $exit_code";
     350        $command .= " -exp_tag $exp_tag";
     351        $command .= " -exp_name UNKNOWN";
     352        $command .= " -inst UNKNOWN";
     353        $command .= " -telescope UNKNOWN";
     354        $command .= " -telescope UNKNOWN";
     355        $command .= " -filelevel UNKNOWN";
    350356        $command .= " -hostname $host" if defined $host;
    351357        $command .= " -dbname $dbname" if defined $dbname;
  • branches/czw_branch/20101203/ippScripts/scripts/register_imfile.pl

    r30118 r30586  
    1010my $date = `date`;
    1111print "\n\n";
    12 print "Starting script $0 on $host at $date\n\n";
     12my $cmd_line = join ' ', @ARGV;
     13print "Starting script $0 $cmd_line on $host at $date\n\n";
    1314
    1415use vars qw( $VERSION );
     
    3940
    4041my ($cache, $exp_id, $tmp_class_id, $tmp_exp_name, $uri, $bytes, $md5sum, $dbname, $verbose, $no_update, $no_op, $logfile);
     42my ($sunrise, $sunset);
    4143GetOptions(
    4244    'caches'           => \$cache,
     
    4749    'bytes=s'          => \$bytes,
    4850    'md5sum=s'         => \$md5sum,
     51    'sunrise=s'        => \$sunrise,
     52    'sunset=s'         => \$sunset,
    4953    'dbname|d=s'       => \$dbname,    # Database name
    5054    'verbose'          => \$verbose,   # Print to stdout
     
    5458) or pod2usage( 2 );
    5559
    56 my $ipprc = PS::IPP::Config->new() or my_die( "Unable to set up", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR ); # IPP configuration
    57 $ipprc->redirect_output($logfile) or my_die( "Unable to redirect output", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_SYS_ERROR ) if $logfile;
     60my $ipprc = PS::IPP::Config->new() or my_die_for_add( "Unable to set up", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR ); # IPP configuration
     61$ipprc->redirect_output($logfile) or my_die_for_add( "Unable to redirect output", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_SYS_ERROR ) if $logfile;
    5862
    5963pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
     
    6569    defined $uri;
    6670
     71unless (defined($sunset)) {
     72    $sunset = '03:30:00';
     73}
     74unless (defined($sunrise)) {
     75    $sunrise = '17:30:00';
     76}
    6777
    6878my $RECIPE = "REGISTER"; # Recipe to use for ppStats
     
    8494
    8595my $cmdflags;
    86 my $burntoolStateGood;
     96my $burntoolStateTarget;
     97my $burntoolStateCurrent;
    8798# Run ppStats on the input file
    8899{
     
    101112    print "STDOUT:\n$out1";
    102113    print "STDERR:\n$err1";
    103     &my_die("Unable to perform ppStats on exposure id $exp_id: " . $h1->result(), $exp_id, $tmp_exp_name, $tmp_class_id, $uri, ($h1->result() or $PS_EXIT_PROG_ERROR) ) unless $result1;
     114    &my_die_for_add("Unable to perform ppStats on exposure id $exp_id: " . $h1->result(), $exp_id, $tmp_exp_name, $tmp_class_id, $uri, ($h1->result() or $PS_EXIT_PROG_ERROR) ) unless $result1;
    104115
    105116    print "[Running " . join(' ', @command2) . "]\n";
     
    110121    print "STDOUT:\n$out2";
    111122    print "STDERR:\n$err2";
    112     &my_die("Unable to perform ppStatsFromMetadata on exposure id $exp_id: " . $h2->result(), $exp_id, $tmp_exp_name, $tmp_class_id, $uri, ($h2->result() or $PS_EXIT_PROG_ERROR) ) unless $result2;
     123    &my_die_for_add("Unable to perform ppStatsFromMetadata on exposure id $exp_id: " . $h2->result(), $exp_id, $tmp_exp_name, $tmp_class_id, $uri, ($h2->result() or $PS_EXIT_PROG_ERROR) ) unless $result2;
    113124    chomp $out2;
    114125    $cmdflags = $out2;
    115126
    116127    # Manually parse the burntool_state entry.
    117     my $burntoolState = 0;
     128    $burntoolStateCurrent = 0;
    118129    my $isGPC1 = 0;
    119     $burntoolStateGood = 0;
     130    $burntoolStateTarget = 0;
    120131    foreach my $line (split /\n/, $out1) {
    121132        if ($line =~ /FPA.BURNTOOL.APPLIED/) {
    122133            $line =~ s/^\s+//;
    123             $burntoolState = (split /\s+/, $line)[2];
     134            $burntoolStateCurrent = (split /\s+/, $line)[2];
    124135        }
    125136        if ($line =~ /FPA.CAMERA/) {
     
    131142    }
    132143    if ($isGPC1 != 1) {
    133         $burntoolState = 0; # If it's not GPC1, you shouldn't have run burntool.
    134     }
    135     elsif (($isGPC1 == 1) && ($burntoolState == 1)) {
    136 #       print STDERR "In the good region: >>$burntoolState<<\n";
     144        $burntoolStateCurrent = 0; # If it's not GPC1, you shouldn't have run burntool.
     145    }
     146    elsif (($isGPC1 == 1) && ($burntoolStateCurrent == 1)) {
     147#       print STDERR "In the good region: >>$burntoolStateCurrent<<\n";
    137148        my $ppConfigDump_cmd = "$ppConfigDump -camera GPC1 -dump-camera -";
    138149        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    148159            if ($line =~ /BURNTOOL.STATE.GOOD/) {
    149160                $line =~ s/^\s+//;
    150                 $burntoolStateGood = (split /\s+/, $line)[2];
     161                $burntoolStateTarget = (split /\s+/, $line)[2];
    151162                last;
    152163            }
    153164        }
    154         $burntoolState = $burntoolStateGood; # Positive because this has the header table.
    155 
    156     }
    157     $cmdflags .= " -burntool_state $burntoolState ";
     165        # XXX why was this being equated??
     166        # $burntoolState = $burntoolStateGood; # Positive because this has the header table.
     167
     168    }
     169    $cmdflags .= " -burntool_state $burntoolStateTarget ";
    158170}
    159171
    160172$now_time = localtime();
    161173printf STDERR "\ndone with ppStats: %s\n", $now_time if $verbose;
     174printf STDERR "\nburntool state current: %d target: %d\n", $burntoolStateCurrent, $burntoolStateTarget;
    162175
    163176# we require at a minimum: -telescope, -inst, -filelevel, -class_id, -exp_type
    164 if (uc(&value_for_flag ($cmdflags, "NULL", "-telescope")) eq "NULL") { &my_die ("telescope not found", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR); }
    165 if (uc(&value_for_flag ($cmdflags, "NULL", "-inst"))      eq "NULL") { &my_die ("inst      not found", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR); }
    166 if (uc(&value_for_flag ($cmdflags, "NULL", "-filelevel")) eq "NULL") { &my_die ("filelevel not found", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR); }
    167 if (uc(&value_for_flag ($cmdflags, "NULL", "-class_id"))  eq "NULL") { &my_die ("class_id  not found", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR); }
    168 if (uc(&value_for_flag ($cmdflags, "NULL", "-exp_type"))  eq "NULL") { &my_die ("exp_type  not found", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR); }
     177if (uc(&value_for_flag ($cmdflags, "NULL", "-telescope")) eq "NULL") { &my_die_for_add ("telescope not found", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR); }
     178if (uc(&value_for_flag ($cmdflags, "NULL", "-inst"))      eq "NULL") { &my_die_for_add ("inst      not found", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR); }
     179if (uc(&value_for_flag ($cmdflags, "NULL", "-filelevel")) eq "NULL") { &my_die_for_add ("filelevel not found", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR); }
     180if (uc(&value_for_flag ($cmdflags, "NULL", "-class_id"))  eq "NULL") { &my_die_for_add ("class_id  not found", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR); }
     181if (uc(&value_for_flag ($cmdflags, "NULL", "-exp_type"))  eq "NULL") { &my_die_for_add ("exp_type  not found", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR); }
     182my $dateobs   = &value_for_flag($cmdflags, 0.0, "-dateobs");
    169183
    170184my $command = "$regtool -addprocessedimfile";
     
    177191$command .= " -hostname $host" if defined $host;
    178192$command .= " -dbname $dbname" if defined $dbname;
    179 $command .= " -data_state check_burntool";
     193if (abs($burntoolStateCurrent) == $burntoolStateTarget) {
     194    printf STDERR "This has already been burned.\n";
     195    $command .= " -data_state full";
     196}
     197elsif (is_daytime($dateobs,$sunrise,$sunset)) {
     198    printf STDERR "This is a daytime exposure.\n";
     199    $command .= " -data_state full";
     200}
     201else {
     202    printf STDERR "Need to check burntool.\n";
     203    $command .= " -data_state check_burntool";
     204}
    180205$command .= " $cmdflags";
    181206
     
    187212my $ra        = &value_for_flag($cmdflags, 0.0, "-ra");
    188213my $dec       = &value_for_flag($cmdflags, 0.0, "-decl");
    189 my $dateobs   = &value_for_flag($cmdflags, 0.0, "-dateobs");
     214
    190215
    191216# if the needed data is available, pass it to sunmoon:
     
    216241# lock file?
    217242# if exp_type = DARK and date > MIDNIGHT HST { wait }
    218 # system("ipp_apply_burntool.pl --class_id $class_id --dateobs_begin $date_start --dateobs_end $date_end --dbname gpc1 --logfile /data/$host.0/burntool_logs/$class_id.$start_date.log"); 
     243# system("ipp_apply_burntool.pl --class_id $class_id --dateobs_begin $date_start --dateobs_end $date_end --dbname gpc1 --logfile /data/$host.0/burntool_logs/$class_id.$start_date.log");
    219244
    220245$now_time = localtime();
     
    236261# We now have an imfile in the database, check if we can burntool it.  If not, continue on.
    237262
    238 {
     263if ((abs($burntoolStateCurrent) != $burntoolStateTarget)&&
     264    (!is_daytime($dateobs,$sunrise,$sunset))) {
    239265    my $mdcParser  = PS::IPP::Metadata::Config->new;
    240266
     
    243269    $check_date =~ s/T.*$//;
    244270    my $exp_name   = $tmp_exp_name;
    245    
     271
    246272
    247273    my $bt_check_command = "$regtool -checkburntoolimfile ";
    248274    $bt_check_command .= " -class_id $class_id ";
    249     $bt_check_command .= " -date $check_date ";
    250     $bt_check_command .= " -valid_burntool $burntoolStateGood ";
     275    $bt_check_command .= " -dateobs_begin ${check_date}T${sunset} ";
     276    $bt_check_command .= " -dateobs_end ${check_date}T${sunrise} ";
     277    $bt_check_command .= " -valid_burntool $burntoolStateTarget ";
    251278    $bt_check_command .= " -exp_name $exp_name ";
    252279    $bt_check_command .= " -dbname $dbname" if defined $dbname;
    253280
    254281    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    255         run ( command => $bt_check_command, verbose => $verbose);
     282        run ( command => $bt_check_command, verbose => $verbose);
    256283    unless ($success) {
    257         $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    258         &my_die("Unable to perform regtool: $error_code",
    259                 $class_id, $exp_name, $date, $PS_EXIT_SYS_ERROR);
     284        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     285        &my_die_for_update("Unable to perform regtool: $error_code",
     286                           $exp_id, $class_id, $PS_EXIT_SYS_ERROR);
    260287    }
    261288
     
    264291    my $exposures;
    265292    while ( scalar @whole > 0 ) {
    266         my $value = shift @whole;
    267         push @single, $value;
    268         if ($value =~ /^\s*END\s*$/) {
    269             push @single, "\n";
    270            
    271             my $list = parse_md_list( $mdcParser->parse( join( "\n", @single ) ) );
    272             &my_die("Unable to parse output from regtool",
    273                     $class_id, $exp_name, $date, $PS_EXIT_SYS_ERROR) unless
    274                         defined $list;
    275             push @{ $exposures }, @$list;
    276             @single = ();
    277         }
    278     }
    279    
     293        my $value = shift @whole;
     294        push @single, $value;
     295        if ($value =~ /^\s*END\s*$/) {
     296            push @single, "\n";
     297
     298            my $list = parse_md_list( $mdcParser->parse( join( "\n", @single ) ) );
     299            &my_die_for_update("Unable to parse output from regtool",
     300                               $exp_id, $class_id, $PS_EXIT_SYS_ERROR) unless
     301                                   defined $list;
     302            push @{ $exposures }, @$list;
     303            @single = ();
     304        }
     305    }
     306
    280307    # We only care about the final entry, as that contains the exposure we are.
    281    
     308
    282309    my $regtool_update = "$regtool -updateprocessedimfile ";
    283310    $regtool_update .= "-dbname $dbname " if defined $dbname;
     
    286313    my $burntool_data = pop(@{ $exposures });
    287314    if ($burntool_data->{burnable} == 0) {
    288         $regtool_update .= " -burntool_state 0 -set_state pending_burntool ";
    289         unless ($no_update) {
    290             my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    291                 IPC::Cmd::run(command => $regtool_update, verbose => $verbose);
    292             unless ($success) {
    293                 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    294                 warn ("Unable to perform regtool -addprocessedimfile: $error_code");
    295                 exit($error_code);
    296             }
    297         } else {
    298             print "skipping command: $command\n";
    299         }
     315        $regtool_update .= " -burntool_state 0 -set_state pending_burntool ";
     316        unless ($no_update) {
     317            my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     318                IPC::Cmd::run(command => $regtool_update, verbose => $verbose);
     319            unless ($success) {
     320                $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     321                warn ("Unable to perform regtool -addprocessedimfile: $error_code");
     322                exit($error_code);
     323            }
     324        } else {
     325            print "skipping command: $command\n";
     326        }
    300327    }
    301328    else {
    302         my $apply_command = "$ippApplyBurntoolSingle --dbname $dbname ";
    303         $apply_command .= " --class_id $class_id --exp_id $exp_id ";
    304         $apply_command .= " --this_uri $burntool_data->{uri} ";
    305         $apply_command .= " --previous_uri $burntool_data->{previous_uri} " if defined $burntool_data->{previous_uri};
    306         $apply_command .= " --imfile_state $burntool_data->{imfile_state} ";
    307         $apply_command .= " --verbose " if $verbose;
    308         print "$apply_command\n";
    309         unless ($no_update) {
    310             my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    311                 IPC::Cmd::run(command => $apply_command, verbose => $verbose);
    312             unless ($success) {
    313                 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    314                 warn ("Unable to perform ipp_apply_burntool_single.pl: $error_code");
    315                 exit($error_code);
    316             }
    317         }
    318     }   
     329        my $apply_command = "$ippApplyBurntoolSingle --dbname $dbname ";
     330        $apply_command .= " --class_id $class_id --exp_id $exp_id ";
     331        $apply_command .= " --this_uri $burntool_data->{uri} ";
     332        $apply_command .= " --previous_uri $burntool_data->{previous_uri} " if defined $burntool_data->{previous_uri};
     333        $apply_command .= " --imfile_state $burntool_data->{imfile_state} ";
     334        $apply_command .= " --verbose " if $verbose;
     335        print "$apply_command\n";
     336        unless ($no_update) {
     337            my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     338                IPC::Cmd::run(command => $apply_command, verbose => $verbose);
     339            unless ($success) {
     340                $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     341                &my_die_for_update("Unable to perform ipp_apply_burntool_single.pl: $error_code",
     342                               $exp_id, $class_id, $PS_EXIT_SYS_ERROR);
     343            }
     344        }
     345    }
    319346
    320347
     
    353380}
    354381
    355 sub my_die
     382sub is_daytime
     383{
     384    my $dateobs = shift;
     385    my $sunset  = shift;
     386    my $sunrise = shift;
     387
     388    my ($date,$time);
     389
     390    if ($dateobs =~ /T/) {
     391        ($date,$time) = split /T/, $dateobs;
     392    }
     393    else {
     394        ($date,$time) = split / /, $dateobs;
     395    }
     396    my ($hour,$minute,$second) = split /\:/, $time; # /;
     397    my ($ss_hour,$ss_minute,$ss_second) = split /\:/, $sunset; # /;
     398    my ($sr_hour,$sr_minute,$sr_second) = split /\:/, $sunrise; # /;
     399    if ($second =~ /Z/) {
     400        $second =~ s/Z//;
     401    }
     402#     print "this exposure: $hour $minute $second\n";
     403#     print "sunset:        $ss_hour $ss_minute $ss_second\n";
     404#     print "sunrise:       $sr_hour $sr_minute $sr_second\n";
     405#     printf "Hss: %d Mss: %d Sss: %d\n",($hour >= $ss_hour),($minute >= $ss_minute),($second >= $ss_second);
     406#     printf "Hsr: %d Msr: %d Ssr: %d\n",($hour <= $sr_hour),($minute <= $sr_minute),($second <= $sr_second);
     407
     408    if (($hour > $ss_hour)&&($hour <= 24)) {
     409        return(1); # After sunset by more than an hour, before midnight
     410    }
     411    elsif ($hour == $ss_hour) {
     412        if ($minute > $ss_minute) {
     413            return(1); # After sunset by more than a minute
     414        }
     415        elsif ($minute == $ss_minute) {
     416            if ($second >= $ss_second) {
     417                return(1); # After sunset by more than a second
     418            }
     419            else {
     420                return(0);
     421            }
     422        }
     423        else {
     424            return(0);
     425        }
     426    }
     427    elsif (($hour < $sr_hour)&&($hour >= 0)) {
     428        return(1); # Before sunrise by more than an hour, but after midnight
     429    }
     430    elsif ($hour == $sr_hour) {
     431        if ($minute < $sr_minute) {
     432            return(1); # Before sunrise by more than a minute
     433        }
     434        elsif ($minute == $sr_minute) {
     435            if ($second <= $sr_second) {
     436                return(1); # Before sunrise by more than a second
     437            }
     438            else {
     439                return(0);
     440            }
     441        }
     442        else {
     443            return(0);
     444        }
     445    }
     446    else {
     447        return(0); # We should never get here.
     448    }
     449}
     450
     451sub my_die_for_add
    356452{
    357453    my $msg = shift; # Warning message on die
     
    384480    exit $exit_code;
    385481}
     482sub my_die_for_update
     483{
     484    my $msg = shift; # Warning message on die
     485    my $exp_id = shift;
     486    my $class_id = shift;
     487    my $exit_code = shift;
     488
     489    $exit_code = $PS_EXIT_PROG_ERROR unless defined $exit_code;
     490
     491    carp($msg);
     492    if (defined $exp_id && defined $tmp_class_id and not $no_update) {
     493        my $command = "$regtool -updateprocessedimfile";
     494        $command .= " -exp_id $exp_id";
     495        $command .= " -class_id $class_id";
     496        $command .= " -fault $exit_code";
     497        $command .= " -hostname $host" if defined $host;
     498        $command .= " -dbname $dbname" if defined $dbname;
     499        print "Running: $command\n";
     500        system($command);
     501    }
     502    exit $exit_code;
     503}
    386504
    387505# Pau.
  • branches/czw_branch/20101203/ippTasks

  • branches/czw_branch/20101203/ippTasks/Makefile.am

    r30018 r30586  
    1717        warp.pro \
    1818        magic.pro \
     19        magic.cleanup.pro \
    1920        destreak.pro \
    2021        destreak.cleanup.pro \
  • branches/czw_branch/20101203/ippTasks/addstar.pro

    r28211 r30586  
    173173    $run = $run --minidvodb_group $MINIDVODB_GROUP
    174174        if (("$MINIDVODB_NAME" != "NULL") && ("$MINIDVODB_NAME" != "(null)"))
    175            $run = $run --minidvodb_name $MINIDVODB_NAME #have addstar_run.pl grab the 'active' name if it is NULL
     175           $run = $run --minidvodb_name $MINIDVODB_NAME
     176    #have addstar_run.pl grab the 'active' name if it is NULL
    176177        end
    177178    end
  • branches/czw_branch/20101203/ippTasks/diff.pro

    r28375 r30586  
    4545  end
    4646  task diff.revert
    47     active false
     47    active true
    4848  end
    4949  task diff.summary.load
     
    448448  periods      -timeout 120.0
    449449  npending     1
    450   active false
    451450
    452451  stdout NULL
     
    457456    # Only revert failures with fault=2 (SYS_ERROR), which tend to be
    458457    # temporary filesystem problems.  Every other fault type is
    459     # interesting and should be kept for debugging (and so it doesn't
     458    # interesting and should be kept for debugging (and so it does not
    460459    # continue to occur).
    461     $run = difftool -revertdiffskyfile -fault 2
     460    # XXX: actually we are getting enough jobs with fault 4 that work after reverting
     461    # that we are going to remove that cut for now
     462    #
     463    #$run = difftool -revertdiffskyfile -fault 2
     464    $run = difftool -revertdiffskyfile
    462465    if ($DB:n == 0)
    463466      option DEFAULT
  • branches/czw_branch/20101203/ippTasks/diskbalance.pro

    r29631 r30586  
    194194    book getword balancePending $pageName source_name      -var SOURCE
    195195    book getword balancePending $pageName destination_name -var DESTINATION
    196    
     196    book getword balancePending $pageName destination_host -var DEST_HOST
    197197    # Fix this with multihost restriction when possible.
    198     set.host.for.balance $DESTINATION
     198    set.host.for.balance $DEST_HOST
    199199
    200200    stdout NULL
  • branches/czw_branch/20101203/ippTasks/dist.pro

    r29386 r30586  
    6161  end
    6262  task dist.revert
    63     active false
     63    active true
    6464  end
    6565end
     
    9595end
    9696
     97# This is now only used if we are not using a nebulous outroot
    9798macro get.host.for.component
    9899    if ($0 != 3)
     
    122123end
    123124
     125# This is now only used if we are not using a nebulous outroot
    124126macro set.dist.workdir.by.component
    125127    if ($0 != 5)
     
    139141    book getword ipphosts distribution count -var count
    140142    if ("$count" == "NULL")
    141         echo "ERROR: distributin hosts list is empty"
     143        echo "ERROR: distribution hosts list is empty"
    142144        break
    143145    end
     
    289291    end
    290292
    291 
    292     set.dist.workdir.by.component $DIST_STAGE_ID $COMPONENT $OUTDIR_TEMPLATE OUTDIR
    293     if ("$OUTDIR" == "NULL")
    294         echo ERROR failed to set workdir for $COMPONENT
    295         break
    296     end
    297 
    298293    substr $COMPONENT 0 3 COMP_HEAD
    299294    if ("$COMP_HEAD" == "sky")
    300295        set.host.for.skycell $COMPONENT
     296        set.workdir.by.skycell $COMPONENT $OUTDIR_TEMPLATE $default_host OUTDIR
    301297    else
    302         # assume component is a class_id, if not we will default to anyhost
     298        # assume component is a class_id, if  it is not we will default to
     299        # host "anyhost"
     300        # and volume "any"
    303301        set.host.for.camera $CAMERA $COMPONENT
     302        set.workdir.by.camera $CAMERA $COMPONENT $OUTDIR_TEMPLATE $default_host OUTDIR
     303    end
     304
     305    if ("$OUTDIR" == "NULL")
     306        echo ERROR failed to set workdir for $COMPONENT
     307        break
    304308    end
    305309
    306310    sprintf logfile "%s/dist.%s.%s.log" $OUTDIR $DIST_ID $COMPONENT
    307 #    stdout $logfile
    308 #    stderr $logfile
    309311
    310312    $run = dist_component.pl --dist_id $DIST_ID --camera $CAMERA --stage $DIST_STAGE --stage_id $DIST_STAGE_ID --component $COMPONENT --path_base $PATH_BASE --chip_path_base $CHIP_PATH_BASE --state $STATE --data_state $DATA_STATE $EXTRA_ARGS --outdir $OUTDIR --logfile $logfile
     
    401403    book getpage distToAdvance 0 -var pageName -key pantaskState INIT
    402404    if ("$pageName" == "NULL") break
     405
     406    # XXX the sql for disttool -toadvance does not include the camera:
     407    # hack around this for now
     408    $CAMERA = GPC1
    403409
    404410    book setword distToAdvance $pageName pantaskState RUN
     
    414420    end
    415421
    416     host anyhost
    417 
    418     # using $DIST_ID as the "component" works fine here since we only look
    419     # at the last two digits. But make sure that there 2 digits
    420     $fake_component = $STAGE_ID + 10
    421     set.dist.workdir.by.component $fake_component "exposure" $OUTDIR_TEMPLATE OUTDIR
     422    substr $OUTDIR_TEMPLATE 0 3 SCHEME
     423    if ("$SCHEME" == "neb")
     424        # XXX This does not work if workdir is not in nebulous
     425        # and $default_host == "any" because /data/any does not exist
     426        # use "dummy" as component. Result will be 'any'
     427        # set.workdir.by.camera $CAMERA dummy $OUTDIR_TEMPLATE $default_host OUTDIR
     428        set.workdir.by.camera GPC1 dummy $OUTDIR_TEMPLATE $default_host OUTDIR
     429    else
     430        # using $DIST_ID as the "component" works fine here since we only look
     431        # at the last two digits. But make sure that there 2 digits
     432        $fake_component = $STAGE_ID + 10
     433        set.dist.workdir.by.component $fake_component "exposure" $OUTDIR_TEMPLATE OUTDIR
     434    end
     435 
    422436    if ("$OUTDIR" == "NULL")
    423437        echo ERROR failed to set workdir for $DIST_ID
    424438        break
    425439    end
     440    host anyhost
    426441
    427442    sprintf logfile "%s/dist.advance.%s.log" $OUTDIR $DIST_ID
    428 #    stdout $logfile
    429 #    stderr $logfile
    430 
    431     $run = dist_advancerun.pl --dist_id $DIST_ID --stage $STAGE --stage_id $STAGE_ID --outdir $OUTDIR $EXTRA_ARGS --logfile $logfile
     443
     444    $run = dist_advancerun.pl --dist_id $DIST_ID --stage $STAGE --stage_id $STAGE_ID --camera $CAMERA --outdir $OUTDIR $EXTRA_ARGS --logfile $logfile
    432445    add_standard_args run
    433446
  • branches/czw_branch/20101203/ippTasks/ipphosts.mhpcc.config

    r28500 r30586  
    2222  sky09 STR  ipp014
    2323  sky10 STR  ipp015
    24   sky11 STR  ipp016
     24  sky11 STR  ipp006
    2525  sky12 STR  ipp017
    2626  sky13 STR  ipp018
     
    125125  XY26  STR  ipp027
    126126  XY27  STR  ipp028
    127   XY30  STR  ipp016
     127  XY30  STR  ipp006
    128128  XY31  STR  ipp044
    129129
     
    204204  ota26  STR  ipp027
    205205  ota27  STR  ipp028
    206   ota30  STR  ipp016
     206  ota30  STR  ipp006
    207207  ota31  STR  ipp044
    208208                   
     
    298298  XY11  STR  ipp039
    299299                   
    300   XY12  STR  ipp009
     300  XY12  STR  ipp005
    301301  XY13  STR  ipp024
    302302  XY14  STR  ipp010
     
    305305  XY16  STR  ipp011
    306306  XY17  STR  ipp026
    307   XY20  STR  ipp012
     307  XY20  STR  ipp006
    308308  XY21  STR  ipp041
    309309                   
    310310  XY22  STR  ipp013
    311311  XY23  STR  ipp042
    312   XY24  STR  ipp014
     312  XY24  STR  ipp007
    313313  XY25  STR  ipp043
    314314                   
    315315  XY26  STR  ipp027
    316316  XY27  STR  ipp028
    317   XY30  STR  ipp016
     317  XY30  STR  ipp006
    318318  XY31  STR  ipp044
    319319                   
     
    358358  XY72  STR  ipp052
    359359                   
    360   XY73  STR  ipp053
     360  XY73  STR  ipp007
    361361  XY74  STR  ipp015
    362362  XY75  STR  ipp025
     
    371371  sky02 STR  ipp007
    372372  sky03 STR  ipp008
    373   sky04 STR  ipp009
     373  sky04 STR  ipp005
    374374  sky05 STR  ipp010
    375375  sky06 STR  ipp011
    376   sky07 STR  ipp012
     376  sky07 STR  ipp006
    377377  sky08 STR  ipp013
    378   sky09 STR  ipp014
     378  sky09 STR  ipp007
    379379  sky10 STR  ipp015
    380   sky11 STR  ipp016
     380  sky11 STR  ipp006
    381381  sky12 STR  ipp017
    382382  sky13 STR  ipp018
     
    414414  sky45 STR  ipp051
    415415  sky46 STR  ipp052
    416   sky47 STR  ipp053
     416  sky47 STR  ipp007
    417417  sky48 STR  ipp023
    418418  sky49 STR  ipp024
     
    445445  sky76 STR  ipp051
    446446  sky77 STR  ipp052
    447   sky78 STR  ipp053
    448 END
     447  sky78 STR  ipp006
     448END
  • branches/czw_branch/20101203/ippTasks/nightly_science.pro

    r30018 r30586  
    77    ns.detrends.off
    88    ns.dqstats.on
    9 #    ns.sweetspot.on
    10 #    ns.registration.on
    11 #    ns.burntool.on
    12 #    ns.chips.on
    139    ns.stacks.on
    1410    ns.diffs.on
     
    1915    ns.detrends.off
    2016    ns.dqstats.off
    21 #    ns.sweetspot.off
    22 #    ns.registration.off
    23 #    ns.burntool.off
    24 #    ns.chips.off
    2517    ns.stacks.off
    2618    ns.diffs.off
     
    5345end
    5446
    55 # macro ns.sweetspot.on
    56 #   task ns.sweetspot.load
    57 #     active true
    58 #   end
    59 # end
    60 
    61 # macro ns.registration.on
    62 #   task ns.registration.load
    63 #     active true
    64 #   end
    65 # end
    66 
    67 # macro ns.burntool.on
    68 #   task ns.burntool.load
    69 #     active true
    70 #   end
    71 #   task ns.burntool.run
    72 #     active true
    73 #   end
    74 # end
    75 
    76 # macro ns.chips.on
    77 #   task ns.chips.load
    78 #     active true
    79 #   end
    80 #   task ns.chips.run
    81 #     active true
    82 #   end
    83 # end
    84 
    8547macro ns.stacks.on
    8648  task ns.stacks.load
     
    9153  end
    9254  task ns.stacks.confirm
    93     active true
     55    active false
    9456  end
    9557end
     
    12284end
    12385
    124 # macro ns.sweetspot.off
    125 #   task ns.sweetspot.load
    126 #     active false
    127 #   end
    128 # end
    129 
    130 # macro ns.registration.off
    131 #   task ns.registration.load
    132 #     active false
    133 #   end
    134 # end
    135 
    136 # macro ns.burntool.off
    137 #   task ns.burntool.load
    138 #     active false
    139 #   end
    140 #   task ns.burntool.run
    141 #     active false
    142 #   end
    143 # end
    144 
    145 # macro ns.chips.off
    146 #   task ns.chips.load
    147 #     active false
    148 #   end
    149 #   task ns.chips.run
    150 #     active false
    151 #   end
    152 # end
    153 
    15486macro ns.stacks.off
    15587  task ns.stacks.load
     
    15991    active false
    16092  end
     93  task ns.stacks.confirm
     94    active false
     95  end
     96
    16197end
    16298
     
    170106end
    171107
    172 # $ns_regPAGE = 0
    173 # $ns_burnPAGE = 0
    174 # $ns_RburnPAGE = 0
    175 # $ns_RburnCELL = 0
    176 # $ns_chipPAGE = 0
    177 # $ns_RchipPAGE = 0
     108macro ns.stacks.confirm.on
     109  task ns.stacks.confirm
     110    active true
     111  end
     112end
     113
     114macro ns.stacks.confirm.off
     115  task ns.stacks.confirm
     116    active false
     117  end
     118end
     119
     120
    178121$ns_stackPAGE = 0
    179122$ns_RstackPAGE = 0
     
    183126
    184127book init nsData
     128book init nsDiffs
     129book init nsStacks
    185130#
    186131# Macros to control the book.
    187132#
    188133macro ns.add.date
     134  if ($0 != 2)
     135    echo "USAGE: ns.add.date (YYYY-MM-DD)"
     136    break
     137  end
     138
    189139   book newpage nsData $1
    190140   book setword nsData $1 nsState NEW
    191    book setword nsData $1 nsStackState TOWARP
    192    book setword nsData $1 nsDiffState TOWARP
     141   book setword nsData $1 dbname $DB:0
     142
     143   book newpage nsDiffs $1
     144   book setword nsDiffs $1 nsDiffState TOWARP
     145   book setword nsDiffs $1 nsObservingState UNKNOWN
     146
     147   book newpage nsStacks $1
     148   book setword nsStacks $1 nsStackState TOWARP
     149
    193150end
    194151
     
    198155       book getpage nsData $i -var date
    199156       book getword nsData $date nsState -var state
    200        book getword nsData $date nsStackState -var Sstate
    201        book getword nsData $date nsDiffState -var Dstate
    202        book getword nsData $date nsObservingState -var Ostate
     157       book getword nsStacks $date nsStackState -var Sstate
     158       book getword nsDiffs $date nsDiffState -var Dstate
     159       book getword nsDiffs $date nsObservingState -var Ostate
    203160       echo $date $state $Sstate $Dstate $Ostate
    204161    end
     
    212169    book setword nsData $1 nsState $2
    213170end
    214 
    215171
    216172
     
    232188    book newpage nsData $today
    233189    book setword nsData $today nsState NEW
    234     book setword nsData $today nsStackState TOWARP
    235     book setword nsData $today nsDiffState TOWARP
     190    book newpage nsStacks $today
     191    book setword nsStacks $today nsStackState TOWARP
     192    book newpage nsDiffs $today
     193    book setword nsDiffs $today nsDiffState TOWARP
    236194    book setword nsData $today dbname $DB:0
    237195
    238196#    command echo $today
    239    command nightly_science.pl --clean_old --date $today --dbname $DB:0
     197   $run = nightly_science.pl --clean_old --date $today --dbname $DB:0
     198#    add_standard_args run
     199    command $run
    240200  end
    241201
     
    272232    $today = `date -u +%Y-%m-%d`
    273233
    274     command nightly_science.pl --queue_detrends --date $today --dbname $DB:0
    275     add_standard_args
     234    $run = nightly_science.pl --queue_detrends --date $today --dbname $DB:0
     235#     add_standard_args $run
     236     command $run
    276237  end
    277238 
     
    309270    $today = `date -u +%Y-%m-%d`
    310271
    311     command nightly_science.pl --queue_dqstats --date $today --dbname $DB:0
    312     add_standard_args
     272    $run = nightly_science.pl --queue_dqstats --date $today --dbname $DB:0
     273#     add_standard_args $run
     274     command $run
     275
    313276  end
    314277
     
    333296#
    334297task              ns.stacks.load
     298  active          false
    335299  host            local
    336300  periods         -poll $LOADPOLL
     
    344308
    345309     book getpage nsData $ns_stackPAGE -var date
    346      book getword nsData $date nsStackState -var ns_STATE
    347      book getword nsData $date dbname -var $DBNAME
     310     book getword nsStacks $date nsStackState -var ns_STATE
     311     book getword nsDiffs $date nsDiffState -var ns_diff_STATE
     312     book getword nsData $date dbname -var DBNAME
    348313     book npages nsData -var Npages
    349314
     
    358323     if ("$ns_STATE" != "TOWARP") break
    359324
    360      $run = nightly_science.pl --check_stacks --date $date
    361      add_standard_args
     325     $run = nightly_science.pl --check_stacks --date $date --dbname $DBNAME
     326#     add_standard_args $run
    362327     command $run
    363328
     
    367332  task.exit   0
    368333#    convert 'stdout' to book format
    369     book delpage nsData $options:0
    370     ipptool2book stdout nsData -uniq -key date
    371 
    372     book getword nsData $options:0 nsNmacros -var ns_Nmacros
     334    book delpage nsStacks $options:0
     335    ipptool2book stdout nsStacks -uniq -key date
     336
     337    book getword nsStacks $options:0 nsNmacros -var ns_Nmacros
    373338    if ("$ns_Nmacros" != "NULL")
    374339        for i 0 $ns_Nmacros
    375340            sprintf macroName "ns%dMacro" $i
    376             book getword nsData $options:0 $macroName -var macroCmd
     341            book getword nsStacks $options:0 $macroName -var macroCmd
    377342            $macroCmd
    378343        end
     
    413378
    414379     book getpage nsData $ns_RstackPAGE -var date
    415      book getword nsData $date nsStackState -var ns_STATE
    416      book getword nsData $date dbname -var $DBNAME
     380     book getword nsStacks $date nsStackState -var ns_STATE
     381     book getword nsDiffs $date nsDiffState -var ns_diff_STATE
     382     book getword nsData $date dbname -var DBNAME
    417383     book npages nsData -var Npages
    418384
     
    425391     option $date
    426392
    427      if (("$ns_STATE" != "QUEUESTACKS")&&("$ns_STATE" != "TOWARP")&&("$ns_STATE" != "FORCETOWARP")) break
    428      $run = nightly_science.pl --queue_stacks --date $date
    429      add_standard_args
     393     if (("$ns_STATE" != "STACKING")&&("$ns_STATE" != "TOWARP")&&("$ns_STATE" != "FORCETOWARP")) break
     394     $run = nightly_science.pl --queue_stacks --date $date --dbname $DBNAME
     395#     add_standard_args $run
    430396     command $run
    431397   end
     
    433399  task.exit   0
    434400#    convert 'stdout' to book format
    435     book delpage nsData $options:0
     401    book delpage nsStacks $options:0
    436402# We've queued up stacking. We're done with this date, so don't reload the page.
    437     ipptool2book stdout nsData -uniq -key date
    438 
    439     book getword nsData $options:0 nsNmacros -var ns_Nmacros
     403    ipptool2book stdout nsStacks -uniq -key date
     404
     405    book getword nsStacks $options:0 nsNmacros -var ns_Nmacros
    440406    if ("$ns_Nmacros" != "NULL")
    441407        for i 0 $ns_Nmacros
    442408            sprintf macroName "ns%dMacro" $i
    443             book getword nsData $options:0 $macroName -var macroCmd
     409            book getword nsStacks $options:0 $macroName -var macroCmd
    444410            $macroCmd
    445411        end
     
    468434#
    469435task              ns.stacks.confirm
     436  active          false
    470437  host            local
    471438  periods         -poll $LOADPOLL
     
    479446
    480447     book getpage nsData $ns_CstackPAGE -var date
    481      book getword nsData $date nsStackState -var ns_STATE
    482      book getword nsData $date dbname -var $DBNAME
     448     book getword nsStacks $date nsStackState -var ns_STATE
     449     book getword nsData $date dbname -var DBNAME
    483450     book npages nsData -var Npages
    484451
     
    492459
    493460     if ("$ns_STATE" != "STACKING") break
    494      $run = nightly_science.pl --confirm_stacks --date $date
    495      add_standard_args
     461     $run = nightly_science.pl --confirm_stacks --date $date --dbname $DBNAME
     462#     add_standard_args $run
    496463     command $run
    497464   end
     
    499466  task.exit   0
    500467#    convert 'stdout' to book format
    501     book delpage nsData $options:0
    502     ipptool2book stdout nsData -uniq -key date
    503 
    504     book getword nsData $options:0 nsNmacros -var ns_Nmacros
     468    book delpage nsStacks $options:0
     469    ipptool2book stdout nsStacks -uniq -key date
     470
     471    book getword nsStacks $options:0 nsNmacros -var ns_Nmacros
    505472    if ("$ns_Nmacros" != "NULL")
    506473        for i 0 $ns_Nmacros
    507474            sprintf macroName "ns%dMacro" $i
    508             book getword nsData $options:0 $macroName -var macroCmd
     475            book getword nsStacks $options:0 $macroName -var macroCmd
    509476            $macroCmd
    510477        end
     
    534501#
    535502task              ns.diffs.load
     503  active          false
    536504  host            local
    537505  periods         -poll $LOADPOLL
     
    545513
    546514     book getpage nsData $ns_diffPAGE -var date
    547      book getword nsData $date nsDiffState -var ns_STATE
    548      book getword nsData $date dbname -var $DBNAME
     515     book getword nsDiffs $date nsDiffState -var ns_STATE
     516     book getword nsStacks $date nsStackState -var ns_stack_STATE
     517     book getword nsData $date dbname -var DBNAME
    549518     book npages nsData -var Npages
    550519
     
    558527
    559528     if ("$ns_STATE" != "TOWARP") break
    560      $run = nightly_science.pl --check_diffs --date $date
    561      add_standard_args
     529     $run = nightly_science.pl --check_diffs --date $date --dbname $DBNAME
     530#     add_standard_args $run
    562531     command $run
    563532   end
     
    566535  task.exit   0
    567536#    convert 'stdout' to book format
    568     book delpage nsData $options:0
    569     ipptool2book stdout nsData -uniq -key date
    570 
    571     book getword nsData $options:0 nsNmacros -var ns_Nmacros
     537    book delpage nsDiffs $options:0
     538    ipptool2book stdout nsDiffs -uniq -key date
     539
     540    book getword nsDiffs $options:0 nsNmacros -var ns_Nmacros
    572541    if ("$ns_Nmacros" != "NULL")
    573542        for i 0 $ns_Nmacros
    574543            sprintf macroName "ns%dMacro" $i
    575             book getword nsData $options:0 $macroName -var macroCmd
     544            book getword nsDiffs $options:0 $macroName -var macroCmd
    576545            $macroCmd
    577546        end
     
    604573  periods         -poll $LOADPOLL
    605574  periods         -exec $LOADEXEC
    606   periods         -timeout 120
     575  periods         -timeout 900
    607576  npending        1
    608577
     
    612581
    613582     book getpage nsData $ns_RdiffPAGE -var date
    614      book getword nsData $date nsDiffState -var ns_STATE
    615      book getword nsData $date dbname -var $DBNAME
     583     book getword nsDiffs $date nsDiffState -var ns_STATE
     584     book getword nsStacks $date nsStackState -var ns_stack_STATE
     585     book getword nsData $date dbname -var DBNAME
    616586     book npages nsData -var Npages
    617587
     
    624594     option $date
    625595
    626      if (("$ns_STATE" != "QUEUEDIFFS")&&("$ns_STATE" != "TOWARP")&&("$ns_STATE" != "FORCETOWARP")) break
    627      $run = nightly_science.pl --queue_diffs --date $date
    628      add_standard_args
     596     if (("$ns_STATE" != "DIFFING")&&("$ns_STATE" != "QUEUEDIFFS")&&("$ns_STATE" != "TOWARP")&&("$ns_STATE" != "FORCETOWARP")) break
     597     $run = nightly_science.pl --queue_diffs --date $date --dbname $DBNAME
     598#     add_standard_args $run
    629599     command $run
    630600   end
     
    632602  task.exit   0
    633603#    convert 'stdout' to book format
    634     book delpage nsData $options:0
     604    book delpage nsDiffs $options:0
    635605# We've queued up diffing. We're done with this date, so don't reload the page.
    636     ipptool2book stdout nsData -uniq -key date
    637 
    638     book getword nsData $options:0 nsNmacros -var ns_Nmacros
     606    ipptool2book stdout nsDiffs -uniq -key date
     607
     608    book getword nsDiffs $options:0 nsNmacros -var ns_Nmacros
    639609    if ("$ns_Nmacros" != "NULL")
    640610        for i 0 $ns_Nmacros
    641611            sprintf macroName "ns%dMacro" $i
    642             book getword nsData $options:0 $macroName -var macroCmd
     612            book getword nsDiffs $options:0 $macroName -var macroCmd
    643613            $macroCmd
    644614        end
  • branches/czw_branch/20101203/ippTasks/pstamp.pro

    r29719 r30586  
    148148end
    149149
     150macro pstamp.status.on
     151    task pstamp.save.status
     152        active true
     153    end
     154end
     155macro pstamp.status.off
     156    task pstamp.save.status
     157        active false
     158    end
     159end
     160macro pstamp.status.set.exec
     161    task pstamp.save.status
     162        periods -exec $1
     163    end
     164end
     165
    150166task pstamp.request.find
    151167    host        local
     
    258274        book getword pstampRequest $pageName ds_outProduct -var PRODUCT
    259275        book getword pstampRequest $pageName outdir -var OUTDIR
     276        book getword pstampRequest $pageName need_magic -var NEED_MAGIC
    260277        book getword pstampRequest $pageName label -var LABEL
    261278
     
    263280
    264281        $run = pstamp_parser_run.pl --req_id $REQ_ID --uri $URI --product $PRODUCT --outdir $OUTDIR --label $LABEL --redirect-output
     282
     283        if ($NEED_MAGIC != 0)
     284            $run = $run --need_magic
     285        end
    265286
    266287        add_standard_args run
     
    900921    end
    901922end
     923
     924task pstamp.save.status
     925    host        local
     926
     927    periods     -poll $LOADPOLL
     928    periods     -exec 90
     929    periods     -timeout 20
     930    npending    1
     931
     932    task.exec
     933        stdout NULL
     934        stderr $LOGSUBDIR/pstamp.save.status.log
     935
     936        $run = pstamp_save_server_status.pl --update-link
     937        command $run
     938    end
     939
     940    task.exit $EXIT_SUCCESS
     941        # echo nothing to do
     942    end
     943
     944    task.exit   default
     945        showcommand failure
     946    end
     947
     948    task.exit   crash
     949        showcommand crash
     950    end
     951
     952    task.exit   timeout
     953        showcommand timeout
     954    end
     955end
  • branches/czw_branch/20101203/ippTasks/publish.pro

    r30118 r30586  
    7979    end
    8080    add_poll_args run
     81    add_poll_labels run
    8182    command $run
    8283  end
     
    131132    book getword publishRun $pageName dbname -var DBNAME
    132133    book getword publishRun $pageName output_format -var OUTPUT_FORMAT
     134    book getword publishRun $pageName need_magic -var NEED_MAGIC
    133135
    134136    stdout $LOGDIR/publish.run.log
     
    139141
    140142    $run = publish_file.pl --pub_id $PUB_ID --camera $CAMERA --workdir $WORKDIR --product $PRODUCT --stage $STAGE --stage_id $STAGE_ID --output_format $OUTPUT_FORMAT --redirect-output
     143
     144    if ("$NEED_MAGIC" == "T")
     145        $run = $run --need-magic
     146    end
     147
    141148    add_standard_args run
    142149
  • branches/czw_branch/20101203/ippTasks/rcserver.pro

    r28792 r30586  
    136136
    137137    sprintf logfile "%s/makefs.%s.%s.log" $DIST_DIR $DIST_ID $DEST_ID
    138     stdout $logfile
    139     stderr $logfile
    140138
    141139    book setword rcPendingFS $pageName pantaskState RUN
    142140
    143     $run = dist_make_fileset.pl --dist_id $DIST_ID --target_id $TARGET_ID --stage $STAGE --stage_id $STAGE_ID --data_group $DATA_GROUP --filter $FILTER --dest_id $DEST_ID --product_name $PRODUCT_NAME  --ds_dbhost $DS_DBHOST --ds_dbname $DS_DBNAME --dist_dir $DIST_DIR
     141    $run = dist_make_fileset.pl --dist_id $DIST_ID --target_id $TARGET_ID --stage $STAGE --stage_id $STAGE_ID --data_group $DATA_GROUP --filter $FILTER --dest_id $DEST_ID --product_name $PRODUCT_NAME  --ds_dbhost $DS_DBHOST --ds_dbname $DS_DBNAME --dist_dir $DIST_DIR --logfile $logfile
    144142
    145143    add_standard_args run
  • branches/czw_branch/20101203/ippTasks/register.pro

    r30118 r30586  
    99book init regPendingExp
    1010book init regPendingBurntoolImfile
     11book init regDates
    1112
    1213macro register.reset
     
    1415  book init regPendingExp
    1516  book init regPendingBurntoolImfile
     17  book init regDates
    1618end
    1719
     
    2123  book listbook regPendingExp
    2224  book listbook regPendingBurntoolImfile
     25  book listbook regDates
    2326end
    2427
     
    3033    active true
    3134  end
     35  task register.imfile.revert
     36    active false
     37  end
    3238  task register.exp.load
    3339    active true
     
    5157    active false
    5258  end
     59  task register.imfile.revert
     60    active false
     61  end
    5362  task register.exp.load
    5463    active false
     
    6574end
    6675
    67 $valid_burntool_value = 14
     76macro register.revert.on
     77  task register.imfile.revert
     78    active true
     79  end
     80end
     81
     82macro register.revert.off
     83  task register.imfile.revert
     84    active false
     85  end
     86end
     87
     88macro burntool.on
     89  task register.burntool.load
     90    active true
     91  end
     92  task register.burntool.run
     93    active true
     94  end
     95end
     96
     97macro burntool.off
     98  task register.burntool.load
     99    active false
     100  end
     101  task register.burntool.run
     102    active false
     103  end
     104end
     105
     106macro register.add.date
     107  if ($0 != 4)
     108    echo "USAGE: register.add.date (YYYY-MM-DD) (DBNAME) (VALID_BURNTOOL)"
     109    break
     110  end
     111
     112   book newpage regDates $1
     113   book setword regDates $1 nsState NEW
     114   book setword regDates $1 dbname $2
     115   book setword regDates $1 valid_burntool $3
     116end
     117
     118
     119# $valid_burntool_value = 14
     120$sunrise = 17:30:00
     121$sunset  = 03:30:00
    68122
    69123macro replace.survey.values
     
    147201$regPendingImfile_DB = 0
    148202$regPendingBurntoolImfile_DB = 0
     203$regRevertImfile_DB = 0
    149204$regPendingExp_DB = 0
    150205
     
    265320    # XXX register_imfile.pl differs from the standard script : it does not have an 'outroot' argument, and it does not take '--redirect'
    266321    $run = register_imfile.pl --exp_id $EXP_ID --tmp_class_id $TMP_CLASS_ID --tmp_exp_name $TMP_EXP_NAME --uri $URI --logfile $logfile --bytes $BYTES --md5sum $MD5SUM
     322    $run = $run --sunset $sunset --sunrise $sunrise
    267323    add_standard_args run
    268324
     
    295351  end
    296352end
     353
     354task register.imfile.revert
     355  host         local
     356  periods      -poll 60.0
     357  periods      -exec 1800.0
     358  periods      -timeout 120.0
     359  npending     1
     360
     361  stdout       NULL
     362  stderr       $LOGDIR/register.imfile.revert.log
     363
     364  task.exec
     365    $run = regtool -revertprocessedimfile
     366    if ($DB:n == 0)
     367      option DEFAULT
     368    else
     369      option $DB:$regRevertImfile_DB
     370      $run = $run -dbname $DB:$regRevertImfile_DB
     371      $regRevertImfile_DB ++
     372      if ($regRevertImfile_DB >= $DB:n) set regRevertImfile_DB = 0
     373    end
     374    add_poll_args run
     375    command $run
     376  end
     377
     378  # success
     379  task.exit    0
     380  end
     381
     382  # locked list
     383  task.exit    default
     384    showcommand failure
     385  end
     386
     387  task.exit    crash
     388    showcommand crash
     389  end
     390
     391  # operation times out
     392  task.exit    timeout
     393    showcommand timeout
     394  end
     395end
     396
    297397
    298398# select exposures ready for register_exp.pl
     
    463563  # select entried from the current DB; cycle to the next DB, if it exists
    464564  task.exec
     565     book npages regDates -var Npages
     566     if ($Npages == 0)
     567       $today = `date -u +%Y-%m-%d`
     568       $dbname = $DB:0
     569       $valid_burntool = 14
     570     else
     571       book getpage regDates $reg_datePAGE -var today
     572       book getword regDates $today dbname -var dbname
     573       book getword regDates $today valid_burntool -var valid_burntool
     574       $reg_datePAGE ++
     575       if ($reg_datePAGE >= $Npages) set reg_datePAGE = 0
     576     end
     577
    465578    $run = regtool -pendingburntoolimfile
    466     $today = `date -u +%Y-%m-%d`
     579
    467580# debugging purposes
    468 #    $today = "2010-12-06"
    469     $run = $run -date $today -valid_burntool $valid_burntool_value
    470     if ($DB:n == 0)
    471       option DEFAULT
    472     else
    473       # save the DB name for the exit tasks
    474       option $DB:$regPendingBurntoolImfile_DB
    475       $run = $run -dbname $DB:$regPendingBurntoolImfile_DB
    476       $regPendingBurntoolImfile_DB ++
    477       if ($regPendingBurntoolImfile_DB >= $DB:n) set regPendingBurntoolImfile_DB = 0
    478     end
     581#   $today = "2010-12-25"
     582    $dateobs_begin = $today\T$sunset
     583    $dateobs_end   = $today\T$sunrise
     584    $run = $run -dateobs_begin $dateobs_begin -dateobs_end $dateobs_end -valid_burntool $valid_burntool
     585    $run = $run -dbname $dbname
     586    option $dbname
     587#     if ($DB:n == 0)
     588#       option DEFAULT
     589#     else
     590#       # save the DB name for the exit tasks
     591#       option $DB:$regPendingBurntoolImfile_DB
     592#       $run = $run -dbname $DB:$regPendingBurntoolImfile_DB
     593#       if ("$dbname" != "$DB:$regPendingBurntoolImfile_DB")
     594#         break
     595#       end
     596#       $regPendingBurntoolImfile_DB ++
     597#       if ($regPendingBurntoolImfile_DB >= $DB:n) set regPendingBurntoolImfile_DB = 0
     598#     end
    479599
    480600#    echo $run
     
    574694end
    575695
    576    
     696task   register.initday.load
     697  host            local
     698  periods         -poll $LOADPOLL
     699  periods         -exec $LOADEXEC
     700  periods         -timeout 30
     701  trange          0:00:00 1:00:00 -nmax 1
     702  npending        1
     703
     704  task.exec
     705    $today = `date -u +%Y-%m-%d`
     706    book newpage regDates $today
     707    book setword regDates $today nsState NEW
     708    book setword regDates $today dbname $DB:0
     709    book setword regDates $today valid_burntool 14
     710
     711    command true
     712  end
     713
     714  task.exit       0
     715    # nothing to do here?
     716  end
     717  # locked list
     718  task.exit    default
     719    showcommand failure
     720  end
     721  task.exit    crash
     722    showcommand crash
     723  end
     724  #operation times out?
     725  task.exit    timeout
     726    showcommand timeout
     727  end
     728end
     729
    577730   
    578731 
  • branches/czw_branch/20101203/ippTasks/survey.pro

    r29768 r30586  
    259259# user functions to manipulate destreak labels
    260260macro survey.add.destreak
    261   if ($0 != 3)
    262     echo "USAGE: survey.add.destreak (label) (workdir base)"
     261  if ($0 != 4)
     262    echo "USAGE: survey.add.destreak (label) (workdir base) (recovery root)"
    263263    break
    264264  end
    265265  book newpage SURVEY_DESTREAK $1
    266266  book setword SURVEY_DESTREAK $1 WORKDIR $2
     267  book setword SURVEY_DESTREAK $1 RECOVERYROOT $3
    267268  book setword SURVEY_DESTREAK $1 STATE PENDING
    268269end
     
    286287# user functions to manipulate dist labels
    287288macro survey.add.dist
    288   if ($0 != 2)
    289     echo "USAGE: survey.add.dist (label)"
     289  if ($0 != 3)
     290    echo "USAGE: survey.add.dist (label) (workdir)"
    290291    break
    291292  end
    292293  book newpage SURVEY_DIST $1
     294  book setword SURVEY_DIST $1 WORKDIR $2
    293295  book setword SURVEY_DIST $1 STATE PENDING
    294296end
     
    366368# user functions to manipulate publish labels
    367369macro survey.add.publish
    368   if ($0 != 3)
    369     echo "USAGE: survey.add.publish (label) (client_id)"
     370  if ($0 != 5)
     371    echo "USAGE: survey.add.publish (tag) (label) (client_id) (comment)"
    370372    break
    371373  end
    372374  book newpage SURVEY_PUBLISH $1
    373   book setword SURVEY_PUBLISH $1 CLIENT_ID $2
     375  book setword SURVEY_PUBLISH $1 LABEL $2
     376  book setword SURVEY_PUBLISH $1 CLIENT_ID $3
     377  book setword SURVEY_PUBLISH $1 COMMENT $4
    374378  book setword SURVEY_PUBLISH $1 STATE PENDING
    375379end
     
    821825    book setword SURVEY_DESTREAK $label STATE DONE
    822826    book getword SURVEY_DESTREAK $label WORKDIR -var workdir
     827    book getword SURVEY_DESTREAK $label RECOVERYROOT -var recoveryroot
    823828 
    824829    $run = magic_destreak_defineruns.pl --label $label --workdir $workdir/$label
     830    if ("$recoveryroot" != "NULL")
     831        $run = $run --recoveryroot $recoveryroot/$label
     832    end
    825833
    826834    if ($DB:n == 0)
     
    889897    end
    890898
     899    book getword SURVEY_DIST $label WORKDIR -var workdir_base
     900    $year = `date +%Y`
     901    $month = `date +%m`
     902    $day = `date +%d`
     903    $workdir = $workdir_base/$label/$year/$month/$day
     904
    891905    book setword SURVEY_DIST $label STATE DONE
    892906 
    893907    # note workdir is set by the script based on site.config
    894     $run = dist_defineruns.pl --label $label
     908    $run = dist_defineruns.pl --label $label --workdir $workdir
    895909
    896910    if ($DB:n == 0)
     
    901915    end
    902916   
    903 #    echo $run
     917    if ($VERBOSE > 1 )
     918        echo $run
     919    end
    904920    command $run
    905921  end
     
    10841100    endif
    10851101
    1086     book getpage SURVEY_PUBLISH 0 -var label -key STATE NEW
    1087     if ("$label" == "NULL")
    1088       # All labels have been done --- reset
    1089       # echo "Resetting labels"
     1102    # survey.publish allows multiple entries per label.
     1103    # The key is called tag and must be unique
     1104    book getpage SURVEY_PUBLISH 0 -var tag -key STATE NEW
     1105    if ("$tag" == "NULL")
     1106      # All tags have been done --- reset
     1107      # echo "Resetting tags"
    10901108      for i 0 $N
    1091         book getpage SURVEY_PUBLISH $i -var label
    1092         book setword SURVEY_PUBLISH $label STATE NEW
     1109        book getpage SURVEY_PUBLISH $i -var tag
     1110        book setword SURVEY_PUBLISH $tag STATE NEW
    10931111      end
    1094       book getpage SURVEY_PUBLISH 0 -var label -key STATE NEW
     1112      book getpage SURVEY_PUBLISH 0 -var tag -key STATE NEW
    10951113
    10961114      # Select different database
     
    10991117    end
    11001118
    1101     book setword SURVEY_PUBLISH $label STATE DONE
    1102     book getword SURVEY_PUBLISH $label CLIENT_ID -var client_id
     1119    book setword SURVEY_PUBLISH $tag STATE DONE
     1120    book getword SURVEY_PUBLISH $tag LABEL -var label
     1121    book getword SURVEY_PUBLISH $tag CLIENT_ID -var client_id
     1122    book getword SURVEY_PUBLISH $tag COMMENT -var comment
    11031123 
    11041124    $run = pubtool -definerun -label $label -client_id $client_id
     1125
     1126    if ("$comment" != "NULL")
     1127        $run = $run -comment $comment
     1128    end
    11051129
    11061130    if ($DB:n == 0)
     
    11111135    end
    11121136   
    1113     #echo $run
     1137    echo $run
     1138
    11141139    command $run
     1140   
    11151141  end
    11161142
  • branches/czw_branch/20101203/ippToPsps/config/detection/map.xml

    r28638 r30586  
    11<?xml version="1.0" encoding="UTF-8"?>
    22
    3 <tabledata>
    4 
    5  <table name="FrameMeta">
    6   <map ippName="ZPT_ERR" ippType="TFLOAT" pspsName="photoScat" />
    7   <map ippName="MJD-OBS" ippType="TDOUBLE" pspsName="expStart" />
    8   <map ippName="EXPREQ" ippType="TFLOAT" pspsName="expTime" />
    9   <map ippName="AIRMASS" ippType="TFLOAT" pspsName="airmass" />
    10   <map ippName="RA" ippType="TDOUBLE" pspsName="raBore" />
    11   <map ippName="DEC" ippType="TDOUBLE" pspsName="decBore" />
    12   <map ippName="CTYPE1" ippType="TSTRING" pspsName="ctype1" />
    13   <map ippName="CTYPE2" ippType="TSTRING" pspsName="ctype2" />
    14   <map ippName="CRVAL1" ippType="TDOUBLE" pspsName="crval1" />
    15   <map ippName="CRVAL2" ippType="TDOUBLE" pspsName="crval2" />
    16   <map ippName="CRPIX1" ippType="TDOUBLE" pspsName="crpix1" />
    17   <map ippName="CRPIX2" ippType="TDOUBLE" pspsName="crpix2" />
    18   <map ippName="CDELT1" ippType="TDOUBLE" pspsName="cdelt1" />
    19   <map ippName="CDELT2" ippType="TDOUBLE" pspsName="cdelt2" />
    20   <map ippName="PC001001" ippType="TDOUBLE" pspsName="pc001001" />
    21   <map ippName="PC001002" ippType="TDOUBLE" pspsName="pc001002" />
    22   <map ippName="PC002001" ippType="TDOUBLE" pspsName="pc002001" />
    23   <map ippName="PC002002" ippType="TDOUBLE" pspsName="pc002002" />
    24   <map ippName="NPLYTERM" ippType="TBYTE" pspsName="polyOrder" />
    25   <map ippName="PCA1X3Y0" ippType="TDOUBLE" pspsName="pca1x3y0" />
    26   <map ippName="PCA1X2Y1" ippType="TDOUBLE" pspsName="pca1x2y1" />
    27   <map ippName="PCA1X1Y2" ippType="TDOUBLE" pspsName="pca1x1y2" />
    28   <map ippName="PCA1X0Y3" ippType="TDOUBLE" pspsName="pca1x0y3" />
    29   <map ippName="PCA1X2Y0" ippType="TDOUBLE" pspsName="pca1x2y0" />
    30   <map ippName="PCA1X1Y1" ippType="TDOUBLE" pspsName="pca1x1y1" />
    31   <map ippName="PCA1X0Y2" ippType="TDOUBLE" pspsName="pca1x0y2" />
    32   <map ippName="PCA2X3Y0" ippType="TDOUBLE" pspsName="pca2x3y0" />
    33   <map ippName="PCA2X2Y1" ippType="TDOUBLE" pspsName="pca2x2y1" />
    34   <map ippName="PCA2X1Y2" ippType="TDOUBLE" pspsName="pca2x1y2" />
    35   <map ippName="PCA2X0Y3" ippType="TDOUBLE" pspsName="pca2x0y3" />
    36   <map ippName="PCA2X2Y0" ippType="TDOUBLE" pspsName="pca2x2y0" />
    37   <map ippName="PCA2X1Y1" ippType="TDOUBLE" pspsName="pca2x1y1" />
    38   <map ippName="PCA2X0Y2" ippType="TDOUBLE" pspsName="pca2x0y2" />
    39  </table>
    40 
    41  <table name="ImageMeta">
    42   <map ippName="MSKY_MN" ippType="TFLOAT" pspsName="sky" />
    43   <map ippName="MSKY_SIG" ippType="TFLOAT" pspsName="skyScat" />
    44   <map ippName="FSATUR" ippType="TFLOAT" pspsName="magSat" />
    45   <map ippName="FLIMIT" ippType="TFLOAT" pspsName="completMag" />
    46   <map ippName="CERROR" ippType="TFLOAT" pspsName="astroScat" />
    47   <map ippName="NASTRO" ippType="TLONG" pspsName="numAstroRef" />
    48   <map ippName="NASTRO" ippType="TLONG" pspsName="numPhotoRef" />
    49   <map ippName="CNAXIS1" ippType="TSHORT" pspsName="nx" />
    50   <map ippName="CNAXIS2" ippType="TSHORT" pspsName="ny" />
    51   <map ippName="FWHM_MAJ" ippType="TFLOAT" pspsName="psfWidMajor" />
    52   <map ippName="FWHM_MIN" ippType="TFLOAT" pspsName="psfWidMinor" />
    53   <map ippName="ANGLE" ippType="TFLOAT" pspsName="psfTheta" />
    54   <map ippName="IQ_FW1" ippType="TFLOAT" pspsName="momentWidMajor" />
    55   <map ippName="IQ_FW2" ippType="TFLOAT" pspsName="momentWidMinor" />
    56   <map ippName="APMIFIT" ippType="TFLOAT" pspsName="apResid" />
    57   <map ippName="DAPMIFIT" ippType="TFLOAT" pspsName="dapResid" />
    58   <map ippName="DETECTOR" ippType="TSTRING" pspsName="detectorID" />
    59   <map ippName="DETREND.MASK" ippType="TSTRING" pspsName="detrend1" />
    60   <map ippName="DETREND.DARK" ippType="TSTRING" pspsName="detrend2" />
    61   <map ippName="DETREND.FLAT" ippType="TSTRING" pspsName="detrend3" />
    62   <map ippName="DETREND.FRINGE" ippType="TSTRING" pspsName="detrend4" />
    63   <map ippName="CTYPE1" ippType="TSTRING" pspsName="ctype1" />
    64   <map ippName="CTYPE2" ippType="TSTRING" pspsName="ctype2" />
    65   <map ippName="CRVAL1" ippType="TDOUBLE" pspsName="crval1" />
    66   <map ippName="CRVAL2" ippType="TDOUBLE" pspsName="crval2" />
    67   <map ippName="CRPIX1" ippType="TDOUBLE" pspsName="crpix1" />
    68   <map ippName="CRPIX2" ippType="TDOUBLE" pspsName="crpix2" />
    69   <map ippName="CDELT1" ippType="TDOUBLE" pspsName="cdelt1" />
    70   <map ippName="CDELT2" ippType="TDOUBLE" pspsName="cdelt2" />
    71   <map ippName="PC001001" ippType="TDOUBLE" pspsName="pc001001" />
    72   <map ippName="PC001002" ippType="TDOUBLE" pspsName="pc001002" />
    73   <map ippName="PC002001" ippType="TDOUBLE" pspsName="pc002001" />
    74   <map ippName="PC002002" ippType="TDOUBLE" pspsName="pc002002" />
    75   <map ippName="NPLYTERM" ippType="TBYTE" pspsName="polyOrder" />
    76   <map ippName="PCA1X3Y0" ippType="TDOUBLE" pspsName="pca1x3y0" />
    77   <map ippName="PCA1X2Y1" ippType="TDOUBLE" pspsName="pca1x2y1" />
    78   <map ippName="PCA1X1Y2" ippType="TDOUBLE" pspsName="pca1x1y2" />
    79   <map ippName="PCA1X0Y3" ippType="TDOUBLE" pspsName="pca1x0y3" />
    80   <map ippName="PCA1X2Y0" ippType="TDOUBLE" pspsName="pca1x2y0" />
    81   <map ippName="PCA1X1Y1" ippType="TDOUBLE" pspsName="pca1x1y1" />
    82   <map ippName="PCA1X0Y2" ippType="TDOUBLE" pspsName="pca1x0y2" />
    83   <map ippName="PCA2X3Y0" ippType="TDOUBLE" pspsName="pca2x3y0" />
    84   <map ippName="PCA2X2Y1" ippType="TDOUBLE" pspsName="pca2x2y1" />
    85   <map ippName="PCA2X1Y2" ippType="TDOUBLE" pspsName="pca2x1y2" />
    86   <map ippName="PCA2X0Y3" ippType="TDOUBLE" pspsName="pca2x0y3" />
    87   <map ippName="PCA2X2Y0" ippType="TDOUBLE" pspsName="pca2x2y0" />
    88   <map ippName="PCA2X1Y1" ippType="TDOUBLE" pspsName="pca2x1y1" />
    89   <map ippName="PCA2X0Y2" ippType="TDOUBLE" pspsName="pca2x0y2" />
    90  </table>
    91 
    92  <table name="Detection">
    93   <map ippName="X_PSF" ippType="TFLOAT" pspsName="xPos" />
    94   <map ippName="Y_PSF" ippType="TFLOAT" pspsName="yPos" />
    95   <map ippName="X_PSF_SIG" ippType="TFLOAT" pspsName="xPosErr" />
    96   <map ippName="Y_PSF_SIG" ippType="TFLOAT" pspsName="yPosErr" />
    97   <map ippName="PSF_MAJOR" ippType="TFLOAT" pspsName="psfWidMajor" />
    98   <map ippName="PSF_MINOR" ippType="TFLOAT" pspsName="psfWidMinor" />
    99   <map ippName="PSF_THETA" ippType="TFLOAT" pspsName="psfTheta" />
    100   <map ippName="PSF_QF" ippType="TFLOAT" pspsName="psfCf" />
    101   <map ippName="MOMENTS_XX" ippType="TFLOAT" pspsName="momentXX" />
    102   <map ippName="MOMENTS_XY" ippType="TFLOAT" pspsName="momentXY" />
    103   <map ippName="MOMENTS_YY" ippType="TFLOAT" pspsName="momentYY" />
    104   <map ippName="SKY" ippType="TFLOAT" pspsName="sky" />
    105   <map ippName="SKY_SIGMA" ippType="TFLOAT" pspsName="skyErr" />
    106   <map ippName="EXT_NSIGMA" ippType="TFLOAT" pspsName="sgSep" />
    107  </table>
    108 
     3<tabledata type="detection">
     4  <table name="FrameMeta" ippfitsextension="">
     5    <!--  DONE IN CODE <map pspsName="frameID" ippType="TLONG" ippName="" comment="unique exposure/frame identifier."/> -->
     6    <!--  DONE IN CODE <map pspsName="frameName" ippType="TSTRING" ippName="" comment="frame name provided by camera software"/> -->
     7    <!--  DONE IN CODE  <map pspsName="surveyID" ippType="TBYTE" ippName="" comment="survey flag identifier"/> -->
     8    <!--  DONE IN CODE <map pspsName="filterID" ippType="TBYTE" ippName="" comment="filter identifier"/> -->
     9    <!--  1? <map pspsName="cameraID" ippType="TSHORT" ippName="" comment="camera identifier"/> -->
     10    <!--  1? <map pspsName="cameraConfigID" ippType="TSHORT" ippName="" comment="camera configuration identifier"/> -->
     11    <!--  DONE IN CODE <map pspsName="telescopeID" ippType="TSHORT" ippName="" comment="telescope identifier"/> -->
     12    <!--  **MISSING** <map pspsName="analysisVer" ippType="TSTRING" ippName="" comment="IPP software analysis release"/> -->
     13    <!--  **MISSING** <map pspsName="p1Recip" ippType="TSTRING" ippName="" comment="IPP phase 1 MD5 Checksum"/> -->
     14    <!--  **MISSING** <map pspsName="p2Recip" ippType="TSTRING" ippName="" comment="IPP phase 2 MD5 Checksum"/> -->
     15    <!--  **MISSING** <map pspsName="p3Recip" ippType="TSTRING" ippName="" comment="IPP phase 3 MD5 Checksum"/> -->
     16    <!--  DONE IN CODE <map pspsName="nOTA" ippType="TSHORT" ippName="" comment="number of valid OTA/CCD images in this exposure"/> -->
     17          <map pspsName="photoScat" ippType="TFLOAT" ippName="ZPT_ERR" comment=" global photometric scatter (unit = mag)"/>
     18    <!--  DONE IN CODE <map pspsName="numPhotoRef" ippType="TLONG" ippName="" comment="number of photometric reference sources"/> -->
     19          <map pspsName="expStart" ippType="TDOUBLE" ippName="MJD-OBS" comment=" exposure start time in MJD (unit = day)"/>
     20          <map pspsName="expTime" ippType="TFLOAT" ippName="EXPREQ" comment=" exposure time (unit = s)"/>
     21          <map pspsName="airmass" ippType="TFLOAT" ippName="AIRMASS" comment="airmass at mid-exposure"/>
     22          <map pspsName="raBore" ippType="TDOUBLE" ippName="RA" comment=" RA of telescope boresight (unit = deg)"/>
     23          <map pspsName="decBore" ippType="TDOUBLE" ippName="DEC" comment=" DEC of telescope boresight (unit = deg)"/>
     24          <map pspsName="ctype1" ippType="TSTRING" ippName="CTYPE1" comment="name of astrometric projection in RA"/>
     25          <map pspsName="ctype2" ippType="TSTRING" ippName="CTYPE2" comment="name of astrometric projection in DEC"/>
     26          <map pspsName="crval1" ippType="TDOUBLE" ippName="CRVAL1" comment=" RA corresponding to reference pixel (unit = deg)"/>
     27          <map pspsName="crval2" ippType="TDOUBLE" ippName="CRVAL2" comment=" DEC corresponding to reference pixel (unit = deg)"/>
     28          <map pspsName="crpix1" ippType="TDOUBLE" ippName="CRPIX1" comment="reference pixel value for RA"/>
     29          <map pspsName="crpix2" ippType="TDOUBLE" ippName="CRPIX2" comment="reference pixel value for DEC"/>
     30          <map pspsName="cdelt1" ippType="TDOUBLE" ippName="CDELT1" comment="scale factor for RA"/>
     31          <map pspsName="cdelt2" ippType="TDOUBLE" ippName="CDELT2" comment="scale factor for DEC"/>
     32          <map pspsName="pc001001" ippType="TDOUBLE" ippName="PC001001" comment="elements of rotation/Dcale matrix"/>
     33          <map pspsName="pc001002" ippType="TDOUBLE" ippName="PC001002" comment="elements of rotation/Dcale matrix"/>
     34          <map pspsName="pc002001" ippType="TDOUBLE" ippName="PC002001" comment="elements of rotation/Dcale matrix"/>
     35          <map pspsName="pc002002" ippType="TDOUBLE" ippName="PC002002" comment="elements of rotation/Dcale matrix"/>
     36          <map pspsName="polyOrder" ippType="TBYTE" ippName="NPLYTERM" comment="polynomial order of astrometry fit"/>
     37          <map pspsName="pca1x3y0" ippType="TDOUBLE" ippName="PCA1X3Y0" comment="polynomial coefficients for the astrometric fit"/>
     38          <map pspsName="pca1x2y1" ippType="TDOUBLE" ippName="PCA1X2Y1" comment="polynomial coefficients for the astrometric fit"/>
     39          <map pspsName="pca1x1y2" ippType="TDOUBLE" ippName="PCA1X1Y2" comment="polynomial coefficients for the astrometric fit"/>
     40          <map pspsName="pca1x0y3" ippType="TDOUBLE" ippName="PCA1X0Y3" comment="polynomial coefficients for the astrometric fit"/>
     41          <map pspsName="pca1x2y0" ippType="TDOUBLE" ippName="PCA1X2Y0" comment="polynomial coefficients for the astrometric fit"/>
     42          <map pspsName="pca1x1y1" ippType="TDOUBLE" ippName="PCA1X1Y1" comment="polynomial coefficients for the astrometric fit"/>
     43          <map pspsName="pca1x0y2" ippType="TDOUBLE" ippName="PCA1X0Y2" comment="polynomial coefficients for the astrometric fit"/>
     44          <map pspsName="pca2x3y0" ippType="TDOUBLE" ippName="PCA2X3Y0" comment="polynomial coefficients for the astrometric fit"/>
     45          <map pspsName="pca2x2y1" ippType="TDOUBLE" ippName="PCA2X2Y1" comment="polynomial coefficients for the astrometric fit"/>
     46          <map pspsName="pca2x1y2" ippType="TDOUBLE" ippName="PCA2X1Y2" comment="polynomial coefficients for the astrometric fit"/>
     47          <map pspsName="pca2x0y3" ippType="TDOUBLE" ippName="PCA2X0Y3" comment="polynomial coefficients for the astrometric fit"/>
     48          <map pspsName="pca2x2y0" ippType="TDOUBLE" ippName="PCA2X2Y0" comment="polynomial coefficients for the astrometric fit"/>
     49          <map pspsName="pca2x1y1" ippType="TDOUBLE" ippName="PCA2X1Y1" comment="polynomial coefficients for the astrometric fit"/>
     50          <map pspsName="pca2x0y2" ippType="TDOUBLE" ippName="PCA2X0Y2" comment="polynomial coefficients for the astrometric fit"/>
     51    <!--  **MISSING** <map pspsName="calibModNum" ippType="TSHORT" ippName="" comment="calibration modification number"/> -->
     52    <!--  **MISSING** <map pspsName="dataRelease" ippType="TBYTE" ippName="" comment="Data release"/> -->
     53  </table>
     54  <table name="ImageMeta" ippfitsextension="">
     55    <!--  DONE IN CODE <map pspsName="imageID" ippType="TLONGLONG" ippName="" comment="unique ID for each image, hashed from frameID and ccdID (ALEX)"/> -->
     56    <!--  DONE IN CODE <map pspsName="frameID" ippType="TLONG" ippName="" comment="frame identifier, also known as exposure number"/> -->
     57    <!--  DONE IN CODE <map pspsName="ccdID" ippType="TSHORT" ippName="" comment="ccd cell identifier in the focal plane"/> -->
     58    <!--  DONE IN CODE <map pspsName="photoCalID" ippType="TLONG" ippName="" comment="photometry reduction code identifier"/> -->
     59    <!--  DONE IN CODE <map pspsName="filterID" ippType="TBYTE" ippName="" comment="filter ID"/> -->
     60    <!--  **MISSING** <map pspsName="bias" ippType="TFLOAT" ippName="" comment=" detector bias level (unit = ADU)"/> -->
     61    <!--  **MISSING** <map pspsName="biasScat" ippType="TFLOAT" ippName="" comment=" scatter in bias level (unit = ADU)"/> -->
     62          <map pspsName="sky" ippType="TFLOAT" ippName="MSKY_MN" comment=" mean sky level (unit = ADU)"/>
     63          <map pspsName="skyScat" ippType="TFLOAT" ippName="MSKY_SIG" comment=" scatter in mean sky level (unit = ADU)"/>
     64    <!--  DONE IN CODE <map pspsName="nDetect" ippType="TLONG" ippName="" comment="number of detections on CCD"/> -->
     65          <map pspsName="magSat" ippType="TFLOAT" ippName="FSATUR" comment=" saturation magnitude level (unit = mag)"/>
     66          <map pspsName="completMag" ippType="TFLOAT" ippName="FLIMIT" comment=" 95% completion level in mag (unit = mag)"/>
     67          <map pspsName="astroScat" ippType="TFLOAT" ippName="CERROR" comment=" astrometric scatter for chip (unit = mag)"/>
     68    <!-- DONE IN CODE <map pspsName="photoScat" ippType="TFLOAT" ippName="" comment="photometric scatter for chip"/> -->
     69          <map pspsName="numAstroRef" ippType="TLONG" ippName="NASTRO" comment="number of astrometric reference sources"/>
     70          <map pspsName="numPhotoRef" ippType="TLONG" ippName="NASTRO" comment="number of photometric reference sources"/>
     71          <map pspsName="nx" ippType="TSHORT" ippName="CNAXIS1" comment="chip dimension in x"/>
     72          <map pspsName="ny" ippType="TSHORT" ippName="CNAXIS2" comment="chip dimension in y"/>
     73    <!--  **MISSING** <map pspsName="psfModelID" ippType="TLONG" ippName="" comment="PSF model identifier"/> -->
     74    <!--  DONE IN CODE <map pspsName="psfFwhm" ippType="TFLOAT" ippName="" comment=" model psf full width at half maximum at chip center (unit = arcsec)"/> -->
     75          <map pspsName="psfWidMajor" ippType="TFLOAT" ippName="FWHM_MAJ" comment=" model PSF parameters at chip center (unit = arcsec)"/>
     76          <map pspsName="psfWidMinor" ippType="TFLOAT" ippName="FWHM_MIN" comment=" model PSF parameters at chip center (unit = arcsec)"/>
     77          <map pspsName="psfTheta" ippType="TFLOAT" ippName="ANGLE" comment=" model PSF parameters at chip center (unit = deg)"/>
     78    <!--  DONE IN CODE <map pspsName="momentFwhm" ippType="TFLOAT" ippName="" comment=" average PSF full width at half maximum from moments (unit = arcsec)"/> -->
     79          <map pspsName="momentWidMajor" ippType="TFLOAT" ippName="IQ_FW1" comment=" average PSF parameters from moments (unit = arcsec)"/>
     80          <map pspsName="momentWidMinor" ippType="TFLOAT" ippName="IQ_FW2" comment=" average PSF parameters from moments (unit = arcsec)"/>
     81          <map pspsName="apResid" ippType="TFLOAT" ippName="APMIFIT" comment="corrected aperture residual"/>
     82          <map pspsName="dapResid" ippType="TFLOAT" ippName="DAPMIFIT" comment="scatter of aperture corrections"/>
     83          <map pspsName="detectorID" ippType="TSTRING" ippName="DETECTOR" comment="identifier for actual CCD chip"/>
     84    <!--  DONE IN CODE <map pspsName="qaFlags" ippType="TLONGLONG" ippName="" comment="Q/A flags for this OTA"/> -->
     85          <map pspsName="detrend1" ippType="TSTRING" ippName="DETREND.MASK" comment="identifier of detrend image 1"/>
     86          <map pspsName="detrend2" ippType="TSTRING" ippName="DETREND.DARK" comment="identifier of detrend image 2"/>
     87          <map pspsName="detrend3" ippType="TSTRING" ippName="DETREND.FLAT" comment="identifier of detrend image 3"/>
     88          <map pspsName="detrend4" ippType="TSTRING" ippName="DETREND.FRINGE" comment="identifier of detrend image 4"/>
     89    <!--  **MISSING** <map pspsName="detrend5" ippType="TSTRING" ippName="" comment="identifier of detrend image 5"/> -->
     90    <!--  **MISSING** <map pspsName="detrend6" ippType="TSTRING" ippName="" comment="identifier of detrend image 6"/> -->
     91    <!--  **MISSING** <map pspsName="detrend7" ippType="TSTRING" ippName="" comment="identifier of detrend image 7"/> -->
     92    <!--  **MISSING** <map pspsName="detrend8" ippType="TSTRING" ippName="" comment="identifier of detrend image 8"/> -->
     93    <!--  DONE IN CODE <map pspsName="photoZero" ippType="TFLOAT" ippName="" comment=" local derived photometric zero point (unit = mag)"/> -->
     94          <map pspsName="ctype1" ippType="TSTRING" ippName="CTYPE1" comment="name of astrometric projection in RA"/>
     95          <map pspsName="ctype2" ippType="TSTRING" ippName="CTYPE2" comment="name of astrometric projection in DEC"/>
     96          <map pspsName="crval1" ippType="TDOUBLE" ippName="CRVAL1" comment=" RA corresponding to reference pixel (unit = deg)"/>
     97          <map pspsName="crval2" ippType="TDOUBLE" ippName="CRVAL2" comment=" DEC corresponding to reference pixel (unit = deg)"/>
     98          <map pspsName="crpix1" ippType="TDOUBLE" ippName="CRPIX1" comment=" reference pixel value for RA (unit = pix)"/>
     99          <map pspsName="crpix2" ippType="TDOUBLE" ippName="CRPIX2" comment=" reference pixel value for DEC (unit = pix)"/>
     100          <map pspsName="cdelt1" ippType="TDOUBLE" ippName="CDELT1" comment="scale factor for RA"/>
     101          <map pspsName="cdelt2" ippType="TDOUBLE" ippName="CDELT2" comment="scale factor for DEC"/>
     102          <map pspsName="pc001001" ippType="TDOUBLE" ippName="PC001001" comment="elements of rotation/Dcale matrix"/>
     103          <map pspsName="pc001002" ippType="TDOUBLE" ippName="PC001002" comment="elements of rotation/Dcale matrix"/>
     104          <map pspsName="pc002001" ippType="TDOUBLE" ippName="PC002001" comment="elements of rotation/Dcale matrix"/>
     105          <map pspsName="pc002002" ippType="TDOUBLE" ippName="PC002002" comment="elements of rotation/Dcale matrix"/>
     106          <map pspsName="polyOrder" ippType="TBYTE" ippName="NPLYTERM" comment="polynomial order of astrometry fit"/>
     107          <map pspsName="pca1x3y0" ippType="TDOUBLE" ippName="PCA1X3Y0" comment="polynomial coefficients for the astrometric fit"/>
     108          <map pspsName="pca1x2y1" ippType="TDOUBLE" ippName="PCA1X2Y1" comment="polynomial coefficients for the astrometric fit"/>
     109          <map pspsName="pca1x1y2" ippType="TDOUBLE" ippName="PCA1X1Y2" comment="polynomial coefficients for the astrometric fit"/>
     110          <map pspsName="pca1x0y3" ippType="TDOUBLE" ippName="PCA1X0Y3" comment="polynomial coefficients for the astrometric fit"/>
     111          <map pspsName="pca1x2y0" ippType="TDOUBLE" ippName="PCA1X2Y0" comment="polynomial coefficients for the astrometric fit"/>
     112          <map pspsName="pca1x1y1" ippType="TDOUBLE" ippName="PCA1X1Y1" comment="polynomial coefficients for the astrometric fit"/>
     113          <map pspsName="pca1x0y2" ippType="TDOUBLE" ippName="PCA1X0Y2" comment="polynomial coefficients for the astrometric fit"/>
     114          <map pspsName="pca2x3y0" ippType="TDOUBLE" ippName="PCA2X3Y0" comment="polynomial coefficients for the astrometric fit"/>
     115          <map pspsName="pca2x2y1" ippType="TDOUBLE" ippName="PCA2X2Y1" comment="polynomial coefficients for the astrometric fit"/>
     116          <map pspsName="pca2x1y2" ippType="TDOUBLE" ippName="PCA2X1Y2" comment="polynomial coefficients for the astrometric fit"/>
     117          <map pspsName="pca2x0y3" ippType="TDOUBLE" ippName="PCA2X0Y3" comment="polynomial coefficients for the astrometric fit"/>
     118          <map pspsName="pca2x2y0" ippType="TDOUBLE" ippName="PCA2X2Y0" comment="polynomial coefficients for the astrometric fit"/>
     119          <map pspsName="pca2x1y1" ippType="TDOUBLE" ippName="PCA2X1Y1" comment="polynomial coefficients for the astrometric fit"/>
     120          <map pspsName="pca2x0y2" ippType="TDOUBLE" ippName="PCA2X0Y2" comment="polynomial coefficients for the astrometric fit"/>
     121    <!--  **MISSING** <map pspsName="calibModNum" ippType="TSHORT" ippName="" comment="calibration modification number"/> -->
     122    <!--  **MISSING** <map pspsName="dataRelease" ippType="TBYTE" ippName="" comment="Data release"/> -->
     123  </table>
     124  <table name="Detection" ippfitsextension="">
     125    <!--  DONE IN CODE <map pspsName="objID" ippType="TLONGLONG" ippName="" comment="ODM object identifier"/> -->
     126    <!--  DONE IN CODE <map pspsName="detectID" ippType="TLONGLONG" ippName="" comment="ODM detection identifier"/> -->
     127    <!--  DONE IN CODE <map pspsName="ippObjID" ippType="TLONGLONG" ippName="" comment="object id generated by IPP"/> -->
     128    <!--  DONE IN CODE <map pspsName="ippDetectID" ippType="TLONGLONG" ippName="" comment="detection id generated by IPP"/> -->
     129    <!--  DONE IN CODE <map pspsName="filterID" ippType="TBYTE" ippName="" comment="filter ID: g=1, r=2, i=3, z=4, y=5, w=6, ..."/> -->
     130    <!--  DONE IN CODE <map pspsName="surveyID" ippType="TBYTE" ippName="" comment="survey flag identifier"/> -->
     131    <!--  DONE IN CODE <map pspsName="imageID" ippType="TLONGLONG" ippName="" comment="image id hash of frame identifier & OTA/CCD number"/> -->
     132    <!--  DONE IN CODE <map pspsName="obsTime" ippType="TDOUBLE" ippName="" comment=" Time of mid observation (unit = day)"/> -->
     133          <map pspsName="xPos" ippType="TFLOAT" ippName="X_PSF" comment=" measured x on CCD from PSF fit (unit = pix)"/> -->
     134          <map pspsName="yPos" ippType="TFLOAT" ippName="Y_PSF" comment=" measured y on CCD from PSF fit (unit = pix)"/> -->
     135          <map pspsName="xPosErr" ippType="TFLOAT" ippName="X_PSF_SIG" comment=" estimated error in x (unit = pix)"/> -->
     136          <map pspsName="yPosErr" ippType="TFLOAT" ippName="Y_PSF_SIG" comment=" estimated error in y (unit = pix)"/> -->
     137    <!--  DONE IN CODE <map pspsName="instFlux" ippType="TFLOAT" ippName="" comment=" PSF instrumental flux (unit = adu/s)"/> -->
     138    <!--  DONE IN CODE<map pspsName="instFluxErr" ippType="TFLOAT" ippName="" comment=" estimated error in flux (unit = adu/s)"/> -->
     139    <!--  DONE IN CODE <map pspsName="peakADU" ippType="TFLOAT" ippName="" comment=" peak count in source pixel (unit = adu)"/> -->
     140          <map pspsName="psfWidMajor" ippType="TFLOAT" ippName="PSF_MAJOR" comment=" model PSF width in major axis (unit = arcsec)"/> -->
     141          <map pspsName="psfWidMinor" ippType="TFLOAT" ippName="PSF_MINOR" comment=" model PSF width in minor axis (unit = arcsec)"/> -->
     142          <map pspsName="psfTheta" ippType="TFLOAT" ippName="PSF_THETA" comment=" model PSF orientation angle (unit = deg)"/> -->
     143    <!--  **MISSING** <map pspsName="psfLikelihood" ippType="TFLOAT" ippName="" comment="PSF likelihood"/> -->
     144          <map pspsName="psfCf" ippType="TFLOAT" ippName="PSF_QF" comment="PSF coverage factor"/> -->
     145          <map pspsName="momentXX" ippType="TFLOAT" ippName="MOMENTS_XX" comment=" moment XX (unit = arcsec)"/> -->
     146          <map pspsName="momentXY" ippType="TFLOAT" ippName="MOMENTS_XY" comment=" moment XY (unit = arcsec)"/> -->
     147          <map pspsName="momentYY" ippType="TFLOAT" ippName="MOMENTS_YY" comment=" momeny YY (unit = arcsec)"/> -->
     148    <!--  **MISSING** <map pspsName="crLikelihood" ippType="TFLOAT" ippName="" comment="Likelihood the source is a cosmic ray"/> -->
     149    <!--  **MISSING** <map pspsName="extendedLikelihood" ippType="TFLOAT" ippName="" comment="Likelihood the source is extended"/> -->
     150    <!--  DONE IN CODE <map pspsName="infoFlag" ippType="TLONGLONG" ippName="" comment="flag indicating provenance information"/> -->
     151          <map pspsName="sky" ippType="TFLOAT" ippName="SKY" comment=" PSF sky level at source (unit = adu)"/> -->
     152          <map pspsName="skyErr" ippType="TFLOAT" ippName="SKY_SIGMA" comment=" estimated error in sky (unit = adu)"/> -->
     153          <map pspsName="sgSep" ippType="TFLOAT" ippName="EXT_NSIGMA" comment="star/galaxy separator"/> -->
     154    <!--  **MISSING** <map pspsName="activeFlag" ippType="TBYTE" ippName="" comment="indicates whether this detection/orphan is still a detection/orphan"/> -->
     155    <!--  DONE IN CODE <map pspsName="assocDate" ippType="TSTRING" ippName="" comment="date object association assigned"/> -->
     156    <!--  **MISSING** <map pspsName="historyModNum" ippType="TSHORT" ippName="" comment="modification number in the O-D association history"/> -->
     157    <!--  **MISSING** <map pspsName="dataRelease" ippType="TBYTE" ippName="" comment="Data release when this detection was originally taken. Recalibrations do not affect this value."/> -->
     158  </table>
     159  <table name="SkinnyObject" ippfitsextension="">
     160    <!--  DONE IN CODE <map pspsName="objID" ippType="TLONGLONG" ippName="" comment="ODM object identifier index"/> -->
     161    <!--  DONE IN CODE <map pspsName="ippObjID" ippType="TLONGLONG" ippName="" comment="IPP object number"/> -->
     162    <!--  **MISSING** <map pspsName="projectionCellID" ippType="TLONG" ippName="" comment="projection cell identifier at discovery time"/> -->
     163    <!--  **MISSING** <map pspsName="dataRelease" ippType="TBYTE" ippName="" comment="Data release to propagate to the object"/> -->
     164    <!--  DONE IN CODE <map pspsName="surveyID" ippType="TBYTE" ippName="" comment="surveyID </coluumn>"/> -->
     165  </table>
     166  <table name="ObjectCalColor" ippfitsextension="">
     167    <!--  DONE IN CODE <map pspsName="objID" ippType="TLONGLONG" ippName="" comment="ODM object identifier"/> -->
     168    <!--  DONE IN CODE <map pspsName="ippObjID" ippType="TLONGLONG" ippName="" comment="ipp object identifier"/> -->
     169    <!--  DONE IN CODE <map pspsName="filterID" ippType="TBYTE" ippName="" comment="filter identifier"/> -->
     170    <!--  **MISSING** <map pspsName="calColor" ippType="TFLOAT" ippName="" comment=" color adopted for magnitude calculation (unit = mag)"/> -->
     171    <!--  **MISSING** <map pspsName="calColorErr" ippType="TFLOAT" ippName="" comment=" error in calibrating color (unit = mag)"/> -->
     172    <!--  **MISSING** <map pspsName="calibModNum" ippType="TSHORT" ippName="" comment="calibration modification number"/> -->
     173    <!--  **MISSING** <map pspsName="dataRelease" ippType="TBYTE" ippName="" comment="Data release when this color calibration was established"/> -->
     174  </table>
    109175</tabledata>
  • branches/czw_branch/20101203/ippToPsps/config/stack/map.xml

    r29343 r30586  
    22
    33<tabledata type="stack">
    4   <table name="StackMeta" ippfitsextension="SkyChip.hdr">
    5     <!--  <map pspsName="stackMetaID" ippType="TLONGLONG" ippName="" comment="stack identifier"/> -->
    6     <!--  *** DONE IN CODE <map pspsName="skycellID" ippType="TLONG" ippName="" comment="skycell region identifier"/> -->
    7     <!--  *** DONE IN CODE <map pspsName="surveyID" ippType="TBYTE" ippName="" comment="survey flag identifier"/> -->
    8     <!--  <map pspsName="photoCalID" ippType="TLONG" ippName="" comment="photometry code numerical id"/> -->
    9     <!--  *** DONE IN CODE <map pspsName="filterID" ippType="TBYTE" ippName="" comment="filter identifier"/> -->
    10     <!--  <map pspsName="stackTypeID" ippType="TBYTE" ippName="" comment="stack type identifier"/> -->
    11     <!--  <map pspsName="refImageID" ippType="TLONGLONG" ippName="" comment="identifier of image used as reference for analysis"/> -->
    12     <!--  <map pspsName="subtrImageID" ippType="TLONGLONG" ippName="" comment="identifier of image subtracted to generate difference image"/> -->
     4  <table name="StackMeta" ippfitsextension="">
     5    <!--  **MISSING** <map pspsName="stackMetaID" ippType="TLONGLONG" ippName="" comment="stack identifier"/> -->
     6    <!--  DONE IN CODE <map pspsName="skycellID" ippType="TLONG" ippName="" comment="skycell region identifier"/> -->
     7    <!--  DONE IN CODE <map pspsName="surveyID" ippType="TBYTE" ippName="" comment="survey flag identifier"/> -->
     8    <!--  **MISSING** <map pspsName="photoCalID" ippType="TLONG" ippName="" comment="photometry code numerical id"/> -->
     9    <!--  DONE IN CODE <map pspsName="filterID" ippType="TBYTE" ippName="" comment="filter identifier"/> -->
     10    <!--  **MISSING** <map pspsName="stackTypeID" ippType="TBYTE" ippName="" comment="stack type identifier"/> -->
     11    <!--  **MISSING** <map pspsName="stackGroupID" ippType="TLONG" ippName="" comment="stack group identifier"/> -->
    1312          <map pspsName="magSat" ippType="TFLOAT" ippName="FSATUR" comment="saturation magnitude level"/>
    14     <!--  <map pspsName="analVer" ippType="TSHORT" ippName="" comment="analysis version index"/> -->
    15     <!--  <map pspsName="nP2Images" ippType="TSHORT" ippName="" comment="number of P2 images contributing to this cell"/> -->
     13    <!--  **MISSING** <map pspsName="analVer" ippType="TSHORT" ippName="" comment="analysis version index"/> -->
     14    <!--  **MISSING** <map pspsName="nP2Images" ippType="TSHORT" ippName="" comment="number of P2 images contributing to this cell"/> -->
    1615          <map pspsName="completMag" ippType="TFLOAT" ippName="FLIMIT" comment="95% completion level in mag"/>
    17     <!--  <map pspsName="astroScat" ippType="TFLOAT" ippName="" comment="astrometric scatter for chip"/> -->
    18     <!--  <map pspsName="photoScat" ippType="TFLOAT" ippName="" comment="photometric scatter for chip"/> -->
    19     <!--  <map pspsName="nAstroRef" ippType="TLONG" ippName="" comment="number of astrometric reference sources"/> -->
    20     <!--  <map pspsName="nPhoRef" ippType="TLONG" ippName="" comment="number of photometric reference sources"/> -->
    21     <!--  <map pspsName="psfFwhm" ippType="TFLOAT" ippName="" comment="PSF full width at half maximum"/> -->
    22     <!--  <map pspsName="psfmodelID" ippType="TSHORT" ippName="" comment="PSF model identifier"/> -->
    23           <map pspsName="psfWidMajor" ippType="TFLOAT" ippName="FWHM_MAJ" comment="PSF parameters"/>
    24           <map pspsName="psfWidMinor" ippType="TFLOAT" ippName="FWHM_MIN" comment="PSF parameters"/>
    25           <map pspsName="psfTheta" ippType="TFLOAT" ippName="ANGLE" comment="PSF parameters"/>
    26     <!--  <map pspsName="psfExtra1" ippType="TFLOAT" ippName="" comment="PSF parameters"/> -->
    27     <!--  <map pspsName="psfExtra2" ippType="TFLOAT" ippName="" comment="PSF parameters"/> -->
    28     <!--  <map pspsName="photoZero" ippType="TFLOAT" ippName="" comment="local derived photometric zero point"/> -->
    29     <!--  <map pspsName="photoColor" ippType="TFLOAT" ippName="" comment="local derived photometric color term"/> -->
    30     <!--  <map pspsName="ctype1" ippType="TSTRING" ippName="" comment="name of astrometric projection in RA"/> -->
    31     <!--  <map pspsName="ctype2" ippType="TSTRING" ippName="" comment="name of astrometric projection in DEC"/> -->
    32     <!--  <map pspsName="crval1" ippType="TDOUBLE" ippName="" comment="RA corresponding to reference pixel"/> -->
    33     <!--  <map pspsName="crval2" ippType="TDOUBLE" ippName="" comment="DEC corresponding to reference pixel"/> -->
    34     <!--  <map pspsName="crpix1" ippType="TDOUBLE" ippName="" comment="reference pixel value for RA"/> -->
    35     <!--  <map pspsName="crpix2" ippType="TDOUBLE" ippName="" comment="reference pixel value for DEC"/> -->
    36     <!--  <map pspsName="cdelt1" ippType="TDOUBLE" ippName="" comment="scale factor for RA"/> -->
    37     <!--  <map pspsName="cdelt2" ippType="TDOUBLE" ippName="" comment="scale factor for DEC"/> -->
    38     <!--  <map pspsName="pc001001" ippType="TDOUBLE" ippName="" comment="elements of rotation/Dcale matrix"/> -->
    39     <!--  <map pspsName="pc001002" ippType="TDOUBLE" ippName="" comment="elements of rotation/Dcale matrix"/> -->
    40     <!--  <map pspsName="pc002001" ippType="TDOUBLE" ippName="" comment="elements of rotation/Dcale matrix"/> -->
    41     <!--  <map pspsName="pc002002" ippType="TDOUBLE" ippName="" comment="elements of rotation/Dcale matrix"/> -->
    42     <!--  <map pspsName="polyOrder" ippType="TBYTE" ippName="" comment="polynomial order of astrometry fit"/> -->
    43     <!--  <map pspsName="pca1x3y0" ippType="TDOUBLE" ippName="" comment="polynomial coefficients for the astrometric fit"/> -->
    44     <!--  <map pspsName="pca1x2y1" ippType="TDOUBLE" ippName="" comment="polynomial coefficients for the astrometric fit"/> -->
    45     <!--  <map pspsName="pca1x1y2" ippType="TDOUBLE" ippName="" comment="polynomial coefficients for the astrometric fit"/> -->
    46     <!--  <map pspsName="pca1x0y3" ippType="TDOUBLE" ippName="" comment="polynomial coefficients for the astrometric fit"/> -->
    47     <!--  <map pspsName="pca1x2y0" ippType="TDOUBLE" ippName="" comment="polynomial coefficients for the astrometric fit"/> -->
    48     <!--  <map pspsName="pca1x1y1" ippType="TDOUBLE" ippName="" comment="polynomial coefficients for the astrometric fit"/> -->
    49     <!--  <map pspsName="pca1x0y2" ippType="TDOUBLE" ippName="" comment="polynomial coefficients for the astrometric fit"/> -->
    50     <!--  <map pspsName="pca2x3y0" ippType="TDOUBLE" ippName="" comment="polynomial coefficients for the astrometric fit"/> -->
    51     <!--  <map pspsName="pca2x2y1" ippType="TDOUBLE" ippName="" comment="polynomial coefficients for the astrometric fit"/> -->
    52     <!--  <map pspsName="pca2x1y2" ippType="TDOUBLE" ippName="" comment="polynomial coefficients for the astrometric fit"/> -->
    53     <!--  <map pspsName="pca2x0y3" ippType="TDOUBLE" ippName="" comment="polynomial coefficients for the astrometric fit"/> -->
    54     <!--  <map pspsName="pca2x2y0" ippType="TDOUBLE" ippName="" comment="polynomial coefficients for the astrometric fit"/> -->
    55     <!--  <map pspsName="pca2x1y1" ippType="TDOUBLE" ippName="" comment="polynomial coefficients for the astrometric fit"/> -->
    56     <!--  <map pspsName="pca2x0y2" ippType="TDOUBLE" ippName="" comment="polynomial coefficients for the astrometric fit"/> -->
    57     <!--  <map pspsName="calibModNum" ippType="TSHORT" ippName="" comment="calibration modification number"/> -->
    58     <!--  <map pspsName="dataRelease" ippType="TBYTE" ippName="" comment="Data release"/> -->
    59   </table>
    60   <table name="StackDetection" ippfitsextension="SkyChip.psf">
    61     <!--  <map pspsName="objID" ippType="TLONGLONG" ippName="" comment="ODM object identifier"/> -->
    62     <!--  <map pspsName="stackDetectID" ippType="TLONGLONG" ippName="" comment="ODM detection identifier"/> -->
    63     <!--  <map pspsName="ippObjID" ippType="TLONGLONG" ippName="" comment="IPP object identifier"/> -->
    64           <map pspsName="ippDetectID" ippType="TLONGLONG" ippName="IPP_IDET" comment="detection ID generated by IPP"/>
    65     <!--  <map pspsName="filterID" ippType="TBYTE" ippName="" comment="filter identifier"/> -->
    66     <!--  <map pspsName="stackTypeID" ippType="TBYTE" ippName="" comment="stack type identifier"/> -->
    67     <!--   *** DONE IN CODE <map pspsName="surveyID" ippType="TBYTE" ippName="" comment="survey flag identifier"/> -->
    68     <!--  <map pspsName="primaryF" ippType="TBYTE" ippName="" comment="identifies best stack detection for Stacks overlapping the same region of the sky."/> -->
    69     <!--  <map pspsName="stackMetaID" ippType="TLONGLONG" ippName="" comment="stack identifier"/> -->
    70     <!--  *** DONE IN CODE <map pspsName="skyCellID" ippType="TLONG" ippName="" comment="skycell identifier"/> -->
    71     <!--  <map pspsName="projectionCellID" ippType="TLONG" ippName="" comment="projection cell identifier"/> -->
    72     <!--  <map pspsName="stackVer" ippType="TSHORT" ippName="" comment="version number of this stack"/> -->
    73     <!--  <map pspsName="obsTime" ippType="TDOUBLE" ippName="" comment=" Time of mid observation (unit = day)"/> -->
    74     <!--  <map pspsName="xPos" ippType="TFLOAT" ippName="" comment="measured x on CCD from PSF fit"/> -->
    75     <!--  <map pspsName="yPos" ippType="TFLOAT" ippName="" comment="measured y on CCD from PSF fit"/> -->
    76     <!--  <map pspsName="xPosErr" ippType="TFLOAT" ippName="" comment="estimated error in x"/> -->
    77     <!--  <map pspsName="yPosErr" ippType="TFLOAT" ippName="" comment="estimated error in y"/> -->
    78           <map pspsName="instFlux" ippType="TFLOAT" ippName="PSF_INST_FLUX" comment="PSF instrumental flux"/>
    79           <map pspsName="instFluxErr" ippType="TFLOAT" ippName="PSF_INST_FLUX_SIG" comment="estimated error in instrumental flux"/>
    80     <!--  <map pspsName="peakFlux" ippType="TFLOAT" ippName="" comment="ratio of peak flux to total flux"/> -->
    81           <map pspsName="sky" ippType="TFLOAT" ippName="SKY" comment="PSF sky level at source (adu)"/>
     16    <!--  **MISSING** <map pspsName="astroScat" ippType="TFLOAT" ippName="" comment="astrometric scatter for chip"/> -->
     17    <!--  **MISSING** <map pspsName="photoScat" ippType="TFLOAT" ippName="" comment="photometric scatter for chip"/> -->
     18    <!--  **MISSING** <map pspsName="nAstroRef" ippType="TLONG" ippName="" comment="number of astrometric reference sources"/> -->
     19    <!--  **MISSING** <map pspsName="nPhoRef" ippType="TLONG" ippName="" comment="number of photometric reference sources"/> -->
     20    <!--  **MISSING** <map pspsName="mean" ippType="TDOUBLE" ippName="" comment="mean PSF FWHM in the stack"/> -->
     21    <!--  **MISSING** <map pspsName="max" ippType="TDOUBLE" ippName="" comment="maximum PSF FWHM in the stack"/> -->
     22    <!--  **MISSING** <map pspsName="photoZero" ippType="TFLOAT" ippName="" comment="local derived photometric zero point"/> -->
     23    <!--  **MISSING** <map pspsName="photoColor" ippType="TFLOAT" ippName="" comment="local derived photometric color term"/> -->
     24          <map pspsName="ctype1" ippType="TSTRING" ippName="CTYPE1" comment="name of astrometric projection in RA"/>
     25          <map pspsName="ctype2" ippType="TSTRING" ippName="CTYPE2" comment="name of astrometric projection in DEC"/>
     26          <map pspsName="crval1" ippType="TDOUBLE" ippName="CRVAL1" comment="RA corresponding to reference pixel"/>
     27          <map pspsName="crval2" ippType="TDOUBLE" ippName="CRVAL2" comment="DEC corresponding to reference pixel"/>
     28          <map pspsName="crpix1" ippType="TDOUBLE" ippName="CRPIX1" comment="reference pixel value for RA"/>
     29          <map pspsName="crpix2" ippType="TDOUBLE" ippName="CRPIX2" comment="reference pixel value for DEC"/>
     30          <map pspsName="cdelt1" ippType="TDOUBLE" ippName="CDELT1" comment="scale factor for RA"/>
     31          <map pspsName="cdelt2" ippType="TDOUBLE" ippName="CDELT2" comment="scale factor for DEC"/>
     32          <map pspsName="pc001001" ippType="TDOUBLE" ippName="PC001001" comment="elements of rotation/Dcale matrix"/>
     33          <map pspsName="pc001002" ippType="TDOUBLE" ippName="PC001002" comment="elements of rotation/Dcale matrix"/>
     34          <map pspsName="pc002001" ippType="TDOUBLE" ippName="PC002001" comment="elements of rotation/Dcale matrix"/>
     35          <map pspsName="pc002002" ippType="TDOUBLE" ippName="PC002002" comment="elements of rotation/Dcale matrix"/>
     36    <!--  **MISSING** <map pspsName="calibModNum" ippType="TSHORT" ippName="" comment="calibration modification number"/> -->
     37    <!--  **MISSING** <map pspsName="dataRelease" ippType="TBYTE" ippName="" comment="Data release"/> -->
     38  </table>
     39  <table name="StackDetection" ippfitsextension="">
     40    <!--  **MISSING** <map pspsName="objID" ippType="TLONGLONG" ippName="" comment="ODM object identifier"/> -->
     41    <!--  **MISSING** <map pspsName="stackDetectID" ippType="TLONGLONG" ippName="" comment="ODM detection identifier"/> -->
     42    <!--  **MISSING** <map pspsName="ippObjID" ippType="TLONGLONG" ippName="" comment="IPP object identifier"/> -->
     43          <map pspsName="ippDetectID" ippType="TLONGLONG" ippName="IPP_IDET" comment="detection ID generated by IPP"/>
     44    <!--  DONE IN CODE <map pspsName="filterID" ippType="TBYTE" ippName="" comment="filter identifier"/> -->
     45    <!--  **MISSING** <map pspsName="stackTypeID" ippType="TBYTE" ippName="" comment="stack type identifier"/> -->
     46    <!--  **MISSING** <map pspsName="stackGroupID" ippType="TLONG" ippName="" comment="stack group id"/> -->
     47    <!--  DONE IN CODE <map pspsName="surveyID" ippType="TBYTE" ippName="" comment="survey flag identifier"/> -->
     48    <!--  **MISSING** <map pspsName="primaryF" ippType="TBYTE" ippName="" comment="identifies best stack detection for Stacks overlapping the same region of the sky."/> -->
     49    <!--  **MISSING** <map pspsName="stackMetaID" ippType="TLONGLONG" ippName="" comment="stack identifier"/> -->
     50    <!--  DONE IN CODE <map pspsName="skyCellID" ippType="TLONG" ippName="" comment="skycell identifier"/> -->
     51    <!--  **MISSING** <map pspsName="projectionCellID" ippType="TLONG" ippName="" comment="projection cell identifier"/> -->
     52    <!--  **MISSING** <map pspsName="stackVer" ippType="TSHORT" ippName="" comment="version number of this stack"/> -->
     53    <!--  **MISSING** <map pspsName="obsTime" ippType="TDOUBLE" ippName="" comment=" Time of mid observation (unit = day)"/> -->
     54          <map pspsName="xPos" ippType="TFLOAT" ippName="X_PSF" comment="measured x on CCD from PSF fit"/>
     55          <map pspsName="yPos" ippType="TFLOAT" ippName="Y_PSF" comment="measured y on CCD from PSF fit"/>
     56          <map pspsName="xPosErr" ippType="TFLOAT" ippName="X_PSF_SIG" comment="estimated error in x"/> -->
     57          <map pspsName="yPosErr" ippType="TFLOAT" ippName="Y_PSF_SIG" comment="estimated error in y"/> -->
     58          <map pspsName="instFlux" ippType="TFLOAT" ippName="PSF_INST_FLUX" comment="PSF instrumental flux"/>
     59          <map pspsName="instFluxErr" ippType="TFLOAT" ippName="PSF_INST_FLUX_SIG" comment="estimated error in instrumental flux"/>
     60    <!--  **MISSING** <map pspsName="peakFlux" ippType="TFLOAT" ippName="" comment="ratio of peak flux to total flux"/> -->
     61          <map pspsName="sky" ippType="TFLOAT" ippName="SKY" comment="PSF sky level at source (adu)"/>
    8262          <map pspsName="skyErr" ippType="TFLOAT" ippName="SKY_SIGMA" comment="estimated error in sky"/>
    8363          <map pspsName="sgSep" ippType="TFLOAT" ippName="EXT_NSIGMA" comment="star/galaxy separator"/>
    84           <map pspsName="psfWidMajor" ippType="TFLOAT" ippName="PSF_MAJOR" comment="PSF width in major axis"/> 
    85           <map pspsName="psfWidMinor" ippType="TFLOAT" ippName="PSF_MINOR" comment="PSF width in minor axis"/> 
    86           <map pspsName="psfTheta" ippType="TFLOAT" ippName="PSF_THETA" comment="PSF orientation angle"/> 
    87     <!--  <map pspsName="psfLikelihood" ippType="TFLOAT" ippName="" comment="PSF likelihood"/> -->
     64          <map pspsName="psfWidMajor" ippType="TFLOAT" ippName="PSF_MAJOR" comment="PSF width in major axis"/>
     65          <map pspsName="psfWidMinor" ippType="TFLOAT" ippName="PSF_MINOR" comment="PSF width in minor axis"/>
     66          <map pspsName="psfTheta" ippType="TFLOAT" ippName="PSF_THETA" comment="PSF orientation angle"/>
     67    <!--  **MISSING** <map pspsName="psfLikelihood" ippType="TFLOAT" ippName="" comment="PSF likelihood"/> -->
    8868          <map pspsName="psfCf" ippType="TFLOAT" ippName="PSF_QF" comment="PSF coverage factor"/>
    89     <!--  <map pspsName="infoFlag" ippType="TLONG" ippName="" comment="indicator of strange propeties"/> -->
    90     <!--  <map pspsName="nFrames" ippType="TLONG" ippName="" comment="number of frames contributing to source"/> -->
    91     <!--  <map pspsName="wlSigma" ippType="TFLOAT" ippName="" comment="weak lensing sigma"/> -->
    92     <!--  <map pspsName="eps1" ippType="TFLOAT" ippName="" comment="weak lensing vector element eps(1)"/> -->
    93     <!--  <map pspsName="eps2" ippType="TFLOAT" ippName="" comment="weak lensing vector element eps(2)"/> -->
    94     <!--  <map pspsName="Psm11" ippType="TFLOAT" ippName="" comment="weak lensing matrix element P_sm(1,1)"/> -->
    95     <!--  <map pspsName="Psm12" ippType="TFLOAT" ippName="" comment="weak lensing matrix element P_sm(1,2)"/> -->
    96     <!--  <map pspsName="Psm21" ippType="TFLOAT" ippName="" comment="weak lensing matrix element P_sm(2,1)"/> -->
    97     <!--  <map pspsName="Psm22" ippType="TFLOAT" ippName="" comment="weak lensing matrix element P_sm(2,2)"/> -->
    98     <!--  <map pspsName="Psh11" ippType="TFLOAT" ippName="" comment="weak lensing matrix element P_sh(1,1)"/> -->
    99     <!--  <map pspsName="Psh12" ippType="TFLOAT" ippName="" comment="weak lensing matrix element P_sh(1,2)"/> -->
    100     <!--  <map pspsName="Psh21" ippType="TFLOAT" ippName="" comment="weak lensing matrix element P_sh(2,1)"/> -->
    101     <!--  <map pspsName="Psh22" ippType="TFLOAT" ippName="" comment="weak lensing matrix element P_sh(2,2)"/> -->
    102     <!--  <map pspsName="activeFlag" ippType="TBYTE" ippName="" comment="indicates whether this detection/orphan is still a detection/orphan"/> -->
    103     <!--  <map pspsName="assocDate" ippType="TSTRING" ippName="" comment="date object association assigned"/> -->
    104     <!--  <map pspsName="historyModNum" ippType="TSHORT" ippName="" comment="modification number in the O-D association history"/> -->
    105     <!--  <map pspsName="dataRelease" ippType="TBYTE" ippName="" comment="Data release when this detection was originally taken."/> -->
    106   </table>
    107   <table name="StackApFlx" ippfitsextension="SkyChip.xsrc">
    108     <!--  <map pspsName="objID" ippType="TLONGLONG" ippName="" comment="ODM object identifier"/> -->
    109     <!--  <map pspsName="stackDetectID" ippType="TLONGLONG" ippName="" comment="ODM detection identifier"/> -->
    110     <!--  <map pspsName="ippObjID" ippType="TLONGLONG" ippName="" comment="IPP object identifier"/> -->
     69    <!--  **MISSING** <map pspsName="infoFlag" ippType="TLONG" ippName="" comment="indicator of strange propeties"/> -->
     70    <!--  **MISSING** <map pspsName="nFrames" ippType="TLONG" ippName="" comment="number of frames contributing to source"/> -->
     71    <!--  **MISSING** <map pspsName="activeFlag" ippType="TBYTE" ippName="" comment="indicates whether this detection/orphan is still a detection/orphan"/> -->
     72    <!--  DONE IN CODE <map pspsName="assocDate" ippType="TSTRING" ippName="" comment="date object association assigned"/> -->
     73    <!--  **MISSING** <map pspsName="historyModNum" ippType="TSHORT" ippName="" comment="modification number in the O-D association history"/> -->
     74    <!--  **MISSING** <map pspsName="dataRelease" ippType="TBYTE" ippName="" comment="Data release when this detection was originally taken."/> -->
     75  </table>
     76  <table name="StackApFlx" ippfitsextension="">
     77    <!--  **MISSING** <map pspsName="objID" ippType="TLONGLONG" ippName="" comment="ODM object identifier"/> -->
     78    <!--  **MISSING** <map pspsName="stackDetectID" ippType="TLONGLONG" ippName="" comment="ODM detection identifier"/> -->
     79    <!--  **MISSING** <map pspsName="ippObjID" ippType="TLONGLONG" ippName="" comment="IPP object identifier"/> -->
    11180          <map pspsName="ippDetectID" ippType="TLONGLONG" ippName="IPP_IDET" comment="detection ID generated by IPP"/>
    112     <!--  <map pspsName="filterID" ippType="TBYTE" ippName="" comment="filter identifier"/> -->
    113     <!--  <map pspsName="stackTypeID" ippType="TBYTE" ippName="" comment="stack type identifier"/> -->
    114     <!--   *** DONE IN CODE <map pspsName="surveyID" ippType="TBYTE" ippName="" comment="survey flag identifier"/> -->
    115     <!--  <map pspsName="primaryF" ippType="TBYTE" ippName="" comment="identifies best stack detection for Stacks overlapping the same region of the sky."/> -->
    116     <!--  <map pspsName="stackMetaID" ippType="TLONGLONG" ippName="" comment="stack identifier"/> -->
    117     <!--  <map pspsName="isophotMag" ippType="TFLOAT" ippName="" comment="isophotal magnitude"/> -->
    118     <!--  <map pspsName="isophotMagErr" ippType="TFLOAT" ippName="" comment="estimated error in isophotal magnitude"/> -->
    119     <!--  <map pspsName="isophotMajAxis" ippType="TFLOAT" ippName="" comment="isophotal Major Axis"/> -->
    120     <!--  <map pspsName="isophotMajAxisErr" ippType="TFLOAT" ippName="" comment="estimated error in isophotal Major Axis"/> -->
    121     <!--  <map pspsName="isophotMinAxis" ippType="TFLOAT" ippName="" comment="isophotal Minor Axis"/> -->
    122     <!--  <map pspsName="isophotMinAxisErr" ippType="TFLOAT" ippName="" comment="estimated error in isophotal Minor Axis"/> -->
    123     <!--  <map pspsName="isophotMajAxisGrad" ippType="TFLOAT" ippName="" comment="isophotal major axis gradient"/> -->
    124     <!--  <map pspsName="isophotMinAxisGrad" ippType="TFLOAT" ippName="" comment="isophotal minor axis gradient"/> -->
    125     <!--  <map pspsName="isophotPA" ippType="TFLOAT" ippName="" comment="isophotal position angle"/> -->
    126     <!--  <map pspsName="isophotPAErr" ippType="TFLOAT" ippName="" comment="estimated error in isophotal position angle"/> -->
    127     <!--  <map pspsName="isophotPAGrad" ippType="TFLOAT" ippName="" comment="isophotal position angle gradient"/> -->
     81    <!--  DONE IN CODE <map pspsName="filterID" ippType="TBYTE" ippName="" comment="filter identifier"/> -->
     82    <!--  **MISSING** <map pspsName="stackTypeID" ippType="TBYTE" ippName="" comment="stack type identifier"/> -->
     83    <!--  **MISSING** <map pspsName="stackGroupID" ippType="TLONG" ippName="" comment="stack group id"/> -->
     84    <!--  DONE IN CODE <map pspsName="surveyID" ippType="TBYTE" ippName="" comment="survey flag identifier"/> -->
     85    <!--  **MISSING** <map pspsName="primaryF" ippType="TBYTE" ippName="" comment="identifies best stack detection for Stacks overlapping the same region of the sky."/> -->
     86    <!--  **MISSING** <map pspsName="stackMetaID" ippType="TLONGLONG" ippName="" comment="stack identifier"/> -->
     87    <!--  **MISSING** <map pspsName="isophotMag" ippType="TFLOAT" ippName="" comment="isophotal magnitude"/> -->
     88    <!--  **MISSING** <map pspsName="isophotMagErr" ippType="TFLOAT" ippName="" comment="estimated error in isophotal magnitude"/> -->
     89    <!--  **MISSING** <map pspsName="isophotMajAxis" ippType="TFLOAT" ippName="" comment="isophotal Major Axis"/> -->
     90    <!--  **MISSING** <map pspsName="isophotMajAxisErr" ippType="TFLOAT" ippName="" comment="estimated error in isophotal Major Axis"/> -->
     91    <!--  **MISSING** <map pspsName="isophotMinAxis" ippType="TFLOAT" ippName="" comment="isophotal Minor Axis"/> -->
     92    <!--  **MISSING** <map pspsName="isophotMinAxisErr" ippType="TFLOAT" ippName="" comment="estimated error in isophotal Minor Axis"/> -->
     93    <!--  **MISSING** <map pspsName="isophotMajAxisGrad" ippType="TFLOAT" ippName="" comment="isophotal major axis gradient"/> -->
     94    <!--  **MISSING** <map pspsName="isophotMinAxisGrad" ippType="TFLOAT" ippName="" comment="isophotal minor axis gradient"/> -->
     95    <!--  **MISSING** <map pspsName="isophotPA" ippType="TFLOAT" ippName="" comment="isophotal position angle"/> -->
     96    <!--  **MISSING** <map pspsName="isophotPAErr" ippType="TFLOAT" ippName="" comment="estimated error in isophotal position angle"/> -->
     97    <!--  **MISSING** <map pspsName="isophotPAGrad" ippType="TFLOAT" ippName="" comment="isophotal position angle gradient"/> -->
    12898          <map pspsName="petRadius" ippType="TFLOAT" ippName="PETRO_RADIUS" comment="Petrosian radius"/>
    129           <map pspsName="petRadiusErr" ippType="TFLOAT" ippName="PETRO_RADIUS_ERR" comment="estimated error inPetrosian radius"/> 
     99          <map pspsName="petRadiusErr" ippType="TFLOAT" ippName="PETRO_RADIUS_ERR" comment="estimated error inPetrosian radius"/>
    130100          <map pspsName="petMag" ippType="TFLOAT" ippName="PETRO_MAG" comment="Petrosian magntiude"/>
    131101          <map pspsName="petMagErr" ippType="TFLOAT" ippName="PETRO_MAG_ERR" comment="estimated error in petMag"/>
    132           <map pspsName="petR50" ippType="TFLOAT" ippName="PETRO_RADIUS_50" comment="Petrosian radius at 50% light"/> 
    133           <map pspsName="petR50Err" ippType="TFLOAT" ippName="PETRO_RADIUS_50" comment="estimated error inPetrosian radius at 50% light"/>
     102          <map pspsName="petR50" ippType="TFLOAT" ippName="PETRO_RADIUS_50" comment="Petrosian radius at 50% light"/>
     103          <map pspsName="petR50Err" ippType="TFLOAT" ippName="PETRO_RADIUS_50_ERR" comment="estimated error inPetrosian radius at 50% light"/>
    134104          <map pspsName="petR90" ippType="TFLOAT" ippName="PETRO_RADIUS_90" comment="Petrosian radius at 90% light"/>
    135105          <map pspsName="petR90Err" ippType="TFLOAT" ippName="PETRO_RADIUS_90_ERR" comment="estimated error in Petrosian radius at 90% light"/>
    136     <!--  <map pspsName="petCf" ippType="TFLOAT" ippName="" comment="Petrosian fit coverage factor"/> -->
    137     <!--  <map pspsName="flxR1" ippType="TFLOAT" ippName="" comment="Flux inside r = 1"/> -->
    138     <!--  <map pspsName="flxR1Err" ippType="TFLOAT" ippName="" comment="estimated error is flxR1"/> -->
    139     <!--  <map pspsName="flxR1Var" ippType="TFLOAT" ippName="" comment="estimated variance in flxR1"/> -->
    140     <!--  <map pspsName="flxR2" ippType="TFLOAT" ippName="" comment="Flux inside r = 2"/> -->
    141     <!--  <map pspsName="flxR2Err" ippType="TFLOAT" ippName="" comment="estimated error is flxR2"/> -->
    142     <!--  <map pspsName="flxR2Var" ippType="TFLOAT" ippName="" comment="estimated variance in flxR2"/> -->
    143     <!--  <map pspsName="flxR3" ippType="TFLOAT" ippName="" comment="Flux inside r = 3"/> -->
    144     <!--  <map pspsName="flxR3Err" ippType="TFLOAT" ippName="" comment="estimated error is flxR3"/> -->
    145     <!--  <map pspsName="flxR3Var" ippType="TFLOAT" ippName="" comment="estimated variance in flxR3"/> -->
    146     <!--  <map pspsName="flxR4" ippType="TFLOAT" ippName="" comment="Flux inside r = 4"/> -->
    147     <!--  <map pspsName="flxR4Err" ippType="TFLOAT" ippName="" comment="estimated error is flxR4"/> -->
    148     <!--  <map pspsName="flxR4Var" ippType="TFLOAT" ippName="" comment="estimated variance in flxR4"/> -->
    149     <!--  <map pspsName="flxR5" ippType="TFLOAT" ippName="" comment="Flux inside r = 5"/> -->
    150     <!--  <map pspsName="flxR5Err" ippType="TFLOAT" ippName="" comment="estimated error is flxR5"/> -->
    151     <!--  <map pspsName="flxR5Var" ippType="TFLOAT" ippName="" comment="estimated variance in flxR5"/> -->
    152     <!--  <map pspsName="flxR6" ippType="TFLOAT" ippName="" comment="Flux inside r = 6"/> -->
    153     <!--  <map pspsName="flxR6Err" ippType="TFLOAT" ippName="" comment="estimated error is flxR6"/> -->
    154     <!--  <map pspsName="flxR6Var" ippType="TFLOAT" ippName="" comment="estimated variance in flxR6"/> -->
    155     <!--  <map pspsName="flxR7" ippType="TFLOAT" ippName="" comment="Flux inside r = 7"/> -->
    156     <!--  <map pspsName="flxR7Err" ippType="TFLOAT" ippName="" comment="estimated error is flxR7"/> -->
    157     <!--  <map pspsName="flxR7Var" ippType="TFLOAT" ippName="" comment="estimated variance in flxR7"/> -->
    158     <!--  <map pspsName="flxR8" ippType="TFLOAT" ippName="" comment="Flux inside r = 8"/> -->
    159     <!--  <map pspsName="flxR8Err" ippType="TFLOAT" ippName="" comment="estimated error is flxR8"/> -->
    160     <!--  <map pspsName="flxR8Var" ippType="TFLOAT" ippName="" comment="estimated variance in flxR8"/> -->
    161     <!--  <map pspsName="flxR9" ippType="TFLOAT" ippName="" comment="Flux inside r = 9"/> -->
    162     <!--  <map pspsName="flxR9Err" ippType="TFLOAT" ippName="" comment="estimated error is flxR9"/> -->
    163     <!--  <map pspsName="flxR9Var" ippType="TFLOAT" ippName="" comment="estimated variance in flxR9"/> -->
    164     <!--  <map pspsName="flxR10" ippType="TFLOAT" ippName="" comment="Flux inside r = 10"/> -->
    165     <!--  <map pspsName="flxR10Err" ippType="TFLOAT" ippName="" comment="estimated error is flxR10"/> -->
    166     <!--  <map pspsName="flxR10Var" ippType="TFLOAT" ippName="" comment="estimated variance in flxR10"/> -->
    167     <!--  <map pspsName="c1FlxR1" ippType="TFLOAT" ippName="" comment="Flux inside r = 1"/> -->
    168     <!--  <map pspsName="c1FlxR1Err" ippType="TFLOAT" ippName="" comment="estimated error is c1FlxR1"/> -->
    169     <!--  <map pspsName="c1FlxR1Var" ippType="TFLOAT" ippName="" comment="estimated variance in c1FlxR1"/> -->
    170     <!--  <map pspsName="c1FlxR2" ippType="TFLOAT" ippName="" comment="Flux inside r = 2"/> -->
    171     <!--  <map pspsName="c1FlxR2Err" ippType="TFLOAT" ippName="" comment="estimated error is c1FlxR2"/> -->
    172     <!--  <map pspsName="c1FlxR2Var" ippType="TFLOAT" ippName="" comment="estimated variance in c1FlxR2"/> -->
    173     <!--  <map pspsName="c1FlxR3" ippType="TFLOAT" ippName="" comment="Flux inside r = 3"/> -->
    174     <!--  <map pspsName="c1FlxR3Err" ippType="TFLOAT" ippName="" comment="estimated error is c1FlxR3"/> -->
    175     <!--  <map pspsName="c1FlxR3Var" ippType="TFLOAT" ippName="" comment="estimated variance in c1FlxR3"/> -->
    176     <!--  <map pspsName="c1FlxR4" ippType="TFLOAT" ippName="" comment="Flux inside r = 4"/> -->
    177     <!--  <map pspsName="c1FlxR4Err" ippType="TFLOAT" ippName="" comment="estimated error is c1FlxR4"/> -->
    178     <!--  <map pspsName="c1FlxR4Var" ippType="TFLOAT" ippName="" comment="estimated variance in c1FlxR4"/> -->
    179     <!--  <map pspsName="c1FlxR5" ippType="TFLOAT" ippName="" comment="Flux inside r = 5"/> -->
    180     <!--  <map pspsName="c1FlxR5Err" ippType="TFLOAT" ippName="" comment="estimated error is c1FlxR5"/> -->
    181     <!--  <map pspsName="c1FlxR5Var" ippType="TFLOAT" ippName="" comment="estimated variance in c1FlxR5"/> -->
    182     <!--  <map pspsName="c1FlxR6" ippType="TFLOAT" ippName="" comment="Flux inside r = 6"/> -->
    183     <!--  <map pspsName="c1FlxR6Err" ippType="TFLOAT" ippName="" comment="estimated error is c1FlxR6"/> -->
    184     <!--  <map pspsName="c1FlxR6Var" ippType="TFLOAT" ippName="" comment="estimated variance in c1FlxR6"/> -->
    185     <!--  <map pspsName="c1FlxR7" ippType="TFLOAT" ippName="" comment="Flux inside r = 7"/> -->
    186     <!--  <map pspsName="c1FlxR7Err" ippType="TFLOAT" ippName="" comment="estimated error is c1FlxR7"/> -->
    187     <!--  <map pspsName="c1FlxR7Var" ippType="TFLOAT" ippName="" comment="estimated variance in c1FlxR7"/> -->
    188     <!--  <map pspsName="c1FlxR8" ippType="TFLOAT" ippName="" comment="Flux inside r = 8"/> -->
    189     <!--  <map pspsName="c1FlxR8Err" ippType="TFLOAT" ippName="" comment="estimated error is c1FlxR8"/> -->
    190     <!--  <map pspsName="c1FlxR8Var" ippType="TFLOAT" ippName="" comment="estimated variance in c1FlxR8"/> -->
    191     <!--  <map pspsName="c1FlxR9" ippType="TFLOAT" ippName="" comment="Flux inside r = 9"/> -->
    192     <!--  <map pspsName="c1FlxR9Err" ippType="TFLOAT" ippName="" comment="estimated error is c1FlxR9"/> -->
    193     <!--  <map pspsName="c1FlxR9Var" ippType="TFLOAT" ippName="" comment="estimated variance in c1FlxR9"/> -->
    194     <!--  <map pspsName="c1FlxR10" ippType="TFLOAT" ippName="" comment="Flux inside r = 10"/> -->
    195     <!--  <map pspsName="c1FlxR10Err" ippType="TFLOAT" ippName="" comment="estimated error is c1FlxR10"/> -->
    196     <!--  <map pspsName="c1FlxR10Var" ippType="TFLOAT" ippName="" comment="estimated variance in c1FlxR10"/> -->
    197     <!--  <map pspsName="c2FlxR1" ippType="TFLOAT" ippName="" comment="Flux inside r = 1"/> -->
    198     <!--  <map pspsName="c2FlxR1Err" ippType="TFLOAT" ippName="" comment="estimated error is c2FlxR1"/> -->
    199     <!--  <map pspsName="c2FlxR1Var" ippType="TFLOAT" ippName="" comment="estimated variance in c2FlxR1"/> -->
    200     <!--  <map pspsName="c2FlxR2" ippType="TFLOAT" ippName="" comment="Flux inside r = 2"/> -->
    201     <!--  <map pspsName="c2FlxR2Err" ippType="TFLOAT" ippName="" comment="estimated error is c2FlxR2"/> -->
    202     <!--  <map pspsName="c2FlxR2Var" ippType="TFLOAT" ippName="" comment="estimated variance in c2FlxR2"/> -->
    203     <!--  <map pspsName="c2FlxR3" ippType="TFLOAT" ippName="" comment="Flux inside r = 3"/> -->
    204     <!--  <map pspsName="c2FlxR3Err" ippType="TFLOAT" ippName="" comment="estimated error is c2FlxR3"/> -->
    205     <!--  <map pspsName="c2FlxR3Var" ippType="TFLOAT" ippName="" comment="estimated variance in c2FlxR3"/> -->
    206     <!--  <map pspsName="c2FlxR4" ippType="TFLOAT" ippName="" comment="Flux inside r = 4"/> -->
    207     <!--  <map pspsName="c2FlxR4Err" ippType="TFLOAT" ippName="" comment="estimated error is c2FlxR4"/> -->
    208     <!--  <map pspsName="c2FlxR4Var" ippType="TFLOAT" ippName="" comment="estimated variance in c2FlxR4"/> -->
    209     <!--  <map pspsName="c2FlxR5" ippType="TFLOAT" ippName="" comment="Flux inside r = 5"/> -->
    210     <!--  <map pspsName="c2FlxR5Err" ippType="TFLOAT" ippName="" comment="estimated error is c2FlxR5"/> -->
    211     <!--  <map pspsName="c2FlxR5Var" ippType="TFLOAT" ippName="" comment="estimated variance in c2FlxR5"/> -->
    212     <!--  <map pspsName="c2FlxR6" ippType="TFLOAT" ippName="" comment="Flux inside r = 6"/> -->
    213     <!--  <map pspsName="c2FlxR6Err" ippType="TFLOAT" ippName="" comment="estimated error is c2FlxR6"/> -->
    214     <!--  <map pspsName="c2FlxR6Var" ippType="TFLOAT" ippName="" comment="estimated variance in c2FlxR6"/> -->
    215     <!--  <map pspsName="c2FlxR7" ippType="TFLOAT" ippName="" comment="Flux inside r = 7"/> -->
    216     <!--  <map pspsName="c2FlxR7Err" ippType="TFLOAT" ippName="" comment="estimated error is c2FlxR7"/> -->
    217     <!--  <map pspsName="c2FlxR7Var" ippType="TFLOAT" ippName="" comment="estimated variance in c2FlxR7"/> -->
    218     <!--  <map pspsName="c2FlxR8" ippType="TFLOAT" ippName="" comment="Flux inside r = 8"/> -->
    219     <!--  <map pspsName="c2FlxR8Err" ippType="TFLOAT" ippName="" comment="estimated error is c2FlxR8"/> -->
    220     <!--  <map pspsName="c2FlxR8Var" ippType="TFLOAT" ippName="" comment="estimated variance in c2FlxR8"/> -->
    221     <!--  <map pspsName="c2FlxR9" ippType="TFLOAT" ippName="" comment="Flux inside r = 9"/> -->
    222     <!--  <map pspsName="c2FlxR9Err" ippType="TFLOAT" ippName="" comment="estimated error is c2FlxR9"/> -->
    223     <!--  <map pspsName="c2FlxR9Var" ippType="TFLOAT" ippName="" comment="estimated variance in c2FlxR9"/> -->
    224     <!--  <map pspsName="c2FlxR10" ippType="TFLOAT" ippName="" comment="Flux inside r = 10"/> -->
    225     <!--  <map pspsName="c2FlxR10Err" ippType="TFLOAT" ippName="" comment="estimated error is c2FlxR10"/> -->
    226     <!--  <map pspsName="c2FlxR10Var" ippType="TFLOAT" ippName="" comment="estimated variance in c2FlxR10"/> -->
    227     <!--  <map pspsName="c3FlxR1" ippType="TFLOAT" ippName="" comment="Flux inside r = 1"/> -->
    228     <!--  <map pspsName="c3FlxR1Err" ippType="TFLOAT" ippName="" comment="estimated error is c3FlxR1"/> -->
    229     <!--  <map pspsName="c3FlxR1Var" ippType="TFLOAT" ippName="" comment="estimated variance in c3FlxR1"/> -->
    230     <!--  <map pspsName="c3FlxR2" ippType="TFLOAT" ippName="" comment="Flux inside r = 2"/> -->
    231     <!--  <map pspsName="c3FlxR2Err" ippType="TFLOAT" ippName="" comment="estimated error is c3FlxR2"/> -->
    232     <!--  <map pspsName="c3FlxR2Var" ippType="TFLOAT" ippName="" comment="estimated variance in c3FlxR2"/> -->
    233     <!--  <map pspsName="c3FlxR3" ippType="TFLOAT" ippName="" comment="Flux inside r = 3"/> -->
    234     <!--  <map pspsName="c3FlxR3Err" ippType="TFLOAT" ippName="" comment="estimated error is c3FlxR3"/> -->
    235     <!--  <map pspsName="c3FlxR3Var" ippType="TFLOAT" ippName="" comment="estimated variance in c3FlxR3"/> -->
    236     <!--  <map pspsName="c3FlxR4" ippType="TFLOAT" ippName="" comment="Flux inside r = 4"/> -->
    237     <!--  <map pspsName="c3FlxR4Err" ippType="TFLOAT" ippName="" comment="estimated error is c3FlxR4"/> -->
    238     <!--  <map pspsName="c3FlxR4Var" ippType="TFLOAT" ippName="" comment="estimated variance in c3FlxR4"/> -->
    239     <!--  <map pspsName="c3FlxR5" ippType="TFLOAT" ippName="" comment="Flux inside r = 5"/> -->
    240     <!--  <map pspsName="c3FlxR5Err" ippType="TFLOAT" ippName="" comment="estimated error is c3FlxR5"/> -->
    241     <!--  <map pspsName="c3FlxR5Var" ippType="TFLOAT" ippName="" comment="estimated variance in c3FlxR5"/> -->
    242     <!--  <map pspsName="c3FlxR6" ippType="TFLOAT" ippName="" comment="Flux inside r = 6"/> -->
    243     <!--  <map pspsName="c3FlxR6Err" ippType="TFLOAT" ippName="" comment="estimated error is c3FlxR6"/> -->
    244     <!--  <map pspsName="c3FlxR6Var" ippType="TFLOAT" ippName="" comment="estimated variance in c3FlxR6"/> -->
    245     <!--  <map pspsName="c3FlxR7" ippType="TFLOAT" ippName="" comment="Flux inside r = 7"/> -->
    246     <!--  <map pspsName="c3FlxR7Err" ippType="TFLOAT" ippName="" comment="estimated error is c3FlxR7"/> -->
    247     <!--  <map pspsName="c3FlxR7Var" ippType="TFLOAT" ippName="" comment="estimated variance in c3FlxR7"/> -->
    248     <!--  <map pspsName="c3FlxR8" ippType="TFLOAT" ippName="" comment="Flux inside r = 8"/> -->
    249     <!--  <map pspsName="c3FlxR8Err" ippType="TFLOAT" ippName="" comment="estimated error is c3FlxR8"/> -->
    250     <!--  <map pspsName="c3FlxR8Var" ippType="TFLOAT" ippName="" comment="estimated variance in c3FlxR8"/> -->
    251     <!--  <map pspsName="c3FlxR9" ippType="TFLOAT" ippName="" comment="Flux inside r = 9"/> -->
    252     <!--  <map pspsName="c3FlxR9Err" ippType="TFLOAT" ippName="" comment="estimated error is c3FlxR9"/> -->
    253     <!--  <map pspsName="c3FlxR9Var" ippType="TFLOAT" ippName="" comment="estimated variance in c3FlxR9"/> -->
    254     <!--  <map pspsName="c3FlxR10" ippType="TFLOAT" ippName="" comment="Flux inside r = 10"/> -->
    255     <!--  <map pspsName="c3FlxR10Err" ippType="TFLOAT" ippName="" comment="estimated error is c3FlxR10"/> -->
    256     <!--  <map pspsName="c3FlxR10Var" ippType="TFLOAT" ippName="" comment="estimated variance in c3FlxR10"/> -->
    257     <!--  <map pspsName="logC" ippType="TFLOAT" ippName="" comment="Abraham concentration index"/> -->
    258     <!--  <map pspsName="logA" ippType="TFLOAT" ippName="" comment="Abraham asymmetry index"/> -->
    259     <!--  <map pspsName="activeFlag" ippType="TBYTE" ippName="" comment="indicates whether this detection/orphan is still a detection/orphan"/> -->
    260     <!--  <map pspsName="dataRelease" ippType="TBYTE" ippName="" comment="Data release when this detection was taken"/> -->
     106    <!--  **MISSING** <map pspsName="petCf" ippType="TFLOAT" ippName="" comment="Petrosian fit coverage factor"/> -->
     107    <!--  **MISSING** <map pspsName="flxR1" ippType="TFLOAT" ippName="" comment="Flux inside r = 1"/> -->
     108    <!--  **MISSING** <map pspsName="flxR1Err" ippType="TFLOAT" ippName="" comment="estimated error is flxR1"/> -->
     109    <!--  **MISSING** <map pspsName="flxR1Std" ippType="TFLOAT" ippName="" comment="estimated standard deviation in flxR1"/> -->
     110    <!--  **MISSING** <map pspsName="flxR1Fill" ippType="TFLOAT" ippName="" comment="estimated filling factor at R1"/> -->
     111    <!--  **MISSING** <map pspsName="flxR2" ippType="TFLOAT" ippName="" comment="Flux inside r = 2"/> -->
     112    <!--  **MISSING** <map pspsName="flxR2Err" ippType="TFLOAT" ippName="" comment="estimated error is flxR2"/> -->
     113    <!--  **MISSING** <map pspsName="flxR2Std" ippType="TFLOAT" ippName="" comment="estimated standard deviation in flxR2"/> -->
     114    <!--  **MISSING** <map pspsName="flxR2Fill" ippType="TFLOAT" ippName="" comment="estimated filling factor at R1"/> -->
     115    <!--  **MISSING** <map pspsName="flxR3" ippType="TFLOAT" ippName="" comment="Flux inside r = 3"/> -->
     116    <!--  **MISSING** <map pspsName="flxR3Err" ippType="TFLOAT" ippName="" comment="estimated error is flxR3"/> -->
     117    <!--  **MISSING** <map pspsName="flxR3Std" ippType="TFLOAT" ippName="" comment="estimated standard deviation in flxR3"/> -->
     118    <!--  **MISSING** <map pspsName="flxR3Fill" ippType="TFLOAT" ippName="" comment="estimated filling factor at R3"/> -->
     119    <!--  **MISSING** <map pspsName="flxR4" ippType="TFLOAT" ippName="" comment="Flux inside r = 4"/> -->
     120    <!--  **MISSING** <map pspsName="flxR4Err" ippType="TFLOAT" ippName="" comment="estimated error is flxR4"/> -->
     121    <!--  **MISSING** <map pspsName="flxR4Std" ippType="TFLOAT" ippName="" comment="estimated standard deviation in flxR4"/> -->
     122    <!--  **MISSING** <map pspsName="flxR4Fill" ippType="TFLOAT" ippName="" comment="estimated filling factor at R4"/> -->
     123    <!--  **MISSING** <map pspsName="flxR5" ippType="TFLOAT" ippName="" comment="Flux inside r = 5"/> -->
     124    <!--  **MISSING** <map pspsName="flxR5Err" ippType="TFLOAT" ippName="" comment="estimated error is flxR5"/> -->
     125    <!--  **MISSING** <map pspsName="flxR5Std" ippType="TFLOAT" ippName="" comment="estimated standard deviation in flxR5"/> -->
     126    <!--  **MISSING** <map pspsName="flxR5Fill" ippType="TFLOAT" ippName="" comment="estimated filling factor at R5"/> -->
     127    <!--  **MISSING** <map pspsName="flxR6" ippType="TFLOAT" ippName="" comment="Flux inside r = 6"/> -->
     128    <!--  **MISSING** <map pspsName="flxR6Err" ippType="TFLOAT" ippName="" comment="estimated error is flxR6"/> -->
     129    <!--  **MISSING** <map pspsName="flxR6Std" ippType="TFLOAT" ippName="" comment="estimated standard deviation in flxR6"/> -->
     130    <!--  **MISSING** <map pspsName="flxR6Fill" ippType="TFLOAT" ippName="" comment="estimated filling factor at R6"/> -->
     131    <!--  **MISSING** <map pspsName="flxR7" ippType="TFLOAT" ippName="" comment="Flux inside r = 7"/> -->
     132    <!--  **MISSING** <map pspsName="flxR7Err" ippType="TFLOAT" ippName="" comment="estimated error is flxR7"/> -->
     133    <!--  **MISSING** <map pspsName="flxR7Std" ippType="TFLOAT" ippName="" comment="estimated standard deviation in flxR7"/> -->
     134    <!--  **MISSING** <map pspsName="flxR7Fill" ippType="TFLOAT" ippName="" comment="estimated filling factor at R7"/> -->
     135    <!--  **MISSING** <map pspsName="flxR8" ippType="TFLOAT" ippName="" comment="Flux inside r = 8"/> -->
     136    <!--  **MISSING** <map pspsName="flxR8Err" ippType="TFLOAT" ippName="" comment="estimated error is flxR8"/> -->
     137    <!--  **MISSING** <map pspsName="flxR8Std" ippType="TFLOAT" ippName="" comment="estimated standard deviation in flxR8"/> -->
     138    <!--  **MISSING** <map pspsName="flxR8Fill" ippType="TFLOAT" ippName="" comment="estimated filling factor at R8"/> -->
     139    <!--  **MISSING** <map pspsName="flxR9" ippType="TFLOAT" ippName="" comment="Flux inside r = 9"/> -->
     140    <!--  **MISSING** <map pspsName="flxR9Err" ippType="TFLOAT" ippName="" comment="estimated error is flxR9"/> -->
     141    <!--  **MISSING** <map pspsName="flxR9Std" ippType="TFLOAT" ippName="" comment="estimated standard deviation in flxR9"/> -->
     142    <!--  **MISSING** <map pspsName="flxR9Fill" ippType="TFLOAT" ippName="" comment="estimated filling factor at R9"/> -->
     143    <!--  **MISSING** <map pspsName="flxR10" ippType="TFLOAT" ippName="" comment="Flux inside r = 10"/> -->
     144    <!--  **MISSING** <map pspsName="flxR10Err" ippType="TFLOAT" ippName="" comment="estimated error is flxR10"/> -->
     145    <!--  **MISSING** <map pspsName="flxR10Std" ippType="TFLOAT" ippName="" comment="estimated standard deviation in flxR10"/> -->
     146    <!--  **MISSING** <map pspsName="flxR10Fill" ippType="TFLOAT" ippName="" comment="estimated filling factor at R10"/> -->
     147    <!--  **MISSING** <map pspsName="c1flxR1" ippType="TFLOAT" ippName="" comment="Flux inside r = 1"/> -->
     148    <!--  **MISSING** <map pspsName="c1flxR1Err" ippType="TFLOAT" ippName="" comment="estimated error is c1flxR1"/> -->
     149    <!--  **MISSING** <map pspsName="c1flxR1Std" ippType="TFLOAT" ippName="" comment="estimated standard deviation in c1flxR1"/> -->
     150    <!--  **MISSING** <map pspsName="c1flxR1Fill" ippType="TFLOAT" ippName="" comment="estimated filling factor at R1"/> -->
     151    <!--  **MISSING** <map pspsName="c1flxR2" ippType="TFLOAT" ippName="" comment="Flux inside r = 2"/> -->
     152    <!--  **MISSING** <map pspsName="c1flxR2Err" ippType="TFLOAT" ippName="" comment="estimated error is c1flxR2"/> -->
     153    <!--  **MISSING** <map pspsName="c1flxR2Std" ippType="TFLOAT" ippName="" comment="estimated standard deviation in c1flxR2"/> -->
     154    <!--  **MISSING** <map pspsName="c1flxR2Fill" ippType="TFLOAT" ippName="" comment="estimated filling factor at R1"/> -->
     155    <!--  **MISSING** <map pspsName="c1flxR3" ippType="TFLOAT" ippName="" comment="Flux inside r = 3"/> -->
     156    <!--  **MISSING** <map pspsName="c1flxR3Err" ippType="TFLOAT" ippName="" comment="estimated error is c1flxR3"/> -->
     157    <!--  **MISSING** <map pspsName="c1flxR3Std" ippType="TFLOAT" ippName="" comment="estimated standard deviation in c1flxR3"/> -->
     158    <!--  **MISSING** <map pspsName="c1flxR3Fill" ippType="TFLOAT" ippName="" comment="estimated filling factor at R3"/> -->
     159    <!--  **MISSING** <map pspsName="c1flxR4" ippType="TFLOAT" ippName="" comment="Flux inside r = 4"/> -->
     160    <!--  **MISSING** <map pspsName="c1flxR4Err" ippType="TFLOAT" ippName="" comment="estimated error is c1flxR4"/> -->
     161    <!--  **MISSING** <map pspsName="c1flxR4Std" ippType="TFLOAT" ippName="" comment="estimated standard deviation in c1flxR4"/> -->
     162    <!--  **MISSING** <map pspsName="c1flxR4Fill" ippType="TFLOAT" ippName="" comment="estimated filling factor at R4"/> -->
     163    <!--  **MISSING** <map pspsName="c1flxR5" ippType="TFLOAT" ippName="" comment="Flux inside r = 5"/> -->
     164    <!--  **MISSING** <map pspsName="c1flxR5Err" ippType="TFLOAT" ippName="" comment="estimated error is c1flxR5"/> -->
     165    <!--  **MISSING** <map pspsName="c1flxR5Std" ippType="TFLOAT" ippName="" comment="estimated standard deviation in c1flxR5"/> -->
     166    <!--  **MISSING** <map pspsName="c1flxR5Fill" ippType="TFLOAT" ippName="" comment="estimated filling factor at R5"/> -->
     167    <!--  **MISSING** <map pspsName="c1flxR6" ippType="TFLOAT" ippName="" comment="Flux inside r = 6"/> -->
     168    <!--  **MISSING** <map pspsName="c1flxR6Err" ippType="TFLOAT" ippName="" comment="estimated error is c1flxR6"/> -->
     169    <!--  **MISSING** <map pspsName="c1flxR6Std" ippType="TFLOAT" ippName="" comment="estimated standard deviation in c1flxR6"/> -->
     170    <!--  **MISSING** <map pspsName="c1flxR6Fill" ippType="TFLOAT" ippName="" comment="estimated filling factor at R6"/> -->
     171    <!--  **MISSING** <map pspsName="c1flxR7" ippType="TFLOAT" ippName="" comment="Flux inside r = 7"/> -->
     172    <!--  **MISSING** <map pspsName="c1flxR7Err" ippType="TFLOAT" ippName="" comment="estimated error is c1flxR7"/> -->
     173    <!--  **MISSING** <map pspsName="c1flxR7Std" ippType="TFLOAT" ippName="" comment="estimated standard deviation in c1flxR7"/> -->
     174    <!--  **MISSING** <map pspsName="c1flxR7Fill" ippType="TFLOAT" ippName="" comment="estimated filling factor at R7"/> -->
     175    <!--  **MISSING** <map pspsName="c1flxR8" ippType="TFLOAT" ippName="" comment="Flux inside r = 8"/> -->
     176    <!--  **MISSING** <map pspsName="c1flxR8Err" ippType="TFLOAT" ippName="" comment="estimated error is c1flxR8"/> -->
     177    <!--  **MISSING** <map pspsName="c1flxR8Std" ippType="TFLOAT" ippName="" comment="estimated standard deviation in c1flxR8"/> -->
     178    <!--  **MISSING** <map pspsName="c1flxR8Fill" ippType="TFLOAT" ippName="" comment="estimated filling factor at R8"/> -->
     179    <!--  **MISSING** <map pspsName="c1flxR9" ippType="TFLOAT" ippName="" comment="Flux inside r = 9"/> -->
     180    <!--  **MISSING** <map pspsName="c1flxR9Err" ippType="TFLOAT" ippName="" comment="estimated error is c1flxR9"/> -->
     181    <!--  **MISSING** <map pspsName="c1flxR9Std" ippType="TFLOAT" ippName="" comment="estimated standard deviation in c1flxR9"/> -->
     182    <!--  **MISSING** <map pspsName="c1flxR9Fill" ippType="TFLOAT" ippName="" comment="estimated filling factor at R9"/> -->
     183    <!--  **MISSING** <map pspsName="c1flxR10" ippType="TFLOAT" ippName="" comment="Flux inside r = 10"/> -->
     184    <!--  **MISSING** <map pspsName="c1flxR10Err" ippType="TFLOAT" ippName="" comment="estimated error is c1flxR10"/> -->
     185    <!--  **MISSING** <map pspsName="c1flxR10Std" ippType="TFLOAT" ippName="" comment="estimated standard deviation in c1flxR10"/> -->
     186    <!--  **MISSING** <map pspsName="c1flxR10Fill" ippType="TFLOAT" ippName="" comment="estimated filling factor at R10"/> -->
     187    <!--  **MISSING** <map pspsName="c2flxR1" ippType="TFLOAT" ippName="" comment="Flux inside r = 1"/> -->
     188    <!--  **MISSING** <map pspsName="c2flxR1Err" ippType="TFLOAT" ippName="" comment="estimated error is c2flxR1"/> -->
     189    <!--  **MISSING** <map pspsName="c2flxR1Std" ippType="TFLOAT" ippName="" comment="estimated standard deviation in c2flxR1"/> -->
     190    <!--  **MISSING** <map pspsName="c2flxR1Fill" ippType="TFLOAT" ippName="" comment="estimated filling factor at R1"/> -->
     191    <!--  **MISSING** <map pspsName="c2flxR2" ippType="TFLOAT" ippName="" comment="Flux inside r = 2"/> -->
     192    <!--  **MISSING** <map pspsName="c2flxR2Err" ippType="TFLOAT" ippName="" comment="estimated error is c2flxR2"/> -->
     193    <!--  **MISSING** <map pspsName="c2flxR2Std" ippType="TFLOAT" ippName="" comment="estimated standard deviation in c2flxR2"/> -->
     194    <!--  **MISSING** <map pspsName="c2flxR2Fill" ippType="TFLOAT" ippName="" comment="estimated filling factor at R1"/> -->
     195    <!--  **MISSING** <map pspsName="c2flxR3" ippType="TFLOAT" ippName="" comment="Flux inside r = 3"/> -->
     196    <!--  **MISSING** <map pspsName="c2flxR3Err" ippType="TFLOAT" ippName="" comment="estimated error is c2flxR3"/> -->
     197    <!--  **MISSING** <map pspsName="c2flxR3Std" ippType="TFLOAT" ippName="" comment="estimated standard deviation in c2flxR3"/> -->
     198    <!--  **MISSING** <map pspsName="c2flxR3Fill" ippType="TFLOAT" ippName="" comment="estimated filling factor at R3"/> -->
     199    <!--  **MISSING** <map pspsName="c2flxR4" ippType="TFLOAT" ippName="" comment="Flux inside r = 4"/> -->
     200    <!--  **MISSING** <map pspsName="c2flxR4Err" ippType="TFLOAT" ippName="" comment="estimated error is c2flxR4"/> -->
     201    <!--  **MISSING** <map pspsName="c2flxR4Std" ippType="TFLOAT" ippName="" comment="estimated standard deviation in c2flxR4"/> -->
     202    <!--  **MISSING** <map pspsName="c2flxR4Fill" ippType="TFLOAT" ippName="" comment="estimated filling factor at R4"/> -->
     203    <!--  **MISSING** <map pspsName="c2flxR5" ippType="TFLOAT" ippName="" comment="Flux inside r = 5"/> -->
     204    <!--  **MISSING** <map pspsName="c2flxR5Err" ippType="TFLOAT" ippName="" comment="estimated error is c2flxR5"/> -->
     205    <!--  **MISSING** <map pspsName="c2flxR5Std" ippType="TFLOAT" ippName="" comment="estimated standard deviation in c2flxR5"/> -->
     206    <!--  **MISSING** <map pspsName="c2flxR5Fill" ippType="TFLOAT" ippName="" comment="estimated filling factor at R5"/> -->
     207    <!--  **MISSING** <map pspsName="c2flxR6" ippType="TFLOAT" ippName="" comment="Flux inside r = 6"/> -->
     208    <!--  **MISSING** <map pspsName="c2flxR6Err" ippType="TFLOAT" ippName="" comment="estimated error is c2flxR6"/> -->
     209    <!--  **MISSING** <map pspsName="c2flxR6Std" ippType="TFLOAT" ippName="" comment="estimated standard deviation in c2flxR6"/> -->
     210    <!--  **MISSING** <map pspsName="c2flxR6Fill" ippType="TFLOAT" ippName="" comment="estimated filling factor at R6"/> -->
     211    <!--  **MISSING** <map pspsName="c2flxR7" ippType="TFLOAT" ippName="" comment="Flux inside r = 7"/> -->
     212    <!--  **MISSING** <map pspsName="c2flxR7Err" ippType="TFLOAT" ippName="" comment="estimated error is c2flxR7"/> -->
     213    <!--  **MISSING** <map pspsName="c2flxR7Std" ippType="TFLOAT" ippName="" comment="estimated standard deviation in c2flxR7"/> -->
     214    <!--  **MISSING** <map pspsName="c2flxR7Fill" ippType="TFLOAT" ippName="" comment="estimated filling factor at R7"/> -->
     215    <!--  **MISSING** <map pspsName="c2flxR8" ippType="TFLOAT" ippName="" comment="Flux inside r = 8"/> -->
     216    <!--  **MISSING** <map pspsName="c2flxR8Err" ippType="TFLOAT" ippName="" comment="estimated error is c2flxR8"/> -->
     217    <!--  **MISSING** <map pspsName="c2flxR8Std" ippType="TFLOAT" ippName="" comment="estimated standard deviation in c2flxR8"/> -->
     218    <!--  **MISSING** <map pspsName="c2flxR8Fill" ippType="TFLOAT" ippName="" comment="estimated filling factor at R8"/> -->
     219    <!--  **MISSING** <map pspsName="c2flxR9" ippType="TFLOAT" ippName="" comment="Flux inside r = 9"/> -->
     220    <!--  **MISSING** <map pspsName="c2flxR9Err" ippType="TFLOAT" ippName="" comment="estimated error is c2flxR9"/> -->
     221    <!--  **MISSING** <map pspsName="c2flxR9Std" ippType="TFLOAT" ippName="" comment="estimated standard deviation in c2flxR9"/> -->
     222    <!--  **MISSING** <map pspsName="c2flxR9Fill" ippType="TFLOAT" ippName="" comment="estimated filling factor at R9"/> -->
     223    <!--  **MISSING** <map pspsName="c2flxR10" ippType="TFLOAT" ippName="" comment="Flux inside r = 10"/> -->
     224    <!--  **MISSING** <map pspsName="c2flxR10Err" ippType="TFLOAT" ippName="" comment="estimated error is c2flxR10"/> -->
     225    <!--  **MISSING** <map pspsName="c2flxR10Std" ippType="TFLOAT" ippName="" comment="estimated standard deviation in c2flxR10"/> -->
     226    <!--  **MISSING** <map pspsName="c2flxR10Fill" ippType="TFLOAT" ippName="" comment="estimated filling factor at R10"/> -->
     227    <!--  **MISSING** <map pspsName="logC" ippType="TFLOAT" ippName="" comment="Abraham concentration index"/> -->
     228    <!--  **MISSING** <map pspsName="logA" ippType="TFLOAT" ippName="" comment="Abraham asymmetry index"/> -->
     229    <!--  **MISSING** <map pspsName="activeFlag" ippType="TBYTE" ippName="" comment="indicates whether this detection/orphan is still a detection/orphan"/> -->
     230    <!--  **MISSING** <map pspsName="dataRelease" ippType="TBYTE" ippName="" comment="Data release when this detection was taken"/> -->
    261231  </table>
    262232  <table name="StackModelFit" ippfitsextension="">
    263     <!--  <map pspsName="objID" ippType="TLONGLONG" ippName="" comment="ODM object identifier"/> -->
    264     <!--  <map pspsName="stackDetectID" ippType="TLONGLONG" ippName="" comment="ODM detection identifier"/> -->
    265     <!--  <map pspsName="ippObjID" ippType="TLONGLONG" ippName="" comment="IPP object identifier"/> -->
    266     <!--  <map pspsName="ippDetectID" ippType="TLONGLONG" ippName="" comment="detection ID generated by IPP"/> -->
    267     <!--  <map pspsName="filterID" ippType="TBYTE" ippName="" comment="filter identifier"/> -->
    268     <!--  <map pspsName="stackTypeID" ippType="TBYTE" ippName="" comment="stack type identifier"/> -->
    269     <!--  <map pspsName="surveyID" ippType="TBYTE" ippName="" comment="survey flag identifier"/> -->
    270     <!--  <map pspsName="primaryF" ippType="TBYTE" ippName="" comment="identifies best stack detection for Stacks overlapping the same region of the sky."/> -->
    271     <!--  <map pspsName="stackMetaID" ippType="TLONGLONG" ippName="" comment="stack identifier"/> -->
    272     <!--  <map pspsName="deVRadius" ippType="TFLOAT" ippName="" comment="deVaucouleurs radius"/> -->
    273     <!--  <map pspsName="deVRadiusErr" ippType="TFLOAT" ippName="" comment="estimated error in deVaucouleurs radius"/> -->
    274     <!--  <map pspsName="deVMag" ippType="TFLOAT" ippName="" comment="deVaucouleurs magntiude"/> -->
    275     <!--  <map pspsName="deVMagErr" ippType="TFLOAT" ippName="" comment="estimated error in deV_mag"/> -->
    276     <!--  <map pspsName="deVAb" ippType="TFLOAT" ippName="" comment="deVaucoulerus axis ratio"/> -->
    277     <!--  <map pspsName="deVAbErr" ippType="TFLOAT" ippName="" comment="estimated error in deVaucoulerus axis ratio"/> -->
    278     <!--  <map pspsName="raDeVOff" ippType="TFLOAT" ippName="" comment="Offset in RA of deVaucouleurs fit from PSF RA"/> -->
    279     <!--  <map pspsName="decDeVOff" ippType="TFLOAT" ippName="" comment="Offset in DEC of deVaucouleurs fit from PSF DEC"/> -->
    280     <!--  <map pspsName="raDeVOffErr" ippType="TFLOAT" ippName="" comment="estimated error in ra offset"/> -->
    281     <!--  <map pspsName="decDeVOffErr" ippType="TFLOAT" ippName="" comment="estimated error in dec offset"/> -->
    282     <!--  <map pspsName="deVCf" ippType="TFLOAT" ippName="" comment="deVaucouleurs fit coverage factor"/> -->
    283     <!--  <map pspsName="deVLikelihood" ippType="TFLOAT" ippName="" comment="deVaucouleurs fit likelihood factor"/> -->
    284     <!--  <map pspsName="deVCovar11" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
    285     <!--  <map pspsName="deVCovar12" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
    286     <!--  <map pspsName="deVCovar13" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
    287     <!--  <map pspsName="deVCovar14" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
    288     <!--  <map pspsName="deVCovar15" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
    289     <!--  <map pspsName="deVCovar16" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
    290     <!--  <map pspsName="deVCovar22" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
    291     <!--  <map pspsName="deVCovar23" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
    292     <!--  <map pspsName="deVCovar24" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
    293     <!--  <map pspsName="deVCovar25" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
    294     <!--  <map pspsName="deVCovar26" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
    295     <!--  <map pspsName="deVCovar33" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
    296     <!--  <map pspsName="deVCovar34" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
    297     <!--  <map pspsName="deVCovar35" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
    298     <!--  <map pspsName="deVCovar36" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
    299     <!--  <map pspsName="deVCovar44" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
    300     <!--  <map pspsName="deVCovar45" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
    301     <!--  <map pspsName="deVCovar46" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
    302     <!--  <map pspsName="deVCovar55" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
    303     <!--  <map pspsName="deVCovar56" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
    304     <!--  <map pspsName="deVCovar66" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
    305     <!--  <map pspsName="expRadius" ippType="TFLOAT" ippName="" comment="Exponential fit radius"/> -->
    306     <!--  <map pspsName="expRadiusErr" ippType="TFLOAT" ippName="" comment="estimated error in Exponential fit radius"/> -->
    307     <!--  <map pspsName="expMag" ippType="TFLOAT" ippName="" comment="Exponential fit magntiude"/> -->
    308     <!--  <map pspsName="expMagErr" ippType="TFLOAT" ippName="" comment="estimated error in expMag"/> -->
    309     <!--  <map pspsName="expAb" ippType="TFLOAT" ippName="" comment="Exponential fit axis ratio"/> -->
    310     <!--  <map pspsName="expAbErr" ippType="TFLOAT" ippName="" comment="estimated error in Exponential fit axis ratio"/> -->
    311     <!--  <map pspsName="raExpOff" ippType="TFLOAT" ippName="" comment="Offset in RA of Exponential fit from PSF RA"/> -->
    312     <!--  <map pspsName="decExpOff" ippType="TFLOAT" ippName="" comment="Offset in DEC of Exponential fit from PSF DEC"/> -->
    313     <!--  <map pspsName="raExpOffErr" ippType="TFLOAT" ippName="" comment="estimated error in raExpOff"/> -->
    314     <!--  <map pspsName="decExpOffErr" ippType="TFLOAT" ippName="" comment="estimated error in decExpOff"/> -->
    315     <!--  <map pspsName="expCf" ippType="TFLOAT" ippName="" comment="Exponential fit coverage factor"/> -->
    316     <!--  <map pspsName="expLikelihood" ippType="TFLOAT" ippName="" comment="Exponential fit likelihood factor"/> -->
    317     <!--  <map pspsName="expCovar11" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
    318     <!--  <map pspsName="expCovar12" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
    319     <!--  <map pspsName="expCovar13" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
    320     <!--  <map pspsName="expCovar14" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
    321     <!--  <map pspsName="expCovar15" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
    322     <!--  <map pspsName="expCovar16" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
    323     <!--  <map pspsName="expCovar22" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
    324     <!--  <map pspsName="expCovar23" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
    325     <!--  <map pspsName="expCovar24" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
    326     <!--  <map pspsName="expCovar25" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
    327     <!--  <map pspsName="expCovar26" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
    328     <!--  <map pspsName="expCovar33" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
    329     <!--  <map pspsName="expCovar34" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
    330     <!--  <map pspsName="expCovar35" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
    331     <!--  <map pspsName="expCovar36" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
    332     <!--  <map pspsName="expCovar44" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
    333     <!--  <map pspsName="expCovar45" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
    334     <!--  <map pspsName="expCovar46" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
    335     <!--  <map pspsName="expCovar55" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
    336     <!--  <map pspsName="expCovar56" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
    337     <!--  <map pspsName="expCovar66" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
    338     <!--  <map pspsName="serRadius" ippType="TFLOAT" ippName="" comment="Sersic radius"/> -->
    339     <!--  <map pspsName="serRadiusErr" ippType="TFLOAT" ippName="" comment="estimated error in Sersic radius"/> -->
    340     <!--  <map pspsName="serMag" ippType="TFLOAT" ippName="" comment="Sersic magntiude"/> -->
    341     <!--  <map pspsName="serMagErr" ippType="TFLOAT" ippName="" comment="estimated error in serMag"/> -->
    342     <!--  <map pspsName="serAb" ippType="TFLOAT" ippName="" comment="Sersic axis ratio"/> -->
    343     <!--  <map pspsName="serAbErr" ippType="TFLOAT" ippName="" comment="estimated error in Sersic axis ratio"/> -->
    344     <!--  <map pspsName="serNu" ippType="TFLOAT" ippName="" comment="Sersic index"/> -->
    345     <!--  <map pspsName="serNuErr" ippType="TFLOAT" ippName="" comment="estimated error in Sersic index"/> -->
    346     <!--  <map pspsName="raSerOff" ippType="TFLOAT" ippName="" comment="Offset in RA of Sersic fit from PSF RA"/> -->
    347     <!--  <map pspsName="decSerOff" ippType="TFLOAT" ippName="" comment="Offset in DEC of Sersic fit from PSF DEC"/> -->
    348     <!--  <map pspsName="raSerOffErr" ippType="TFLOAT" ippName="" comment="estimated error in raSerOff"/> -->
    349     <!--  <map pspsName="decSerOffErr" ippType="TFLOAT" ippName="" comment="estimated error in decSerOff"/> -->
    350     <!--  <map pspsName="serCf" ippType="TFLOAT" ippName="" comment="Sersic fit coverage factor"/> -->
    351     <!--  <map pspsName="serLikelihood" ippType="TFLOAT" ippName="" comment="Sersic fit likelihood factor"/> -->
    352     <!--  <map pspsName="sersicCovar11" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
    353     <!--  <map pspsName="sersicCovar12" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
    354     <!--  <map pspsName="sersicCovar13" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
    355     <!--  <map pspsName="sersicCovar14" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
    356     <!--  <map pspsName="sersicCovar15" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
    357     <!--  <map pspsName="sersicCovar16" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
    358     <!--  <map pspsName="sersicCovar17" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
    359     <!--  <map pspsName="sersicCovar22" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
    360     <!--  <map pspsName="sersicCovar23" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
    361     <!--  <map pspsName="sersicCovar24" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
    362     <!--  <map pspsName="sersicCovar25" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
    363     <!--  <map pspsName="sersicCovar26" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
    364     <!--  <map pspsName="sersicCovar27" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
    365     <!--  <map pspsName="sersicCovar33" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
    366     <!--  <map pspsName="sersicCovar34" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
    367     <!--  <map pspsName="sersicCovar35" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
    368     <!--  <map pspsName="sersicCovar36" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
    369     <!--  <map pspsName="sersicCovar37" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
    370     <!--  <map pspsName="sersicCovar44" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
    371     <!--  <map pspsName="sersicCovar45" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
    372     <!--  <map pspsName="sersicCovar46" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
    373     <!--  <map pspsName="sersicCovar47" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
    374     <!--  <map pspsName="sersicCovar55" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
    375     <!--  <map pspsName="sersicCovar56" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
    376     <!--  <map pspsName="sersicCovar57" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
    377     <!--  <map pspsName="sersicCovar66" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
    378     <!--  <map pspsName="sersicCovar67" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
    379     <!--  <map pspsName="sersicCovar77" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
    380     <!--  <map pspsName="activeFlag" ippType="TBYTE" ippName="" comment="indicates whether this detection/orphan is still a detection/orphan"/> -->
    381     <!--  <map pspsName="dataRelease" ippType="TBYTE" ippName="" comment="Data release when this detection was taken"/> -->
     233    <!--  **MISSING** <map pspsName="objID" ippType="TLONGLONG" ippName="" comment="ODM object identifier"/> -->
     234    <!--  **MISSING** <map pspsName="stackDetectID" ippType="TLONGLONG" ippName="" comment="ODM detection identifier"/> -->
     235    <!--  **MISSING** <map pspsName="ippObjID" ippType="TLONGLONG" ippName="" comment="IPP object identifier"/> -->
     236    <!--  **MISSING** <map pspsName="ippDetectID" ippType="TLONGLONG" ippName="" comment="detection ID generated by IPP"/> -->
     237    <!--  **MISSING** <map pspsName="filterID" ippType="TBYTE" ippName="" comment="filter identifier"/> -->
     238    <!--  **MISSING** <map pspsName="stackTypeID" ippType="TBYTE" ippName="" comment="stack type identifier"/> -->
     239    <!--  **MISSING** <map pspsName="stackGroupID" ippType="TLONG" ippName="" comment="stack group id"/> -->
     240    <!--  **MISSING** <map pspsName="surveyID" ippType="TBYTE" ippName="" comment="survey flag identifier"/> -->
     241    <!--  **MISSING** <map pspsName="primaryF" ippType="TBYTE" ippName="" comment="identifies best stack detection for Stacks overlapping the same region of the sky."/> -->
     242    <!--  **MISSING** <map pspsName="stackMetaID" ippType="TLONGLONG" ippName="" comment="stack identifier"/> -->
     243    <!--  **MISSING** <map pspsName="deVRadius" ippType="TFLOAT" ippName="" comment="deVaucouleurs radius"/> -->
     244    <!--  **MISSING** <map pspsName="deVRadiusErr" ippType="TFLOAT" ippName="" comment="estimated error in deVaucouleurs radius"/> -->
     245    <!--  **MISSING** <map pspsName="deVMag" ippType="TFLOAT" ippName="" comment="deVaucouleurs magntiude"/> -->
     246    <!--  **MISSING** <map pspsName="deVMagErr" ippType="TFLOAT" ippName="" comment="estimated error in deV_mag"/> -->
     247    <!--  **MISSING** <map pspsName="deVAb" ippType="TFLOAT" ippName="" comment="deVaucoulerus axis ratio"/> -->
     248    <!--  **MISSING** <map pspsName="deVAbErr" ippType="TFLOAT" ippName="" comment="estimated error in deVaucoulerus axis ratio"/> -->
     249    <!--  **MISSING** <map pspsName="deVPhi" ippType="TFLOAT" ippName="" comment="estmated phi of deVaucouleurs axis"/> -->
     250    <!--  **MISSING** <map pspsName="deVPhiErr" ippType="TFLOAT" ippName="" comment="estmated error of phi of deVaucouleurs axis"/> -->
     251    <!--  **MISSING** <map pspsName="raDeVOff" ippType="TFLOAT" ippName="" comment="Offset in RA of deVaucouleurs fit from PSF RA"/> -->
     252    <!--  **MISSING** <map pspsName="decDeVOff" ippType="TFLOAT" ippName="" comment="Offset in DEC of deVaucouleurs fit from PSF DEC"/> -->
     253    <!--  **MISSING** <map pspsName="raDeVOffErr" ippType="TFLOAT" ippName="" comment="estimated error in ra offset"/> -->
     254    <!--  **MISSING** <map pspsName="decDeVOffErr" ippType="TFLOAT" ippName="" comment="estimated error in dec offset"/> -->
     255    <!--  **MISSING** <map pspsName="deVCf" ippType="TFLOAT" ippName="" comment="deVaucouleurs fit coverage factor"/> -->
     256    <!--  **MISSING** <map pspsName="deVLikelihood" ippType="TFLOAT" ippName="" comment="deVaucouleurs fit likelihood factor"/> -->
     257    <!--  **MISSING** <map pspsName="deVCovar11" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
     258    <!--  **MISSING** <map pspsName="deVCovar12" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
     259    <!--  **MISSING** <map pspsName="deVCovar13" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
     260    <!--  **MISSING** <map pspsName="deVCovar14" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
     261    <!--  **MISSING** <map pspsName="deVCovar15" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
     262    <!--  **MISSING** <map pspsName="deVCovar16" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
     263    <!--  **MISSING** <map pspsName="deVCovar17" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
     264    <!--  **MISSING** <map pspsName="deVCovar22" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
     265    <!--  **MISSING** <map pspsName="deVCovar23" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
     266    <!--  **MISSING** <map pspsName="deVCovar24" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
     267    <!--  **MISSING** <map pspsName="deVCovar25" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
     268    <!--  **MISSING** <map pspsName="deVCovar26" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
     269    <!--  **MISSING** <map pspsName="deVCovar27" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
     270    <!--  **MISSING** <map pspsName="deVCovar33" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
     271    <!--  **MISSING** <map pspsName="deVCovar34" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
     272    <!--  **MISSING** <map pspsName="deVCovar35" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
     273    <!--  **MISSING** <map pspsName="deVCovar36" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
     274    <!--  **MISSING** <map pspsName="deVCovar37" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
     275    <!--  **MISSING** <map pspsName="deVCovar44" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
     276    <!--  **MISSING** <map pspsName="deVCovar45" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
     277    <!--  **MISSING** <map pspsName="deVCovar46" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
     278    <!--  **MISSING** <map pspsName="deVCovar47" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
     279    <!--  **MISSING** <map pspsName="deVCovar55" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
     280    <!--  **MISSING** <map pspsName="deVCovar56" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
     281    <!--  **MISSING** <map pspsName="deVCovar57" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
     282    <!--  **MISSING** <map pspsName="deVCovar66" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
     283    <!--  **MISSING** <map pspsName="deVCovar67" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
     284    <!--  **MISSING** <map pspsName="deVCovar77" ippType="TFLOAT" ippName="" comment="covariance for deVaucouleurs fit"/> -->
     285    <!--  **MISSING** <map pspsName="expRadius" ippType="TFLOAT" ippName="" comment="Exponential fit radius"/> -->
     286    <!--  **MISSING** <map pspsName="expRadiusErr" ippType="TFLOAT" ippName="" comment="estimated error in Exponential fit radius"/> -->
     287    <!--  **MISSING** <map pspsName="expMag" ippType="TFLOAT" ippName="" comment="Exponential fit magntiude"/> -->
     288    <!--  **MISSING** <map pspsName="expMagErr" ippType="TFLOAT" ippName="" comment="estimated error in expMag"/> -->
     289    <!--  **MISSING** <map pspsName="expAb" ippType="TFLOAT" ippName="" comment="Exponential fit axis ratio"/> -->
     290    <!--  **MISSING** <map pspsName="expAbErr" ippType="TFLOAT" ippName="" comment="estimated error in Exponential fit axis ratio"/> -->
     291    <!--  **MISSING** <map pspsName="expPhi" ippType="TFLOAT" ippName="" comment="estmated phi of Exponential axis"/> -->
     292    <!--  **MISSING** <map pspsName="expPhiErr" ippType="TFLOAT" ippName="" comment="estmated error of phi of Exponential axis"/> -->
     293    <!--  **MISSING** <map pspsName="raExpOff" ippType="TFLOAT" ippName="" comment="Offset in RA of Exponential fit from PSF RA"/> -->
     294    <!--  **MISSING** <map pspsName="decExpOff" ippType="TFLOAT" ippName="" comment="Offset in DEC of Exponential fit from PSF DEC"/> -->
     295    <!--  **MISSING** <map pspsName="raExpOffErr" ippType="TFLOAT" ippName="" comment="estimated error in raExpOff"/> -->
     296    <!--  **MISSING** <map pspsName="decExpOffErr" ippType="TFLOAT" ippName="" comment="estimated error in decExpOff"/> -->
     297    <!--  **MISSING** <map pspsName="expCf" ippType="TFLOAT" ippName="" comment="Exponential fit coverage factor"/> -->
     298    <!--  **MISSING** <map pspsName="expLikelihood" ippType="TFLOAT" ippName="" comment="Exponential fit likelihood factor"/> -->
     299    <!--  **MISSING** <map pspsName="expCovar11" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
     300    <!--  **MISSING** <map pspsName="expCovar12" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
     301    <!--  **MISSING** <map pspsName="expCovar13" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
     302    <!--  **MISSING** <map pspsName="expCovar14" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
     303    <!--  **MISSING** <map pspsName="expCovar15" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
     304    <!--  **MISSING** <map pspsName="expCovar16" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
     305    <!--  **MISSING** <map pspsName="expCovar17" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
     306    <!--  **MISSING** <map pspsName="expCovar22" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
     307    <!--  **MISSING** <map pspsName="expCovar23" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
     308    <!--  **MISSING** <map pspsName="expCovar24" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
     309    <!--  **MISSING** <map pspsName="expCovar25" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
     310    <!--  **MISSING** <map pspsName="expCovar26" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
     311    <!--  **MISSING** <map pspsName="expCovar27" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
     312    <!--  **MISSING** <map pspsName="expCovar33" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
     313    <!--  **MISSING** <map pspsName="expCovar34" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
     314    <!--  **MISSING** <map pspsName="expCovar35" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
     315    <!--  **MISSING** <map pspsName="expCovar36" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
     316    <!--  **MISSING** <map pspsName="expCovar37" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
     317    <!--  **MISSING** <map pspsName="expCovar44" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
     318    <!--  **MISSING** <map pspsName="expCovar45" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
     319    <!--  **MISSING** <map pspsName="expCovar46" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
     320    <!--  **MISSING** <map pspsName="expCovar47" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
     321    <!--  **MISSING** <map pspsName="expCovar55" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
     322    <!--  **MISSING** <map pspsName="expCovar56" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
     323    <!--  **MISSING** <map pspsName="expCovar57" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
     324    <!--  **MISSING** <map pspsName="expCovar66" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
     325    <!--  **MISSING** <map pspsName="expCovar67" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
     326    <!--  **MISSING** <map pspsName="expCovar77" ippType="TFLOAT" ippName="" comment="covariance for Exponential fit"/> -->
     327    <!--  **MISSING** <map pspsName="serRadius" ippType="TFLOAT" ippName="" comment="Sersic radius"/> -->
     328    <!--  **MISSING** <map pspsName="serRadiusErr" ippType="TFLOAT" ippName="" comment="estimated error in Sersic radius"/> -->
     329    <!--  **MISSING** <map pspsName="serMag" ippType="TFLOAT" ippName="" comment="Sersic magntiude"/> -->
     330    <!--  **MISSING** <map pspsName="serMagErr" ippType="TFLOAT" ippName="" comment="estimated error in serMag"/> -->
     331    <!--  **MISSING** <map pspsName="serAb" ippType="TFLOAT" ippName="" comment="Sersic axis ratio"/> -->
     332    <!--  **MISSING** <map pspsName="serAbErr" ippType="TFLOAT" ippName="" comment="estimated error in Sersic axis ratio"/> -->
     333    <!--  **MISSING** <map pspsName="serNu" ippType="TFLOAT" ippName="" comment="Sersic index"/> -->
     334    <!--  **MISSING** <map pspsName="serNuErr" ippType="TFLOAT" ippName="" comment="estimated error in Sersic index"/> -->
     335    <!--  **MISSING** <map pspsName="serPhi" ippType="TFLOAT" ippName="" comment="estmated phi of Sersic axis"/> -->
     336    <!--  **MISSING** <map pspsName="serPhiErr" ippType="TFLOAT" ippName="" comment="estmated error of phi of Sersic axis"/> -->
     337    <!--  **MISSING** <map pspsName="raSerOff" ippType="TFLOAT" ippName="" comment="Offset in RA of Sersic fit from PSF RA"/> -->
     338    <!--  **MISSING** <map pspsName="decSerOff" ippType="TFLOAT" ippName="" comment="Offset in DEC of Sersic fit from PSF DEC"/> -->
     339    <!--  **MISSING** <map pspsName="raSerOffErr" ippType="TFLOAT" ippName="" comment="estimated error in raSerOff"/> -->
     340    <!--  **MISSING** <map pspsName="decSerOffErr" ippType="TFLOAT" ippName="" comment="estimated error in decSerOff"/> -->
     341    <!--  **MISSING** <map pspsName="serCf" ippType="TFLOAT" ippName="" comment="Sersic fit coverage factor"/> -->
     342    <!--  **MISSING** <map pspsName="serLikelihood" ippType="TFLOAT" ippName="" comment="Sersic fit likelihood factor"/> -->
     343    <!--  **MISSING** <map pspsName="sersicCovar11" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     344    <!--  **MISSING** <map pspsName="sersicCovar12" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     345    <!--  **MISSING** <map pspsName="sersicCovar13" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     346    <!--  **MISSING** <map pspsName="sersicCovar14" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     347    <!--  **MISSING** <map pspsName="sersicCovar15" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     348    <!--  **MISSING** <map pspsName="sersicCovar16" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     349    <!--  **MISSING** <map pspsName="sersicCovar17" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     350    <!--  **MISSING** <map pspsName="sersicCovar18" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     351    <!--  **MISSING** <map pspsName="sersicCovar22" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     352    <!--  **MISSING** <map pspsName="sersicCovar23" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     353    <!--  **MISSING** <map pspsName="sersicCovar24" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     354    <!--  **MISSING** <map pspsName="sersicCovar25" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     355    <!--  **MISSING** <map pspsName="sersicCovar26" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     356    <!--  **MISSING** <map pspsName="sersicCovar27" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     357    <!--  **MISSING** <map pspsName="sersicCovar28" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     358    <!--  **MISSING** <map pspsName="sersicCovar33" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     359    <!--  **MISSING** <map pspsName="sersicCovar34" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     360    <!--  **MISSING** <map pspsName="sersicCovar35" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     361    <!--  **MISSING** <map pspsName="sersicCovar36" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     362    <!--  **MISSING** <map pspsName="sersicCovar37" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     363    <!--  **MISSING** <map pspsName="sersicCovar38" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     364    <!--  **MISSING** <map pspsName="sersicCovar44" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     365    <!--  **MISSING** <map pspsName="sersicCovar45" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     366    <!--  **MISSING** <map pspsName="sersicCovar46" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     367    <!--  **MISSING** <map pspsName="sersicCovar47" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     368    <!--  **MISSING** <map pspsName="sersicCovar48" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     369    <!--  **MISSING** <map pspsName="sersicCovar55" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     370    <!--  **MISSING** <map pspsName="sersicCovar56" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     371    <!--  **MISSING** <map pspsName="sersicCovar57" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     372    <!--  **MISSING** <map pspsName="sersicCovar58" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     373    <!--  **MISSING** <map pspsName="sersicCovar66" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     374    <!--  **MISSING** <map pspsName="sersicCovar67" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     375    <!--  **MISSING** <map pspsName="sersicCovar68" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     376    <!--  **MISSING** <map pspsName="sersicCovar77" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     377    <!--  **MISSING** <map pspsName="sersicCovar78" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     378    <!--  **MISSING** <map pspsName="sersicCovar88" ippType="TFLOAT" ippName="" comment="covariance for Sersic fit"/> -->
     379    <!--  **MISSING** <map pspsName="activeFlag" ippType="TBYTE" ippName="" comment="indicates whether this detection/orphan is still a detection/orphan"/> -->
     380    <!--  **MISSING** <map pspsName="dataRelease" ippType="TBYTE" ippName="" comment="Data release when this detection was taken"/> -->
    382381  </table>
    383382  <table name="StackToImage" ippfitsextension="">
    384     <!--  <map pspsName="stackMetaID" ippType="TLONGLONG" ippName="" comment="stack identifier"/> -->
    385     <!--  <map pspsName="imageID" ippType="TLONGLONG" ippName="" comment="hashed exposure-ccdID identifier"/> -->
     383    <!--  **MISSING** <map pspsName="stackMetaID" ippType="TLONGLONG" ippName="" comment="stack identifier"/> -->
     384    <!--  **MISSING** <map pspsName="imageID" ippType="TLONGLONG" ippName="" comment="hashed exposure-ccdID identifier"/> -->
    386385  </table>
    387386</tabledata>
  • branches/czw_branch/20101203/ippToPsps/config/stack/tables.xml

    r29241 r30586  
    99    <column name="filterID" type="TBYTE" default="0" comment="filter identifier"></column>
    1010    <column name="stackTypeID" type="TBYTE" default="0" comment="stack type identifier"></column>
    11     <column name="refImageID" type="TLONGLONG" default="-999" comment="identifier of image used as reference for analysis"></column>
    12     <column name="subtrImageID" type="TLONGLONG" default="-999" comment="identifier of image subtracted to generate difference image"></column>
     11    <column name="stackGroupID" type="TLONG" default="0" comment="stack group identifier"></column>
    1312    <column name="magSat" type="TFLOAT" default="-999" comment="saturation magnitude level"></column>
    1413    <column name="analVer" type="TSHORT" default="-999" comment="analysis version index"></column>
     
    1918    <column name="nAstroRef" type="TLONG" default="-999" comment="number of astrometric reference sources"></column>
    2019    <column name="nPhoRef" type="TLONG" default="-999" comment="number of photometric reference sources"></column>
    21     <column name="psfFwhm" type="TFLOAT" default="-999" comment="PSF full width at half maximum"></column>
    22     <column name="psfmodelID" type="TSHORT" default="-999" comment="PSF model identifier"></column>
    23     <column name="psfWidMajor" type="TFLOAT" default="-999" comment="PSF parameters"></column>
    24     <column name="psfWidMinor" type="TFLOAT" default="-999" comment="PSF parameters"></column>
    25     <column name="psfTheta" type="TFLOAT" default="-999" comment="PSF parameters"></column>
    26     <column name="psfExtra1" type="TFLOAT" default="-999" comment="PSF parameters"></column>
    27     <column name="psfExtra2" type="TFLOAT" default="-999" comment="PSF parameters"></column>
     20    <column name="mean" type="TDOUBLE" default="-999" comment="mean PSF FWHM in the stack"></column>
     21    <column name="max" type="TDOUBLE" default="-999" comment="maximum PSF FWHM in the stack"></column>
    2822    <column name="photoZero" type="TFLOAT" default="-999" comment="local derived photometric zero point"></column>
    2923    <column name="photoColor" type="TFLOAT" default="-999" comment="local derived photometric color term"></column>
     
    4034    <column name="pc002001" type="TDOUBLE" default="-999" comment="elements of rotation/Dcale matrix"></column>
    4135    <column name="pc002002" type="TDOUBLE" default="-999" comment="elements of rotation/Dcale matrix"></column>
    42     <column name="polyOrder" type="TBYTE" default="255" comment="polynomial order of astrometry fit"></column>
    43     <column name="pca1x3y0" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>
    44     <column name="pca1x2y1" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>
    45     <column name="pca1x1y2" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>
    46     <column name="pca1x0y3" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>
    47     <column name="pca1x2y0" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>
    48     <column name="pca1x1y1" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>
    49     <column name="pca1x0y2" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>
    50     <column name="pca2x3y0" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>
    51     <column name="pca2x2y1" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>
    52     <column name="pca2x1y2" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>
    53     <column name="pca2x0y3" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>
    54     <column name="pca2x2y0" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>
    55     <column name="pca2x1y1" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>
    56     <column name="pca2x0y2" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>
    5736    <column name="calibModNum" type="TSHORT" default="0" comment="calibration modification number"></column>
    5837    <column name="dataRelease" type="TBYTE" default="0" comment="Data release"></column>
     
    6544    <column name="filterID" type="TBYTE" default="0" comment="filter identifier"></column>
    6645    <column name="stackTypeID" type="TBYTE" default="0" comment="stack type identifier"></column>
     46    <column name="stackGroupID" type="TLONG" default="0" comment="stack group id"></column>
    6747    <column name="surveyID" type="TBYTE" default="0" comment="survey flag identifier"></column>
    6848    <column name="primaryF" type="TBYTE" default="255" comment="identifies best stack detection for Stacks overlapping the same region of the sky."></column>
     
    8969    <column name="infoFlag" type="TLONG" default="-999" comment="indicator of strange propeties"></column>
    9070    <column name="nFrames" type="TLONG" default="-999" comment="number of frames contributing to source"></column>
    91     <column name="wlSigma" type="TFLOAT" default="-999" comment="weak lensing sigma"></column>
    92     <column name="eps1" type="TFLOAT" default="-999" comment="weak lensing vector element eps(1)"></column>
    93     <column name="eps2" type="TFLOAT" default="-999" comment="weak lensing vector element eps(2)"></column>
    94     <column name="Psm11" type="TFLOAT" default="-999" comment="weak lensing matrix element P_sm(1,1)"></column>
    95     <column name="Psm12" type="TFLOAT" default="-999" comment="weak lensing matrix element P_sm(1,2)"></column>
    96     <column name="Psm21" type="TFLOAT" default="-999" comment="weak lensing matrix element P_sm(2,1)"></column>
    97     <column name="Psm22" type="TFLOAT" default="-999" comment="weak lensing matrix element P_sm(2,2)"></column>
    98     <column name="Psh11" type="TFLOAT" default="-999" comment="weak lensing matrix element P_sh(1,1)"></column>
    99     <column name="Psh12" type="TFLOAT" default="-999" comment="weak lensing matrix element P_sh(1,2)"></column>
    100     <column name="Psh21" type="TFLOAT" default="-999" comment="weak lensing matrix element P_sh(2,1)"></column>
    101     <column name="Psh22" type="TFLOAT" default="-999" comment="weak lensing matrix element P_sh(2,2)"></column>
    10271    <column name="activeFlag" type="TBYTE" default="-999" comment="indicates whether this detection/orphan is still a detection/orphan"></column>
    10372    <column name="assocDate" type="TSTRING" default="28881231" comment="date object association assigned"></column>
     
    11281    <column name="filterID" type="TBYTE" default="0" comment="filter identifier"></column>
    11382    <column name="stackTypeID" type="TBYTE" default="0" comment="stack type identifier"></column>
     83    <column name="stackGroupID" type="TLONG" default="0" comment="stack group id"></column>
    11484    <column name="surveyID" type="TBYTE" default="0" comment="survey flag identifier"></column>
    11585    <column name="primaryF" type="TBYTE" default="255" comment="identifies best stack detection for Stacks overlapping the same region of the sky."></column>
     
    137107    <column name="flxR1" type="TFLOAT" default="-999" comment="Flux inside r = 1"></column>
    138108    <column name="flxR1Err" type="TFLOAT" default="-999" comment="estimated error is flxR1"></column>
    139     <column name="flxR1Var" type="TFLOAT" default="-999" comment="estimated variance in flxR1"></column>
     109    <column name="flxR1Std" type="TFLOAT" default="-999" comment="estimated standard deviation in flxR1"></column>
     110    <column name="flxR1Fill" type="TFLOAT" default="-999" comment="estimated filling factor at R1"></column>
    140111    <column name="flxR2" type="TFLOAT" default="-999" comment="Flux inside r = 2"></column>
    141112    <column name="flxR2Err" type="TFLOAT" default="-999" comment="estimated error is flxR2"></column>
    142     <column name="flxR2Var" type="TFLOAT" default="-999" comment="estimated variance in flxR2"></column>
     113    <column name="flxR2Std" type="TFLOAT" default="-999" comment="estimated standard deviation in flxR2"></column>
     114    <column name="flxR2Fill" type="TFLOAT" default="-999" comment="estimated filling factor at R1"></column>
    143115    <column name="flxR3" type="TFLOAT" default="-999" comment="Flux inside r = 3"></column>
    144116    <column name="flxR3Err" type="TFLOAT" default="-999" comment="estimated error is flxR3"></column>
    145     <column name="flxR3Var" type="TFLOAT" default="-999" comment="estimated variance in flxR3"></column>
     117    <column name="flxR3Std" type="TFLOAT" default="-999" comment="estimated standard deviation in flxR3"></column>
     118    <column name="flxR3Fill" type="TFLOAT" default="-999" comment="estimated filling factor at R3"></column>
    146119    <column name="flxR4" type="TFLOAT" default="-999" comment="Flux inside r = 4"></column>
    147120    <column name="flxR4Err" type="TFLOAT" default="-999" comment="estimated error is flxR4"></column>
    148     <column name="flxR4Var" type="TFLOAT" default="-999" comment="estimated variance in flxR4"></column>
     121    <column name="flxR4Std" type="TFLOAT" default="-999" comment="estimated standard deviation in flxR4"></column>
     122    <column name="flxR4Fill" type="TFLOAT" default="-999" comment="estimated filling factor at R4"></column>
    149123    <column name="flxR5" type="TFLOAT" default="-999" comment="Flux inside r = 5"></column>
    150124    <column name="flxR5Err" type="TFLOAT" default="-999" comment="estimated error is flxR5"></column>
    151     <column name="flxR5Var" type="TFLOAT" default="-999" comment="estimated variance in flxR5"></column>
     125    <column name="flxR5Std" type="TFLOAT" default="-999" comment="estimated standard deviation in flxR5"></column>
     126    <column name="flxR5Fill" type="TFLOAT" default="-999" comment="estimated filling factor at R5"></column>
    152127    <column name="flxR6" type="TFLOAT" default="-999" comment="Flux inside r = 6"></column>
    153128    <column name="flxR6Err" type="TFLOAT" default="-999" comment="estimated error is flxR6"></column>
    154     <column name="flxR6Var" type="TFLOAT" default="-999" comment="estimated variance in flxR6"></column>
     129    <column name="flxR6Std" type="TFLOAT" default="-999" comment="estimated standard deviation in flxR6"></column>
     130    <column name="flxR6Fill" type="TFLOAT" default="-999" comment="estimated filling factor at R6"></column>
    155131    <column name="flxR7" type="TFLOAT" default="-999" comment="Flux inside r = 7"></column>
    156132    <column name="flxR7Err" type="TFLOAT" default="-999" comment="estimated error is flxR7"></column>
    157     <column name="flxR7Var" type="TFLOAT" default="-999" comment="estimated variance in flxR7"></column>
     133    <column name="flxR7Std" type="TFLOAT" default="-999" comment="estimated standard deviation in flxR7"></column>
     134    <column name="flxR7Fill" type="TFLOAT" default="-999" comment="estimated filling factor at R7"></column>
    158135    <column name="flxR8" type="TFLOAT" default="-999" comment="Flux inside r = 8"></column>
    159136    <column name="flxR8Err" type="TFLOAT" default="-999" comment="estimated error is flxR8"></column>
    160     <column name="flxR8Var" type="TFLOAT" default="-999" comment="estimated variance in flxR8"></column>
     137    <column name="flxR8Std" type="TFLOAT" default="-999" comment="estimated standard deviation in flxR8"></column>
     138    <column name="flxR8Fill" type="TFLOAT" default="-999" comment="estimated filling factor at R8"></column>
    161139    <column name="flxR9" type="TFLOAT" default="-999" comment="Flux inside r = 9"></column>
    162140    <column name="flxR9Err" type="TFLOAT" default="-999" comment="estimated error is flxR9"></column>
    163     <column name="flxR9Var" type="TFLOAT" default="-999" comment="estimated variance in flxR9"></column>
     141    <column name="flxR9Std" type="TFLOAT" default="-999" comment="estimated standard deviation in flxR9"></column>
     142    <column name="flxR9Fill" type="TFLOAT" default="-999" comment="estimated filling factor at R9"></column>
    164143    <column name="flxR10" type="TFLOAT" default="-999" comment="Flux inside r = 10"></column>
    165144    <column name="flxR10Err" type="TFLOAT" default="-999" comment="estimated error is flxR10"></column>
    166     <column name="flxR10Var" type="TFLOAT" default="-999" comment="estimated variance in flxR10"></column>
    167     <column name="c1FlxR1" type="TFLOAT" default="-999" comment="Flux inside r = 1"></column>
    168     <column name="c1FlxR1Err" type="TFLOAT" default="-999" comment="estimated error is c1FlxR1"></column>
    169     <column name="c1FlxR1Var" type="TFLOAT" default="-999" comment="estimated variance in c1FlxR1"></column>
    170     <column name="c1FlxR2" type="TFLOAT" default="-999" comment="Flux inside r = 2"></column>
    171     <column name="c1FlxR2Err" type="TFLOAT" default="-999" comment="estimated error is c1FlxR2"></column>
    172     <column name="c1FlxR2Var" type="TFLOAT" default="-999" comment="estimated variance in c1FlxR2"></column>
    173     <column name="c1FlxR3" type="TFLOAT" default="-999" comment="Flux inside r = 3"></column>
    174     <column name="c1FlxR3Err" type="TFLOAT" default="-999" comment="estimated error is c1FlxR3"></column>
    175     <column name="c1FlxR3Var" type="TFLOAT" default="-999" comment="estimated variance in c1FlxR3"></column>
    176     <column name="c1FlxR4" type="TFLOAT" default="-999" comment="Flux inside r = 4"></column>
    177     <column name="c1FlxR4Err" type="TFLOAT" default="-999" comment="estimated error is c1FlxR4"></column>
    178     <column name="c1FlxR4Var" type="TFLOAT" default="-999" comment="estimated variance in c1FlxR4"></column>
    179     <column name="c1FlxR5" type="TFLOAT" default="-999" comment="Flux inside r = 5"></column>
    180     <column name="c1FlxR5Err" type="TFLOAT" default="-999" comment="estimated error is c1FlxR5"></column>
    181     <column name="c1FlxR5Var" type="TFLOAT" default="-999" comment="estimated variance in c1FlxR5"></column>
    182     <column name="c1FlxR6" type="TFLOAT" default="-999" comment="Flux inside r = 6"></column>
    183     <column name="c1FlxR6Err" type="TFLOAT" default="-999" comment="estimated error is c1FlxR6"></column>
    184     <column name="c1FlxR6Var" type="TFLOAT" default="-999" comment="estimated variance in c1FlxR6"></column>
    185     <column name="c1FlxR7" type="TFLOAT" default="-999" comment="Flux inside r = 7"></column>
    186     <column name="c1FlxR7Err" type="TFLOAT" default="-999" comment="estimated error is c1FlxR7"></column>
    187     <column name="c1FlxR7Var" type="TFLOAT" default="-999" comment="estimated variance in c1FlxR7"></column>
    188     <column name="c1FlxR8" type="TFLOAT" default="-999" comment="Flux inside r = 8"></column>
    189     <column name="c1FlxR8Err" type="TFLOAT" default="-999" comment="estimated error is c1FlxR8"></column>
    190     <column name="c1FlxR8Var" type="TFLOAT" default="-999" comment="estimated variance in c1FlxR8"></column>
    191     <column name="c1FlxR9" type="TFLOAT" default="-999" comment="Flux inside r = 9"></column>
    192     <column name="c1FlxR9Err" type="TFLOAT" default="-999" comment="estimated error is c1FlxR9"></column>
    193     <column name="c1FlxR9Var" type="TFLOAT" default="-999" comment="estimated variance in c1FlxR9"></column>
    194     <column name="c1FlxR10" type="TFLOAT" default="-999" comment="Flux inside r = 10"></column>
    195     <column name="c1FlxR10Err" type="TFLOAT" default="-999" comment="estimated error is c1FlxR10"></column>
    196     <column name="c1FlxR10Var" type="TFLOAT" default="-999" comment="estimated variance in c1FlxR10"></column>
    197     <column name="c2FlxR1" type="TFLOAT" default="-999" comment="Flux inside r = 1"></column>
    198     <column name="c2FlxR1Err" type="TFLOAT" default="-999" comment="estimated error is c2FlxR1"></column>
    199     <column name="c2FlxR1Var" type="TFLOAT" default="-999" comment="estimated variance in c2FlxR1"></column>
    200     <column name="c2FlxR2" type="TFLOAT" default="-999" comment="Flux inside r = 2"></column>
    201     <column name="c2FlxR2Err" type="TFLOAT" default="-999" comment="estimated error is c2FlxR2"></column>
    202     <column name="c2FlxR2Var" type="TFLOAT" default="-999" comment="estimated variance in c2FlxR2"></column>
    203     <column name="c2FlxR3" type="TFLOAT" default="-999" comment="Flux inside r = 3"></column>
    204     <column name="c2FlxR3Err" type="TFLOAT" default="-999" comment="estimated error is c2FlxR3"></column>
    205     <column name="c2FlxR3Var" type="TFLOAT" default="-999" comment="estimated variance in c2FlxR3"></column>
    206     <column name="c2FlxR4" type="TFLOAT" default="-999" comment="Flux inside r = 4"></column>
    207     <column name="c2FlxR4Err" type="TFLOAT" default="-999" comment="estimated error is c2FlxR4"></column>
    208     <column name="c2FlxR4Var" type="TFLOAT" default="-999" comment="estimated variance in c2FlxR4"></column>
    209     <column name="c2FlxR5" type="TFLOAT" default="-999" comment="Flux inside r = 5"></column>
    210     <column name="c2FlxR5Err" type="TFLOAT" default="-999" comment="estimated error is c2FlxR5"></column>
    211     <column name="c2FlxR5Var" type="TFLOAT" default="-999" comment="estimated variance in c2FlxR5"></column>
    212     <column name="c2FlxR6" type="TFLOAT" default="-999" comment="Flux inside r = 6"></column>
    213     <column name="c2FlxR6Err" type="TFLOAT" default="-999" comment="estimated error is c2FlxR6"></column>
    214     <column name="c2FlxR6Var" type="TFLOAT" default="-999" comment="estimated variance in c2FlxR6"></column>
    215     <column name="c2FlxR7" type="TFLOAT" default="-999" comment="Flux inside r = 7"></column>
    216     <column name="c2FlxR7Err" type="TFLOAT" default="-999" comment="estimated error is c2FlxR7"></column>
    217     <column name="c2FlxR7Var" type="TFLOAT" default="-999" comment="estimated variance in c2FlxR7"></column>
    218     <column name="c2FlxR8" type="TFLOAT" default="-999" comment="Flux inside r = 8"></column>
    219     <column name="c2FlxR8Err" type="TFLOAT" default="-999" comment="estimated error is c2FlxR8"></column>
    220     <column name="c2FlxR8Var" type="TFLOAT" default="-999" comment="estimated variance in c2FlxR8"></column>
    221     <column name="c2FlxR9" type="TFLOAT" default="-999" comment="Flux inside r = 9"></column>
    222     <column name="c2FlxR9Err" type="TFLOAT" default="-999" comment="estimated error is c2FlxR9"></column>
    223     <column name="c2FlxR9Var" type="TFLOAT" default="-999" comment="estimated variance in c2FlxR9"></column>
    224     <column name="c2FlxR10" type="TFLOAT" default="-999" comment="Flux inside r = 10"></column>
    225     <column name="c2FlxR10Err" type="TFLOAT" default="-999" comment="estimated error is c2FlxR10"></column>
    226     <column name="c2FlxR10Var" type="TFLOAT" default="-999" comment="estimated variance in c2FlxR10"></column>
    227     <column name="c3FlxR1" type="TFLOAT" default="-999" comment="Flux inside r = 1"></column>
    228     <column name="c3FlxR1Err" type="TFLOAT" default="-999" comment="estimated error is c3FlxR1"></column>
    229     <column name="c3FlxR1Var" type="TFLOAT" default="-999" comment="estimated variance in c3FlxR1"></column>
    230     <column name="c3FlxR2" type="TFLOAT" default="-999" comment="Flux inside r = 2"></column>
    231     <column name="c3FlxR2Err" type="TFLOAT" default="-999" comment="estimated error is c3FlxR2"></column>
    232     <column name="c3FlxR2Var" type="TFLOAT" default="-999" comment="estimated variance in c3FlxR2"></column>
    233     <column name="c3FlxR3" type="TFLOAT" default="-999" comment="Flux inside r = 3"></column>
    234     <column name="c3FlxR3Err" type="TFLOAT" default="-999" comment="estimated error is c3FlxR3"></column>
    235     <column name="c3FlxR3Var" type="TFLOAT" default="-999" comment="estimated variance in c3FlxR3"></column>
    236     <column name="c3FlxR4" type="TFLOAT" default="-999" comment="Flux inside r = 4"></column>
    237     <column name="c3FlxR4Err" type="TFLOAT" default="-999" comment="estimated error is c3FlxR4"></column>
    238     <column name="c3FlxR4Var" type="TFLOAT" default="-999" comment="estimated variance in c3FlxR4"></column>
    239     <column name="c3FlxR5" type="TFLOAT" default="-999" comment="Flux inside r = 5"></column>
    240     <column name="c3FlxR5Err" type="TFLOAT" default="-999" comment="estimated error is c3FlxR5"></column>
    241     <column name="c3FlxR5Var" type="TFLOAT" default="-999" comment="estimated variance in c3FlxR5"></column>
    242     <column name="c3FlxR6" type="TFLOAT" default="-999" comment="Flux inside r = 6"></column>
    243     <column name="c3FlxR6Err" type="TFLOAT" default="-999" comment="estimated error is c3FlxR6"></column>
    244     <column name="c3FlxR6Var" type="TFLOAT" default="-999" comment="estimated variance in c3FlxR6"></column>
    245     <column name="c3FlxR7" type="TFLOAT" default="-999" comment="Flux inside r = 7"></column>
    246     <column name="c3FlxR7Err" type="TFLOAT" default="-999" comment="estimated error is c3FlxR7"></column>
    247     <column name="c3FlxR7Var" type="TFLOAT" default="-999" comment="estimated variance in c3FlxR7"></column>
    248     <column name="c3FlxR8" type="TFLOAT" default="-999" comment="Flux inside r = 8"></column>
    249     <column name="c3FlxR8Err" type="TFLOAT" default="-999" comment="estimated error is c3FlxR8"></column>
    250     <column name="c3FlxR8Var" type="TFLOAT" default="-999" comment="estimated variance in c3FlxR8"></column>
    251     <column name="c3FlxR9" type="TFLOAT" default="-999" comment="Flux inside r = 9"></column>
    252     <column name="c3FlxR9Err" type="TFLOAT" default="-999" comment="estimated error is c3FlxR9"></column>
    253     <column name="c3FlxR9Var" type="TFLOAT" default="-999" comment="estimated variance in c3FlxR9"></column>
    254     <column name="c3FlxR10" type="TFLOAT" default="-999" comment="Flux inside r = 10"></column>
    255     <column name="c3FlxR10Err" type="TFLOAT" default="-999" comment="estimated error is c3FlxR10"></column>
    256     <column name="c3FlxR10Var" type="TFLOAT" default="-999" comment="estimated variance in c3FlxR10"></column>
     145    <column name="flxR10Std" type="TFLOAT" default="-999" comment="estimated standard deviation in flxR10"></column>
     146    <column name="flxR10Fill" type="TFLOAT" default="-999" comment="estimated filling factor at R10"></column>
     147    <column name="c1flxR1" type="TFLOAT" default="-999" comment="Flux inside r = 1"></column>
     148    <column name="c1flxR1Err" type="TFLOAT" default="-999" comment="estimated error is c1flxR1"></column>
     149    <column name="c1flxR1Std" type="TFLOAT" default="-999" comment="estimated standard deviation in c1flxR1"></column>
     150    <column name="c1flxR1Fill" type="TFLOAT" default="-999" comment="estimated filling factor at R1"></column>
     151    <column name="c1flxR2" type="TFLOAT" default="-999" comment="Flux inside r = 2"></column>
     152    <column name="c1flxR2Err" type="TFLOAT" default="-999" comment="estimated error is c1flxR2"></column>
     153    <column name="c1flxR2Std" type="TFLOAT" default="-999" comment="estimated standard deviation in c1flxR2"></column>
     154    <column name="c1flxR2Fill" type="TFLOAT" default="-999" comment="estimated filling factor at R1"></column>
     155    <column name="c1flxR3" type="TFLOAT" default="-999" comment="Flux inside r = 3"></column>
     156    <column name="c1flxR3Err" type="TFLOAT" default="-999" comment="estimated error is c1flxR3"></column>
     157    <column name="c1flxR3Std" type="TFLOAT" default="-999" comment="estimated standard deviation in c1flxR3"></column>
     158    <column name="c1flxR3Fill" type="TFLOAT" default="-999" comment="estimated filling factor at R3"></column>
     159    <column name="c1flxR4" type="TFLOAT" default="-999" comment="Flux inside r = 4"></column>
     160    <column name="c1flxR4Err" type="TFLOAT" default="-999" comment="estimated error is c1flxR4"></column>
     161    <column name="c1flxR4Std" type="TFLOAT" default="-999" comment="estimated standard deviation in c1flxR4"></column>
     162    <column name="c1flxR4Fill" type="TFLOAT" default="-999" comment="estimated filling factor at R4"></column>
     163    <column name="c1flxR5" type="TFLOAT" default="-999" comment="Flux inside r = 5"></column>
     164    <column name="c1flxR5Err" type="TFLOAT" default="-999" comment="estimated error is c1flxR5"></column>
     165    <column name="c1flxR5Std" type="TFLOAT" default="-999" comment="estimated standard deviation in c1flxR5"></column>
     166    <column name="c1flxR5Fill" type="TFLOAT" default="-999" comment="estimated filling factor at R5"></column>
     167    <column name="c1flxR6" type="TFLOAT" default="-999" comment="Flux inside r = 6"></column>
     168    <column name="c1flxR6Err" type="TFLOAT" default="-999" comment="estimated error is c1flxR6"></column>
     169    <column name="c1flxR6Std" type="TFLOAT" default="-999" comment="estimated standard deviation in c1flxR6"></column>
     170    <column name="c1flxR6Fill" type="TFLOAT" default="-999" comment="estimated filling factor at R6"></column>
     171    <column name="c1flxR7" type="TFLOAT" default="-999" comment="Flux inside r = 7"></column>
     172    <column name="c1flxR7Err" type="TFLOAT" default="-999" comment="estimated error is c1flxR7"></column>
     173    <column name="c1flxR7Std" type="TFLOAT" default="-999" comment="estimated standard deviation in c1flxR7"></column>
     174    <column name="c1flxR7Fill" type="TFLOAT" default="-999" comment="estimated filling factor at R7"></column>
     175    <column name="c1flxR8" type="TFLOAT" default="-999" comment="Flux inside r = 8"></column>
     176    <column name="c1flxR8Err" type="TFLOAT" default="-999" comment="estimated error is c1flxR8"></column>
     177    <column name="c1flxR8Std" type="TFLOAT" default="-999" comment="estimated standard deviation in c1flxR8"></column>
     178    <column name="c1flxR8Fill" type="TFLOAT" default="-999" comment="estimated filling factor at R8"></column>
     179    <column name="c1flxR9" type="TFLOAT" default="-999" comment="Flux inside r = 9"></column>
     180    <column name="c1flxR9Err" type="TFLOAT" default="-999" comment="estimated error is c1flxR9"></column>
     181    <column name="c1flxR9Std" type="TFLOAT" default="-999" comment="estimated standard deviation in c1flxR9"></column>
     182    <column name="c1flxR9Fill" type="TFLOAT" default="-999" comment="estimated filling factor at R9"></column>
     183    <column name="c1flxR10" type="TFLOAT" default="-999" comment="Flux inside r = 10"></column>
     184    <column name="c1flxR10Err" type="TFLOAT" default="-999" comment="estimated error is c1flxR10"></column>
     185    <column name="c1flxR10Std" type="TFLOAT" default="-999" comment="estimated standard deviation in c1flxR10"></column>
     186    <column name="c1flxR10Fill" type="TFLOAT" default="-999" comment="estimated filling factor at R10"></column>
     187    <column name="c2flxR1" type="TFLOAT" default="-999" comment="Flux inside r = 1"></column>
     188    <column name="c2flxR1Err" type="TFLOAT" default="-999" comment="estimated error is c2flxR1"></column>
     189    <column name="c2flxR1Std" type="TFLOAT" default="-999" comment="estimated standard deviation in c2flxR1"></column>
     190    <column name="c2flxR1Fill" type="TFLOAT" default="-999" comment="estimated filling factor at R1"></column>
     191    <column name="c2flxR2" type="TFLOAT" default="-999" comment="Flux inside r = 2"></column>
     192    <column name="c2flxR2Err" type="TFLOAT" default="-999" comment="estimated error is c2flxR2"></column>
     193    <column name="c2flxR2Std" type="TFLOAT" default="-999" comment="estimated standard deviation in c2flxR2"></column>
     194    <column name="c2flxR2Fill" type="TFLOAT" default="-999" comment="estimated filling factor at R1"></column>
     195    <column name="c2flxR3" type="TFLOAT" default="-999" comment="Flux inside r = 3"></column>
     196    <column name="c2flxR3Err" type="TFLOAT" default="-999" comment="estimated error is c2flxR3"></column>
     197    <column name="c2flxR3Std" type="TFLOAT" default="-999" comment="estimated standard deviation in c2flxR3"></column>
     198    <column name="c2flxR3Fill" type="TFLOAT" default="-999" comment="estimated filling factor at R3"></column>
     199    <column name="c2flxR4" type="TFLOAT" default="-999" comment="Flux inside r = 4"></column>
     200    <column name="c2flxR4Err" type="TFLOAT" default="-999" comment="estimated error is c2flxR4"></column>
     201    <column name="c2flxR4Std" type="TFLOAT" default="-999" comment="estimated standard deviation in c2flxR4"></column>
     202    <column name="c2flxR4Fill" type="TFLOAT" default="-999" comment="estimated filling factor at R4"></column>
     203    <column name="c2flxR5" type="TFLOAT" default="-999" comment="Flux inside r = 5"></column>
     204    <column name="c2flxR5Err" type="TFLOAT" default="-999" comment="estimated error is c2flxR5"></column>
     205    <column name="c2flxR5Std" type="TFLOAT" default="-999" comment="estimated standard deviation in c2flxR5"></column>
     206    <column name="c2flxR5Fill" type="TFLOAT" default="-999" comment="estimated filling factor at R5"></column>
     207    <column name="c2flxR6" type="TFLOAT" default="-999" comment="Flux inside r = 6"></column>
     208    <column name="c2flxR6Err" type="TFLOAT" default="-999" comment="estimated error is c2flxR6"></column>
     209    <column name="c2flxR6Std" type="TFLOAT" default="-999" comment="estimated standard deviation in c2flxR6"></column>
     210    <column name="c2flxR6Fill" type="TFLOAT" default="-999" comment="estimated filling factor at R6"></column>
     211    <column name="c2flxR7" type="TFLOAT" default="-999" comment="Flux inside r = 7"></column>
     212    <column name="c2flxR7Err" type="TFLOAT" default="-999" comment="estimated error is c2flxR7"></column>
     213    <column name="c2flxR7Std" type="TFLOAT" default="-999" comment="estimated standard deviation in c2flxR7"></column>
     214    <column name="c2flxR7Fill" type="TFLOAT" default="-999" comment="estimated filling factor at R7"></column>
     215    <column name="c2flxR8" type="TFLOAT" default="-999" comment="Flux inside r = 8"></column>
     216    <column name="c2flxR8Err" type="TFLOAT" default="-999" comment="estimated error is c2flxR8"></column>
     217    <column name="c2flxR8Std" type="TFLOAT" default="-999" comment="estimated standard deviation in c2flxR8"></column>
     218    <column name="c2flxR8Fill" type="TFLOAT" default="-999" comment="estimated filling factor at R8"></column>
     219    <column name="c2flxR9" type="TFLOAT" default="-999" comment="Flux inside r = 9"></column>
     220    <column name="c2flxR9Err" type="TFLOAT" default="-999" comment="estimated error is c2flxR9"></column>
     221    <column name="c2flxR9Std" type="TFLOAT" default="-999" comment="estimated standard deviation in c2flxR9"></column>
     222    <column name="c2flxR9Fill" type="TFLOAT" default="-999" comment="estimated filling factor at R9"></column>
     223    <column name="c2flxR10" type="TFLOAT" default="-999" comment="Flux inside r = 10"></column>
     224    <column name="c2flxR10Err" type="TFLOAT" default="-999" comment="estimated error is c2flxR10"></column>
     225    <column name="c2flxR10Std" type="TFLOAT" default="-999" comment="estimated standard deviation in c2flxR10"></column>
     226    <column name="c2flxR10Fill" type="TFLOAT" default="-999" comment="estimated filling factor at R10"></column>
    257227    <column name="logC" type="TFLOAT" default="-999" comment="Abraham concentration index"></column>
    258228    <column name="logA" type="TFLOAT" default="-999" comment="Abraham asymmetry index"></column>
     
    267237    <column name="filterID" type="TBYTE" default="0" comment="filter identifier"></column>
    268238    <column name="stackTypeID" type="TBYTE" default="0" comment="stack type identifier"></column>
     239    <column name="stackGroupID" type="TLONG" default="0" comment="stack group id"></column>
    269240    <column name="surveyID" type="TBYTE" default="0" comment="survey flag identifier"></column>
    270241    <column name="primaryF" type="TBYTE" default="255" comment="identifies best stack detection for Stacks overlapping the same region of the sky."></column>
     
    276247    <column name="deVAb" type="TFLOAT" default="-999" comment="deVaucoulerus axis ratio"></column>
    277248    <column name="deVAbErr" type="TFLOAT" default="-999" comment="estimated error in deVaucoulerus axis ratio"></column>
     249    <column name="deVPhi" type="TFLOAT" default="-999" comment="estmated phi of deVaucouleurs axis"></column>
     250    <column name="deVPhiErr" type="TFLOAT" default="-999" comment="estmated error of phi of deVaucouleurs axis"></column>
    278251    <column name="raDeVOff" type="TFLOAT" default="-999" comment="Offset in RA of deVaucouleurs fit from PSF RA"></column>
    279252    <column name="decDeVOff" type="TFLOAT" default="-999" comment="Offset in DEC of deVaucouleurs fit from PSF DEC"></column>
     
    288261    <column name="deVCovar15" type="TFLOAT" default="-999" comment="covariance for deVaucouleurs fit"></column>
    289262    <column name="deVCovar16" type="TFLOAT" default="-999" comment="covariance for deVaucouleurs fit"></column>
     263    <column name="deVCovar17" type="TFLOAT" default="-999" comment="covariance for deVaucouleurs fit"></column>
    290264    <column name="deVCovar22" type="TFLOAT" default="-999" comment="covariance for deVaucouleurs fit"></column>
    291265    <column name="deVCovar23" type="TFLOAT" default="-999" comment="covariance for deVaucouleurs fit"></column>
     
    293267    <column name="deVCovar25" type="TFLOAT" default="-999" comment="covariance for deVaucouleurs fit"></column>
    294268    <column name="deVCovar26" type="TFLOAT" default="-999" comment="covariance for deVaucouleurs fit"></column>
     269    <column name="deVCovar27" type="TFLOAT" default="-999" comment="covariance for deVaucouleurs fit"></column>
    295270    <column name="deVCovar33" type="TFLOAT" default="-999" comment="covariance for deVaucouleurs fit"></column>
    296271    <column name="deVCovar34" type="TFLOAT" default="-999" comment="covariance for deVaucouleurs fit"></column>
    297272    <column name="deVCovar35" type="TFLOAT" default="-999" comment="covariance for deVaucouleurs fit"></column>
    298273    <column name="deVCovar36" type="TFLOAT" default="-999" comment="covariance for deVaucouleurs fit"></column>
     274    <column name="deVCovar37" type="TFLOAT" default="-999" comment="covariance for deVaucouleurs fit"></column>
    299275    <column name="deVCovar44" type="TFLOAT" default="-999" comment="covariance for deVaucouleurs fit"></column>
    300276    <column name="deVCovar45" type="TFLOAT" default="-999" comment="covariance for deVaucouleurs fit"></column>
    301277    <column name="deVCovar46" type="TFLOAT" default="-999" comment="covariance for deVaucouleurs fit"></column>
     278    <column name="deVCovar47" type="TFLOAT" default="-999" comment="covariance for deVaucouleurs fit"></column>
    302279    <column name="deVCovar55" type="TFLOAT" default="-999" comment="covariance for deVaucouleurs fit"></column>
    303280    <column name="deVCovar56" type="TFLOAT" default="-999" comment="covariance for deVaucouleurs fit"></column>
     281    <column name="deVCovar57" type="TFLOAT" default="-999" comment="covariance for deVaucouleurs fit"></column>
    304282    <column name="deVCovar66" type="TFLOAT" default="-999" comment="covariance for deVaucouleurs fit"></column>
     283    <column name="deVCovar67" type="TFLOAT" default="-999" comment="covariance for deVaucouleurs fit"></column>
     284    <column name="deVCovar77" type="TFLOAT" default="-999" comment="covariance for deVaucouleurs fit"></column>
    305285    <column name="expRadius" type="TFLOAT" default="-999" comment="Exponential fit radius"></column>
    306286    <column name="expRadiusErr" type="TFLOAT" default="-999" comment="estimated error in Exponential fit radius"></column>
     
    309289    <column name="expAb" type="TFLOAT" default="-999" comment="Exponential fit axis ratio"></column>
    310290    <column name="expAbErr" type="TFLOAT" default="-999" comment="estimated error in Exponential fit axis ratio"></column>
     291    <column name="expPhi" type="TFLOAT" default="-999" comment="estmated phi of Exponential axis"></column>
     292    <column name="expPhiErr" type="TFLOAT" default="-999" comment="estmated error of phi of Exponential axis"></column>
    311293    <column name="raExpOff" type="TFLOAT" default="-999" comment="Offset in RA of Exponential fit from PSF RA"></column>
    312294    <column name="decExpOff" type="TFLOAT" default="-999" comment="Offset in DEC of Exponential fit from PSF DEC"></column>
     
    321303    <column name="expCovar15" type="TFLOAT" default="-999" comment="covariance for Exponential fit"></column>
    322304    <column name="expCovar16" type="TFLOAT" default="-999" comment="covariance for Exponential fit"></column>
     305    <column name="expCovar17" type="TFLOAT" default="-999" comment="covariance for Exponential fit"></column>
    323306    <column name="expCovar22" type="TFLOAT" default="-999" comment="covariance for Exponential fit"></column>
    324307    <column name="expCovar23" type="TFLOAT" default="-999" comment="covariance for Exponential fit"></column>
     
    326309    <column name="expCovar25" type="TFLOAT" default="-999" comment="covariance for Exponential fit"></column>
    327310    <column name="expCovar26" type="TFLOAT" default="-999" comment="covariance for Exponential fit"></column>
     311    <column name="expCovar27" type="TFLOAT" default="-999" comment="covariance for Exponential fit"></column>
    328312    <column name="expCovar33" type="TFLOAT" default="-999" comment="covariance for Exponential fit"></column>
    329313    <column name="expCovar34" type="TFLOAT" default="-999" comment="covariance for Exponential fit"></column>
    330314    <column name="expCovar35" type="TFLOAT" default="-999" comment="covariance for Exponential fit"></column>
    331315    <column name="expCovar36" type="TFLOAT" default="-999" comment="covariance for Exponential fit"></column>
     316    <column name="expCovar37" type="TFLOAT" default="-999" comment="covariance for Exponential fit"></column>
    332317    <column name="expCovar44" type="TFLOAT" default="-999" comment="covariance for Exponential fit"></column>
    333318    <column name="expCovar45" type="TFLOAT" default="-999" comment="covariance for Exponential fit"></column>
    334319    <column name="expCovar46" type="TFLOAT" default="-999" comment="covariance for Exponential fit"></column>
     320    <column name="expCovar47" type="TFLOAT" default="-999" comment="covariance for Exponential fit"></column>
    335321    <column name="expCovar55" type="TFLOAT" default="-999" comment="covariance for Exponential fit"></column>
    336322    <column name="expCovar56" type="TFLOAT" default="-999" comment="covariance for Exponential fit"></column>
     323    <column name="expCovar57" type="TFLOAT" default="-999" comment="covariance for Exponential fit"></column>
    337324    <column name="expCovar66" type="TFLOAT" default="-999" comment="covariance for Exponential fit"></column>
     325    <column name="expCovar67" type="TFLOAT" default="-999" comment="covariance for Exponential fit"></column>
     326    <column name="expCovar77" type="TFLOAT" default="-999" comment="covariance for Exponential fit"></column>
    338327    <column name="serRadius" type="TFLOAT" default="-999" comment="Sersic radius"></column>
    339328    <column name="serRadiusErr" type="TFLOAT" default="-999" comment="estimated error in Sersic radius"></column>
     
    344333    <column name="serNu" type="TFLOAT" default="-999" comment="Sersic index"></column>
    345334    <column name="serNuErr" type="TFLOAT" default="-999" comment="estimated error in Sersic index"></column>
     335    <column name="serPhi" type="TFLOAT" default="-999" comment="estmated phi of Sersic axis"></column>
     336    <column name="serPhiErr" type="TFLOAT" default="-999" comment="estmated error of phi of Sersic axis"></column>
    346337    <column name="raSerOff" type="TFLOAT" default="-999" comment="Offset in RA of Sersic fit from PSF RA"></column>
    347338    <column name="decSerOff" type="TFLOAT" default="-999" comment="Offset in DEC of Sersic fit from PSF DEC"></column>
     
    357348    <column name="sersicCovar16" type="TFLOAT" default="-999" comment="covariance for Sersic fit"></column>
    358349    <column name="sersicCovar17" type="TFLOAT" default="-999" comment="covariance for Sersic fit"></column>
     350    <column name="sersicCovar18" type="TFLOAT" default="-999" comment="covariance for Sersic fit"></column>
    359351    <column name="sersicCovar22" type="TFLOAT" default="-999" comment="covariance for Sersic fit"></column>
    360352    <column name="sersicCovar23" type="TFLOAT" default="-999" comment="covariance for Sersic fit"></column>
     
    363355    <column name="sersicCovar26" type="TFLOAT" default="-999" comment="covariance for Sersic fit"></column>
    364356    <column name="sersicCovar27" type="TFLOAT" default="-999" comment="covariance for Sersic fit"></column>
     357    <column name="sersicCovar28" type="TFLOAT" default="-999" comment="covariance for Sersic fit"></column>
    365358    <column name="sersicCovar33" type="TFLOAT" default="-999" comment="covariance for Sersic fit"></column>
    366359    <column name="sersicCovar34" type="TFLOAT" default="-999" comment="covariance for Sersic fit"></column>
     
    368361    <column name="sersicCovar36" type="TFLOAT" default="-999" comment="covariance for Sersic fit"></column>
    369362    <column name="sersicCovar37" type="TFLOAT" default="-999" comment="covariance for Sersic fit"></column>
     363    <column name="sersicCovar38" type="TFLOAT" default="-999" comment="covariance for Sersic fit"></column>
    370364    <column name="sersicCovar44" type="TFLOAT" default="-999" comment="covariance for Sersic fit"></column>
    371365    <column name="sersicCovar45" type="TFLOAT" default="-999" comment="covariance for Sersic fit"></column>
    372366    <column name="sersicCovar46" type="TFLOAT" default="-999" comment="covariance for Sersic fit"></column>
    373367    <column name="sersicCovar47" type="TFLOAT" default="-999" comment="covariance for Sersic fit"></column>
     368    <column name="sersicCovar48" type="TFLOAT" default="-999" comment="covariance for Sersic fit"></column>
    374369    <column name="sersicCovar55" type="TFLOAT" default="-999" comment="covariance for Sersic fit"></column>
    375370    <column name="sersicCovar56" type="TFLOAT" default="-999" comment="covariance for Sersic fit"></column>
    376371    <column name="sersicCovar57" type="TFLOAT" default="-999" comment="covariance for Sersic fit"></column>
     372    <column name="sersicCovar58" type="TFLOAT" default="-999" comment="covariance for Sersic fit"></column>
    377373    <column name="sersicCovar66" type="TFLOAT" default="-999" comment="covariance for Sersic fit"></column>
    378374    <column name="sersicCovar67" type="TFLOAT" default="-999" comment="covariance for Sersic fit"></column>
     375    <column name="sersicCovar68" type="TFLOAT" default="-999" comment="covariance for Sersic fit"></column>
    379376    <column name="sersicCovar77" type="TFLOAT" default="-999" comment="covariance for Sersic fit"></column>
     377    <column name="sersicCovar78" type="TFLOAT" default="-999" comment="covariance for Sersic fit"></column>
     378    <column name="sersicCovar88" type="TFLOAT" default="-999" comment="covariance for Sersic fit"></column>
    380379    <column name="activeFlag" type="TBYTE" default="-999" comment="indicates whether this detection/orphan is still a detection/orphan"></column>
    381380    <column name="dataRelease" type="TBYTE" default="0" comment="Data release when this detection was taken"></column>
  • branches/czw_branch/20101203/ippToPsps/docs/loadingSummary.txt

    r30118 r30586  
    11***********************************************************
    2 *    Summary of IPP->PSPS loading as of 2010-12-09 12:05:49
    3 *    DVO Db = 'ThreePi.V1'
    4 *    Exposures between 105437 and 213141
     2*    Summary of IPP->PSPS loading as of 2011-01-26 08:13:49
     3*    DVO Db = 'Threepi.V1'
     4*    Exposures between 105437 and 230033
    55*
    6 * total Exposures                            = 35973
    7 *   merged into PSPS                         = 32082
    8 *   un-merged                                = 3890
    9 *     unprocessed by ippToPsps               = 3351
    10 *       missing SMF files                    = 518
    11 *       available SMF files                  = 2833
    12 *     processed by ippToPsps                 = 539
    13 *       not on datastore                     = 4
    14 *       on datastore                         = 535
    15 *         not loaded to ODM                  = 19
    16 *         loaded to ODM but rejected         = 516
    17 *           under -30 dec limit              = 493
    18 *           remaining ODM failures           = 23
     6* Total Exposures                            = 43669
     7*   Merged into PSPS                         = 42144
     8*   Un-merged                                = 1524
     9*     Unprocessed by ippToPsps               = 748
     10*       Missing SMF files                    = 584
     11*       Available SMF files                  = 164
     12*     Processed by ippToPsps                 = 776
     13*       Not on datastore                     = 0
     14*       On datastore                         = 776
     15*         Not loaded to ODM                  = 32
     16*         Loaded to ODM                      = 744
     17*           MergeWorthy                      = 0
     18*           Not MergeWorthy                  = 744
     19*             Under -30 dec limit            = 645
     20*             Remaining failures             = 99
    1921*
    2022***********************************************************
  • branches/czw_branch/20101203/ippToPsps/perl/checkOdmStatus.pl

    r30118 r30586  
    183183        }
    184184        # if merged and already removed from datastore then delete files
    185         if (defined $filePath && $merged && $deleted) {
     185        if (defined $filePath && $mergeWorthy && $deleted) {
    186186
    187187            if($batch->deleteFile($batchId)) {$numDeleted++;}
  • branches/czw_branch/20101203/ippToPsps/perl/exposureSummary.pl

    r30118 r30586  
    8686my $totalUnmerged = 0;
    8787my $totalMergeWorthy = 0;
     88my $totalNotMergeWorthy = 0;
    8889my $totalProcessed = 0;
    8990my $totalOnDatastore = 0;
    9091my $totalLoadedToOdm = 0;
    9192my $totalLoadFailed = 0;
     93my $totalMergeWorthy = 0;
    9294my $totalUnderObjIdLimit = 0;
    9395my $totalUnprocessed = 0;
    9496my $totalUnprocessedAvailableSmfs = 0;
    95 my $totalOdmFailures = 0;
     97my $remainingOdmFailures = 0;
    9698my $totalUnprocessedMissingSmfs = 0;
     99my $totalProcessedNotOnDatastore = 0;
    97100
    98101
    99102open (UNPRO, ">unprocessedExposures.txt") or print "* Problem opening data file for unprocessed exposures\n";
    100103open (ODMFAIL, ">odmFailures.txt") or print "* Problem opening data file for ODM failures\n";
     104open (NOTONDATASTORE, ">notOnDatastore.txt") or print "* Problem opening data file for exposures not on datastore\n";
    101105
    102106if ($checkNeb) {
     
    114118    if ($verbose) {print "$totalUnmerged | $expId \n"; }
    115119
     120    # processed stuff
    116121    if ($ippToPspsDb->isExposureProcessed($expId)) {
    117122
    118123        $totalProcessed++;
    119124
    120         if ($ippToPspsDb->isExposureAlreadyPublished($expId)) {
     125        if (!$ippToPspsDb->isExposureAlreadyPublished($expId)) {
     126
     127            $totalProcessedNotOnDatastore++;
     128            print NOTONDATASTORE "$expId\n";
     129        }
     130        else {
    121131
    122132            $totalOnDatastore++;
     
    126136                $totalLoadedToOdm++;
    127137
    128                 if ($ippToPspsDb->didLoadFail($expId)) {
    129 
    130                     $totalLoadFailed++;
     138                if ($ippToPspsDb->isMergeWorthy($expId)) {
     139
     140                    $totalMergeWorthy++;
    131141                }
    132                 if ($ippToPspsDb->isMinObjIdUnderLimit($expId)) {
    133 
    134                     $totalUnderObjIdLimit++;
    135                 }
     142                # not mergeworthy
    136143                else {
    137144
    138                     $totalOdmFailures++;
    139                     print ODMFAIL "$expId\n";
     145                    $totalNotMergeWorthy++;
     146
     147                    #if ($ippToPspsDb->didLoadFail($expId)) {
     148
     149                    #    $totalLoadFailed++;
     150                    #}
     151                    if ($ippToPspsDb->isMinObjIdUnderLimit($expId)) {
     152
     153                        $totalUnderObjIdLimit++;
     154                    }
     155                    else {
     156
     157                        $remainingOdmFailures++;
     158                        print ODMFAIL "$expId\n";
     159                    }
    140160                }
    141161            }
    142162        }
    143163    }
     164    # unprocessed stuff
    144165    else {
    145166
     
    181202close(UNPRO);
    182203close(ODMFAIL);
     204close(NOTONDATASTORE);
    183205if ($checkNeb) {
    184206
     
    186208    close(NOTMISSSMF);
    187209}
    188 my $totalProcessedNotOnDatastore = $totalProcessed - $totalOnDatastore;
    189210my $totalOnDatastoreNotLoaded = $totalOnDatastore - $totalLoadedToOdm;
    190211print "***********************************************************\n";
     
    193214print "*    Exposures between $beginExp and $endExp\n";
    194215print "*\n";
    195 print "* total Exposures                            = $totalExposures\n";
    196 print "*   merged into PSPS                         = $totalMerged\n";
    197 print "*   un-merged                                = $totalUnmerged\n";
    198 print "*     unprocessed by ippToPsps               = $totalUnprocessed\n";
     216print "* Total Exposures                            = $totalExposures\n";
     217print "*   Merged into PSPS                         = $totalMerged\n";
     218print "*   Un-merged                                = $totalUnmerged\n";
     219print "*     Unprocessed by ippToPsps               = $totalUnprocessed\n";
    199220if ($checkNeb) {
    200     print "*       missing SMF files                    = $totalUnprocessedMissingSmfs\n";
    201     print "*       available SMF files                  = $totalUnprocessedAvailableSmfs\n";
    202 }
    203 print "*     processed by ippToPsps                 = $totalProcessed\n";
    204 print "*       not on datastore                     = $totalProcessedNotOnDatastore\n";
    205 print "*       on datastore                         = $totalOnDatastore\n";
    206 print "*         not loaded to ODM                  = $totalOnDatastoreNotLoaded\n";
    207 print "*         loaded to ODM but rejected         = $totalLoadedToOdm\n";
    208 print "*           under -30 dec limit              = $totalUnderObjIdLimit\n";
    209 print "*           remaining ODM failures           = $totalOdmFailures\n";
     221    print "*       Missing SMF files                    = $totalUnprocessedMissingSmfs\n";
     222    print "*       Available SMF files                  = $totalUnprocessedAvailableSmfs\n";
     223}
     224print "*     Processed by ippToPsps                 = $totalProcessed\n";
     225print "*       Not on datastore                     = $totalProcessedNotOnDatastore\n";
     226print "*       On datastore                         = $totalOnDatastore\n";
     227print "*         Not loaded to ODM                  = $totalOnDatastoreNotLoaded\n";
     228print "*         Loaded to ODM                      = $totalLoadedToOdm\n";
     229print "*           MergeWorthy                      = $totalMergeWorthy\n";
     230print "*           Not MergeWorthy                  = $totalNotMergeWorthy\n";
     231print "*             Under -30 dec limit            = $totalUnderObjIdLimit\n";
     232print "*             Remaining failures             = $remainingOdmFailures\n";
    210233print "*\n";
    211234print "***********************************************************\n";
  • branches/czw_branch/20101203/ippToPsps/perl/ippToPsps/Batch.pm

    r29646 r30586  
    126126    $self->{_surveyType} = $self->getSurveyTypeFromDistGroup();
    127127
    128     # can we run ippToPsps?
    129     $self->{_ippToPsps} = can_run('ippToPsps') or
    130         (warn "Can't find 'ippToPsps' program" and exit($PS_EXIT_CONFIG_ERROR));
    131 
    132128    # set up batch output paths
    133129    $self->init();
     
    139135
    140136    return $self;
     137}
     138
     139########################################################################################
     140#
     141# Sets to program and checks we can run it
     142#
     143########################################################################################
     144sub setProgram {
     145    my ($self, $program) = @_;
     146
     147    # can we run ippToPsps?
     148    $self->{program} = can_run($program) or
     149        (warn "Can't find '$program' program" and exit($PS_EXIT_CONFIG_ERROR));
    141150}
    142151
     
    197206    my ($self, $input, $resultsFilePath) = @_;
    198207
    199     # build command
    200     my $command = "$self->{_ippToPsps}";
    201     $command .= " -input $input";
    202     $command .= " -output $self->{_batchDir}";
    203     if (defined $self->{_dvoPath} ) {$command .= " -D CATDIR $self->{_dvoPath}";}
    204     $command .= " -config ../config"; # TODO
    205         $command .= " -id $self->{_expId}";
    206     $command .= " -expname $self->{_expName}";
    207     $command .= " -survey $self->{_surveyType}";
    208     $command .= " -batch $self->{_type}";
    209     $command .= " -results $resultsFilePath";
    210 
    211     # run command
    212     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf )
    213         = run(command => $command, verbose => $self->{_verbose});
    214 
    215     return $success;
     208    my $thisFunction = (caller(0))[3];
     209    print "* ERROR: '$thisFunction' not implemented\n";
    216210}
    217211
  • branches/czw_branch/20101203/ippToPsps/perl/ippToPsps/DetectionBatch.pm

    r30118 r30586  
    88use File::Temp qw(tempfile);
    99use XML::LibXML;
     10use IPC::Cmd 0.36 qw( can_run run );
    1011
    1112use ippToPsps::Batch;
     
    6364            );
    6465
     66    $self->setProgram("detectionbatch");
     67
    6568    bless $self, $class;
    6669    $self->process();
     
    105108#######################################################################################
    106109#
     110# runs the ippToPsps program
     111#
     112#######################################################################################
     113sub runProgram {
     114    my ($self, $input, $resultsFilePath) = @_;
     115
     116    # build command
     117    my $command = "$self->{program}";
     118    $command .= " -input $input";
     119    $command .= " -output $self->{_batchDir}";
     120    if (defined $self->{_dvoPath} ) {$command .= " -D CATDIR $self->{_dvoPath}";}
     121    $command .= " -config ../config"; # TODO
     122    $command .= " -survey $self->{_surveyType}";
     123    $command .= " -results $resultsFilePath";
     124    $command .= " -expid $self->{_expId}";
     125    $command .= " -expname $self->{_expName}";
     126
     127    # run command
     128    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf )
     129        = run(command => $command, verbose => $self->{_verbose});
     130
     131    return $success;
     132}
     133
     134
     135#######################################################################################
     136#
    107137# - Reads results from processing (min/max obj ID etc)
    108138# - writes to Db
  • branches/czw_branch/20101203/ippToPsps/perl/ippToPsps/InitBatch.pm

    r29212 r30586  
    88use File::Temp qw(tempfile);
    99use XML::LibXML;
     10use IPC::Cmd 0.36 qw( can_run run );
    1011
    1112use ippToPsps::Batch;
     
    3738            $_[7]);    # save_temps
    3839
     40    $self->setProgram("initbatch");
     41
    3942    bless $self, $class;
    4043    $self->process();
     
    5255    return "NULL";
    5356}
     57
     58#######################################################################################
     59#
     60# runs the ippToPsps program
     61#
     62#######################################################################################
     63sub runProgram {
     64    my ($self, $input, $resultsFilePath) = @_;
     65
     66    # build command
     67    my $command = "$self->{program}";
     68    $command .= " -output $self->{_batchDir}";
     69    $command .= " -config ../config"; # TODO
     70    $command .= " -results $resultsFilePath";
     71
     72    # run command
     73    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf )
     74        = run(command => $command, verbose => $self->{_verbose});
     75
     76    return $success;
     77}
     78
    5479
    5580#######################################################################################
  • branches/czw_branch/20101203/ippToPsps/perl/ippToPsps/IppToPspsDb.pm

    r30118 r30586  
    252252#######################################################################################
    253253#
     254# Checks whether this exposure is 'MergeWorthy'
     255#
     256########################################################################################
     257sub isMergeWorthy {
     258        my ($self, $expId) = @_;
     259
     260        my $query = $self->{_db}->prepare(<<SQL);
     261        SELECT COUNT(*)
     262            FROM batches
     263            WHERE exp_id = $expId
     264            AND merge_worthy
     265SQL
     266
     267    $query->execute;
     268
     269    return scalar $query->fetchrow_array();
     270}
     271
     272
     273#######################################################################################
     274#
    254275# Checks whether this exposure has a min object ID under old PSPS hard limit of 72010000000000001
    255276#
     
    262283        FROM batches
    263284        WHERE exp_id = $expId
     285        AND min_obj_id > 0
    264286        AND min_obj_id < 72010000000000001
    265287SQL
  • branches/czw_branch/20101203/ippToPsps/perl/ippToPsps/StackBatch.pm

    r29236 r30586  
    88use File::Temp qw(tempfile);
    99use XML::LibXML;
     10use IPC::Cmd 0.36 qw( can_run run );
    1011
    1112use ippToPsps::Batch;
     
    5758            $_[7],  # dvoDb
    5859            $_[8],  # dvoPath
    59             "NULL", # distGroup
     60            "ThreePi", # distGroup TODO
    6061            $_[9], # dontTarBall
    6162            $_[10], # verbose
    6263            $_[11]  # save_temps
    6364            );
    64 
     65   
     66    $self->setProgram("stackbatch");
    6567
    6668    $self->{_skyId} = $_[1];
     
    7880sub createInputFileList {
    7981    my ($self, $inputFile) = @_;
     82
     83  # TODO hardcode demo file for now
     84        print $inputFile "/data/ippc18.0/home/rhenders/psphotstack.v3.001.cmf\n";
     85            return 1;
     86
    8087
    8188    my ($nebPath, $numInputs);
     
    98105    return 1;
    99106}
     107
     108#######################################################################################
     109#
     110# runs the ippToPsps program
     111#
     112#######################################################################################
     113sub runProgram {
     114    my ($self, $input, $resultsFilePath) = @_;
     115
     116    # build command
     117    my $command = "$self->{program}";
     118    $command .= " -input $input";
     119    $command .= " -output $self->{_batchDir}";
     120    if (defined $self->{_dvoPath} ) {$command .= " -D CATDIR $self->{_dvoPath}";}
     121    $command .= " -config ../config"; # TODO
     122    $command .= " -survey $self->{_surveyType}";
     123    $command .= " -results $resultsFilePath";
     124    $command .= " -skycellid $self->{_skyId}";
     125
     126    # run command
     127    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf )
     128        = run(command => $command, verbose => $self->{_verbose});
     129
     130    return $success;
     131}
     132
    100133
    101134#######################################################################################
  • branches/czw_branch/20101203/ippToPsps/perl/pspsSchema2xml.pl

    r29304 r30586  
    3030pod2usage(
    3131        -msg => "\n   Required options:\n\n".
    32         "--schema <path to PSPS schema>\n".
    33         "--type <init|det|diff|stack|object>\n".
     32        "- <path to PSPS schema>\n".
     33        "-t   <init|detection|diff|stack|object>\n".
    3434        -exitval => 3
    3535        ) unless
     
    3737defined $type;
    3838
    39 if ($type ne "init" && $type ne "det" && $type ne "diff" && $type ne "stack" && $type ne "object" ) {
     39if (
     40        $type ne "init" &&
     41        $type ne "detection" &&
     42        $type ne "diff" &&
     43        $type ne "stack" &&
     44        $type ne "object" ) {
    4045
    4146    print "Don't understand type '$type'\n";
     
    4348}
    4449
    45 my $enumsHeader = "ippToPsps".ucfirst($type)."Enums";
     50my $enumsHeader = ucfirst($type)."BatchEnums";
    4651open(OUT, ">".$enumsHeader.".h") or die("Error");
    4752
     
    6166
    6267if ($type eq "init") {createInit();}
    63 elsif ($type eq "det") {createDetections();}
     68elsif ($type eq "detection") {createDetections();}
    6469elsif ($type eq "diff") {createDiffs();}
    6570elsif ($type eq "stack") {createStacks();}
     
    345350    $tablesWriter->endTag();
    346351
    347     $mapWriter->comment(" <map pspsName=\"$name\" ippType=\"$type\" ippName=\"\" comment=\"$comment\"/>");
     352    $mapWriter->comment(" **MISSING** <map pspsName=\"$name\" ippType=\"$type\" ippName=\"\" comment=\"$comment\"/>");
    348353
    349354#    $mapWriter->endTag();
  • branches/czw_branch/20101203/ippToPsps/src/Makefile.am

    r27809 r30586  
    1414
    1515# Force recompilation of ippToPspsVersion.c, since it gets the version information
    16 ippToPspsVersion.c: ippToPspsVersionDefinitions.h
    17 ippToPspsVersionDefinitions.h: ippToPspsVersionDefinitions.h.in FORCE
    18         -$(RM) ippToPspsVersionDefinitions.h
    19         $(SED) -e "s|@IPPTOPSPS_VERSION@|\"$(IPPTOPSPS_VERSION)\"|" -e "s|@IPPTOPSPS_BRANCH@|\"$(IPPTOPSPS_BRANCH)\"|" -e "s|@IPPTOPSPS_SOURCE@|\"$(IPPTOPSPS_SOURCE)\"|" ippToPspsVersionDefinitions.h.in > ippToPspsVersionDefinitions.h
     16Version.c: VersionDefinitions.h
     17VersionDefinitions.h: VersionDefinitions.h.in FORCE
     18        -$(RM) VersionDefinitions.h
     19        $(SED) -e "s|@IPPTOPSPS_VERSION@|\"$(IPPTOPSPS_VERSION)\"|" -e "s|@IPPTOPSPS_BRANCH@|\"$(IPPTOPSPS_BRANCH)\"|" -e "s|@IPPTOPSPS_SOURCE@|\"$(IPPTOPSPS_SOURCE)\"|" VersionDefinitions.h.in > VersionDefinitions.h
    2020FORCE: ;
    2121
    22 bin_PROGRAMS = ippToPsps
     22# all the programs we create
     23bin_PROGRAMS = initbatch detectionbatch stackbatch
    2324
    24 ippToPsps_CFLAGS = $(IPPTOPSPS_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -I/usr/include/libxml2
    25 ippToPsps_LDFLAGS = $(IPPTOPSPS_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) -lxml2
    2625
    27 ippToPsps_SOURCES = \
    28         main.c \
    29         ippToPsps.c \
    30         ippToPspsVersion.c \
    31         ippToPspsConfig.c \
    32         ippToPspsBatchTest.c \
    33         ippToPspsBatchInit.c \
    34         ippToPspsBatchDetection.c \
    35         ippToPspsBatchStack.c \
    36         ippToPspsBatchDifference.c   
     26# initbatch
     27initbatch_CFLAGS = $(IPPTOPSPS_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -I/usr/include/libxml2
     28initbatch_LDFLAGS = $(IPPTOPSPS_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) -lxml2
     29initbatch_SOURCES = \
     30        InitBatch.c \
     31        Batch.c \
     32        Version.c \
     33        Config.c
    3734
    38 include_HEADERS = \
    39         ippToPsps.h \
    40         ippToPspsConfig.h \
    41         ippToPspsDetEnums.h \
    42         ippToPspsDiffEnums.h \
    43         ippToPspsStackEnums.h
     35# detectionbatch
     36detectionbatch_CFLAGS = $(IPPTOPSPS_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -I/usr/include/libxml2
     37detectionbatch_LDFLAGS = $(IPPTOPSPS_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) -lxml2
     38detectionbatch_SOURCES = \
     39        DetectionBatch.c \
     40        Batch.c \
     41        Version.c \
     42        Config.c
     43
     44# stackbatch
     45stackbatch_CFLAGS = $(IPPTOPSPS_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -I/usr/include/libxml2
     46stackbatch_LDFLAGS = $(IPPTOPSPS_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) -lxml2
     47stackbatch_SOURCES = \
     48        StackBatch.c \
     49        Batch.c \
     50        Version.c \
     51        Config.c
    4452
    4553clean-local:
  • branches/czw_branch/20101203/ippTools/share/Makefile.am

    r29908 r30586  
    246246        magictool_exposure.sql \
    247247        magictool_setfull.sql \
     248        magictool_setgotocleaned.sql \
     249        magictool_tocleanup.sql \
    248250        magicdstool_clearstatefaults.sql \
    249251        magicdstool_change_file_data_state.sql \
     
    333335        regtool_updatebyqueryimfile.sql \
    334336        regtool_pendingburntoolimfile.sql \
     337        regtool_checkstatus.sql \
    335338        stacktool_associationdefine_select.sql \
    336339        stacktool_definebyquery_insert.sql \
  • branches/czw_branch/20101203/ippTools/share/disttool_pending_SSdiff.sql

    r27027 r30586  
    1717    diffSkyfile.quality,
    1818    distRun.no_magic,
    19     0 AS magicked
     19    0 AS magicked,
     20    IFNULL(Label.priority, 10000) AS priority
    2021FROM distRun
    2122JOIN distTarget USING(target_id, stage, clean)
     
    4243    ON distRun.dist_id = distComponent.dist_id
    4344    AND diffSkyfile.skycell_id = distComponent.component
     45LEFT JOIN Label ON distRun.label = Label.label
    4446WHERE
    4547    distRun.state = 'new'
     
    4850    AND ((diffRun.magicked > 0) OR distRun.no_magic)
    4951    AND (diffRun.state = 'full' OR (distRun.clean AND diffRun.state = 'cleaned'))
     52    AND (Label.active OR Label.active IS NULL)
  • branches/czw_branch/20101203/ippTools/share/disttool_pending_camera.sql

    r29509 r30586  
    1515    camProcessedExp.quality,
    1616    distRun.no_magic,
    17     chipRun.magicked
     17    chipRun.magicked,
     18    IFNULL(Label.priority, 10000) AS priority
    1819FROM distRun
    1920JOIN distTarget USING(target_id, stage, clean)
     
    2122JOIN camProcessedExp USING(cam_id)
    2223JOIN chipRun USING(chip_id)
    23 -- JOIN chipProcessedImfile USING(exp_id, chip_id)
    2424JOIN rawExp using(exp_id)
    2525LEFT JOIN distComponent
    2626    ON distRun.dist_id = distComponent.dist_id
    27 --    AND chipProcessedImfile.class_id = distComponent.component
     27LEFT JOIN Label
     28    ON distRun.label = Label.label
    2829WHERE
    2930    distRun.state = 'new'
    3031    AND distRun.stage = 'camera'
    3132    AND distComponent.dist_id IS NULL
    32     AND (((clean OR (chipRun.magicked > 0)) AND (camRun.magicked > 0)) OR distRun.no_magic)
     33    AND (((clean OR (chipRun.magicked != 0)) AND (camRun.magicked > 0)) OR distRun.no_magic)
    3334    AND (camRun.state = 'full' OR (distRun.clean AND camRun.state = 'cleaned'))
     35    AND (Label.active OR Label.active IS NULL)
  • branches/czw_branch/20101203/ippTools/share/disttool_pending_chip.sql

    r26567 r30586  
    1515    chipProcessedImfile.quality,
    1616    distRun.no_magic,
    17     chipProcessedImfile.magicked
     17    chipProcessedImfile.magicked,
     18    IFNULL(Label.priority, 10000) AS priority
    1819FROM distRun
    1920JOIN distTarget USING(target_id, stage, clean)
     
    2425    ON distRun.dist_id = distComponent.dist_id
    2526    AND chipProcessedImfile.class_id = distComponent.component
     27LEFT JOIN Label
     28    ON distRun.label = Label.label
    2629WHERE
    2730    distRun.state = 'new'
     
    3033    AND ((chipRun.magicked > 0) OR distRun.no_magic)
    3134    AND (chipRun.state = 'full' OR (distRun.clean AND chipRun.state = 'cleaned'))
     35    AND (Label.active OR Label.active IS NULL)
  • branches/czw_branch/20101203/ippTools/share/disttool_pending_chip_bg.sql

    r28730 r30586  
    1515    0 AS quality,
    1616    distRun.no_magic,
    17     chipBackgroundImfile.magicked
     17    chipBackgroundImfile.magicked,
     18    IFNULL(Label.priority, 10000) AS priority
    1819FROM distRun
    1920JOIN distTarget USING(target_id, stage, clean)
     
    2526    ON distRun.dist_id = distComponent.dist_id
    2627    AND chipBackgroundImfile.class_id = distComponent.component
     28LEFT JOIN Label ON distRun.label = Label.label
    2729WHERE
    2830    distRun.state = 'new'
     
    3133    AND ((chipBackgroundRun.magicked > 0) OR distRun.no_magic)
    3234    AND (chipBackgroundRun.state = 'full')
     35    AND (Label.active OR Label.active IS NULL)
  • branches/czw_branch/20101203/ippTools/share/disttool_pending_diff.sql

    r26567 r30586  
    1717    diffSkyfile.quality,
    1818    distRun.no_magic,
    19     diffSkyfile.magicked
     19    diffSkyfile.magicked,
     20    IFNULL(Label.priority, 10000) AS priority
    2021FROM distRun
    2122JOIN distTarget USING(target_id, stage, clean)
     
    3233    ON distRun.dist_id = distComponent.dist_id
    3334    AND diffSkyfile.skycell_id = distComponent.component
     35LEFT JOIN Label ON distRun.label = Label.label
    3436WHERE
    3537    distRun.state = 'new'
     
    3840    AND ((diffRun.magicked > 0) OR distRun.no_magic)
    3941    AND (diffRun.state = 'full' OR (distRun.clean AND diffRun.state = 'cleaned'))
     42    AND (Label.active OR Label.active IS NULL)
  • branches/czw_branch/20101203/ippTools/share/disttool_pending_fake.sql

    r27458 r30586  
    1515    0 as quality,
    1616    distRun.no_magic,
    17     0 as magicked
     17    0 as magicked,
     18    IFNULL(Label.priority, 10000) AS priority
    1819FROM distRun
    1920JOIN distTarget USING(target_id, stage, clean)
     
    2627    ON distRun.dist_id = distComponent.dist_id
    2728    AND fakeProcessedImfile.class_id = distComponent.component
     29LEFT JOIN Label ON distRun.label = Label.label
    2830WHERE
    2931    distRun.state = 'new'
    3032    AND distRun.stage = 'fake'
    3133    AND distComponent.dist_id IS NULL
     34    AND (Label.active OR Label.active IS NULL)
  • branches/czw_branch/20101203/ippTools/share/disttool_pending_raw.sql

    r27457 r30586  
    1717    0 as quality,
    1818    distRun.no_magic,
    19     rawImfile.magicked
     19    rawImfile.magicked,
     20    IFNULL(Label.priority, 10000) AS priority
    2021FROM distRun
    2122JOIN distTarget USING(target_id, stage, clean)
     
    2829    ON distRun.dist_id = distComponent.dist_id
    2930    AND rawImfile.class_id = distComponent.component
     31LEFT JOIN Label ON distRun.label = Label.label
    3032WHERE
    3133    distRun.state = 'new'
     
    3436    AND distComponent.dist_id IS NULL
    3537    AND (rawExp.magicked OR distRun.no_magic)
     38    AND (Label.active OR Label.active IS NULL)
    3639UNION
    3740    -- raw stage alternate inputs
     
    5457    0 as quality,
    5558    distRun.no_magic,
    56     rawImfile.magicked
     59    rawImfile.magicked,
     60    IFNULL(Label.priority, 10000) AS priority
    5761FROM distRun
    5862JOIN distTarget USING(target_id, stage, clean)
     
    6872    ON distRun.dist_id = distComponent.dist_id
    6973    AND rawImfile.class_id = distComponent.component
     74LEFT JOIN Label ON distRun.label = Label.label
    7075WHERE
    7176    distRun.state = 'new'
     
    7479    AND chipProcessedImfile.data_state = 'full'
    7580    AND chipProcessedImfile.magicked > 0
     81    AND (Label.active OR Label.active IS NULL)
    7682UNION
    7783    -- raw stage clean (dbinfo only)
     
    9399    0 as quality,
    94100    distRun.no_magic,
    95     rawExp.magicked
     101    rawExp.magicked,
     102    IFNULL(Label.priority, 10000) AS priority
    96103FROM distRun
    97104JOIN distTarget USING(target_id, stage, clean)
     
    99106LEFT JOIN distComponent
    100107    ON distRun.dist_id = distComponent.dist_id
     108LEFT JOIN Label ON distRun.label = Label.label
    101109WHERE
    102110    distRun.state = 'new'
     
    104112    AND distRun.clean
    105113    AND distComponent.dist_id IS NULL
     114    AND (Label.active OR Label.active IS NULL)
  • branches/czw_branch/20101203/ippTools/share/disttool_pending_sky.sql

    r28959 r30586  
    1515    staticskyResult.quality,
    1616    1 AS no_magic,
    17     0 AS magicked
     17    0 AS magicked,
     18    IFNULL(Label.priority, 10000) AS priority
    1819FROM distRun
    1920JOIN distTarget USING(target_id, stage, clean)
     
    4344    ON distRun.dist_id = distComponent.dist_id
    4445    AND stackRun.skycell_id = distComponent.component
     46LEFT JOIN Label ON distRun.label = Label.label
    4547WHERE
    4648    distRun.state = 'new'
     
    4951    AND (staticskyRun.state = 'full' OR (distRun.clean AND staticskyRun.state = 'cleaned'))
    5052    AND (staticskyResult.fault = 0 AND staticskyResult.quality = 0)
     53    AND (Label.active OR Label.active IS NULL)
  • branches/czw_branch/20101203/ippTools/share/disttool_pending_stack.sql

    r25838 r30586  
    1717    stackSumSkyfile.quality,
    1818    1 AS no_magic,
    19     0 AS magicked
     19    0 AS magicked,
     20    IFNULL(Label.priority, 10000) AS priority
    2021FROM distRun
    2122JOIN distTarget USING(target_id, stage, clean)
     
    4344    ON distRun.dist_id = distComponent.dist_id
    4445    AND stackRun.skycell_id = distComponent.component
     46LEFT JOIN Label ON distRun.label = Label.label
    4547WHERE
    4648    distRun.state = 'new'
     
    4951    AND (stackRun.state = 'full' OR (distRun.clean AND stackRun.state = 'cleaned'))
    5052    AND (stackSumSkyfile.fault = 0 AND stackSumSkyfile.quality = 0)
     53    AND (Label.active OR Label.active IS NULL)
  • branches/czw_branch/20101203/ippTools/share/disttool_pending_warp.sql

    r26567 r30586  
    1515    warpSkyfile.quality,
    1616    distRun.no_magic,
    17     warpSkyfile.magicked
     17    warpSkyfile.magicked,
     18    IFNULL(Label.priority, 10000) AS priority
    1819FROM distRun
    1920JOIN distTarget USING(target_id, stage, clean)
     
    2728    ON distRun.dist_id = distComponent.dist_id
    2829    AND warpSkyfile.skycell_id = distComponent.component
     30LEFT JOIN Label ON distRun.label = Label.label
    2931WHERE
    3032    distRun.state = 'new'
     
    3335    AND ((warpRun.magicked > 0) OR distRun.no_magic)
    3436    AND (warpRun.state = 'full' OR (distRun.clean AND warpRun.state = 'cleaned'))
     37    AND (Label.active OR Label.active IS NULL)
  • branches/czw_branch/20101203/ippTools/share/disttool_pending_warp_bg.sql

    r28742 r30586  
    1515    0 as quality,
    1616    distRun.no_magic,
    17     warpBackgroundSkyfile.magicked
     17    warpBackgroundSkyfile.magicked,
     18    IFNULL(Label.priority, 10000) AS priority
    1819FROM distRun
    1920JOIN distTarget USING(target_id, stage, clean)
     
    2829    ON distRun.dist_id = distComponent.dist_id
    2930    AND warpBackgroundSkyfile.skycell_id = distComponent.component
     31LEFT JOIN Label ON distRun.label = Label.label
    3032WHERE
    3133    distRun.state = 'new'
     
    3436    AND ((warpBackgroundRun.magicked > 0) OR distRun.no_magic)
    3537    AND (warpBackgroundRun.state = 'full')
     38    AND (Label.active OR Label.active IS NULL)
  • branches/czw_branch/20101203/ippTools/share/disttool_revertrun.sql

    r26266 r30586  
    11UPDATE distRun
    22SET distRun.fault = 0
    3 WHERE distRun.state = 'new'
     3WHERE (distRun.state = 'new' OR distRun.state = 'goto_cleaned')
    44    AND distRun.fault != 0
  • branches/czw_branch/20101203/ippTools/share/magicdstool_todestreak_camera.sql

    r29561 r30586  
    3838    AND magicDSRun.stage = 'camera'
    3939    AND camRun.state = 'full'
    40     AND chipRun.state = 'full'
    41     AND chipRun.magicked
     40    AND ((chipRun.state = 'full' AND chipRun.magicked > 0)
     41         OR (chipRun.state = 'cleaned' AND chipRun.magicked < 0))
    4242    AND camProcessedExp.fault = 0
    4343    AND camProcessedExp.quality = 0
  • branches/czw_branch/20101203/ippTools/share/magicdstool_torevert_diff.sql

    r27945 r30586  
    1010    outroot,
    1111    diffSkyfile.path_base,
     12    magicDSFile.backup_path_base,
     13    magicDSFile.recovery_path_base,
    1214    "NULL" AS cam_path_base,
    1315    CAST(diffRun.bothways AS SIGNED) AS bothways,
  • branches/czw_branch/20101203/ippTools/share/pstamptool_pendingreq.sql

    r27874 r30586  
    33    pstampRequest.*,
    44    pstampDataStore.outProduct AS ds_outProduct,
     5    IFNULL(pstampDataStore.need_magic, 1) AS need_magic,
    56    IFNULL(Label.priority, 10000) AS priority
    67FROM pstampRequest
  • branches/czw_branch/20101203/ippTools/share/pubtool_pending.sql

    r30118 r30586  
    1010        publishClient.workdir,
    1111        publishClient.output_format,
     12        publishClient.magicked AS need_magic,
    1213        diffRun.diff_id AS stage_id,
    1314        rawExp.camera,
     
    3738        publishClient.workdir,
    3839        publishClient.output_format,
     40        publishClient.magicked AS need_magic,
    3941        camRun.cam_id AS stage_id,
    4042        rawExp.camera,
     
    5961        publishClient.workdir,
    6062        publishClient.output_format,
     63        publishClient.magicked AS need_magic,
    6164        diffPhotRun.diff_phot_id AS stage_id,
    6265        rawExp.camera,
  • branches/czw_branch/20101203/ippTools/share/pxadmin_create_tables.sql

    r30118 r30586  
    13911391        uri VARCHAR(255),
    13921392        pollInterval INTEGER DEFAULT 60,
     1393        need_magic TINYINT,
    13931394        PRIMARY KEY(ds_id),
    13941395        KEY(ds_id)
  • branches/czw_branch/20101203/ippTools/share/regtool_checkburntoolimfile.sql

    r29908 r30586  
    11SELECT DISTINCT
    2        exp_name,
     2       summitExp.exp_name,
    33       rawImfile.uri,
    44       summitExp.dateobs AS registered,
     
    1111       newExp.exp_id,
    1212       summitExp.exp_type,
    13        rawExp.dateobs,
    14        rawExp.obs_mode AS obs_mode,
    15        rawExp.object AS object,
     13       rawImfile.dateobs,
     14       rawImfile.obs_mode AS obs_mode,
     15       rawImfile.object AS object,
    1616       rawImfile.burntool_state AS burntool_state,
    1717       rawImfile.class_id,
     18       summitImfile.class_id AS summit_class_id,
    1819       (pzDownloadExp.state = 'stop') AS is_downloaded,
    1920       (rawImfile.burntool_state IS NOT NULL) AS is_registered
    2021       FROM
    21             summitExp
    22             LEFT JOIN pzDownloadExp USING(exp_name)
    23             LEFT JOIN newExp ON exp_name = tmp_exp_name
    24             LEFT JOIN rawExp USING(exp_id, exp_name)
    25             LEFT JOIN rawImfile USING(exp_name)
     22       summitExp
     23       JOIN summitImfile USING(exp_name)
     24       LEFT JOIN pzDownloadExp USING(exp_name)
     25       LEFT JOIN newExp ON summitExp.exp_name = tmp_exp_name
     26       LEFT JOIN newImfile ON (summitImfile.class_id = newImfile.tmp_class_id AND newExp.exp_id = newImfile.exp_id)
     27       LEFT JOIN rawExp ON rawExp.exp_id = newExp.exp_id
     28       LEFT JOIN rawImfile ON (rawImfile.exp_id = newExp.exp_id AND rawImfile.tmp_class_id = newImfile.tmp_class_id)
    2629       WHERE
    27              summitExp.dateobs >= '@DATE@T00:00:00'
    28              AND summitExp.dateobs <= '@DATE@T23:59:59'
    29              AND (rawImfile.class_id = '@CLASS_ID@' OR rawImfile.class_id IS NULL)
    30              AND (exp_name <= '@EXP_NAME@')                                                                     
     30             summitExp.dateobs >= '@DATEOBS_BEGIN@'
     31             AND summitExp.dateobs <= '@DATEOBS_END@'
     32             AND summitImfile.class_id = '@CLASS_ID@'
     33             AND (summitExp.exp_name <= '@EXP_NAME@')                                                                     
    3134ORDER BY summitExp.dateobs
  • branches/czw_branch/20101203/ippTools/share/regtool_pendingburntoolimfile.sql

    r29982 r30586  
    1212       newImfile.tmp_class_id,
    1313       summitExp.exp_type,
    14        rawExp.dateobs,
    15        rawExp.obs_mode AS obs_mode,
    16        rawExp.object AS object,
     14       rawImfile.dateobs,
     15       rawImfile.obs_mode AS obs_mode,
     16       rawImfile.object AS object,
    1717       rawImfile.burntool_state AS burntool_state,
    1818       rawImfile.class_id,
     19       summitImfile.class_id AS summit_class_id,
    1920       (pzDownloadExp.state = 'stop') AS is_downloaded,
    2021       (rawImfile.burntool_state IS NOT NULL) AS is_registered
    2122       FROM
    22             summitExp
    23             LEFT JOIN pzDownloadExp USING(exp_name)
    24             LEFT JOIN newExp ON exp_name = tmp_exp_name
    25             LEFT JOIN newImfile USING(exp_id)
    26             LEFT JOIN rawExp USING(exp_id, exp_name)
    27             LEFT JOIN rawImfile ON (rawImfile.exp_name = newExp.tmp_exp_name AND rawImfile.tmp_class_id = newImfile.tmp_class_id)
     23       summitExp
     24       JOIN summitImfile USING(exp_name)
     25       LEFT JOIN pzDownloadExp USING(exp_name)
     26       LEFT JOIN newExp ON summitExp.exp_name = tmp_exp_name
     27       LEFT JOIN newImfile ON (summitImfile.class_id = newImfile.tmp_class_id AND newExp.exp_id = newImfile.exp_id)
     28       LEFT JOIN rawExp ON rawExp.exp_id = newExp.exp_id
     29       LEFT JOIN rawImfile ON (rawImfile.exp_id = newExp.exp_id AND rawImfile.tmp_class_id = newImfile.tmp_class_id)
    2830       WHERE
    29              summitExp.dateobs >= '@DATE@T00:00:00'
    30              AND summitExp.dateobs <= '@DATE@T23:59:59'
    31 ORDER BY newImfile.tmp_class_id,summitExp.dateobs
     31             summitExp.dateobs >= '@DATEOBS_BEGIN@'
     32             AND summitExp.dateobs <= '@DATEOBS_END@'
     33ORDER BY summitImfile.class_id,summitExp.dateobs
  • branches/czw_branch/20101203/ippTools/share/regtool_pendingexp.sql

    r30118 r30586  
    4848          GROUP BY newExp.exp_id
    4949          HAVING SUM(rawImfile.fault) = 0
     50          LIMIT 256
    5051         ) AS RAWEXPOSURES
    5152         USING (exp_id)
  • branches/czw_branch/20101203/ippTools/src/disttool.c

    r29067 r30586  
    857857    psFree(where);
    858858
     859    psStringAppend(&query, "\nORDER BY priority DESC, dist_id");
     860
    859861    // treat limit == 0 as "no limit"
    860862    if (limit) {
  • branches/czw_branch/20101203/ippTools/src/dqstatstool.c

    r28427 r30586  
    9292  }
    9393  else {
    94     psStringAppend(&query, " AND (invalid IS NULL OR invalid = 1) ");
     94    psStringAppend(&query, " AND (warp_id IS NOT NULL AND invalid IS NULL) ");
    9595  }
    9696
     
    402402
    403403    if (psMetadataLookupStr(&status,enginedef,"COLNAME")&&
    404         isfinite(psMetadataLookupF32(&status,enginedef,"MINIMUM"))&&
    405         isfinite(psMetadataLookupF32(&status,enginedef,"MAXIMUM"))) {
     404        (strcmp(psMetadataLookupStr(&status,enginedef,"RULETYPE"),"STRICT") == 0)&&
     405        (isfinite(psMetadataLookupF32(&status,enginedef,"MINIMUM"))&&
     406         isfinite(psMetadataLookupF32(&status,enginedef,"MAXIMUM")))) {
    406407      psArrayAdd(decisionRules,decisionRules->n,enginedef);
     408    }
     409    else if (psMetadataLookupStr(&status,enginedef,"COLNAME")&&
     410             (strcmp(psMetadataLookupStr(&status,enginedef,"RULETYPE"),"CDF") == 0)&&
     411             (isfinite(psMetadataLookupF32(&status,enginedef,"CDF00"))&&
     412              isfinite(psMetadataLookupF32(&status,enginedef,"CDF50"))&&
     413              isfinite(psMetadataLookupF32(&status,enginedef,"CDF100")))) {
     414      psArrayAdd(decisionRules,decisionRules->n, enginedef);
     415    }
     416    else if (strcmp(psMetadataLookupStr(&status,enginedef,"RULETYPE"),"UNUSED") == 0) {
    407417    }
    408418    else {
     
    637647    // Calculate if this exposure was "good" or not.
    638648    bool accept = true;
     649    psF32 quality = 1.0;
    639650    for (long j = 0; j < decisionRules->n; j++) {
    640651      psMetadata *rule = decisionRules->data[j];
     
    644655        psError(PS_EXIT_CONFIG_ERROR, false, "Unable to find column name");
    645656        return(false);
    646       }     
    647       psF32 min_value  = psMetadataLookupF32(&status,rule,"MINIMUM");
    648       if (!status) {
    649         psError(PS_EXIT_CONFIG_ERROR, false, "Unable to find min value for %s",colname);
    650         return(false);
    651       }     
    652       psF32 max_value  = psMetadataLookupF32(&status,rule,"MAXIMUM");
    653       if (!status) {
    654         psError(PS_EXIT_CONFIG_ERROR, false, "Unable to find max value for %s",colname);
    655         return(false);
    656       }
    657       psString filter = psMetadataLookupStr(&status,rule,"FILTER");
    658       if (!status) {
    659         status = true;
    660       }
    661       if (filter) {
    662         psString imfilter = psMetadataLookupStr(&status,tableRow,"FILTER");
    663         if (strcmp(filter,imfilter) != 0) {
    664           continue;
    665         }
    666657      }
    667658      // Not happy with this being set to a F32. Can this ever be something else?
    668659      psF32 value      = psMetadataLookupF32(&status,tableRow,colname);
    669660      if (!status) {
    670         psError(PS_EXIT_CONFIG_ERROR, false, "Unable to find column %s (%f %f %f) in compare with rule.",colname,min_value,max_value,value);
     661        psError(PS_EXIT_CONFIG_ERROR, false, "Unable to find column %s (%f) in compare with rule.",
     662                colname,value);
    671663        psFree(colNames);
    672664        psFree(colTypes);
     
    677669        return(false);
    678670      }
    679       if ((value > max_value)||(value < min_value)) {
    680         accept = false;
    681       }     
     671      psString filter = psMetadataLookupStr(&status,rule,"FILTER");
     672      if (!status) {
     673        status = true;
     674      }
     675      if (filter) {
     676        psString imfilter = psMetadataLookupStr(&status,tableRow,"FILTER");
     677        if (strcmp(filter,imfilter) != 0) {
     678          continue;
     679        }
     680      }
     681     
     682      if (strcmp(psMetadataLookupStr(&status,rule,"RULETYPE"),"STRICT") == 0) {
     683        psF32 min_value  = psMetadataLookupF32(&status,rule,"MINIMUM");
     684        if (!status) {
     685          psError(PS_EXIT_CONFIG_ERROR, false, "Unable to find min value for %s",colname);
     686          return(false);
     687        }     
     688        psF32 max_value  = psMetadataLookupF32(&status,rule,"MAXIMUM");
     689        if (!status) {
     690          psError(PS_EXIT_CONFIG_ERROR, false, "Unable to find max value for %s",colname);
     691          return(false);
     692        }
     693
     694        if ((value > max_value)||(value < min_value)) {
     695          accept = false;
     696        }
     697      } // End STRICT min/max rule parsing
     698      else if (strcmp(psMetadataLookupStr(&status,rule,"RULETYPE"),"CDF") == 0) {
     699        // I'm just going to implement a quick linear interpolation over the points that exist.
     700        psF32 min_value,max_value = 99;
     701        psF32 min_cdf = 0.0,max_cdf = 1.0;
     702        psF32 cdf;
     703        psF32 try[22] = {0.00,0.05,0.10,0.15,0.20,0.25,0.30,0.35,0.40,0.45,0.50,
     704                         0.55,0.60,0.65,0.70,0.75,0.80,0.85,0.90,0.95,0.99,1.00};
     705        int i;
     706        int done = 0;
     707        status = true;
     708        min_value = psMetadataLookupF32(&status,rule,"CDF00");
     709        min_cdf   = 0.0;
     710        if (!isfinite(value)) {
     711          quality = 0.0;
     712          continue;
     713        }
     714        if (!status) {
     715          status = true;
     716          psError(PS_EXIT_CONFIG_ERROR, false, "Unable to find CDF00 value for %s",colname);
     717        }
     718        if (value < min_value) {
     719          if (quality > min_cdf) {
     720            quality = 0.0;
     721            continue;
     722          }
     723        }
     724
     725        for (i = 1; i < 22; i++) {
     726          psString label = psStringCopy("");
     727          psStringAppend(&label,"CDF%02d",(int) (100 * try[i]));
     728         
     729          max_value = psMetadataLookupF32(&status,rule,label);
     730          max_cdf   = try[i];
     731          if (!status) {
     732            status = true;
     733            psError(PS_EXIT_CONFIG_ERROR, false, "Unable to find %s value for %s",label,colname);
     734          }
     735          if ((value < max_value)&&(value > min_value)) {
     736            cdf = ((value - min_value) * max_cdf + (max_value - value) * min_cdf) / (max_value - min_value);
     737            //      fprintf(stderr,"value: %f %f %f %f %f %f %d %d %f\n",value,quality,min_cdf,min_value,max_cdf,max_value, value < max_value, value > min_value,cdf);
     738            if (quality > cdf) {
     739              quality = cdf;
     740              done = 1;
     741              i = 25;
     742            }
     743          }
     744          min_value = max_value;
     745          min_cdf = max_cdf;
     746        }
     747        if (done) {
     748          continue;
     749        }
     750        // Reached end of array without finding the value;
     751        if (value > min_value) {
     752          if (quality > min_cdf) {
     753            quality = 1.0;
     754          }
     755        }
     756
     757
     758      } // End CDF rule parsing
    682759    }
    683760    bool success;
     
    695772      return(false);
    696773    }
     774    success = psMetadataAddF32(tableRow,PS_LIST_TAIL,"QUALITY",0,"",quality);
     775    if (!success) {
     776      psError(PS_ERR_UNKNOWN,false, "Error adding exposure quality to fits table row.");
     777      psFree(colNames);
     778      psFree(colTypes);
     779      psFree(contents);
     780      psFree(query);
     781      psFree(outTable);
     782      psFree(statsoutput);
     783      psFree(statIter);
     784      psFree(tableRow);
     785      return(false);
     786    }
    697787
    698788    // Add the row to the table array.
  • branches/czw_branch/20101203/ippTools/src/magicdstool.c

    r30118 r30586  
    11151115    psString queryFile = NULL;
    11161116    if (state) {
    1117         if (! strcmp(state, "new") ) {
     1117        if (! strcmp(state, "new") || !strcmp(state, "goto_restored")) {
    11181118            queryFile = "magicdstool_revertdestreakedfile.sql";
    11191119        } else if (!strcmp(state, "update")) {
     
    17241724    PXOPT_LOOKUP_STR(component, config->args, "-component", false, false);
    17251725    PXOPT_LOOKUP_STR(label, config->args, "-set_label", false, false);
     1726    PXOPT_LOOKUP_STR(recoveryroot, config->args, "-set_recoveryroot", false, false);
    17261727
    17271728    psString query = pxDataGet("magicdstool_setfiletoupdate.sql");
     
    17341735    if (label) {
    17351736        psStringAppend(&setHook, "\n , magicDSRun.label = '%s'", label);
     1737    }
     1738    if (recoveryroot) {
     1739        psStringAppend(&setHook, "\n , magicDSRun.recoveryroot = '%s'", recoveryroot);
    17361740    }
    17371741
  • branches/czw_branch/20101203/ippTools/src/magicdstoolConfig.c

    r30118 r30586  
    230230    psMetadataAddStr(setfiletoupdateArgs, PS_LIST_TAIL, "-component", 0, "define component", NULL);
    231231    psMetadataAddStr(setfiletoupdateArgs, PS_LIST_TAIL, "-set_label", 0, "set new label", NULL);
     232    psMetadataAddStr(setfiletoupdateArgs, PS_LIST_TAIL, "-set_recoveryroot", 0, "define new recovery directory", NULL);
    232233
    233234    // -destreakedfile
  • branches/czw_branch/20101203/ippTools/src/magictool.c

    r29625 r30586  
    4949static bool censorrunMode(pxConfig *config);
    5050static bool exposureMode(pxConfig *config);
     51static bool setgotocleanedMode(pxConfig *config);
     52static bool tocleanupMode(pxConfig *config);
     53static bool setworkdirstateMode(pxConfig *config);
    5154
    5255static bool setmagicRunState(pxConfig *config, psS64 magic_id, const char *state, psString setString);
     
    8992        MODECASE(MAGICTOOL_MODE_CENSORRUN,           censorrunMode);
    9093        MODECASE(MAGICTOOL_MODE_EXPOSURE,            exposureMode);
     94        MODECASE(MAGICTOOL_MODE_SETGOTOCLEANED,      setgotocleanedMode);
     95        MODECASE(MAGICTOOL_MODE_TOCLEANUP,           tocleanupMode);
     96        MODECASE(MAGICTOOL_MODE_SETWORKDIRSTATE,     setworkdirstateMode);
    9197        default:
    9298            psAbort("invalid option (this should not happen)");
     
    621627    PXOPT_COPY_S64(config->args, where, "-magic_id", "magic_id", "==");
    622628    PXOPT_COPY_S16(config->args, where, "-fault", "fault", "==");
    623     PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
     629    pxAddLabelSearchArgs (config, where, "-label", "magicRun.label", "==");
    624630
    625631    psString query = psStringCopy("UPDATE magicRun SET fault = 0 WHERE state = 'new' AND fault != 0");
     
    829835    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
    830836
    831     // look for "inputs" that need to processed
    832     psString query = pxDataGet("magictool_toprocess_inputs.sql");
    833     if (!query) {
    834         psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
    835         return false;
    836     }
    837 
    838837    psString whereString = NULL;
    839838    if (psListLength(where->list)) {
     
    844843    psFree(where);
    845844
    846     psStringAppend(&query, "\nORDER BY priority DESC, magic_id");
    847 
    848     // treat limit == 0 as "no limit"
    849     if (limit) {
    850         // cut limit in half
    851         // hack to prevent pending leaf nodes from blocking branch nodes
    852         psString limitString = psDBGenerateLimitSQL((limit + 1) / 2);
    853         psStringAppend(&query, " %s", limitString);
    854         psFree(limitString);
    855     }
    856 
    857     if (!p_psDBRunQueryF(config->dbh, query, whereString, whereString)) {
    858         psError(PS_ERR_UNKNOWN, false, "database error");
    859         psFree(whereString);
    860         psFree(query);
    861         return false;
    862     }
    863     psFree(query);
    864 
    865     psArray *output = p_psDBFetchResult(config->dbh);
    866     if (!output) {
    867         psErrorCode err = psErrorCodeLast();
    868         switch (err) {
    869             case PS_ERR_DB_CLIENT:
    870                 psError(PXTOOLS_ERR_SYS, false, "database error");
    871             case PS_ERR_DB_SERVER:
    872                 psError(PXTOOLS_ERR_PROG, false, "database error");
    873             default:
    874                 psError(PXTOOLS_ERR_PROG, false, "unknown error");
    875         }
    876 
    877         return false;
    878     }
    879     if (!psArrayLength(output)) {
    880         psTrace("magictool", PS_LOG_INFO, "no rows found");
    881     }
    882 
    883     if (limit) {
    884         if (psArrayLength(output) >= limit) {
    885             // we've found enough (note that limit was applied to the query so '> limit' won't happen)
    886             // negative simple so the default is true
    887             if (!ippdbPrintMetadatas(stdout, output, "magicMe", !simple)) {
    888                 psError(PS_ERR_UNKNOWN, false, "failed to print array");
    889                 psFree(output);
    890                 return false;
    891             }
    892             psFree(output);
    893             return true;
    894         }
    895     }
    896 
    897     // look for tree nodes that need to be processed
     845    // First look for branch nodes that need to be processed.
     846    // These get priority over skycells because they are from runs
     847    // that are already in progress and there are fewer of them.
     848    // When we looked for skycells first we got starved.
    898849
    899850    // first find incomplete magicRuns
    900     query = pxDataGet("magictool_toprocess_runs.sql");
     851    psString query = pxDataGet("magictool_toprocess_runs.sql");
    901852    if (!query) {
    902853        psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
     
    904855    }
    905856
    906     // we limit the query even though it is cheap (only magic_id is selected)
    907 
    908     // XXX: if the first 1000 unfinished magicRuns have no ready nodes
    909     // that haven't faulted, later runs won't get returned even though
    910     // they have work to do. When we used a limit of 100 we actually ran
    911     // into this problem. Since we're using labels a limit of 1000 will
    912     // probably be ok.
     857    // Find outstanding magicRuns in new state.
     858    // We limit the query, but this is problematic. In practice do
     859    // we need to?
     860    // XXX: If the first 1000 magicRuns have no branch nodes ready
     861    // but higher runs do we they won't be noticed.
     862    // Perhaps have this limit be an argument.
    913863    {
    914864        psString limitString = psDBGenerateLimitSQL( 1000 );
     
    940890        return false;
    941891    }
     892
    942893    if (!psArrayLength(magicRuns)) {
     894        // no pending magicRuns nothing to do
    943895        psTrace("magictool", PS_LOG_INFO, "no rows found");
    944         psFree(magicRuns);
    945896        return true;
    946897    }
    947 
    948     query = pxDataGet("magictool_toprocess_tree.sql");
     898    psArray *output = psArrayAllocEmpty(100);
     899
     900    {
     901        query = pxDataGet("magictool_toprocess_tree.sql");
     902        if (!query) {
     903            psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
     904            return false;
     905        }
     906
     907        for (psS64 index = 0; index < psArrayLength(magicRuns); index++) {
     908            if (limit && (psArrayLength(output) >= limit)) {
     909                break;
     910            }
     911            bool status;
     912            psS64 magic_id = psMetadataLookupS64(&status, magicRuns->data[index], "magic_id");
     913            if (!status) {
     914                psAbort("failed to lookup value for magic_id column");
     915            }
     916
     917            whereString = NULL;
     918            psStringAppend(&whereString, "\nAND (magic_id = %" PRId64 ")", magic_id);
     919            if (!p_psDBRunQueryF(config->dbh, query, whereString )) {
     920                psError(PS_ERR_UNKNOWN, false, "database error");
     921                psFree(whereString);
     922                psFree(query);
     923                return false;
     924            }
     925            psFree(whereString);
     926            psArray *magicTree = p_psDBFetchResult(config->dbh);
     927            if (!magicTree) {
     928                psErrorCode err = psErrorCodeLast();
     929                switch (err) {
     930                    case PS_ERR_DB_CLIENT:
     931                        psError(PXTOOLS_ERR_SYS, false, "database error");
     932                    case PS_ERR_DB_SERVER:
     933                        psError(PXTOOLS_ERR_PROG, false, "database error");
     934                    default:
     935                        psError(PXTOOLS_ERR_PROG, false, "unknown error");
     936                }
     937
     938                return false;
     939            }
     940            psS64 length = psArrayLength(magicTree);
     941            if (!length) {
     942                psTrace("magictool", PS_LOG_INFO, "no rows found for magic_id %" PRId64, magic_id);
     943                psFree(magicTree);
     944                continue;
     945            }
     946
     947            psHash *forest = psHashAlloc(length);
     948
     949            // convert the array of metadata into a pxTree structure
     950            for (long i = 0; i < length; i++) {
     951                bool status;
     952                psString node = psMetadataLookupStr(&status, magicTree->data[i], "node");
     953                if (!status) {
     954                    psAbort("failed to lookup value for node column");
     955                }
     956
     957                psString dep = psMetadataLookupStr(&status, magicTree->data[i], "dep");
     958                if (!status) {
     959                    psAbort("failed to lookup value for dep column");
     960                }
     961
     962                pxTreeBuilder(forest, node, dep, magicTree->data[i]);
     963
     964            }
     965
     966            // find the root of the tree
     967            pxNode *root = psMemIncrRefCounter(psHashLookup(forest, "root"));
     968            psFree(forest);
     969            //    pxTreePrint(stdout, root);
     970
     971            // crawl through the tree and looking for nodes with children that are all
     972            // "done"
     973            pxTreeCrawl(root, findReadyNodes, output);
     974            psFree(root);
     975            psFree(magicTree);
     976        }
     977
     978        int len = psArrayLength(output);
     979        if (len) {
     980            if (limit) {
     981                if (limit < psArrayLength(output)) {
     982                    // truncate the array
     983                    long arrayLength = psArrayLength(output);
     984                    for (long i = arrayLength - 1; i >= limit; i--) {
     985                        psArrayRemoveIndex(output, i);
     986                    }
     987                    // negative simple so the default is true
     988                    if (!ippdbPrintMetadatas(stdout, output, "magicMe", !simple)) {
     989                        psError(PS_ERR_UNKNOWN, false, "failed to print array");
     990                        psFree(output);
     991                        return false;
     992                    }
     993                    psFree(output);
     994                    return true;
     995                } else {
     996                    limit -= len;
     997                }
     998            }
     999        }
     1000    }
     1001
     1002    // look for "inputs" (skycells) that need to processed
     1003    query = pxDataGet("magictool_toprocess_inputs.sql");
    9491004    if (!query) {
    9501005        psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
     
    9521007    }
    9531008
    954     for (psS64 index = 0; index < psArrayLength(magicRuns); index++) {
    955         if (limit && (psArrayLength(output) >= limit)) {
    956             break;
    957         }
    958         bool status;
    959         psS64 magic_id = psMetadataLookupS64(&status, magicRuns->data[index], "magic_id");
    960         if (!status) {
    961             psAbort("failed to lookup value for magic_id column");
    962         }
    963 
    964         whereString = NULL;
    965         psStringAppend(&whereString, "\nAND (magic_id = %" PRId64 ")", magic_id);
    966         if (!p_psDBRunQueryF(config->dbh, query, whereString )) {
    967             psError(PS_ERR_UNKNOWN, false, "database error");
    968             psFree(whereString);
    969             psFree(query);
    970             return false;
    971         }
     1009    psStringAppend(&query, "\nORDER BY priority DESC, magic_id");
     1010
     1011    // treat limit == 0 as "no limit"
     1012    if (limit) {
     1013        psString limitString = psDBGenerateLimitSQL(limit);
     1014        psStringAppend(&query, " %s", limitString);
     1015        psFree(limitString);
     1016    }
     1017
     1018    if (!p_psDBRunQueryF(config->dbh, query, whereString, whereString)) {
     1019        psError(PS_ERR_UNKNOWN, false, "database error");
    9721020        psFree(whereString);
    973         psArray *magicTree = p_psDBFetchResult(config->dbh);
    974         if (!magicTree) {
    975             psErrorCode err = psErrorCodeLast();
    976             switch (err) {
    977                 case PS_ERR_DB_CLIENT:
    978                     psError(PXTOOLS_ERR_SYS, false, "database error");
    979                 case PS_ERR_DB_SERVER:
    980                     psError(PXTOOLS_ERR_PROG, false, "database error");
    981                 default:
    982                     psError(PXTOOLS_ERR_PROG, false, "unknown error");
    983             }
    984 
    985             return false;
    986         }
    987         psS64 length = psArrayLength(magicTree);
    988         if (!length) {
    989             psTrace("magictool", PS_LOG_INFO, "no rows found for magic_id %" PRId64, magic_id);
    990             psFree(magicTree);
    991             continue;
    992         }
    993 
    994         psHash *forest = psHashAlloc(length);
    995 
    996         // convert the array of metadata into a pxTree structure
    997         for (long i = 0; i < length; i++) {
    998             bool status;
    999             psString node = psMetadataLookupStr(&status, magicTree->data[i], "node");
    1000             if (!status) {
    1001                 psAbort("failed to lookup value for node column");
    1002             }
    1003 
    1004             psString dep = psMetadataLookupStr(&status, magicTree->data[i], "dep");
    1005             if (!status) {
    1006                 psAbort("failed to lookup value for dep column");
    1007             }
    1008 
    1009             pxTreeBuilder(forest, node, dep, magicTree->data[i]);
    1010 
    1011         }
    1012 
    1013         // find the root of the tree
    1014         pxNode *root = psMemIncrRefCounter(psHashLookup(forest, "root"));
    1015         psFree(forest);
    1016         //    pxTreePrint(stdout, root);
    1017 
    1018         // crawl through the tree and looking for nodes with children that are all
    1019         // "done"
    1020         pxTreeCrawl(root, findReadyNodes, output);
    1021         psFree(root);
    1022         psFree(magicTree);
    1023     }
    1024 
     1021        psFree(query);
     1022        return false;
     1023    }
     1024    psFree(query);
     1025
     1026    psArray *skycellOutput = p_psDBFetchResult(config->dbh);
     1027    if (!skycellOutput) {
     1028        psErrorCode err = psErrorCodeLast();
     1029        switch (err) {
     1030            case PS_ERR_DB_CLIENT:
     1031                psError(PXTOOLS_ERR_SYS, false, "database error");
     1032            case PS_ERR_DB_SERVER:
     1033                psError(PXTOOLS_ERR_PROG, false, "database error");
     1034            default:
     1035                psError(PXTOOLS_ERR_PROG, false, "unknown error");
     1036        }
     1037
     1038        return false;
     1039    }
     1040    // merge the arrays so that we can print them all at once
     1041    if (psArrayLength(skycellOutput)) {
     1042        int len = psArrayLength(skycellOutput);
     1043        for (int i=0; i < len; i++) {
     1044            psArrayAdd(output, 0, skycellOutput->data[i]);
     1045        }
     1046    }
     1047    psFree(skycellOutput);
    10251048    if (psArrayLength(output)) {
    1026         if (limit && (limit < psArrayLength(output))) {
    1027             // truncate the array
    1028             long arrayLength = psArrayLength(output);
    1029             for (long i = arrayLength - 1; i >= limit; i--) {
    1030                 psArrayRemoveIndex(output, i);
    1031             }
    1032         }
    1033         // negative simple so the default is true
    10341049        if (!ippdbPrintMetadatas(stdout, output, "magicMe", !simple)) {
    10351050            psError(PS_ERR_UNKNOWN, false, "failed to print array");
     
    10371052            return false;
    10381053        }
    1039     }
    1040 
     1054    } else {
     1055        psTrace("magictool", PS_LOG_INFO, "no rows found");
     1056    }
    10411057    psFree(output);
    1042 
    10431058    return true;
    10441059}
     
    16221637    return true;
    16231638}
     1639static bool setgotocleanedMode(pxConfig *config)
     1640{
     1641    PS_ASSERT_PTR_NON_NULL(config, false);
     1642
     1643    psMetadata *where = psMetadataAlloc();
     1644    PXOPT_COPY_S64(config->args, where, "-magic_id", "magicRun.magic_id", "==");
     1645    PXOPT_COPY_S64(config->args, where, "-exp_id", "magicRun.exp_id", "==");
     1646    PXOPT_COPY_STR(config->args, where, "-label", "magicRun.label", "LIKE");
     1647    PXOPT_COPY_STR(config->args, where, "-data_group", "magicRun.data_group", "LIKE");
     1648
     1649    PXOPT_LOOKUP_STR(set_label, config->args, "-set_label", false, false);
     1650
     1651    psString query = psStringCopy("UPDATE magicRun SET workdir_state = 'goto_cleaned'\n");
     1652    if (set_label) {
     1653        psStringAppend(&query, ", label = '%s'", set_label);
     1654    }
     1655    // This mode doubles as a revert function for cleanup errors
     1656    PXOPT_LOOKUP_BOOL(clearfault, config->args, "-clearfault", false);
     1657    if (!clearfault) {
     1658        psStringAppend(&query, "WHERE workdir_state = 'dirty'");
     1659    } else {
     1660        psStringAppend(&query, "WHERE workdir_state = 'error_cleaned'");
     1661    }
     1662    psStringAppend(&query, "\nAND (magicRun.state = 'full' OR magicRun.state = 'drop')");
     1663
     1664    // Require search parameters unless we're just clearing faults
     1665    if (psListLength(where->list)) {
     1666        psString clause = psDBGenerateWhereConditionSQL(where, NULL);
     1667        psStringAppend(&query, "\nAND %s", clause);
     1668        psFree(clause);
     1669        psFree(where);
     1670    } else if ( !clearfault) {
     1671        psError(PS_ERR_UNKNOWN, false, "search parameters are required");
     1672        psFree(where);
     1673        return false;
     1674    }
     1675
     1676    if (!p_psDBRunQuery(config->dbh, query)) {
     1677        psError(PS_ERR_UNKNOWN, false, "database error");
     1678        psFree(query);
     1679        return false;
     1680    }
     1681    psFree(query);
     1682
     1683    return true;
     1684}
     1685
     1686static bool setworkdirstateMode(pxConfig *config)
     1687{
     1688    PS_ASSERT_PTR_NON_NULL(config, false);
     1689
     1690    // required
     1691    PXOPT_LOOKUP_S64(magic_id, config->args, "-magic_id", true, false);
     1692    PXOPT_LOOKUP_STR(workdir_state, config->args, "-set_workdir_state", true, false);
     1693
     1694    if (strcmp(workdir_state, "cleaned") && strcmp(workdir_state, "error_cleaned")) {
     1695        psError(PS_ERR_UNKNOWN, true, "%s is not a valid value for workdir_state", workdir_state);
     1696        return false;
     1697    }
     1698   
     1699    psString query = NULL;
     1700    psStringAppend(&query, "UPDATE magicRun SET workdir_state = '%s' WHERE magic_id = %" PRId64, workdir_state, magic_id);
     1701
     1702    if (!p_psDBRunQuery(config->dbh, query)) {
     1703        psError(PS_ERR_UNKNOWN, false, "database error");
     1704        psFree(query);
     1705        return false;
     1706    }
     1707    psFree(query);
     1708
     1709    return true;
     1710}
     1711static bool tocleanupMode(pxConfig *config)
     1712{
     1713    PS_ASSERT_PTR_NON_NULL(config, false);
     1714
     1715    psMetadata *where = psMetadataAlloc();
     1716    PXOPT_COPY_S64(config->args, where, "-magic_id", "magicRun.magic_id", "==");
     1717    pxAddLabelSearchArgs (config, where, "-label", "magicRun.label", "==");
     1718    pxAddLabelSearchArgs (config, where, "-data_group", "magicRun.data_group", "==");
     1719
     1720    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
     1721    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
     1722
     1723    psString query = pxDataGet("magictool_tocleanup.sql");
     1724    if (!query) {
     1725        psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
     1726        return false;
     1727    }
     1728
     1729    if (psListLength(where->list)) {
     1730        psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
     1731        psStringAppend(&query, " AND %s", whereClause);
     1732        psFree(whereClause);
     1733    }
     1734    psFree(where);
     1735
     1736    psStringAppend(&query, "\nORDER BY priority DESC, magic_id");
     1737
     1738    // treat limit == 0 as "no limit"
     1739    if (limit) {
     1740        psString limitString = psDBGenerateLimitSQL(limit);
     1741        psStringAppend(&query, " %s", limitString);
     1742        psFree(limitString);
     1743    }
     1744
     1745    if (!p_psDBRunQuery(config->dbh, query)) {
     1746        psError(PS_ERR_UNKNOWN, false, "database error");
     1747        psFree(query);
     1748        return false;
     1749    }
     1750    psFree(query);
     1751
     1752    psArray *output = p_psDBFetchResult(config->dbh);
     1753    if (!output) {
     1754        psErrorCode err = psErrorCodeLast();
     1755        switch (err) {
     1756            case PS_ERR_DB_CLIENT:
     1757                psError(PXTOOLS_ERR_SYS, false, "database error");
     1758            case PS_ERR_DB_SERVER:
     1759                psError(PXTOOLS_ERR_PROG, false, "database error");
     1760            default:
     1761                psError(PXTOOLS_ERR_PROG, false, "unknown error");
     1762        }
     1763
     1764        return false;
     1765    }
     1766    if (!psArrayLength(output)) {
     1767        psTrace("magictool", PS_LOG_INFO, "no rows found");
     1768        psFree(output);
     1769        return true;
     1770    }
     1771
     1772    if (psArrayLength(output)) {
     1773        // negative simple so the default is true
     1774        if (!ippdbPrintMetadatas(stdout, output, "tocleanup", !simple)) {
     1775            psError(PS_ERR_UNKNOWN, false, "failed to print array");
     1776            psFree(output);
     1777            return false;
     1778        }
     1779    }
     1780
     1781    psFree(output);
     1782
     1783    return true;
     1784}
  • branches/czw_branch/20101203/ippTools/src/magictool.h

    r27982 r30586  
    4343    MAGICTOOL_MODE_CENSORRUN,
    4444    MAGICTOOL_MODE_EXPOSURE,
     45    MAGICTOOL_MODE_SETGOTOCLEANED,
     46    MAGICTOOL_MODE_TOCLEANUP,
     47    MAGICTOOL_MODE_SETWORKDIRSTATE,
    4548} MAGICtoolMode;
    4649
  • branches/czw_branch/20101203/ippTools/src/magictoolConfig.c

    r29495 r30586  
    114114    psMetadataAddS64(reverttreeArgs, PS_LIST_TAIL, "-magic_id", 0, "search by magictool ID", 0);
    115115    psMetadataAddS16(reverttreeArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0);
    116     psMetadataAddStr(reverttreeArgs, PS_LIST_TAIL, "-label", 0, "search by label", NULL);
     116    psMetadataAddStr(reverttreeArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by label", NULL);
    117117
    118118    // -inputs
     
    178178    psMetadataAddBool(exposureArgs, PS_LIST_TAIL, "-inverse", 0, "select the inverse subtraction?", false);
    179179    psMetadataAddBool(exposureArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false);
     180
     181    // -setgotocleaned
     182    psMetadata *setgotocleanedArgs = psMetadataAlloc();
     183    psMetadataAddS64(setgotocleanedArgs, PS_LIST_TAIL, "-magic_id", 0, "select by magictool ID", 0);
     184    psMetadataAddS64(setgotocleanedArgs, PS_LIST_TAIL, "-exp_id", 0, "select by exposure ID)", 0);
     185    psMetadataAddStr(setgotocleanedArgs, PS_LIST_TAIL, "-label",  0, "select by label", NULL);
     186    psMetadataAddStr(setgotocleanedArgs, PS_LIST_TAIL, "-data_group",  0, "select by data_group", NULL);
     187    psMetadataAddStr(setgotocleanedArgs, PS_LIST_TAIL, "-set_label",  0, "set new label", NULL);
     188    psMetadataAddBool(setgotocleanedArgs, PS_LIST_TAIL, "-clearfault",  0, "clear cleanup errors", NULL);
     189
     190    // -tocleanup
     191    psMetadata *tocleanupArgs = psMetadataAlloc();
     192    psMetadataAddS64(tocleanupArgs, PS_LIST_TAIL, "-magic_id", 0, "search by magic ID", 0);
     193    psMetadataAddStr(tocleanupArgs, PS_LIST_TAIL, "-label",    PS_META_DUPLICATE_OK, "search by label", NULL);
     194    psMetadataAddStr(tocleanupArgs, PS_LIST_TAIL, "-data_group",    PS_META_DUPLICATE_OK, "search by label", NULL);
     195    psMetadataAddU64(tocleanupArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0);
     196    psMetadataAddBool(tocleanupArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false);
     197
     198    // -setworkdirstate
     199    psMetadata *setworkdirstateArgs = psMetadataAlloc();
     200    psMetadataAddS64(setworkdirstateArgs, PS_LIST_TAIL, "-magic_id", 0, "select by magictool ID (required)", 0);
     201    psMetadataAddStr(setworkdirstateArgs, PS_LIST_TAIL, "-set_workdir_state", 0, "new workdir_state (required)", 0);
    180202
    181203    psFree(now);
     
    202224    PXOPT_ADD_MODE("-censorrun",           "", MAGICTOOL_MODE_CENSORRUN,           censorrunArgs);
    203225    PXOPT_ADD_MODE("-exposure",            "", MAGICTOOL_MODE_EXPOSURE,            exposureArgs);
     226    PXOPT_ADD_MODE("-setgotocleaned",      "", MAGICTOOL_MODE_SETGOTOCLEANED,      setgotocleanedArgs);
     227    PXOPT_ADD_MODE("-tocleanup",           "", MAGICTOOL_MODE_TOCLEANUP,           tocleanupArgs);
     228    PXOPT_ADD_MODE("-setworkdirstate",     "", MAGICTOOL_MODE_SETWORKDIRSTATE,     setworkdirstateArgs);
    204229
    205230    if (!pxGetOptions(stderr, argc, argv, config, modes, argSets)) {
  • branches/czw_branch/20101203/ippTools/src/pstamptool.c

    r30118 r30586  
    134134    PXOPT_LOOKUP_STR(label,       config->args, "-set_label",         false, false);
    135135    PXOPT_LOOKUP_S32(pollInterval, config->args, "-set_poll_interval",false, false);
     136    PXOPT_LOOKUP_BOOL(no_magic, config->args, "-set_no_magic", false);
     137
     138    bool need_magic = ! no_magic;
    136139
    137140    if (!pstampDataStoreInsert(config->dbh,
     
    143146            outProduct,
    144147            uri,
    145             pollInterval
     148            pollInterval,
     149            need_magic
    146150        )) {
    147151        psError(PS_ERR_UNKNOWN, false, "database error");
  • branches/czw_branch/20101203/ippTools/src/pstamptoolConfig.c

    r30118 r30586  
    5151    psMetadataAddStr(adddatastoreArgs, PS_LIST_TAIL, "-set_label",        0, "define datastore label", NULL);
    5252    psMetadataAddS32(adddatastoreArgs, PS_LIST_TAIL, "-set_poll_interval", 0, "define datastore poll interval (seconds)", 60);
     53    psMetadataAddBool(adddatastoreArgs,PS_LIST_TAIL, "-set_no_magic",   0, "set magic not required", true);
    5354
    5455    // -datastore
  • branches/czw_branch/20101203/ippTools/src/pubtool.c

    r30118 r30586  
    167167    PXOPT_COPY_STR(config->args, diffWhere, "-filter", "rawExp.filter", "LIKE");
    168168    PXOPT_COPY_STR(config->args, diffWhere, "-obs_mode", "rawExp.obs_mode", "LIKE");
     169    PXOPT_COPY_STR(config->args, diffWhere, "-comment", "rawExp.comment", "LIKE");
    169170
    170171    PXOPT_COPY_S64(config->args, camWhere, "-client_id", "client_id", "==");
  • branches/czw_branch/20101203/ippTools/src/pubtoolConfig.c

    r30118 r30586  
    6666    psMetadataAddStr(definerunArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "set and search by label", NULL);
    6767    psMetadataAddStr(definerunArgs, PS_LIST_TAIL, "-data_group", PS_META_DUPLICATE_OK, "search by data_group", NULL);
     68    psMetadataAddStr(definerunArgs, PS_LIST_TAIL, "-comment", 0, "search by comment", NULL);
    6869    psMetadataAddTime(definerunArgs, PS_LIST_TAIL, "-dateobs_begin", 0, "search for exposures by time (>=)", NULL);
    6970    psMetadataAddTime(definerunArgs, PS_LIST_TAIL, "-dateobs_end", 0, "search for exposures by time (<=)", NULL);
  • branches/czw_branch/20101203/ippTools/src/pztool.c

    r29982 r30586  
    4747static bool advanceMode(pxConfig *config);
    4848
     49static bool updatepzexpMode(pxConfig *config);
     50static bool updatenewexpMode(pxConfig *config);
     51
    4952// static bool copydoneCompleteExp(pxConfig *config);
    5053static psArray *pzGetPendingCameras(pxConfig *config);
     
    8386        MODECASE(PZTOOL_MODE_TOADVANCE, toadvanceMode);
    8487        MODECASE(PZTOOL_MODE_ADVANCE, advanceMode);
     88        MODECASE(PZTOOL_MODE_UPDATEPZEXP, updatepzexpMode);
     89        MODECASE(PZTOOL_MODE_UPDATENEWEXP, updatenewexpMode);
    8590        default:
    8691            psAbort("invalid option (this should not happen)");
     
    294299
    295300    psMetadata *where = psMetadataAlloc();
    296     PXOPT_COPY_STR(config->args, where,  "-exp_name",     "exp_name", "==");
    297     PXOPT_COPY_STR(config->args, where,  "-inst",         "camera", "==");
    298     PXOPT_COPY_STR(config->args, where,  "-telescope",    "telescope", "==");
    299     PXOPT_COPY_STR(config->args, where,  "-exp_type",     "exp_type", "==");
     301    PXOPT_COPY_STR(config->args, where,  "-exp_name",      "exp_name",  "==");
     302    PXOPT_COPY_STR(config->args, where,  "-inst",          "camera",    "==");
     303    PXOPT_COPY_STR(config->args, where,  "-telescope",     "telescope", "==");
     304    PXOPT_COPY_STR(config->args, where,  "-exp_type",      "exp_type",  "==");
     305    PXOPT_COPY_TIME(config->args, where, "-dateobs_begin", "dateobs",   ">=");
     306    PXOPT_COPY_TIME(config->args, where, "-dateobs_end",   "dateobs",   "<=");
    300307
    301308    PXOPT_LOOKUP_BOOL(desc, config->args, "-desc", false);
     
    325332
    326333        if (psListLength(where->list)) {
    327             psString whereClause = psDBGenerateWhereConditionSQL(where, "pzDownloadImfile");
     334            psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
    328335            psStringAppend(&query, " AND %s", whereClause);
    329336            psFree(whereClause);
     
    889896            || (strncmp(state, "stop", 5) == 0)
    890897            || (strncmp(state, "reg", 4) == 0)
     898            || (strncmp(state, "drop", 5) == 0)
    891899        )
    892900    ) {
     
    905913}
    906914
     915static bool updatepzexpMode(pxConfig *config)
     916{
     917  PS_ASSERT_PTR_NON_NULL(config, false);
     918  PXOPT_LOOKUP_STR(exp_name, config->args, "-exp_name", true, false);
     919  PXOPT_LOOKUP_STR(camera,   config->args, "-inst",   true, false);
     920  PXOPT_LOOKUP_STR(telescope,config->args, "-telescope",true, false);
     921  PXOPT_LOOKUP_STR(state,    config->args, "-set_state",true, false);
     922
     923  if (!pzDownloadExpSetState(config,exp_name,camera,telescope,state)) {
     924    psError(PS_ERR_UNKNOWN, false, "failed to change state for %s:%s:%s", exp_name, camera, telescope);
     925    return false;
     926  }
     927  return true;
     928}
     929 
     930 
     931static bool updatenewexpMode(pxConfig *config)
     932{
     933    PS_ASSERT_PTR_NON_NULL(config, false);
     934
     935    psMetadata *where = psMetadataAlloc();
     936    PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "==");
     937    PXOPT_COPY_STR(config->args, where,  "-exp_name", "tmp_exp_name", "==");
     938
     939    PXOPT_LOOKUP_STR(new_state, config->args, "-set_state", true, false);
     940
     941    if (strcmp(new_state, "drop") && strcmp(new_state, "run") && strcmp(new_state, "wait")) {
     942        psError(PXTOOLS_ERR_ARGUMENTS, true, "%s is not a valid value for -set_state", new_state);
     943        psFree(where);
     944        return false;
     945    }
     946
     947    if (psListLength(where->list) < 1) {
     948        psFree(where);
     949        psError(PXTOOLS_ERR_CONFIG, false, "-exp_name or -exp_id is required");
     950        return false;
     951    }
     952
     953    psString query = NULL;
     954    psStringAppend(&query, "UPDATE newExp SET state = '%s'", new_state);
     955
     956    psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
     957    psStringAppend(&query, "\nWHERE %s", whereClause);
     958
     959    psFree(whereClause);
     960    psFree(where);
     961
     962    if (!p_psDBRunQuery(config->dbh, query)) {
     963        psError(PS_ERR_UNKNOWN, false, "database error");
     964        psFree(query);
     965        return false;
     966    }
     967    psFree(query);
     968
     969    return true;
     970}
     971
     972
     973
    907974
    908975#if 0
  • branches/czw_branch/20101203/ippTools/src/pztool.h

    r23497 r30586  
    3636    PZTOOL_MODE_CLEARCOMMONFAULTS,
    3737    PZTOOL_MODE_TOADVANCE,
    38     PZTOOL_MODE_ADVANCE
     38    PZTOOL_MODE_ADVANCE,
     39    PZTOOL_MODE_UPDATEPZEXP,
     40    PZTOOL_MODE_UPDATENEWEXP,
    3941} pztoolMode;
    4042
  • branches/czw_branch/20101203/ippTools/src/pztoolConfig.c

    r27082 r30586  
    7676    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-inst", 0,            "define camera ID", NULL);
    7777    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-telescope", 0,            "define telescope ID", NULL);
     78    psMetadataAddTime(pendingimfileArgs, PS_LIST_TAIL, "-dateobs_begin", 0,  "search for exposures by time (>=)", NULL);
     79    psMetadataAddTime(pendingimfileArgs, PS_LIST_TAIL, "-dateobs_end", 0,  "search for exposures by time (<=)", NULL);
    7880    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-exp_type", 0,            "define exposure type", NULL);
    7981    psMetadataAddBool(pendingimfileArgs, PS_LIST_TAIL, "-desc", 0,            "sort ouput in descending format", false);
     
    154156    psMetadataAddStr(advanceArgs, PS_LIST_TAIL, "-label",  0,     "define the label for the chip stage", NULL);
    155157
     158    // -updatepzexp
     159    psMetadata *updatepzexpArgs = psMetadataAlloc();
     160    psMetadataAddStr(updatepzexpArgs, PS_LIST_TAIL, "-exp_name",   0,            "search by exposure name (required)", NULL);
     161    psMetadataAddStr(updatepzexpArgs, PS_LIST_TAIL, "-inst",       0,            "search by camera (required)", NULL);
     162    psMetadataAddStr(updatepzexpArgs, PS_LIST_TAIL, "-telescope",  0,            "search by telescope (required)", NULL);
     163    psMetadataAddStr(updatepzexpArgs, PS_LIST_TAIL, "-set_state",  0,            "define new state (required)", NULL);
     164   
     165    // -updatenewexp
     166    psMetadata *updatenewexpArgs = psMetadataAlloc();
     167    psMetadataAddS64(updatenewexpArgs, PS_LIST_TAIL, "-exp_id",   0,            "search by exposure ID", 0);
     168
     169    psMetadataAddStr(updatenewexpArgs, PS_LIST_TAIL, "-exp_name", 0,            "define exposure ID", NULL);
     170    psMetadataAddStr(updatenewexpArgs, PS_LIST_TAIL, "-set_state", 0,            "define new state (required)", NULL);
     171
    156172    psMetadata *argSets = psMetadataAlloc();
    157173    psMetadata *modes = psMetadataAlloc();
     
    169185    PXOPT_ADD_MODE("-toadvance",          "", PZTOOL_MODE_TOADVANCE,    toadvanceArgs);
    170186    PXOPT_ADD_MODE("-advance",          "", PZTOOL_MODE_ADVANCE,    advanceArgs);
     187    PXOPT_ADD_MODE("-updatepzexp",     "", PZTOOL_MODE_UPDATEPZEXP, updatepzexpArgs);
     188    PXOPT_ADD_MODE("-updatenewexp",    "", PZTOOL_MODE_UPDATENEWEXP,updatenewexpArgs);
    171189
    172190    if (!pxGetOptions(stderr, argc, argv, config, modes, argSets)) {
  • branches/czw_branch/20101203/ippTools/src/regtool.c

    r30118 r30586  
    5151static bool updatebyqueryMode(pxConfig *config);
    5252
     53static bool checkstatusMode(pxConfig *config);
     54
    5355static bool exportrunMode(pxConfig *config);
    5456static bool importrunMode(pxConfig *config);
     
    7476        // imfile
    7577        MODECASE(REGTOOL_MODE_PENDINGIMFILE,         pendingimfileMode);
    76         MODECASE(REGTOOL_MODE_CHECKBURNTOOLIMFILE,   checkburntoolimfileMode);
    77         MODECASE(REGTOOL_MODE_PENDINGBURNTOOLIMFILE, pendingburntoolimfileMode);
     78        MODECASE(REGTOOL_MODE_CHECKBURNTOOLIMFILE,   checkburntoolimfileMode);
     79        MODECASE(REGTOOL_MODE_PENDINGBURNTOOLIMFILE, pendingburntoolimfileMode);
    7880        MODECASE(REGTOOL_MODE_ADDPROCESSEDIMFILE,    addprocessedimfileMode);
    7981        MODECASE(REGTOOL_MODE_PROCESSEDIMFILE,       processedimfileMode);
     
    9092        MODECASE(REGTOOL_MODE_FINISHCOMPRESSEXP,     finishcompressexpMode);
    9193        MODECASE(REGTOOL_MODE_CLEARDUPEXP,           cleardupexpMode);
     94        MODECASE(REGTOOL_MODE_CHECKSTATUS,           checkstatusMode);
    9295        MODECASE(REGTOOL_MODE_EXPORTRUN,             exportrunMode);
    9396        MODECASE(REGTOOL_MODE_IMPORTRUN,             importrunMode);
     
    9598            psAbort("invalid option (this should not happen)");
    9699    }
    97 
     100    psTrace("regtool",9,"Attempting to free config\n");
    98101    psFree(config);
    99102    pmConfigDone();
     
    180183}
    181184
     185 
     186 
     187
    182188static bool checkburntoolimfileMode(pxConfig *config)
    183189{
     
    187193  PXOPT_LOOKUP_STR(exp_name, config->args, "-exp_name", true, false);
    188194  PXOPT_LOOKUP_STR(class_id, config->args, "-class_id", true, false);
    189   PXOPT_LOOKUP_STR(date,     config->args, "-date", true, false);
     195  PXOPT_LOOKUP_STR(dateobs_begin,     config->args, "-dateobs_begin", true, false);
     196  PXOPT_LOOKUP_STR(dateobs_end,     config->args, "-dateobs_end", true, false);
    190197  PXOPT_LOOKUP_S32(valid_burntool, config->args, "-valid_burntool", true, false);
    191198  // optional
     
    201208  psFree(query);
    202209  query = rep;
     210
     211  // convert regular class_id format to summitImfile.class_id format
     212  rep = psStringCopy(class_id);
     213  psFree(class_id);
     214  class_id = rep;
     215 
     216  psStringSubstitute(&class_id,"ota","XY");
    203217 
    204218  psStringSubstitute(&query,exp_name,"@EXP_NAME@");
    205219  psStringSubstitute(&query,class_id,"@CLASS_ID@");
    206   psStringSubstitute(&query,date,"@DATE@");
    207 
    208   fprintf(stderr,"%s",query);
     220  psStringSubstitute(&query,dateobs_begin,"@DATEOBS_BEGIN@");
     221  psStringSubstitute(&query,dateobs_end,"@DATEOBS_END@");
     222
     223  // fprintf(stderr,"%s",query);
    209224
    210225  if (!p_psDBRunQuery(config->dbh, query)) {
     
    215230  }
    216231  psFree(query);
    217  
     232
    218233  psArray *output = p_psDBFetchResult(config->dbh);
    219234  if (!output) {
     
    227242      psError(PXTOOLS_ERR_PROG, false, "unknown error");
    228243    }
    229    
     244
    230245    return false;
    231246  }
    232247  if (!psArrayLength(output)) {
    233248    psTrace("regtool", PS_LOG_INFO, "no rows found");
    234     psFree(output);
    235249    return true;
    236250  }
     
    242256    psMetadata *row = output->data[i];
    243257
     258    if (strcasecmp(psMetadataLookupStr(NULL,row,"download_state"),"drop") == 0) {
     259      continue;
     260    }
     261   
    244262    if ((psMetadataLookupS32(NULL,row,"is_downloaded") != 1)||
    245         (psMetadataLookupS32(NULL,row,"is_registered") != 1)) {
     263        (psMetadataLookupS32(NULL,row,"is_registered") != 1)) {
    246264      ok_to_burn = false;
    247265    }
     
    255273      already_burned = false;
    256274    }
    257    
     275
    258276    if (previous_uri) {
    259277      psMetadataAddStr(row,PS_LIST_TAIL,"previous_uri",PS_META_REPLACE,"",previous_uri);
     
    264282    previous_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri"));
    265283  }
    266  
     284
    267285  // negate simple so the default is true
    268286  if (!ippdbPrintMetadatas(stdout, output, "regBurntoolImfile", !simple)) {
     
    271289    return false;
    272290  }
    273  
     291
    274292  psFree(output);
    275  
     293
    276294
    277295  return(true);
    278  
     296
    279297}
    280298
     
    284302
    285303  // required
    286   PXOPT_LOOKUP_STR(date,     config->args, "-date", true, false);
     304  PXOPT_LOOKUP_STR(dateobs_begin,     config->args, "-dateobs_begin", true, false);
     305  PXOPT_LOOKUP_STR(dateobs_end,     config->args, "-dateobs_end", true, false);
    287306  PXOPT_LOOKUP_S32(valid_burntool, config->args, "-valid_burntool", true, false);
    288307  // optional
     
    297316  psFree(query);
    298317  query = rep;
    299  
    300   psStringSubstitute(&query,date,"@DATE@");
    301 
    302   //  fprintf(stderr,"%s",query);
     318
     319  psStringSubstitute(&query,dateobs_begin,"@DATEOBS_BEGIN@");
     320  psStringSubstitute(&query,dateobs_end,"@DATEOBS_END@");
     321
     322  // fprintf(stderr,"%s",query);
    303323
    304324  if (!p_psDBRunQuery(config->dbh, query)) {
     
    309329  }
    310330  psFree(query);
    311  
     331
    312332  psArray *output = p_psDBFetchResult(config->dbh);
    313333  if (!output) {
     
    321341      psError(PXTOOLS_ERR_PROG, false, "unknown error");
    322342    }
    323    
     343
    324344    return false;
    325345  }
     346
     347  // fprintf (stderr, "found %ld rows\n", output->n);
    326348  if (!psArrayLength(output)) {
    327349    psTrace("regtool", PS_LOG_INFO, "no rows found");
     
    337359  psString this_class_id = NULL;
    338360  psArray *results = psArrayAllocEmpty(60); // List of suggested imfiles to burntool.
    339  
     361
    340362  for (long i = 0; i < output->n; i++) {
    341363    psMetadata *row = output->data[i];
    342364
     365    if (strcasecmp(psMetadataLookupStr(NULL,row,"download_state"),"drop") == 0) {
     366      continue;
     367    }
     368
     369    bool status = false;
     370    char *tmp_id = psMetadataLookupStr(&status,row,"summit_class_id");
     371    if (!status) {
     372      //      fprintf (stderr, "incomplete on %s\n", psMetadataLookupStr(NULL,row,"exp_name"));
     373        continue;
     374    }
     375
    343376    // Add the information about this row and the previous, if it exists.
    344377    // Write the class_id stuff for debugging.
    345     this_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"tmp_class_id"));
    346     psStringSubstitute(&this_class_id,"XY","ota");
     378    // this_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"tmp_class_id"));
     379    this_class_id = psStringCopy(tmp_id);
     380
    347381    psMetadataAddStr(row,PS_LIST_TAIL,"this_class_id",PS_META_REPLACE,"",this_class_id);
     382
    348383    if (previous_class_id) {
    349384      psMetadataAddStr(row,PS_LIST_TAIL,"previous_class_id",PS_META_REPLACE,"",previous_class_id);
     
    353388      continue;
    354389    }
     390
     391    if (0 && !strcmp(this_class_id, "ota44")) {
     392        printf("STAT 1: %s (%d %d) %d %d %d\n",
     393               this_class_id,
     394               ok_to_burn, already_burned,
     395               psMetadataLookupS32(NULL,row,"burntool_state"),
     396               psMetadataLookupS32(NULL,row,"is_registered"),
     397               psMetadataLookupS32(NULL,row,"is_downloaded"));
     398    }
     399
    355400    // Determine if we've crossed a class_id boundary, as this resets the bits.
    356401    if (previous_class_id) {
    357402      if (strcmp(this_class_id,previous_class_id) != 0) {
    358         ok_to_burn = true;
    359         already_burned = true;
    360         previous_uri = NULL;
     403        ok_to_burn = true;
     404        already_burned = true;
     405        previous_uri = NULL;
     406        //      fprintf (stderr, "crossed boundary: %s : %s to %s\n", psMetadataLookupStr(NULL,row,"exp_name"), previous_class_id, this_class_id);
    361407      }
    362408    }
     
    364410    // Write the URIs as well.
    365411    this_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri")); // Duplicate, but helpful for my debugging.
    366     psMetadataAddStr(row,PS_LIST_TAIL,"this_uri",PS_META_REPLACE,"",this_uri); 
     412    psMetadataAddStr(row,PS_LIST_TAIL,"this_uri",PS_META_REPLACE,"",this_uri);
    367413    if (previous_uri) {
    368414      psMetadataAddStr(row,PS_LIST_TAIL,"previous_uri",PS_META_REPLACE,"",previous_uri);
     
    372418    // Convert bits of the SQL query into booleans describing the data state
    373419    if ((psMetadataLookupS32(NULL,row,"is_downloaded") != 1)||
    374         (psMetadataLookupS32(NULL,row,"is_registered") != 1)) {
    375       //      printf("I claim this isn't downloaded or registered? %s %s\n",this_uri,this_class_id);
    376       ok_to_burn = false;
     420        (psMetadataLookupS32(NULL,row,"is_registered") != 1)) {
     421      // printf("I claim this isn't downloaded or registered? %s %s\n",this_uri,this_class_id);
     422        ok_to_burn = false;
    377423    }
    378424    if (already_burned == false) {
    379       //      printf("already_burned looks false %s %s\n",this_uri,this_class_id);
    380       ok_to_burn = false;
     425        // printf("already_burned looks false %s %s\n",this_uri,this_class_id);
     426        ok_to_burn = false;
    381427    }
    382428    if (abs(psMetadataLookupS32(NULL,row,"burntool_state")) == valid_burntool) {
     
    391437    // Check the uri for this exposure
    392438    if (!this_uri) {
    393         ok_to_burn = false;
    394         already_burned = false;
    395 
    396         // Save this round for next round.
    397         psFree(previous_class_id);
    398         psFree(previous_uri);
    399         previous_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"tmp_class_id"));
    400         psStringSubstitute(&previous_class_id,"XY","ota");
    401         previous_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri")); // Save for next round.       
    402         continue;
    403     }     
    404 
    405     //    printf("STATUS: %s %s %s %s (%d %d) %d %d %d\n",this_uri,previous_uri,this_class_id,previous_class_id,ok_to_burn,already_burned,psMetadataLookupS32(NULL,row,"burntool_state"),psMetadataLookupS32(NULL,row,"is_registered"),psMetadataLookupS32(NULL,row,"is_downloaded"));
    406 
    407     // If the state of this imfile is not "pending_burntool" then we can't burn it.
     439        ok_to_burn = false;
     440        already_burned = false;
     441
     442        //      fprintf (stderr, "missing uri: %s %s\n", psMetadataLookupStr(NULL,row,"exp_name"), this_class_id);
     443
     444        // Save this round for next round.
     445        psFree(previous_class_id);
     446        psFree(previous_uri);
     447        previous_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"summit_class_id"));
     448        psStringSubstitute(&previous_class_id,"ota","XY");
     449        previous_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri")); // Save for next round.
     450        continue;
     451    }
     452
     453    if (0 && !strcmp(this_class_id, "ota44")) {
     454        printf("STATUS: %s %s %s %s (%d %d) %d %d %d\n",this_uri,previous_uri,this_class_id,previous_class_id,ok_to_burn,already_burned,psMetadataLookupS32(NULL,row,"burntool_state"),psMetadataLookupS32(NULL,row,"is_registered"),psMetadataLookupS32(NULL,row,"is_downloaded"));
     455    }
     456    // If the state of this imfile is not "pending_burntool" then we can't burn it.
    408457    if (!ignore_state) {
    409458      psString imfile_state = psMetadataLookupStr(NULL,row,"imfile_state");
    410459
    411460      if (!imfile_state) { // imfile state is NULL, so we probably aren't registered.
    412         ok_to_burn = false;
    413 
    414         // Save this round for next round.
    415         psFree(previous_class_id);
    416         psFree(previous_uri);
    417         previous_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"tmp_class_id"));
    418         psStringSubstitute(&previous_class_id,"XY","ota");
    419         previous_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri")); // Save for next round.       
    420         continue;
     461        ok_to_burn = false;
     462
     463        // fprintf (stderr, "missing imfile_state: %s %s\n", psMetadataLookupStr(NULL,row,"exp_name"), this_class_id);
     464
     465        // Save this round for next round.
     466        psFree(previous_class_id);
     467        psFree(previous_uri);
     468        previous_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"summit_class_id"));
     469        psStringSubstitute(&previous_class_id,"ota","XY");
     470        previous_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri")); // Save for next round.
     471        continue;
    421472      }
    422       if (strcmp("pending_burntool",imfile_state) != 0) { // Probably the state is full, do not twiddle states 
    423         // Save this round for next round.
    424         psFree(previous_class_id);
    425         psFree(previous_uri);
    426         previous_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"tmp_class_id"));
    427         psStringSubstitute(&previous_class_id,"XY","ota");
    428         previous_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri")); // Save for next round.       
    429         continue;
     473      if (strcmp("pending_burntool",imfile_state) != 0) { // Probably the state is full, do not twiddle states
     474
     475          if (0 && strcmp(imfile_state, "full")) {
     476              fprintf (stderr, "not pending nor full: %s %s %s\n", psMetadataLookupStr(NULL,row,"exp_name"), this_class_id, imfile_state);
     477          }
     478
     479        // Save this round for next round.
     480        psFree(previous_class_id);
     481        psFree(previous_uri);
     482        previous_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"summit_class_id"));
     483        psStringSubstitute(&previous_class_id,"ota","XY");
     484        previous_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri")); // Save for next round.
     485        continue;
    430486      }
    431487    }
    432    
     488
    433489    // Determine if we've already suggested an entry for this ota, and if not, copy this
    434490    // suggestion into our output result list.
     
    437493      psFree(previous_class_id);
    438494      psFree(previous_uri);
    439       previous_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"tmp_class_id"));
    440       psStringSubstitute(&previous_class_id,"XY","ota");
    441       previous_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri")); // Save for next round.       
     495      previous_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"summit_class_id"));
     496      psStringSubstitute(&previous_class_id,"ota","XY");
     497      previous_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri")); // Save for next round.
    442498      continue;
    443499    }
     
    448504    psFree(previous_class_id);
    449505    psFree(previous_uri);
    450     previous_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"tmp_class_id"));
    451     psStringSubstitute(&previous_class_id,"XY","ota");
    452     previous_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri")); // Save for next round.         
    453   }
    454  
     506    previous_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"summit_class_id"));
     507    psStringSubstitute(&previous_class_id,"ota","XY");
     508    previous_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri")); // Save for next round.
     509  }
     510
    455511  // negate simple so the default is true
    456512  if (!ippdbPrintMetadatas(stdout, results, "regPendingBurntoolImfile", !simple)) {
     
    460516    return false;
    461517  }
    462  
     518
    463519  psFree(output);
    464520  psFree(results);
    465  
     521
    466522
    467523  return(true);
    468  
    469 }
    470 
    471      
     524
     525}
     526
     527
    472528
    473529static bool addprocessedimfileMode(pxConfig *config)
     
    545601    PXOPT_LOOKUP_STR(md5sum, config->args, "-md5sum", false, false);
    546602    PXOPT_LOOKUP_BOOL(video_cells, config->args, "-video_cells", false);
    547    
     603
    548604    PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false);
    549605    PXOPT_LOOKUP_S16(quality, config->args, "-quality", false, false);
     
    618674        bytes,
    619675        md5sum,
    620         video_cells,
    621         0   // burntool_state
     676        0,   // burntool_state
     677        video_cells
    622678    )) {
    623679        psError(PS_ERR_UNKNOWN, false, "database error");
     
    771827        psStringAppend(&query, " AND %s", whereClause);
    772828        psFree(whereClause);
    773     } else {
    774         psFree(where);
    775         psError(PXTOOLS_ERR_CONFIG, false, "search parameters are required");
    776         return false;
    777829    }
    778830    psFree(where);
     
    806858    PXOPT_LOOKUP_STR(set_state, config->args, "-set_state", false, false);
    807859
    808     if ((fault == INT16_MAX) && !isfinite(burntool_state) && !(set_state)) {
     860    if ((fault == INT16_MAX) && (burntool_state == INT16_MAX) && !set_state) {
    809861        psError(PS_ERR_UNKNOWN, false, "one of -fault or -burntool_state or -set_state must be selected");
    810862        return false;
    811863    }
    812     if ((fault != INT16_MAX) && isfinite(burntool_state)) {
     864    if ((fault != INT16_MAX) && (burntool_state != INT16_MAX)) {
    813865        psError(PS_ERR_UNKNOWN, false, "only one of -fault or -burntool_state must be selected");
    814866        return false;
     
    13121364    if (!pxchipQueueByExpTag(config,
    13131365                exp_id,
    1314                              chip_workdir,
     1366                             chip_workdir,
    13151367                label,
    1316                              data_group,
    1317                              dist_group,
     1368                             data_group,
     1369                             dist_group,
    13181370                reduction,
    13191371                NULL,       // expgroup
     
    18311883}
    18321884
     1885static bool checkstatusMode(pxConfig *config)
     1886{
     1887  PS_ASSERT_PTR_NON_NULL(config,false);
     1888
     1889  // required
     1890  PXOPT_LOOKUP_STR(class_id, config->args, "-class_id", true, false);
     1891  // Conditionally required
     1892  PXOPT_LOOKUP_STR(dateobs_begin, config->args, "-dateobs_begin", false, false);
     1893  PXOPT_LOOKUP_STR(dateobs_end,   config->args, "-dateobs_end",   false, false);
     1894  PXOPT_LOOKUP_STR(date,          config->args, "-date",          false, false);
     1895  PXOPT_LOOKUP_BOOL(simple,       config->args, "-simple",        false);
     1896
     1897  psString query = pxDataGet("regtool_checkstatus.sql");
     1898  if (!query) {
     1899    psError(PXTOOLS_ERR_SYS, false, "failed to retrieve SQL statement");
     1900    return false;
     1901  }
     1902  psString rep = psStringCopy(query);
     1903  psFree(query);
     1904  query = rep;
     1905  psStringSubstitute(&class_id,"ota","XY");
     1906  psStringSubstitute(&query,class_id,"@CLASS_ID@");
     1907   
     1908  if (!date) {
     1909    if (!dateobs_begin || !dateobs_end) {
     1910      psError(PXTOOLS_ERR_CONFIG, false, "Either -date or -dateobs_begin -dateobs_end is required");
     1911      psFree(query);
     1912      return false;
     1913    }
     1914    psStringAppend(&query," AND summitExp.dateobs >= '%s' AND summitExp.dateobs <= '%s' ",
     1915                   dateobs_begin,dateobs_end);
     1916  }
     1917  else {
     1918    psStringAppend(&query," AND summitExp.dateobs >= '%sT00:00:00' AND summitExp.dateobs <= '%sT23:59:59' ",
     1919                   date,date);
     1920  }
     1921
     1922  psStringAppend(&query," ORDER BY summitExp.dateobs ");
     1923 
     1924  if (!p_psDBRunQuery(config->dbh, query)) {
     1925    // XXX PS_EXIT_PROG_ERROR (incorrect SQL) or SYS_ERROR (database comms)
     1926    psError(PXTOOLS_ERR_PROG, false, "database error");
     1927    psFree(query);
     1928    return false;
     1929  }
     1930  psFree(query);
     1931
     1932  psArray *output = p_psDBFetchResult(config->dbh);
     1933  if (!output) {
     1934    psErrorCode err = psErrorCodeLast();
     1935    switch (err) {
     1936    case PS_ERR_DB_CLIENT:
     1937      psError(PXTOOLS_ERR_SYS, false, "database error");
     1938    case PS_ERR_DB_SERVER:
     1939      psError(PXTOOLS_ERR_PROG, false, "database error");
     1940    default:
     1941      psError(PXTOOLS_ERR_PROG, false, "unknown error");
     1942    }
     1943
     1944    return false;
     1945  }
     1946  if (!psArrayLength(output)) {
     1947    psTrace("regtool", PS_LOG_INFO, "no rows found");
     1948    return true;
     1949  }
     1950
     1951  if (!ippdbPrintMetadatas(stdout, output, "regCheckStatus", !simple)) {
     1952    psError(PXTOOLS_ERR_PROG, false, "failed to print array");
     1953    psFree(output);
     1954    return false;
     1955  }
     1956
     1957  psFree(output);
     1958
     1959  return(true);
     1960}
     1961
    18331962bool exportrunMode(pxConfig *config)
    18341963{
  • branches/czw_branch/20101203/ippTools/src/regtool.h

    r29908 r30586  
    4141    REGTOOL_MODE_PENDINGCOMPRESSIMFILE,
    4242    REGTOOL_MODE_FINISHCOMPRESSEXP,
     43    REGTOOL_MODE_CHECKSTATUS,
    4344    REGTOOL_MODE_EXPORTRUN,
    4445    REGTOOL_MODE_IMPORTRUN
  • branches/czw_branch/20101203/ippTools/src/regtoolConfig.c

    r30014 r30586  
    5757    ADD_OPT(Str,  checkburntoolimfileArgs, "-exp_name",       "define the exp_name (required)",         NULL);
    5858    ADD_OPT(Str,  checkburntoolimfileArgs, "-class_id",       "define class ID (required)",         NULL);
    59     ADD_OPT(Str,  checkburntoolimfileArgs, "-date",           "select the date to process (required)", NULL);
     59    ADD_OPT(Str,  checkburntoolimfileArgs, "-dateobs_begin",  "set the earliest summit dateobs to consider (required)", NULL);
     60    ADD_OPT(Str,  checkburntoolimfileArgs, "-dateobs_end",    "set the latest summit dateobs to consider (required)", NULL);
    6061    ADD_OPT(S32,  checkburntoolimfileArgs, "-valid_burntool", "define the good burntool value (required)", 0);
    6162    ADD_OPT(Str,  checkburntoolimfileArgs, "-inst",           "define the camera name",     NULL);
     
    6566    // -pendingburntoolimfile
    6667    psMetadata *pendingburntoolimfileArgs = psMetadataAlloc();
    67     ADD_OPT(Str,  pendingburntoolimfileArgs, "-date",           "select the date to process (required)", NULL);
     68    ADD_OPT(Str,  pendingburntoolimfileArgs, "-dateobs_begin",  "set the earliest summit dateobs to consider (required)", NULL);
     69    ADD_OPT(Str,  pendingburntoolimfileArgs, "-dateobs_end",    "set the latest summit dateobs to consider (required)", NULL);
    6870    ADD_OPT(S32,  pendingburntoolimfileArgs, "-valid_burntool", "define the good burntool value (required)", 0);
    6971    ADD_OPT(Bool, pendingburntoolimfileArgs, "-simple",    "use the simple output format",          false);
    7072    ADD_OPT(Bool, pendingburntoolimfileArgs, "-ignore_state",   "ignore the data_state when deciding what to work on",  false);
    7173    ADD_OPT(U64,  pendingburntoolimfileArgs, "-limit",     "limit result set to N items",  0);
    72    
     74
    7375    // -addprocessedimfile
    7476    psMetadata *addprocessedimfileArgs = psMetadataAlloc();
     
    178180    ADD_OPT(S64, revertprocessedimfileArgs, "-exp_id_begin",  "search by exposure ID", 0);
    179181    ADD_OPT(S64, revertprocessedimfileArgs, "-exp_id_end",    "search by exposure ID", 0);
     182    // This argument is not used but is needed because the task uses add.poll.args
     183    ADD_OPT(U64, revertprocessedimfileArgs, "-limit",     "for compatability not used", 0);
    180184
    181185    // -updateprocessedimfile
     
    415419    psMetadataAddBool(finishcompressexpArgs, PS_LIST_TAIL, "-simple", 0,   "use the simple output format", false);
    416420    psMetadataAddU64(finishcompressexpArgs, PS_LIST_TAIL, "-limit",   0,   "limit result set to N items", 0);
     421
     422    // -checkstatus
     423    psMetadata *checkstatusArgs = psMetadataAlloc();
     424    ADD_OPT(Str, checkstatusArgs, "-dateobs_begin", "set the earlist summit dateobs to consider", NULL);
     425    ADD_OPT(Str, checkstatusArgs, "-dateobs_end", "set the latest summit dateobs to consider", NULL);
     426    ADD_OPT(Str, checkstatusArgs, "-date", "use default observing extent and look over entire night", NULL);
     427    ADD_OPT(Str, checkstatusArgs, "-class_id",    "define class ID (required)", NULL);
     428    ADD_OPT(Bool, checkstatusArgs, "-simple",    "use the simple output format", false);
    417429   
    418430    psMetadata *argSets = psMetadataAlloc();
     
    435447    PXOPT_ADD_MODE("-pendingcompressimfile",   "", REGTOOL_MODE_PENDINGCOMPRESSIMFILE, pendingcompressimfileArgs);
    436448    PXOPT_ADD_MODE("-finishcompressexp",       "", REGTOOL_MODE_FINISHCOMPRESSEXP, finishcompressexpArgs);
     449    PXOPT_ADD_MODE("-checkstatus",             "", REGTOOL_MODE_CHECKSTATUS, checkstatusArgs);
    437450    PXOPT_ADD_MODE("-exportrun",            "export run for import on other database", REGTOOL_MODE_EXPORTRUN, exportrunArgs);
    438451    PXOPT_ADD_MODE("-importrun",            "import run from metadata file",           REGTOOL_MODE_IMPORTRUN, importrunArgs);
  • branches/czw_branch/20101203/ippTools/src/stacktool.c

    r29418 r30586  
    497497            psError(PS_ERR_UNKNOWN, false, "database error");
    498498            psFree(output);
    499             psFree(run);
    500499            psFree(insert);
    501500            psFree(list);
     
    517516          psError(PS_ERR_UNKNOWN, false, "database error");
    518517          psFree(output);
    519           psFree(run);
    520518          psFree(insert);
    521519          psFree(list);
  • branches/czw_branch/20101203/ippconfig/isp/camera.config

    r29902 r30586  
    7878# don't censor any masked pixels when making postage stamps
    7979MASK.NO.CENSOR               U32 4294967295
     80BURNTOOL.STATE.GOOD          S16  0  # Value for burntool_state with the most recent bt version.
  • branches/czw_branch/20101203/ippconfig/recipes/dqStatsTool.config

    r28427 r30586  
    55    RULE MULTI
    66    RULE METADATA
     7        COLNAME STR CAMRUN_QUALITY
     8        MINIMUM S32 0
     9        MAXIMUM S32 0
     10        RULETYPE STR STRICT
     11   END
     12# CDF data generated from the data in camRun with non-NULL deteff values.
     13# CZW: How I did this so I can remember next time.
     14# echo "select zpt_obs,fwhm_major,deteff from camProcessedExp JOIN camRun USING (cam_id) JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id) WHERE camRun.label LIKE '%.nightlyscience' AND quality = 0 AND filter = 'FILTER';" | sed 's/FILTER/g.00000/' | mysql -h ippdb01 -u ipp -pipp gpc1 | awk '{print($3)}' | grep -v deteff | grep -v NULL | mk_cdf.pl | awk '{print($2,$1)}' | spline - `echo 0.0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 0.99 1.0`
     15    RULE METADATA
     16        COLNAME STR DETEFF
     17        RULETYPE STR CDF
     18        FILTER  STR g.00000
     19        CDF00   F32 13.0214
     20        CDF05   F32 18.4582
     21        CDF10   F32 18.8631
     22        CDF15   F32 19.1020
     23        CDF20   F32 19.3304
     24        CDF25   F32 19.4613
     25        CDF30   F32 19.5324
     26        CDF35   F32 19.6094
     27        CDF40   F32 19.6878
     28        CDF45   F32 19.7477
     29        CDF50   F32 19.8058
     30        CDF55   F32 19.8737
     31        CDF60   F32 19.9409
     32        CDF65   F32 20.0108
     33        CDF70   F32 20.0860
     34        CDF75   F32 20.1694
     35        CDF80   F32 20.2681
     36        CDF85   F32 20.3974
     37        CDF90   F32 20.5609
     38        CDF95   F32 20.7193
     39        CDF99   F32 20.9785
     40        CDF100  F32 21.6135
     41    END
     42    RULE METADATA
     43        COLNAME STR DETEFF
     44        RULETYPE STR CDF
     45        FILTER  STR r.00000
     46        CDF00   F32 13.0000
     47        CDF05   F32 17.9079
     48        CDF10   F32 18.4030
     49        CDF15   F32 18.7973
     50        CDF20   F32 19.0507
     51        CDF25   F32 19.2644
     52        CDF30   F32 19.4433
     53        CDF35   F32 19.5680
     54        CDF40   F32 19.6728
     55        CDF45   F32 19.7609
     56        CDF50   F32 19.8393
     57        CDF55   F32 19.9125
     58        CDF60   F32 19.9751
     59        CDF65   F32 20.0395
     60        CDF70   F32 20.0926
     61        CDF75   F32 20.1673
     62        CDF80   F32 20.2457
     63        CDF85   F32 20.3496
     64        CDF90   F32 20.4967
     65        CDF95   F32 20.7552
     66        CDF99   F32 21.2945
     67        CDF100  F32 21.6046
     68    END
     69    RULE METADATA
     70        COLNAME STR DETEFF
     71        RULETYPE STR CDF
     72        FILTER  STR i.00000
     73        CDF00   F32 16.4751
     74        CDF05   F32 18.3041
     75        CDF10   F32 18.5018
     76        CDF15   F32 18.6497
     77        CDF20   F32 18.7602
     78        CDF25   F32 18.8521
     79        CDF30   F32 18.9267
     80        CDF35   F32 19.0105
     81        CDF40   F32 19.0948
     82        CDF45   F32 19.1563
     83        CDF50   F32 19.2215
     84        CDF55   F32 19.296
     85        CDF60   F32 19.3689
     86        CDF65   F32 19.4438
     87        CDF70   F32 19.5261
     88        CDF75   F32 19.6127
     89        CDF80   F32 19.7071
     90        CDF85   F32 19.8518
     91        CDF90   F32 20.0447
     92        CDF95   F32 20.5386
     93        CDF99   F32 21.1344
     94        CDF100  F32 21.5592
     95    END
     96    RULE METADATA
     97        COLNAME STR DETEFF
     98        RULETYPE STR CDF
     99        FILTER  STR z.00000
     100        CDF00   F32 12.1771
     101        CDF05   F32 17.5262
     102        CDF10   F32 17.7958
     103        CDF15   F32 17.9979
     104        CDF20   F32 18.1753
     105        CDF25   F32 18.3201
     106        CDF30   F32 18.4335
     107        CDF35   F32 18.5478
     108        CDF40   F32 18.6470
     109        CDF45   F32 18.7494
     110        CDF50   F32 18.8370
     111        CDF55   F32 18.9166
     112        CDF60   F32 19.0028
     113        CDF65   F32 19.0912
     114        CDF70   F32 19.1886
     115        CDF75   F32 19.2912
     116        CDF80   F32 19.4137
     117        CDF85   F32 19.5244
     118        CDF90   F32 19.6437
     119        CDF95   F32 19.9135
     120        CDF99   F32 20.6482
     121        CDF100  F32 21.0925
     122    END
     123    RULE METADATA
     124        COLNAME STR DETEFF
     125        RULETYPE STR CDF
     126        FILTER  STR y.00000
     127        CDF00   F32 11.6109
     128        CDF05   F32 16.7278
     129        CDF10   F32 17.0561
     130        CDF15   F32 17.2778
     131        CDF20   F32 17.4367
     132        CDF25   F32 17.5495
     133        CDF30   F32 17.6469
     134        CDF35   F32 17.7392
     135        CDF40   F32 17.8160
     136        CDF45   F32 17.8927
     137        CDF50   F32 17.9779
     138        CDF55   F32 18.0514
     139        CDF60   F32 18.1292
     140        CDF65   F32 18.2153
     141        CDF70   F32 19.2903
     142        CDF75   F32 18.3627
     143        CDF80   F32 18.4325
     144        CDF85   F32 18.5321
     145        CDF90   F32 18.6403
     146        CDF95   F32 18.7523
     147        CDF99   F32 18.8892
     148        CDF100  F32 19.064
     149    END
     150    RULE METADATA
     151        COLNAME STR DETEFF
     152        RULETYPE STR CDF
     153        FILTER  STR w.00000
     154        CDF00   F32 17.4082
     155        CDF05   F32 19.4333
     156        CDF10   F32 19.9698
     157        CDF15   F32 20.2711
     158        CDF20   F32 20.3919
     159        CDF25   F32 20.5038
     160        CDF30   F32 20.6192
     161        CDF35   F32 20.7273
     162        CDF40   F32 20.8184
     163        CDF45   F32 20.9186
     164        CDF50   F32 21.0151
     165        CDF55   F32 21.1326
     166        CDF60   F32 21.2442
     167        CDF65   F32 21.3412
     168        CDF70   F32 21.4394
     169        CDF75   F32 21.5105
     170        CDF80   F32 21.5567
     171        CDF85   F32 21.6281
     172        CDF90   F32 21.6908
     173        CDF95   F32 21.7566
     174        CDF99   F32 21.8907
     175        CDF100  F32 23.6312
     176    END
     177    RULE METADATA
    7178        COLNAME STR FWHM_MAJOR
     179        RULETYPE STR UNUSED
    8180        MINIMUM F32 0.0
    9181        MAXIMUM F32 9.3            # 90-percentile 2010-02-14 through 2010-06-20 = 2.4"
     
    11183    RULE METADATA
    12184        COLNAME STR FWHM_MINOR
     185        RULETYPE STR UNUSED
    13186        MINIMUM F32 0.0
    14187        MAXIMUM F32 8.44           # 90-percentile 2010-02-14 through 2010-06-20 = 2.18"
     
    16189    RULE METADATA
    17190         COLNAME STR ZEROPOINT
     191        RULETYPE STR UNUSED
    18192         FILTER  STR g.00000
    19193         MINIMUM F32 24.3051           # (median 2010-02-14 through 2010-06-20) - 0.25 magnitudes
     
    22196    RULE METADATA
    23197         COLNAME STR ZEROPOINT
     198        RULETYPE STR UNUSED
    24199         FILTER  STR r.00000
    25200         MINIMUM F32 24.5294           # (median 2010-02-14 through 2010-06-20) - 0.25 magnitudes
     
    28203    RULE METADATA
    29204         COLNAME STR ZEROPOINT
     205        RULETYPE STR UNUSED
    30206         FILTER  STR i.00000
    31207         MINIMUM F32 24.4641           # (median 2010-02-14 through 2010-06-20) - 0.25 magnitudes
     
    34210    RULE METADATA
    35211         COLNAME STR ZEROPOINT
     212        RULETYPE STR UNUSED
    36213         FILTER  STR z.00000
    37214         MINIMUM F32 24.1128           # (median 2010-02-14 through 2010-06-20) - 0.25 magnitudes
     
    40217    RULE METADATA
    41218         COLNAME STR ZEROPOINT
     219        RULETYPE STR UNUSED
    42220         FILTER  STR y.00000
    43221         MINIMUM F32 23.1503           # (median 2010-02-14 through 2010-06-20) - 0.25 magnitudes
     
    46224    RULE METADATA
    47225         COLNAME STR ZEROPOINT
     226        RULETYPE STR UNUSED
    48227         FILTER  STR w.00000
    49228         MINIMUM F32 25.8944           # (median 2010-02-14 through 2010-06-20) - 0.25 magnitudes
    50229         MAXIMUM F32 99.9999           # We refuse to believe in negative clouds.
    51230    END
    52 #    TYPE VAL COLNAME      MINIMUM        MAXIMUM
    53 #    RULE VAL FWHM_MAJOR   0.0            5.0
    54 #    RULE VAL FWHM_MINOR   0.0            5.0
    55231END
    56232
     
    65241    COLUMN VAL rawExp           decl              PS_DATA_F64    DEC                 # Declination
    66242    COLUMN VAL rawExp           exp_time          PS_DATA_F32    EXPTIME             # Exposure time
     243    COLUMN VAL rawExp           obs_mode          PS_DATA_STRING OBS_MODE
    67244
    68245    COLUMN VAL camProcessedExp  zpt_obs           PS_DATA_F32    ZEROPOINT           
     
    107284    COLUMN VAL camProcessedExp  iq_m4_lq          PS_DATA_F32    IQ_M4_LQ           
    108285    COLUMN VAL camProcessedExp  iq_m4_uq          PS_DATA_F32    IQ_M4_UQ           
     286    COLUMN VAL camProcessedExp  deteff            PS_DATA_F32    DETEFF
     287    COLUMN VAL camProcessedExp  quality           PS_DATA_S32    CAMRUN_QUALITY
    109288END
    110289
  • branches/czw_branch/20101203/ippconfig/recipes/filerules-split.mdc

    r30118 r30586  
    346346MAGIC.DUPLICATE.PNG          OUTPUT {OUTPUT}_duplicate.png            JPEG            NONE       FPA        TRUE      NONE
    347347
     348# TYPE                         OUTPUT FILENAME.RULE                     FILE.TYPE       FITS.TYPE  DATA.LEVEL FILE.SAVE FILE.FORMAT
     349DIST.OUTPUT.CHIP.BUNDLE      OUTPUT {OUTPUT}.{CHIP.NAME}.tgz          TEXT            NONE       CHIP       TRUE      NONE
     350DIST.OUTPUT.BUNDLE           OUTPUT {OUTPUT}.tgz                      TEXT            NONE       FPA        TRUE      NONE
     351DIST.OUTPUT.DBINFO           OUTPUT {OUTPUT}.mdc                      TEXT            NONE       FPA        TRUE      NONE
     352DIST.OUTPUT.DIRINFO          OUTPUT {OUTPUT}.mdc                      TEXT            NONE       FPA        TRUE      NONE
     353
    348354PPSMOOTH.OUTPUT              OUTPUT {OUTPUT}.{CHIP.NAME}.fits         IMAGE           NONE       CHIP       TRUE      MEF
    349355PPSMOOTH.OUTPUT.MASK         OUTPUT {OUTPUT}.{CHIP.NAME}.mk.fits      MASK            NONE       CHIP       TRUE      MEF
  • branches/czw_branch/20101203/ippconfig/recipes/nightly_science.config

    r30118 r30586  
    33  MODE           STR CHIP
    44  COMMAND        STR chiptool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -state full -set_label goto_cleaned -label @LABEL@ -data_group @DATA_GROUP@
    5   RETENTION_TIME U16 30
     5  RETENTION_TIME U16 21
    66END
    77CLEAN_MODES METADATA
     
    1313  MODE           STR DIFF
    1414  COMMAND        STR difftool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -state full -set_label goto_cleaned -label @LABEL@ -data_group @DATA_GROUP@
    15   RETENTION_TIME S16 30
     15  RETENTION_TIME S16 21
    1616END
    1717CLEAN_MODES METADATA
     
    2525  RETENTION_TIME S16 1
    2626END
     27CLEAN_MODES METADATA
     28  MODE           STR BGCHIP
     29  COMMAND        STR bgtool -dbname @DBNAME@ -updatechip -set_state goto_cleaned -state full -set_label goto_cleaned -label @LABEL@ -data_group @DATA_GROUP@
     30  RETENTION_TIME S16 7
     31END
     32CLEAN_MODES METADATA
     33  MODE           STR BGWARP
     34  COMMAND        STR bgtool -dbname @DBNAME@ -updatewarp -set_state goto_cleaned -state full -set_label goto_cleaned -label @LABEL@ -data_group @DATA_GROUP@
     35  RETENTION_TIME S16 7
     36END
     37
    2738
    2839END_OF_NIGHT MULTI
     
    93104  NAME      STR MD03
    94105  DISTRIBUTION STR MD03
    95   TESS      STR MD03
     106  TESS      STR MD03.V2
    96107  OBSMODE   STR MD
    97108  OBJECT    STR MD03%
     
    115126  NAME      STR MD05
    116127  DISTRIBUTION STR MD05
    117   TESS      STR MD05
     128  TESS      STR MD05.V2
    118129  OBSMODE   STR MD
    119130  OBJECT    STR MD05%
     
    205216  STACKABLE BOOL FALSE
    206217  DIFFABLE  BOOL TRUE
    207   WARP      S16 60
     218#  WARP      S16 60
    208219END
    209220TARGETS METADATA
     
    216227END
    217228TARGETS METADATA
     229  NAME         STR PI
     230  DISTRIBUTION STR SweetSpot
     231  TESS         STR RINGS.V0
     232  OBSMODE      STR PI
     233  STACKABLE   BOOL FALSE
     234  DIFFABLE    BOOL TRUE
     235END
     236TARGETS METADATA
    218237  NAME         STR CNP
    219238  DISTRIBUTION STR CNP
     
    230249  STACKABLE   BOOL FALSE
    231250  DIFFABLE    BOOL TRUE
    232   CHIP         S16 14
    233   DIFF         S16 14
     251  CHIP         S16 10
     252  DIFF         S16 10
    234253END
    235254# This is a hack, and I freely admit it.
  • branches/czw_branch/20101203/magic/remove/src/streaksVersion.c

    r28043 r30586  
    5858    psString source = streaksSource();   // Software source
    5959
    60     psMetadataAddStr(header, PS_LIST_TAIL, "STREAK_V", 0, NULL, source);
     60    psMetadataAddStr(header, PS_LIST_TAIL, "STREAK_V", PS_META_REPLACE, NULL, source);
    6161   
    6262    psStringPrepend(&version, "%s version: ", streaksProgram);
  • branches/czw_branch/20101203/magic/remove/src/streakscompare.c

    r26477 r30586  
    1818    ippStage stage = psMetadataLookupS32(&status, config->arguments, "STAGE");
    1919
    20     sFile *file1 = sFileOpen(config, stage, "INPUT1", NULL, true);
    21     sFile *file2 = sFileOpen(config, stage, "INPUT2", NULL, true);
     20    sFile *file1 = sFileOpen(config, stage, "INPUT1", NULL, true, false);
     21    sFile *file2 = sFileOpen(config, stage, "INPUT2", NULL, true, false);
    2222
    2323    int ncomponents;
  • branches/czw_branch/20101203/magic/remove/src/streaksio.c

    r29392 r30586  
    4242    sf->class_id = psMetadataLookupStr(&status, config->arguments, "CLASS_ID");
    4343
    44     sf->inImage = sFileOpen(config, stage, "INPUT", NULL, true);
     44    sf->inImage = sFileOpen(config, stage, "INPUT", NULL, true, false);
    4545    sf->nHDU = sf->inImage->nHDU;
    4646
     
    4848    // The names of the temporary and recovery files are taken from the input
    4949    char *inputBasename = basename(sf->inImage->name);
    50     sf->outImage = sFileOpen(config, stage, "OUTPUT", inputBasename, true);
     50    sf->outImage = sFileOpen(config, stage, "OUTPUT", inputBasename, true, true);
    5151
    5252    if (remove) {
    5353        // XXX: the recovery file should be required if stage is raw and the replace flag is set
    5454        // that is if the input raw image is to be destroyed
    55         sf->recImage = sFileOpen(config, stage, "RECOVERY", inputBasename, false);
    56     } else {
    57         sf->recImage = sFileOpen(config, stage, "RECOVERY.IMAGE", NULL, true);
    58     }
    59 
    60     sf->inMask = sFileOpen(config, stage, "INPUT.MASK", NULL, false);
     55        sf->recImage = sFileOpen(config, stage, "RECOVERY", inputBasename, false, false);
     56    } else {
     57        sf->recImage = sFileOpen(config, stage, "RECOVERY.IMAGE", NULL, true, false);
     58    }
     59
     60    sf->inMask = sFileOpen(config, stage, "INPUT.MASK", NULL, false, false);
    6161    if (sf->inMask && (sf->stage != IPP_STAGE_RAW)) {
    6262        inputBasename = basename(sf->inMask->name);
    63         sf->outMask = sFileOpen(config, stage, "OUTPUT", inputBasename, true);
     63        sf->outMask = sFileOpen(config, stage, "OUTPUT", inputBasename, true, true);
    6464        if (remove) {
    65             sf->recMask = sFileOpen(config, stage, "RECOVERY", inputBasename, false);
     65            sf->recMask = sFileOpen(config, stage, "RECOVERY", inputBasename, false, false);
    6666        } else {
    67             sf->recMask = sFileOpen(config, stage, "RECOVERY.MASK", NULL, true);
     67            sf->recMask = sFileOpen(config, stage, "RECOVERY.MASK", NULL, true, false);
    6868        }
    6969    }
     
    7373    // If it doesn't exist, we didn't have a camera mask
    7474    if (remove && sf->inMask && (stage == IPP_STAGE_CHIP)) {
    75         sf->inChMask = sFileOpen(config, stage, "INPUT.CHMASK", NULL, false);
     75        sf->inChMask = sFileOpen(config, stage, "INPUT.CHMASK", NULL, false, false);
    7676        if (sf->inChMask) {
    7777            inputBasename = basename(sf->inChMask->name);
    78             sf->outChMask = sFileOpen(config, stage, "OUTPUT", inputBasename, true);
    79             sf->recChMask = sFileOpen(config, stage, "RECOVERY", inputBasename, false);
    80         }
    81     }
    82 
    83     sf->inWeight = sFileOpen(config, stage, "INPUT.WEIGHT", NULL, false);
     78            sf->outChMask = sFileOpen(config, stage, "OUTPUT", inputBasename, true, true);
     79            sf->recChMask = sFileOpen(config, stage, "RECOVERY", inputBasename, false, false);
     80        }
     81    }
     82
     83    sf->inWeight = sFileOpen(config, stage, "INPUT.WEIGHT", NULL, false, false);
    8484    if (sf->inWeight) {
    8585        inputBasename = basename(sf->inWeight->name);
    86         sf->outWeight = sFileOpen(config, stage, "OUTPUT", inputBasename, true);
     86        sf->outWeight = sFileOpen(config, stage, "OUTPUT", inputBasename, true, true);
    8787        if (remove) {
    88             sf->recWeight = sFileOpen(config, stage, "RECOVERY", inputBasename, false);
     88            sf->recWeight = sFileOpen(config, stage, "RECOVERY", inputBasename, false, false);
    8989        } else {
    90             sf->recWeight = sFileOpen(config, stage, "RECOVERY.WEIGHT", NULL, true);
     90            sf->recWeight = sFileOpen(config, stage, "RECOVERY.WEIGHT", NULL, true, false);
    9191        }
    9292    }
    9393    if (remove) {
    94         sf->inSources = sFileOpen(config, stage, "SOURCES", NULL, false);
     94        sf->inSources = sFileOpen(config, stage, "SOURCES", NULL, false, false);
    9595        if (sf->inSources) {
    9696            inputBasename = basename(sf->inSources->name);
    97             sf->outSources = sFileOpen(config, stage, "OUTPUT", inputBasename, true);
     97            sf->outSources = sFileOpen(config, stage, "OUTPUT", inputBasename, true, true);
    9898        }
    9999    }
     
    121121    sf->transparentStreaks = psMetadataLookupF64(&status, config->arguments, "TRANSPARENT_STREAKS");
    122122
    123     sf->stats = psMetadataAlloc();
    124     psString statsFileName= psMetadataLookupStr(&status, config->arguments, "STATS");
    125     if (statsFileName) {
    126         sf->statsFile = fopen(statsFileName, "w");
    127         if (!sf->statsFile) {
    128             psError(PS_ERR_IO, true, "failed to open stats file %s", statsFileName);
    129             streaksExit("", PS_EXIT_CONFIG_ERROR);
    130         }
    131     }
    132 
    133123    return sf;
    134124}
     
    138128{
    139129    freeImages(sf);
     130    psFree(sf->stats);
    140131    psFree(sf->diffedPixels);
    141132    psFree(sf->tiles);
     
    221212
    222213static psString
    223 resolveFilename(pmConfig *config, sFile *sfile, bool create)
     214resolveFilename(pmConfig *config, sFile *sfile, bool create, bool checkIfDestreaked)
    224215{
    225216    sfile->inNebulous = IN_NEBULOUS(sfile->name);
     
    232223            // instance. It will get created below in pmConfigConvertFilename
    233224            if ((sfile->resolved_name = nebFind(server, sfile->name)) != NULL) {
    234                 if (!nebFileIsDestreaked(sfile)) {
     225                if (checkIfDestreaked && !nebFileIsDestreaked(sfile)) {
    235226                    psError(PS_ERR_IO, false, "attempting to delete file that has not been destreaked %s", sfile->name);
    236227                    return NULL;
     
    247238
    248239sFile *sFileOpen(pmConfig *config, ippStage stage, psString fileSelect,
    249     psString outputFilename, bool required)
     240    psString outputFilename, bool required, bool checkIfDestreaked)
    250241{
    251242    bool status;
     
    322313    // and the file is to be opened for writing
    323314    if (outputFilename) {
     315        sfile->write = true;
    324316        psStringAppend(&sfile->name, "%s%s", name, outputFilename);
    325         sfile->resolved_name = resolveFilename(config, sfile, true);
     317        sfile->resolved_name = resolveFilename(config, sfile, true, checkIfDestreaked);
    326318        if (!sfile->resolved_name) {
    327319            psError(PS_ERR_IO, false, "Failed to resolve filename for %s", sfile->name);
     
    335327    } else {
    336328        sfile->name = psStringCopy(name);
    337         sfile->resolved_name = resolveFilename(config, sfile, false);
     329        sfile->resolved_name = resolveFilename(config, sfile, false, false);
    338330        if (!sfile->resolved_name) {
    339331            psError(PS_ERR_IO, false, "Failed to resolve name for %s", sfile->name);
     
    402394
    403395void
    404 addDestreakKeyword(psMetadata *header)
     396addDestreakKeyword(psMetadata *header, bool value)
    405397{
    406398    psMetadataAddBool(header, PS_LIST_TAIL, "PSDESTRK", PS_META_REPLACE,
    407         "Have streaks been removed from image?", true);
     399        "Have streaks been removed from image?", value);
    408400}
    409401
     
    416408
    417409void
    418 copyPHU(streakFiles *sfiles, bool remove)
     410copyPHU(streakFiles *sfiles, bool remove, bool destreak)
    419411{
    420412    psAssert(sfiles->stage == IPP_STAGE_RAW, "copyPHU should only be used for raw stage");
     
    433425
    434426    // add keyword indicating that streaks have been removed
    435     addDestreakKeyword(imageHeader);
     427    addDestreakKeyword(imageHeader, destreak);
    436428
    437429    if (!psFitsWriteBlank(sfiles->outImage->fits, imageHeader, NULL)) {
     
    463455        }
    464456        // add keyword indicating that streaks have been removed
    465         addDestreakKeyword(maskHeader);
     457        addDestreakKeyword(maskHeader, destreak);
    466458        if (!psFitsWriteBlank(sfiles->outMask->fits, maskHeader, NULL)) {
    467459            psError(PS_ERR_IO, false, "failed to write primary header to %s",
     
    493485
    494486        // add keyword indicating that streaks have been removed
    495         addDestreakKeyword(weightHeader);
     487        addDestreakKeyword(weightHeader, destreak);
    496488        if (!psFitsWriteBlank(sfiles->outWeight->fits, weightHeader, NULL)) {
    497489            psError(PS_ERR_IO, false, "failed to write primary header to %s",
     
    683675    psVector *tiles)
    684676{
    685     if (!sfile) {
     677    if (!sfile || !sfile->write) {
    686678        return;
    687679    }
     
    861853        streaksExit("", PS_EXIT_DATA_ERROR);
    862854    }
     855    sfile->fits = NULL;
    863856    psFree(sfile->header);
    864857    sfile->header = NULL;
     
    11981191                                weight->data.F32[y][x] = NAN;
    11991192                            }
     1193                        } else if (weightType == PS_TYPE_F64) {
     1194                            double weightVal = weight->data.F64[y][x];
     1195                            if (!isnan(weightVal)) {
     1196                                ++nandWeights;
     1197                                weight->data.F64[y][x] = NAN;
     1198                            }
    12001199                        } else if(weightType == PS_TYPE_S16) {
    12011200                            double weightVal = weight->data.S16[y][x];
     
    12491248        psMetadataAddU16(in->header, PS_LIST_TAIL, "ZBLANK", 0, "", 32767);
    12501249    } else if (in->image->type.type == PS_TYPE_F32) {
     1250        in->exciseValue = NAN;
     1251    } else if (in->image->type.type == PS_TYPE_F64) {
    12511252        in->exciseValue = NAN;
    12521253    } else {
  • branches/czw_branch/20101203/magic/remove/src/streaksio.h

    r26408 r30586  
    55
    66sFile *sFileOpen(pmConfig *config, ippStage stage, psString fileSelect,
    7     psString outputFilename, bool required);
     7    psString outputFilename, bool required, bool checkIfDestreaked);
    88
    99void closeImages(streakFiles *sfiles);
     
    1212
    1313void readImage(sFile *sfile, int extnum, ippStage stage, bool isMask);
    14 void copyPHU(streakFiles *sfiles, bool remove);
     14void copyPHU(streakFiles *sfiles, bool remove, bool destreaked);
    1515void copyTable(sFile *out, sFile *in, int extnum);
    1616void copyFitsOptions(sFile *out, sFile *rec, sFile *in, psVector *tiles);
     
    2424void readImageFrom_pmFile(streakFiles *sf);
    2525
    26 void addDestreakKeyword(psMetadata *);
     26void addDestreakKeyword(psMetadata *, bool value);
    2727void addRecoveryKeyword(psMetadata *);
    2828
  • branches/czw_branch/20101203/magic/remove/src/streaksrelease.c

    r27468 r30586  
    2424    if (sfiles->stage == IPP_STAGE_RAW) {
    2525        // copy PHU to output files
    26         copyPHU(sfiles, true);
     26        copyPHU(sfiles, false, true);
    2727
    2828        // advance to the first image extension
  • branches/czw_branch/20101203/magic/remove/src/streaksremove.c

    r29806 r30586  
    9393        // Raw files have a phu and multiple extensions, one per chip
    9494        // Since this is a raw file, copy it's PHU to output files
    95         copyPHU(sfiles, true);
     95        copyPHU(sfiles, true, true);
    9696
    9797        // advance to the first image extension
     
    275275    psLogMsg("streaksremove", PS_LOG_INFO, "time to run streaksremove: %f\n", total_time);
    276276
    277     if (sfiles->statsFile) {
    278         const char *statsMDC = psMetadataConfigFormat(sfiles->stats);
    279         if (!statsMDC || strlen(statsMDC) == 0) {
    280             psError(PS_ERR_IO, false, "Unable to get statistics MDC file.\n");
    281         } else {
    282             fprintf(sfiles->statsFile, "%s", statsMDC);
    283             psFree(statsMDC);
    284             fclose(sfiles->statsFile);
    285             sfiles->statsFile = NULL;
    286             psFree(sfiles->stats);
    287             sfiles->stats = NULL;
    288         }
    289     }
     277    psString statsFileName= psMetadataLookupStr(&status, config->arguments, "STATS");
     278
     279    if (statsFileName) {
     280    // Write out
     281        psString resolved = pmConfigConvertFilename(statsFileName, config, true, true); // Resolved filename
     282        if (!resolved) {
     283            psError(psErrorCodeLast(), false, "Unable to resolve statistics file name");
     284            return false;
     285        }
     286        if (!psMetadataConfigWrite(sfiles->stats, resolved, NULL)) {
     287            psError(psErrorCodeLast(), false, "Unable to serialize stats metadata.\n");
     288            psFree(resolved);
     289            return false;
     290        }
     291        psFree(resolved);
     292    }
     293
    290294    // all done. Clean up to look for memory leaks.
    291295
     
    613617        addRecoveryKeyword(sf->recImage->header);
    614618    }
    615     addDestreakKeyword(sf->outImage->header);
     619    addDestreakKeyword(sf->outImage->header, true);
    616620
    617621    if (!SFILE_IS_IMAGE(sf->inImage)) {
     
    639643                addRecoveryKeyword(sf->recMask->header);
    640644            }
    641             addDestreakKeyword(sf->outMask->header);
     645            addDestreakKeyword(sf->outMask->header, true);
    642646            // Note: we don't excise the mask pixels even if exciseAll is true.
    643647            setupImageRefs(sf->outMask, sf->recMask, sf->inMask, sf->extnum, false);
     
    671675            addRecoveryKeyword(sf->recWeight->header);
    672676        }
    673         addDestreakKeyword(sf->outWeight->header);
     677        addDestreakKeyword(sf->outWeight->header, true);
    674678        setupImageRefs(sf->outWeight, sf->recWeight, sf->inWeight, sf->extnum, exciseAll);
    675679
     
    767771            }
    768772        }
    769     } else {
     773    } else if (sfiles->inImage->image->type.type == PS_TYPE_F32) {
    770774        float imageValue  = sfiles->inImage->image->data.F32[y][x];
    771775        if (sfiles->recImage && !isExciseValue(imageValue, sfiles->inImage->exciseValue) ) {
     
    783787            }
    784788        }
     789    } else {
     790        // We could handle F64 but I don't think we ever get them.
     791        // Should catch this earlier
     792        psError(PS_ERR_IO, true, "unexpected image type %x found", sfiles->inImage->image->type.type );
     793        streaksExit("", PS_EXIT_PROG_ERROR);
    785794    }
    786795
    787796    if (sfiles->outWeight) {
    788         if (sfiles->recWeight) {
    789             sfiles->recWeight->image->data.F32[y][x] = sfiles->inWeight->image->data.F32[y][x];
    790         }
    791797        // Assume that weight images are always a floating point type
    792         sfiles->outWeight->image->data.F32[y][x] = NAN;
     798        if (sfiles->inWeight->image->type.type == PS_TYPE_F32) {
     799            if (sfiles->recWeight) {
     800                sfiles->recWeight->image->data.F32[y][x] = sfiles->inWeight->image->data.F32[y][x];
     801            }
     802            sfiles->outWeight->image->data.F32[y][x] = NAN;
     803        } else if (sfiles->inWeight->image->type.type == PS_TYPE_F64) {
     804            if (sfiles->recWeight) {
     805                sfiles->recWeight->image->data.F64[y][x] = sfiles->inWeight->image->data.F64[y][x];
     806            }
     807            sfiles->outWeight->image->data.F64[y][x] = NAN;
     808        } else {
     809            // Should catch this earlier
     810            psError(PS_ERR_IO, true, "unexpected weight image type %x found", sfiles->inWeight->image->type.type );
     811            streaksExit("", PS_EXIT_PROG_ERROR);
     812        }
    793813    }
    794814    if (sfiles->outMask) {
     
    912932            streaksExit("", PS_EXIT_DATA_ERROR);
    913933        }
    914         addDestreakKeyword(header);
     934        addDestreakKeyword(header, true);
    915935
    916936        if (!psFitsWriteBlank(out->fits, header, extname)) {
     
    973993        psArrayRealloc(outTable, j);
    974994
    975         addDestreakKeyword(header);
     995        addDestreakKeyword(header, true);
    976996        if (psArrayLength(outTable) > 0) {
    977997            printf("Censored %d sources\n", numCensored);
  • branches/czw_branch/20101203/magic/remove/src/streaksremove.h

    r27752 r30586  
    1818    psString    name;
    1919    bool        inNebulous;
     20    bool        write;
    2021    psFits      *fits;
    2122    int         nHDU;
  • branches/czw_branch/20101203/magic/remove/src/streaksreplace.c

    r26477 r30586  
    3636    if (sfiles->stage == IPP_STAGE_RAW) {
    3737        // copy PHU to output files
    38         copyPHU(sfiles, false);
     38        copyPHU(sfiles, false, false);
    3939
    4040        // advance to the first image extension
     
    296296
    297297    sf->outImage->header = (psMetadata*) psMemIncrRefCounter(sf->inImage->header);
     298    addDestreakKeyword(sf->outImage->header, false);
    298299
    299300    if (!SFILE_IS_IMAGE(sf->inImage)) {
     
    317318        readImage(sf->recMask, sf->extnum, sf->stage, true);
    318319        sf->outMask->header = (psMetadata*) psMemIncrRefCounter(sf->inMask->header);
     320       
     321        addDestreakKeyword(sf->outMask->header, false);
    319322
    320323        // XXX: TODO
     
    329332
    330333        sf->outWeight->header = (psMetadata*) psMemIncrRefCounter(sf->inWeight->header);
     334        addDestreakKeyword(sf->outWeight->header, false);
    331335        setupImageRefs(sf->outMask, NULL, sf->inMask, sf->extnum, false);
    332336
  • branches/czw_branch/20101203/ppStack/src/ppStackConvolve.c

    r29283 r30586  
    126126                options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] |= PPSTACK_MASK_MATCH;
    127127                psErrorClear();
     128                if (!ppStackFilesIterateUp(config)) {
     129                    psFree(rng);
     130                    psFree(fpaList);
     131                    psFree(cellList);
     132                    psFree(target);
     133                    return false;
     134                }
    128135                continue;
    129136            }
  • branches/czw_branch/20101203/psLib/src/imageops

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/czw_branch/20101203/psLib/test/math

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/czw_branch/20101203/psModules/src/objects

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/czw_branch/20101203/psphot/src/psphotApResid.c

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/czw_branch/20101203/psphot/src/psphotMakeFluxScale.c

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/czw_branch/20101203/pstamp/scripts/Makefile.am

    r29330 r30586  
    1717        pstamp_runcommand.sh \
    1818        pstamp_server_status \
     19        pstamp_save_server_status.pl \
    1920        pstamp_webrequest.pl \
    2021        pstamp_get_image_job.pl \
    2122        psmkreq \
     23        psstatus \
    2224        pstampstopfaulted \
    2325        pstamp_checkdependent.pl \
  • branches/czw_branch/20101203/pstamp/scripts/pstamp_checkdependent.pl

    r29624 r30586  
    690690                if ($dsfile->{data_state} eq 'cleaned') {
    691691                    $command = "$magicdstool -setfiletoupdate -magic_ds_id $magic_ds_id -component $c";
     692                    # XXX: get the recoveryroot from a config file (it isn't actually used except to check whether it is in nebulous)
     693                    $command .= " -set_recoveryroot neb://any/gpc1/destreak/recover";
    692694                    $command .= " -set_label $rlabel" if $rlabel;
    693695                    if (!$no_update) {
  • branches/czw_branch/20101203/pstamp/scripts/pstamp_job_run.pl

    r30118 r30586  
    1414use File::Basename;
    1515use File::Copy;
     16use File::Temp qw(tempfile);
    1617use Digest::MD5::File qw( file_md5_hex );
    1718use PS::IPP::PStamp::RequestFile qw( :standard );
     19use PS::IPP::PStamp::Job qw( :standard );
    1820use IPC::Cmd 0.36 qw( can_run run );
    1921use POSIX;
     
    2628
    2729my ($job_id, $redirect_output, $outputBase, $rownum, $jobType, $options);
    28 my ($verbose, $dbname, $dbserver, $no_update);
     30my ($verbose, $dbname, $dbserver, $no_update, $save_temps);
    2931
    3032GetOptions(
     
    3941    'verbose'           =>  \$verbose,
    4042    'no-update'         =>  \$no_update,
     43    'save-temps'        =>  \$save_temps,
    4144);
    4245
     
    7578my $pstamp_get_image_job    = can_run('pstamp_get_image_job.pl') or (warn "Can't find pstamp_get_image_job.pl" and $missing_tools = 1);
    7679my $dqueryparse = can_run('dqueryparse.pl') or (warn "Can't find dqueryparse.pl" and $missing_tools = 1);
     80my $streaksreplace = can_run('streaksreplace')  or (warn "Can't find streaksreplace"  and $missing_tools = 1);
     81my $magicdstool = can_run('magicdstool')  or (warn "Can't find magicdstool"  and $missing_tools = 1);
    7782
    7883if ($missing_tools) {
     
    8893    my $argString;
    8994    $argString = $params->{job_args};
     95    my $stage = $params->{stage};
    9096
    9197    # XXX: should we do any other sanity checking?
    9298    my_die("argument list is empty", $job_id, $PS_EXIT_DATA_ERROR) if !$argString;
    9399
    94     $argString .= " -file $params->{image}";
     100    my $nan_masked = 1;
     101    my $muggle = 0;
     102    if (!$params->{magicked}) {
     103        $nan_masked = 0;
     104    } elsif ($params->{magicked} and ($options & ($PSTAMP_REQUEST_UNCENSORED | $PSTAMP_REQUIRE_UNCENSORED))) {
     105        # Attempt to find or create a muggle image
     106        $nan_masked = 0;
     107        $muggle = 1;
     108    }
     109
     110    my $image = $params->{image};
     111    my $mask;
     112    my $variance;
     113    my $fileArgs = " -file $params->{image}";
    95114    my @file_list = ($params->{image});
    96115   
    97     my $nan_masked = 1;
    98     if (!$params->{magicked}) {
    99         $nan_masked = 0;
    100     }
    101116    if ($nan_masked or ($options & $PSTAMP_SELECT_MASK)) {
    102         $argString .= " -mask $params->{mask}";
    103         push @file_list, $params->{mask};
     117        $mask = $params->{mask};
     118        $fileArgs .= " -mask $mask";
     119        push @file_list, $mask;
    104120    }
    105121    if ($options & $PSTAMP_SELECT_VARIANCE) {
    106         $argString .= " -variance $params->{weight}";
    107         push @file_list, $params->{weight};
     122        $variance = $params->{weight};
     123        $fileArgs .= " -variance $variance";
     124        push @file_list, $variance;
    108125    }
    109126
     
    113130    }
    114131
    115     check_files(@file_list);
    116 
    117     my $command = "$ppstamp $outputBase $argString";
     132    # check that actual input files exist
     133    check_files($PSTAMP_GONE, @file_list);
     134
     135    # find our output directory
     136    my $outdir = dirname($outputBase);
     137    my ($tmpImage, $tmpMask, $tmpVariance, $tmproot);
     138   
     139    if ($muggle) {
     140        # first see if the original uncensored images are around
     141        if (check_for_backups($params, \$fileArgs)) {
     142            # We're good to go. fileArgs has been edited to contain the paths for the original uncensored images
     143            print "Making stamps from backup images\n";
     144        } elsif (($options & $PSTAMP_REQUIRE_UNCENSORED) and ($stage ne 'chip')) {
     145            # user required uncensored but since stage isn't chip we can't rebuild them
     146            my_die("uncensored inputs not available for job $job_id", $job_id, $PSTAMP_NOT_AVAILABLE);
     147        } elsif (($options & $PSTAMP_REQUEST_UNCENSORED) and ($stage ne 'chip')) {
     148            # make stamps from uncensored images
     149            $muggle = 0;
     150        } else {
     151            # Try and replace the streaks from the recovery images
     152
     153            @file_list = ();
     154            $tmproot = "$outdir/$job_id";
     155            mkdir $tmproot or
     156                my_die( "failed to create temporary directory $tmproot", $job_id, $PS_EXIT_UNKNOWN_ERROR);
     157            my $muggle_command = "$streaksreplace -stage $stage -tmproot $tmproot";
     158            # find the "directory" of the input path_base
     159            my $inputdir = dirname($image);
     160            my $base = basename($image);
     161            $tmpImage = "$tmproot/$base";
     162
     163            # XXX: We should get the recovery_path_base from the magicDSFile but that requires a bunch of file rule and
     164            # stage work. Import the rule here.
     165            my $recImage = "$inputdir/REC_$base";
     166            my $newFileArgs = " -file $tmpImage";
     167            $muggle_command .= " -image $image -recimage $recImage";
     168            push @file_list, $recImage;
     169
     170            if ($mask) {
     171                $base = basename($mask);
     172                $tmpMask = "$tmproot/$base";
     173                $newFileArgs .= " -mask $tmpMask";
     174                my $recMask = "$inputdir/REC_$base";
     175                $muggle_command .= " -mask $mask -recmask $recMask";
     176                push @file_list, $recMask;
     177            }
     178
     179            if ($variance) {
     180                $base = basename($variance);
     181                $tmpVariance = "$tmproot/$base";
     182                $newFileArgs .= " -weight $tmpVariance";
     183                my $recVariance = "$inputdir/REC_$base";
     184                $muggle_command .= " -weight $variance -recweight $recVariance";
     185                push @file_list, $recVariance;
     186            }
     187            if (check_files(0, @file_list)) {
     188                # recovery files exist and are accessible restore the excised pixels
     189
     190                my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     191                    run(command => $muggle_command, verbose => $verbose);
     192                unless ($success) {
     193                    my $exitStatus = WEXITSTATUS($error_code);
     194                    my_die( "streaksreplace failed with error code: $exitStatus", $job_id, $exitStatus);
     195                }
     196
     197                # set the ppstamp file arguments
     198                $fileArgs = $newFileArgs;
     199            } else {
     200                if ($options & $PSTAMP_REQUIRE_UNCENSORED) {
     201                    my_die( "unable to restore uncensored images", $job_id, $PSTAMP_NOT_AVAILABLE);
     202                }
     203                # just make stamps from the censored images
     204                print "Unable to restore uncensored images, will extract stamps from censored images\n";
     205                # these files won't be used so zap them
     206                ($tmpImage, $tmpMask, $tmpVariance, $tmproot) = (undef, undef, undef, undef);
     207            }
     208        }
     209    }
     210
     211    my $command = "$ppstamp $outputBase $argString $fileArgs";
    118212    $command .= " -dbname $dbname" if $dbname;
    119213    $command .= " -dbserver $dbserver" if $dbserver;
    120     $command .= " -stage $params->{stage}" if $params->{stage};
     214    $command .= " -stage $stage";
    121215    $command .= " -no_censor_masked" unless $nan_masked;
    122216    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    131225    }
    132226
     227    if (!$save_temps) {
     228        unlink $tmpImage if $tmpImage;
     229        unlink $tmpMask if $tmpMask;
     230        unlink $tmpVariance if $tmpVariance;
     231        rmdir $tmproot if $tmproot;
     232    }
     233
    133234    if ($exitStatus == 0) {
    134         my $dir = dirname($outputBase);
    135 
    136         my $reglist = "$dir/reglist$job_id";
     235        my $reglist = "$outdir/reglist$job_id";
    137236
    138237        my $F;
     
    363462
    364463sub check_files {
     464    my $error_code = shift;
     465    my $return_code = 1;
    365466    foreach my $f (@_) {
    366467        if (!$ipprc->file_exists($f)) {
    367             my_die( "file $f does not exist:", $job_id, $PSTAMP_GONE, 'stop');
    368         }
    369     }
     468            if ($error_code) {
     469                my_die( "file $f does not exist:", $job_id, $error_code, 'stop');
     470            } else {
     471                print STDERR "file $f does not exist\n";
     472                $return_code = 0;
     473            }
     474        }
     475    }
     476    return $return_code;
     477}
     478
     479sub check_for_backups {
     480    my $params = shift;
     481    my $r_fileArgs = shift;
     482
     483    my $command = "$magicdstool -destreakedfile -stage $params->{stage} -stage_id $params->{stage_id} -component $params->{component} -dbname $params->{imagedb}";
     484    my $results = runToolAndParse($command, $verbose);
     485    my $dsComponent  = $results->[0];
     486
     487    if ($dsComponent and ($dsComponent->{data_state} eq 'full')) {
     488
     489        print "magicDSFile state is full. Backup images should exist\n";
     490
     491        # replace the file names with the backup paths
     492        # fileArgs has the form:  -file imagename [-mask maskname] [-weight weightname]
     493        my @args = split " ", $$r_fileArgs;
     494
     495        my $newFileArgs;
     496        while (@args) {
     497            my $a = shift @args;
     498            my $f = shift @args;
     499            my_die( "unexpected fileArg list $$r_fileArgs", $job_id, $PS_EXIT_PROG_ERROR, 'run') if !$a or !$f;
     500
     501            my $backup_image_name = $ipprc->destreaked_filename($f);
     502            my_die( "failed to extract backup image name from $f", $job_id, $PS_EXIT_PROG_ERROR, 'run') if !$backup_image_name;
     503            $newFileArgs .= " $a $backup_image_name";
     504        }
     505        $$r_fileArgs = $newFileArgs;
     506
     507        return 1;
     508    }
     509
     510    return 0;
    370511}
    371512
  • branches/czw_branch/20101203/pstamp/scripts/pstamp_parser_run.pl

    r29576 r30586  
    3131my $outdir;
    3232my $label;
     33my $need_magic;
    3334my $verbose;
    3435my $dbname;
     
    4142    'outdir=s'          =>  \$outdir,
    4243    'label=s'           =>  \$label,
     44    'need_magic'        =>  \$need_magic,
    4345    'redirect-output'   =>  \$redirect_output,
    4446    'verbose'           =>  \$verbose,
     
    160162            $parse_cmd = "$pstampparse";
    161163            $parse_cmd .= " --label $label" if $label;
     164            $parse_cmd .= " --need_magic" if $need_magic;
    162165            $request_fault = 0;
    163166        } elsif ($request_type eq "MOPS_DETECTABILITY_QUERY") {
  • branches/czw_branch/20101203/pstamp/scripts/pstamp_server_status

    r29572 r30586  
    2525
    2626pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    27 #pod2usage( -msg => "Required options: --first --stage",
    28 #          -exitval => 3) unless
    29 #    defined $first and
    30 #    defined $stage;
    3127
    3228# Look for programs we need
     
    3935}
    4036
     37# XXX: Note under pantasks this will be the curent directory, so this
     38# isn't necessary if the pstamp/web stuff is configured to point at the
     39# ipp build. But currently it's running out of Bill's build
    4140my $ipphome = "/home/panstarrs/ipp";
     41my $status_cmd = "psstatus";
     42
    4243$rundir = "$ipphome/pstamp" if !$rundir;
    4344
    4445chdir $rundir or die "failed to cd to $rundir";
    4546
     47
     48my $down = 0;
     49if ($down) {
     50    print "Postage Stamp Server will be down for maintenance it will back at approximately 00:00 2010-12-11 UTC\n";
     51    exit 0;
     52}
     53
     54my $now = `date -u`;
     55
     56print "<b>Status updated: &nbsp;&nbsp;&nbsp;</b> $now<br /><br />\n";
    4657
    4758my ($pts, $pantasks_script) = tempfile ('/tmp/pts.XXXX', UNLINK => !$save_temps);
     
    132143        print "Task pstamp.job.run not found.<br />\n";
    133144    }
     145
     146    # now run the script psstatus to check the status of running requests and finished requests
    134147    print "<br /><b>Unfinished Requests</b><br />\n";
    135148    print "<pre>\n";
    136     system "/home/panstarrs/bills/ipp/tools/psstatus -r ";
     149    system "$status_cmd --running";
    137150    print "</pre>\n";
     151
     152if (0) {
     153    # these are included in running requests above
     154    print "<br /><b>Requests building results fileset</b><br/>\n";
     155    print "<pre>\n";
     156    system "$status_cmd --finishing";
     157    print "</pre>\n";
     158}
     159
    138160    print "<br /><b>Requests completed in last 24 hours (most recently completed first)</b><br />\n";
    139161    print "<pre>\n";
    140     # finished requests
    141     system "/home/panstarrs/bills/ipp/tools/psstatus -f";
     162    system "$status_cmd --finished";
    142163    print "</pre>\n";
     164
    143165} else {
    144166    print "Task pstamp.request.run not found.\n";
     
    147169
    148170
    149 
    150171exit 0;
  • branches/czw_branch/20101203/pstamp/scripts/pstampparse.pl

    r30118 r30586  
    3030my $save_temps;
    3131my $no_update;
     32my $dest_requires_magic;
    3233
    3334GetOptions(
     
    3839    'label=s'   =>  \$label,
    3940    'mode=s'    =>  \$mode,
     41    'need_magic'=>  \$dest_requires_magic,
    4042    'dbname=s'  =>  \$dbname,
    4143    'dbserver=s'=>  \$dbserver,
     
    126128}
    127129
    128 # Adjust the label for requests coming in over the web interaface
     130
     131# Adjust the label for requests coming in over the web interface
    129132
    130133my $label_changed = 0;
     
    384387    my $proj_hash = resolve_project($ipprc, $project, $dbname, $dbserver);
    385388    if (!$proj_hash) {
    386         foreach $row (@$rowList) {
    387             insertFakeJobForRow($row, 1, $PSTAMP_UNKNOWN_PRODUCT);
     389        foreach my $r (@$rowList) {
     390            insertFakeJobForRow($r, 1, $PSTAMP_UNKNOWN_PRODUCT);
    388391            $num_jobs++;
    389392        }
     
    409412    $need_magic    = $proj_hash->{need_magic};
    410413
    411     # Temporary hack so that IFA can get at non-magicked data
    412     my $allow_mops_unmagicked = 1;
    413     if ($allow_mops_unmagicked) {
    414         if ($product and (($product eq "mops-pstamp-results") or
    415                           ($product eq "mops-pstamp-results2") or
    416                           ($product eq "ifa-pstamp-results"))) {
    417             $need_magic = 0;
    418         }
    419     }
    420 
    421414    $need_magic = 0 if $stage eq 'stack';
     415
     416    if ($need_magic) {
     417
     418        # this project requires that postage stamps be extracted from destreaked images
     419
     420        if ($option_mask & ($PSTAMP_REQUEST_UNCENSORED | $PSTAMP_REQUIRE_UNCENSORED)) {
     421            # The user has requested uncensored stamps
     422
     423            if (!$dest_requires_magic) {
     424                # and this user's data store destination is allowed uncensored stamps, so accept the request
     425                $need_magic = 0;
     426            } else {
     427                print STDERR "Error row $rownum: User not authorized to to request uncensored stamps.\n";
     428                if ($option_mask & $PSTAMP_REQUIRE_UNCENSORED) {
     429                    # user required uncensored stamps. Can't do it so fail.
     430                    foreach my $r (@$rowList) {
     431                        insertFakeJobForRow($r, 1, $PSTAMP_NOT_AUTHORIZED);
     432                        $num_jobs++;
     433                    }
     434                    return $num_jobs;
     435                }
     436
     437                # user will accept censored stamps. alter OPTION_MASK and continue
     438
     439                print STDERR "    Will attempt to make destreaked stamps\n";
     440                # zap the offending bit in the option mask
     441                $option_mask = $option_mask ^ ($PSTAMP_REQUEST_UNCENSORED);
     442                foreach my $r (@$rowList) {
     443                    $r->{OPTION_MASK} = $option_mask;
     444                }
     445            }
     446        }
     447    }
    422448   
    423449    my $numRows = scalar @$rowList;
  • branches/czw_branch/20101203/tools/czarclean.pl

    r29278 r30586  
    66
    77# local classes
     8use czartool::Config;
    89use czartool::CzarDb;
    910
    1011my $czarDbName = undef;
    11 my $from = undef;
    12 my $to = undef;
     12my $begin = undef;
     13my $end = undef;
    1314my $interval = undef;
    1415my $verbose = undef;
    1516my $optimize = undef;
     17my $config = new czartool::Config();
    1618
    1719GetOptions (
    1820        "dbname|d=s" => \$czarDbName,
    1921        "interval|i=s" => \$interval,
    20         "from|f=s" => \$from,
    21         "to|t=s" => \$to,
     22        "begin|b=s" => \$begin,
     23        "end|e=s" => \$end,
    2224        "optimize|o" => \$optimize,
    2325        "verbose|v" => \$verbose,
     
    3234    print "* UNKNKOWN: option                          @ARGV\n";
    3335}
    34 if (!$from) {
     36if (!$begin) {
    3537    $quit=1;
    36     print "* REQUIRED: choose a from date                 -b <datetime>\n";
     38    print "* REQUIRED: choose a begin date                -b <datetime>\n";
    3739}
    38 if (!$to) {
    39     if($from) {$to=$from;} else {$to="NULL";}
    40     print "* OPTIONAL: choose a to date                   -e <datetime>                   (default=$to)\n";
     40if (!$end) {
     41    if($begin) {$end=$begin;} else {$end="NULL";}
     42    print "* OPTIONAL: choose an end date date            -e <datetime>                   (default=$end)\n";
    4143}
    4244if (!$czarDbName) {
     
    4547}
    4648if (!$interval) {
    47     $interval = "30 MINUTE";
    48     print "* OPTIONAL: choose time interval               -i <'30 MINUTE'|'1 hour'|etc>   (default=$interval)\n";
     49    print "* OPTIONAL: choose time interval               -i <'30 MINUTE'|'1 hour'|etc>   (default=".$config->getCzarCleanupInterval().")\n";
    4950}
    5051if (!$optimize) {
    5152    $optimize = 0;
    52     print "* OPTIONAL: optimize database after cleanup    -o <'30 MINUTE'|'1 hour'|etc>   (default=$interval)\n";
     53    print "* OPTIONAL: optimize database after cleanup    -o                              (default=$optimize)\n";
    5354}
    5455print "*\n*******************************************************************************\n";
     
    5657if ($quit) { exit; }
    5758
    58 
    59 my $save_temps = 0;
    60 
    61 
    62 my $czarDb = new czartool::CzarDb($czarDbName, "ippdb01", "ipp", "ipp", 0, $save_temps); # TODO last arg here is save_temps, should get as arg
     59my $czarDb = $config->getCzarDbInstance();
    6360
    6461my $labels = undef;
    6562
    6663
    67 $czarDb->cleanupDateRange($from, $to, $interval);
     64$czarDb->cleanupDateRange($begin, $end, $config->getCzarCleanupInterval());
    6865if ($optimize) {$czarDb->optimize();}
  • branches/czw_branch/20101203/tools/czarmetrics.pl

    r29868 r30586  
    88use CGI::Pretty qw[:standard];
    99
     10use czartool::Config;
    1011use czartool::DayMetrics;
    1112use czartool::MultiDayMetrics;
    1213use czartool::MetricsIndex;
    13 use czartool::CzarDb;
    14 use czartool::Gpc1Db;
    1514
    1615my $czarDbName = "czardb";
     
    6059if ($quit) {exit;}
    6160
    62 my $gpc1Db = new czartool::Gpc1Db("gpc1", "ippdb01", "ippuser", "ippuser");
    63 my $czarDb = new czartool::CzarDb($czarDbName, "ippdb01", "ipp", "ipp", $verbose, $save_temps);
    64 $czarDb->setDateFormat("%Y%m%d-%H%i%s");
     61my $config = new czartool::Config();
    6562
    6663if ($index) {
    6764
    68     my $metricsIndex = new czartool::MetricsIndex($gpc1Db, $czarDb, "/data/ipp004.0/ipp/ippMetrics/", 1, 0);
     65    my $metricsIndex = new czartool::MetricsIndex($config, 1, 0);
    6966    $metricsIndex->writeHTML();
    7067    exit;
     
    8279if ($cumulative) {
    8380
    84         my $multiDayMetrics = new czartool::MultiDayMetrics($gpc1Db, $czarDb, "/data/ipp004.0/ipp/ippMetrics/", 1, 0, $begin, $end);
     81        my $multiDayMetrics = new czartool::MultiDayMetrics($config, 1, 0, $begin, $end);
    8582        $multiDayMetrics->writeHTML();
    8683}
    8784else {
    8885
     86    my $czarDb = $config->getCzarDbInstance();
     87
    8988    while (1) {
    9089
    91         my $dayMetrics = new czartool::DayMetrics($gpc1Db, $czarDb, "/data/ipp004.0/ipp/ippMetrics/", 1, 0, $thisDay);
     90        my $dayMetrics = new czartool::DayMetrics($config, 1, 0, $thisDay);
    9291        $dayMetrics->writeHTML();
    9392
  • branches/czw_branch/20101203/tools/czarplot.pl

    r30118 r30586  
    77use POSIX qw/strftime/;
    88
    9 use czartool::CzarDb;
    10 use czartool::Gpc1Db;
     9use czartool::Config;
    1110use czartool::Plotter;
    1211use czartool::StageMetrics;
    1312
    14 my $czarDbName = "czardb";
    1513my $label = undef;
    1614my $stage = undef;
     
    3634
    3735GetOptions (
    38         "dbname=s" => \$czarDbName,
    3936        "label|l=s" => \$label,
    4037        "stage|s=s" => \$stage,
     
    114111if ($quit) { exit; }
    115112
     113my $config = new czartool::Config();
     114
    116115# default values
    117116if (!$rate && !$magicMask && !$nebulous && !$histogram && !$analysis && !$timeSeries) {$timeSeries = 1;}
     
    121120else {$savingToFile = 1;}
    122121
    123 my $gpc1Db = new czartool::Gpc1Db("gpc1", "ippdb01", "ippuser", "ippuser");
    124 my $czarDb = new czartool::CzarDb($czarDbName, "ippdb01", "ipp", "ipp", $verbose, $save_temps);
    125 $czarDb->setDateFormat("%Y%m%d-%H%i%s");
     122my $czarDb = $config->getCzarDbInstance();
    126123
     124my $newDayTime =  $config->getMetricsStartTime();
    127125
    128126my $plotter = undef;
    129127if ($savingToFile) {
    130128
    131     $plotter = czartool::Plotter->new_file(
    132             $gpc1Db,
    133             $czarDb,
    134             $path,
    135             $save_temps);
     129    $plotter = czartool::Plotter->new_file($config, $path, $save_temps);
    136130}
    137131else {
    138132
    139     $plotter = czartool::Plotter->new_display(
    140             $gpc1Db,
    141             $czarDb,
    142             $save_temps);
     133    $plotter = czartool::Plotter->new_display($config, $save_temps);
    143134}
    144135
    145 # sort out times
     136# if a single day has been chosen
    146137if($day) {
    147138
    148139    if ($magicMask) {
    149140
    150         $begin =  $day;
     141        $begin = $day;
    151142        $end = $day;
    152143    }
    153144    else {
    154145
    155         # day plots should run from about 6:30am until midnight
    156         $begin = "$day 06:35";
    157         $end = "$day 23:59";
     146        # plots should span 24 housr from previous day
     147        my $dayBefore = $czarDb->subtractInterval($day, "1 DAY");
     148               
     149        $begin = "$dayBefore $newDayTime";
     150        $end = "$day $newDayTime";
    158151    }
    159152}
     
    163156    if (!$begin) {
    164157
     158        my $today = strftime('%Y-%m-%d', localtime);
     159        my $yesterday = $czarDb->subtractInterval($today, "1 DAY");
     160
     161       
    165162        if ($timeinpast) {$begin = $czarDb->subtractInterval($end, $timeinpast);}
    166         else {$begin =  strftime('%Y-%m-%d 06:35',localtime);}
     163        elsif ($czarDb->isBefore($end, "$today $newDayTime")) {$begin = "$yesterday $newDayTime";}
     164        else {$begin = "$today $newDayTime";}
    167165    }
    168166}
     167
    169168if ($rate) {
    170169
  • branches/czw_branch/20101203/tools/czarpoll.pl

    r30118 r30586  
    11#!/usr/bin/perl -w
     2
     3###########################################################################
     4#
     5# Main polling program for czartool. Grabs stuff from various sources every few minutes.
     6#
     7###########################################################################
    28
    39use warnings;
     
    713
    814# local classes
     15use czartool::Config;
    916use czartool::CzarDb;
    1017use czartool::Gpc1Db;
     
    1724
    1825my $period = 60;
    19 my $czarDbName = "czardb"; # TODO variables for other Db stuff, host etc
    2026my $save_temps = 0;
    2127
    2228GetOptions (
    2329        "period|p=s" => \$period, # TODO more Db args
    24         "dbname|d=s" => \$czarDbName,
    2530        );
    2631
    27 my $czarDb = new czartool::CzarDb($czarDbName, "ippdb01", "ipp", "ipp", 0, $save_temps); # TODO last arg here is save_temps, should get as arg
    28 my $gpc1Db = new czartool::Gpc1Db("gpc1", "ippdb01", "ippuser", "ippuser");
     32my $config = new czartool::Config();
     33my $czarDb = $config->getCzarDbInstance();
     34my $gpc1Db = $config->getGpc1Instance;
    2935my $nebulous = new czartool::Nebulous($czarDb);
    3036my $pantasks = new czartool::Pantasks();
    31 my $plotter = czartool::Plotter->new_file($gpc1Db, $czarDb, "/tmp", $save_temps);
     37my $plotter = czartool::Plotter->new_file($config, "/tmp", $save_temps);
    3238my $burntool = new czartool::Burntool();
    3339
    3440
    35 $czarDb->setDateFormat("%Y%m%d-%H%i%s");
    36 
    3741my @stages = ("burntool", "chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist");
    3842
    3943
    4044timePoll($period);
     45
     46###########################################################################
     47#
     48# Updates the dates from pantasks for all interested servers
     49#
     50###########################################################################
     51sub updateDates {
     52
     53    print "* Updating dates\n";
     54    my @servers = ("stdscience", "registration");
     55
     56    my $server = undef;
     57    $czarDb->emptyServerDates();
     58    foreach $server (@servers) {
     59
     60        my @dates = @{$pantasks->getDates($server)};
     61        if (@dates) {
     62
     63            $czarDb->updateServerDates($server, \@dates);
     64        }
     65        else {
     66
     67            print "WARNING: No dates to update for '$server'\n";
     68        }
     69    }
     70}
    4171
    4272###########################################################################
     
    5585        my @labels = @{$pantasks->getLabels($server)};
    5686        if (@labels) {
    57        
     87
    5888            $czarDb->updateCurrentLabels($server, \@labels);
    5989        }
    6090        else {
    61        
    62              print "WARNING: No labels to update for '$server'\n";
     91
     92            print "WARNING: No labels to update for '$server'\n";
    6393        }
    6494    }
     
    110140    my $today = undef;
    111141    my $yesterday = undef;
    112     my $newDayTime = "18:00";
     142    my $newDayTime = $config->getMetricsStartTime();
    113143    my $lastDayDailyTasks = "2010-01-01";
    114144
     
    125155        # if after 18:00 today, then perform some daily tasks and start plots from 18:00 today
    126156        else {
    127            
     157
    128158            $begin = "$today $newDayTime";
    129159
    130160            # check whether yesterday was cleaned. if not, cleanup tables and optimize
    131161            if ($lastDayDailyTasks ne $yesterday) {
    132    
     162
    133163                print "* performing daily tasks (clean-up, metrics)";
    134164
    135165                # create metrics for last 24 hours
    136166                print "* Creating metrics for last 24 hours\n";
    137                 # TODO hardcoded path needs to be in config
    138                 my $dayMetrics = new czartool::DayMetrics($gpc1Db,
    139                         $czarDb,
    140                         "/data/ipp004.0/ipp/ippMetrics/",
    141                         1, 0, $today);
     167                my $dayMetrics = new czartool::DayMetrics($config, 1, 0, $today);
    142168                $dayMetrics->writeHTML();
    143169
    144170                # now update metrics index page
    145                 my $metricsIndex = new czartool::MetricsIndex($gpc1Db,
    146                         $czarDb,
    147                         "/data/ipp004.0/ipp/ippMetrics/",
    148                         1, 0);
     171                my $metricsIndex = new czartool::MetricsIndex($config, 1, 0);
    149172                $metricsIndex->writeHTML();
    150173
    151174                # now cleanup tables from yesterday and optimize
    152175                print "* New day - performing cleanup\n";
    153                 $czarDb->cleanupDateRange($yesterday, $yesterday, "30 MINUTE");
     176                $czarDb->cleanupDateRange($yesterday, $yesterday, $config->getCzarCleanupInterval());
    154177                $czarDb->optimize();
    155178                $lastDayDailyTasks = $yesterday;
     
    167190        $plotter->plotDiskUsageHistogram();
    168191        updateServerStatus();
     192
     193        # check pantasks dates
     194        updateDates();
    169195
    170196        # check labels
  • branches/czw_branch/20101203/tools/czartool.pl

    r28925 r30586  
    66
    77# local classes
     8use czartool::Config;
    89use czartool::CzarDb;
    910use czartool::Gpc1Db;
     
    2223
    2324my @states = ("full", "new", "drop", "wait");
    24 my $czarDb = new czartool::CzarDb($czarDbName, "ippdb01", "ipp", "ipp");
    25 my $gpc1Db = new czartool::Gpc1Db("gpc1", "ippdb01", "ippuser", "ippuser");
     25my $config = new czartool::Config();
     26my $czarDb = $config->getCzarDbInstance();
     27my $gpc1Db = $config->getGpc1Instance();
    2628my $pantasks = new czartool::Pantasks();
    27 $czarDb->setDateFormat("%Y%m%d-%H%i%s");
    2829
    2930my @stdscienceLabels = undef;
  • branches/czw_branch/20101203/tools/czartool/CzarDb.pm

    r29865 r30586  
    152152
    153153    $query->execute;
     154}
     155
     156###########################################################################
     157#
     158# Cleans out server_dates table
     159#
     160###########################################################################
     161sub emptyServerDates {
     162    my ($self, $server, $dates) = @_;
     163
     164    my $query = $self->{_db}->prepare(<<SQL);
     165    DELETE FROM server_dates;
     166SQL
     167
     168    $query->execute;
     169}
     170
     171###########################################################################
     172#
     173# Updates current_labels table
     174#
     175###########################################################################
     176sub updateServerDates {
     177    my ($self, $server, $dates) = @_;
     178
     179    my $size = scalar @{$dates};
     180    if ($size < 1) { return; }
     181
     182    my $date = undef;
     183
     184    foreach $date (@{$dates}) {
     185
     186        my $query = $self->{_db}->prepare(<<SQL);
     187        INSERT INTO server_dates
     188            (server, date)
     189            VALUES
     190            ('$server', '$date');
     191SQL
     192
     193       $query->execute;
     194    }
    154195}
    155196
     
    12431284        elsif ($currentRevision == 10) {$self->createRevision_11();}
    12441285        elsif ($currentRevision == 11) {$self->createRevision_12();}
     1286        elsif ($currentRevision == 12) {$self->createRevision_13();}
    12451287        else {last;}
    12461288    }
     
    16021644# Create revision 12 of the database
    16031645#
     1646# - adding nightlyscience table
     1647#
    16041648#######################################################################################
    16051649sub createRevision_12 {
     
    16081652    print "* Creating revision 12 of '$self->{_dbName}'\n";
    16091653
    1610     # same shape as other stage tables to enable easy update
    16111654    my $query = $self->{_db}->prepare(<<SQL);
    16121655    CREATE TABLE nightlyscience (
     
    16191662    $self->setRevision(12);
    16201663}
     1664#######################################################################################
     1665#
     1666# Create revision 13 of the database
     1667#
     1668# adding server_dates table
     1669#
     1670#######################################################################################
     1671sub createRevision_13 {
     1672    my ($self) = @_;
     1673
     1674    print "* Creating revision 13 of '$self->{_dbName}'\n";
     1675
     1676    my $query = $self->{_db}->prepare(<<SQL);
     1677    CREATE TABLE server_dates (
     1678            timestamp TIMESTAMP DEFAULT NOW(),
     1679            server VARCHAR(64) DEFAULT "NONE",
     1680            date VARCHAR(64) DEFAULT "NONE");
     1681SQL
     1682
     1683        $query->execute;
     1684
     1685    $self->setRevision(13);
     1686}
    162116871;
    16221688
  • branches/czw_branch/20101203/tools/czartool/DayMetrics.pm

    r30118 r30586  
    2828    # Call the constructor of the parent class
    2929    my $self = $class->SUPER::new(
    30             $_[1],  # gpc1Db
    31             $_[2],  # czarDb
    32             $_[3],  # baseDir
    33             $_[4],  # verbose
    34             $_[5]   # save_temps
     30            $_[1],  # config object
     31            $_[2],  # verbose
     32            $_[3]   # save_temps
    3533            );
    3634
    37     $self->{day} = $_[6];
     35    $self->{day} = $_[4];
    3836
    3937    my $yesterday =  $self->{czarDb}->subtractInterval($self->{day}, "1 DAY");
    4038
    4139    # sort out times
    42     $self->{begin} =  "$yesterday 18:00";
     40    $self->{begin} =  "$yesterday " . $self->{config}->getMetricsStartTime();
    4341    $self->{end} = $self->{czarDb}->addInterval($self->{begin}, "1 DAY");
    4442    $self->{burntoolEnd} = $self->{czarDb}->addInterval($self->{begin}, "12 HOUR");
  • branches/czw_branch/20101203/tools/czartool/Metrics.pm

    r30118 r30586  
    2424    my $class = shift;
    2525    my $self = {
    26         gpc1Db => shift,
    27         czarDb => shift,
    28         baseDir => shift,
     26        config => shift,
    2927        verbose => shift,
    3028        save_temps => shift,
    3129    };
     30
     31    $self->{gpc1Db} = $self->{config}->getGpc1Instance();
     32    $self->{czarDb} = $self->{config}->getCzarDbInstance();
     33    $self->{baseDir} = $self->{config}->getMetricsSaveLocation();
    3234
    3335    # create path, dir
     
    3638    # instantiate a plotter object
    3739    $self->{plotter} = czartool::Plotter->new_file(
    38             $self->{gpc1Db},
    39             $self->{czarDb},
     40            $self->{config},
    4041            ".",
    4142            $self->{save_temps});
  • branches/czw_branch/20101203/tools/czartool/MetricsIndex.pm

    r29859 r30586  
    2828    # Call the constructor of the parent class
    2929    my $self = $class->SUPER::new(
    30             $_[1],  # gpc1Db
    31             $_[2],  # czarDb
    32             $_[3],  # baseDir
    33             $_[4],  # verbose
    34             $_[5]   # save_temps
     30            $_[1],  # config object
     31            $_[2],  # verbose
     32            $_[3]   # save_temps
    3533            );
    3634
  • branches/czw_branch/20101203/tools/czartool/MultiDayMetrics.pm

    r29860 r30586  
    2828    # Call the constructor of the parent class
    2929    my $self = $class->SUPER::new(
    30             $_[1],  # gpc1Db
    31             $_[2],  # czarDb
    32             $_[3],  # baseDir
    33             $_[4],  # verbose
    34             $_[5]   # save_temps
     30            $_[1],  # config object
     31            $_[2],  # verbose
     32            $_[3]   # save_temps
    3533            );
    3634
    37     $self->{startDay} = $_[6];
    38     $self->{endDay} = $_[7];
     35    $self->{startDay} = $_[4];
     36    $self->{endDay} = $_[5];
    3937
    4038    # sort out times
    41     $self->{begin} =  "$self->{startDay} 06:00";
    42     $self->{end} =  "$self->{endDay} 06:00";
     39    $self->{begin} =  "$self->{startDay} " . $self->{config}->getMetricsStartTime();
     40    $self->{end} =  "$self->{endDay} " . $self->{config}->getMetricsStartTime();
    4341
    4442    # create path, dir and html file
  • branches/czw_branch/20101203/tools/czartool/Pantasks.pm

    r29076 r30586  
    120120        chomp($line);
    121121        if (!$self->outputOk($line)) {return \@labels;}
    122         if ($line =~ m/pantasks:\s+/) {$passedHeader=1; next;}
    123         if ($passedHeader) {push(@labels, $line);}
     122
     123        # sometimes a label can be on the same line as the panstasks prompt
     124        if ($line =~ m/pantasks: (.*)/) {
     125            $line = $1;
     126            $passedHeader=1;
     127        }
     128
     129        if ($passedHeader && length($line) > 0){push(@labels, $line);}
    124130    }
    125131
     
    191197    }
    192198}
     199
     200###########################################################################
     201#
     202# Gets current dates for this server
     203#
     204###########################################################################
     205sub getDates {
     206    my ($self, $server) = @_;
     207
     208    my @dates;
     209
     210    my $prefix;
     211
     212    if ($server eq "stdscience") {$prefix = "ns";}
     213    elsif ($server eq "registration") {$prefix = "register";}
     214
     215    my @cmdOut = `echo "$prefix.show.dates;quit" | pantasks_client -c ~ipp/$server/ptolemy.rc 2>&1`;
     216    my $line;
     217    my $passedHeader=0;
     218    foreach $line (@cmdOut) {
     219
     220        chomp($line);
     221        if (!$self->outputOk($line)) {return \@dates;}
     222
     223        # sometimes content is on same line as pantasks prompt
     224        if ($line =~ m/pantasks: (.*)/) {
     225            $line =~ s/pantasks: //;
     226                $passedHeader=1;
     227        }
     228
     229        if ($passedHeader && length($line) > 0){
     230
     231            # strip out only the date part
     232            if ($line =~ m/([0-9]{4}-[0-9]{2}-[0-9]{2}).*/) {
     233
     234                push(@dates, $1);
     235            }
     236        }
     237    }
     238
     239    return \@dates;
     240}
     241
     242
    1932431;
  • branches/czw_branch/20101203/tools/czartool/Plotter.pm

    r30118 r30586  
    77
    88use File::Temp;
     9
     10use czartool::Config;
    911
    1012my @allStages = ("burntool", "chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist");
     
    1820    my $class = shift;
    1921    my $self = {
    20         _gpc1Db => shift,
    21         _czarDb => shift,
     22        _config => shift,
    2223        _dateFormat => shift,
    2324        _outputFormat => shift,
     
    2728
    2829    bless $self, $class;
     30    $self->init();
    2931    return $self;
    3032}
     
    3840    my $class = shift;
    3941    my $self = {
    40         _gpc1Db => shift,
    41         _czarDb => shift,
     42        _config => shift,
    4243        _outputPath => shift,
    4344        _save_temps => shift,
    4445                                                    };
    45 
    4646    $self->{_dateFormat} = "%Y%m%d-%H%M%S";
    47     $self->{_outputFormat} = "png font \"/usr/share/fonts/corefonts/arial.ttf\" 8"; # TODO path needs to be in config
    48 
    49         bless $self, $class;
     47    $self->{_outputFormat} = "png font \"".$self->{_config}->getGnuplotFont()."\" ".$self->{_config}->getGnuplotFontSize();
     48
     49    bless $self, $class;
     50    $self->init();
    5051    return $self;
    5152}
     
    5960    my $class = shift;
    6061    my $self = {
    61         _gpc1Db => shift,
    62         _czarDb => shift,
     62        _config => shift,
    6363        _save_temps => shift,
    6464    };
     
    6969
    7070    bless $self, $class;
     71    $self->init();
    7172    return $self;
    7273}
    7374
    74 
     75###########################################################################
     76#
     77# Some initialisation code common to all constructors
     78#
     79###########################################################################
     80sub init {
     81    my ($self) = @_;
     82
     83    $self->{_gpc1Db} = $self->{_config}->getGpc1Instance();
     84    $self->{_czarDb} = $self->{_config}->getCzarDbInstance();
     85}
    7586
    7687###########################################################################
     
    508519    GP->autoflush(1);
    509520
     521    my $datFile = $tmpFile->filename;
    510522    if ($self->{_outputFormat} ne "X11") {print GP "set output \"$outputFile\";";}
    511     print GP
    512         "set term $self->{_outputFormat};" .
    513         "set title \"Total available cluster space over time\\nFrom $fromTime to $toTime HST\";" .
    514         "set key left top;" .
    515         "set xdata time;" .
    516         "set timefmt \"$self->{_dateFormat}\";" .
    517         "set format x \"$timeFormat\";" .
    518         "set xtics \"$minX\", $divX, \"$maxX\";" .
    519         "set grid xtics;" .
    520         "set xlabel \"Time\";" .
    521         "set ylabel \"Available (TB)\";" .
    522         "plot " .
    523         "'".$tmpFile->filename."' using 1:2 title \"Available\" with lines lt 2 lw 2\n";
     523    print GP <<PLOT;
     524        set term $self->{_outputFormat}
     525        set title "Total available cluster space over time\\nFrom $fromTime to $toTime HST"
     526        set key left top
     527        set xdata time
     528        set timefmt "$self->{_dateFormat}"
     529        set format x "$timeFormat"
     530        set xtics "$minX", $divX, "$maxX"
     531        set grid xtics
     532        set xlabel "Time"
     533        set ylabel "Available (TB)"
     534        plot "$datFile" using 1:2 title "Available" with lines lt 2 lw 2
     535PLOT
    524536
    525537    print GP "\n";
  • branches/czw_branch/20101203/tools/roboczar.pl

    r29804 r30586  
    77
    88# local classes
     9use czartool::Config;
    910use czartool::CzarDb;
    1011use czartool::Gpc1Db;
     
    1516use czartool::StageMetrics;
    1617
    17 my $czarDbName = "czardb"; # TODO variables for other Db stuff, host etc
    1818my $save_temps = 0;
    1919
    20 GetOptions (
    21         "dbname|d=s" => \$czarDbName,
    22         );
    23 
    24 my $czarDb = new czartool::CzarDb($czarDbName, "ippdb01", "ipp", "ipp", 0, $save_temps); # TODO last arg here is save_temps, should get as arg
    25 
    26 $czarDb->setDateFormat("%Y%m%d-%H%i%s");
     20my $config = new czartool::Config();
     21my $czarDb = $config->getCzarDbInstance();
    2722
    2823my @stages = ("burntool", "chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist"); # TODO get from Pantasks
     
    4136    $message = "";
    4237
    43     if (anyStoppedServers("20 MINUTE", \$serversMessage)) {
     38    if (anyStoppedServers($config->getRoboczarServerInterval(), \$serversMessage)) {
    4439
    4540        $message .= "\n\n" . $serversMessage;
    4641        $anythingToReport = 1;
    4742    }
    48     if (anyStuckStages("2 HOUR", \$stuckMessage)) {
     43#    if (anyStuckStages("2 HOUR", \$stuckMessage)) {
    4944
    50         $message .= "\n\n" . $stuckMessage;
    51         $anythingToReport = 1;
    52     }
     45 #       $message .= "\n\n" . $stuckMessage;
     46  #      $anythingToReport = 1;
     47   # }
    5348
    5449    if ($anythingToReport && $message ne $lastMessage) {
     
    5651print "\n\n$message\n\n";
    5752
    58         sendEmail(
    59                 "ps-ipp-ops\@ifa.hawaii.edu",
     53        sendEmail($config->getRoboczarEmail(),
    6054                "Roboczar warnings",
    6155                "$message\n");
     
    8276    my $anyStuckStages = 0;
    8377
    84     # exception - we don't care if burntool is stalled before 6:30am
     78    # exception - we don't care if burntool is stalled before 6:30am TODO we do now
    8579    my $burntime = strftime('%Y-%m-%d 06:35', localtime);
    8680    my $worryAboutBurntool = $czarDb->isBefore($burntime, $end);
Note: See TracChangeset for help on using the changeset viewer.