IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25744


Ignore:
Timestamp:
Oct 2, 2009, 12:03:23 PM (17 years ago)
Author:
eugene
Message:

merge from head

Location:
branches/eam_branches/20090715
Files:
1 deleted
66 edited
6 copied

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20090715/DataStore/lib/DataStore/Utils.pm

    r19275 r25744  
    4242$BYTE_FIELD = qr/^\d+$/;
    4343$MD5_FIELD = qr/^[0-9a-f]{32}$/;
    44 %KNOWN_FILE_TYPES = map { $_ => 1 } qw( chip psrequest psresults pstamp chipproc warp stack diff ipp-mops table text xml tgz);
    45 %KNOWN_FILESET_TYPES = map { $_ => 1 } qw( OBJECT BIAS DARK SKYFLAT DOMEFLAT OOF SHACKHARTMANN PSREQUEST PSRESULTS IPP-MOPS XRAY FOCUS MOPS_DETECTABILITY_QUERY MOPS_DETECTABILITY_RESPONSE MOPS_TRANSIENT_DETECTIONS LED notset IPP_PSPS);
    46 %KNOWN_PRODUCT_TYPES = map { $_ => 1 } qw( image dump psrequest psresults table );
     44%KNOWN_FILE_TYPES = map { $_ => 1 } qw( chip psrequest psresults pstamp chipproc warp stack diff ipp-mops table text xml tgz fits );
     45%KNOWN_FILESET_TYPES = map { $_ => 1 } qw( OBJECT BIAS DARK SKYFLAT DOMEFLAT OOF SHACKHARTMANN PSREQUEST PSRESULTS IPP-MOPS XRAY FOCUS MOPS_DETECTABILITY_QUERY MOPS_DETECTABILITY_RESPONSE MOPS_TRANSIENT_DETECTIONS LED notset IPP_PSPS IPP-DIST);
     46%KNOWN_PRODUCT_TYPES = map { $_ => 1 } qw( image dump psrequest psresults table ipp-dist ipp-misc);
    4747
    4848=pod
  • branches/eam_branches/20090715/DataStore/scripts/dsget

    r25397 r25744  
    207207    if (defined $copies and $copies > 1) {
    208208        foreach (1 .. ($copies - 1)) {
    209             $neb->replicate($filename, 'any')
     209            $neb->replicate($filename)
    210210                or die "failed to replicate $filename failed: $!";
    211211        }
  • branches/eam_branches/20090715/DataStore/scripts/dsproductls

    r25624 r25744  
    5959
    6060print "# uri fileset datetime type\n";
    61 my $num = 0;
    6261foreach my $fs (@$data) {
    63     $num++;
    64     if (!defined $fs->uri) {
    65         # Somewhow we get here occasaionally I don't know why yet
    66         print STDERR "uri is not defined! skipping fs: $num\n";
    67         next;
    68     }
    6962    print $fs->uri, " ", $fs->fileset, " ", $fs->datetime, " ", $fs->type;
    7063    if ($extra) {
  • branches/eam_branches/20090715/DataStoreServer/scripts/dsprodtool

    r24196 r25744  
    1212use PS::IPP::Metadata::Config;
    1313use File::Copy;
     14
     15use Term::ReadKey;
    1416
    1517use PS::IPP::Config qw($PS_EXIT_SUCCESS
     
    3638my $dsroot;
    3739my $dbname;
     40my $dbpass;
    3841
    3942my $add;
     
    7881} else {
    7982    $product = $del;
     83    if (! -t STDIN) {
     84        die "cannot delete product from script\n";
     85    }
     86    print "*** Delete the Data Store Product $product? ***\n";
     87    print "*** to delete $product answer YES, and give password ***\n";
     88    print "*** WARNING this action is permanant *** \n";
     89    print "Delete? (YES/[n]): ";
     90
     91    my $line = ReadLine(0);
     92    chomp $line;
     93    exit 1 if !$line or ($line ne "YES");
     94
     95    print "password: ";
     96    ReadMode('noecho');
     97    $line = ReadLine(0);
     98    ReadMode('normal');
     99    print "\n";
     100    chomp $line;
     101    $dbpass = $line;
    80102}
    81103
     
    93115}
    94116
    95 my $root_index_script = "$dsroot/index.txt";
     117my $root_index_script = "$dsroot/index.txt.template";
    96118if (!stat($root_index_script)) {
    97119    $err .= "Data Store not found at '$dsroot'.\n"
     
    106128    unless defined $dbname;
    107129my $dbuser   = metadataLookupStr($siteConfig, 'DS_DBUSER');
    108 my $dbpass   = metadataLookupStr($siteConfig, 'DS_DBPASSWORD');
     130$dbpass   = metadataLookupStr($siteConfig, 'DS_DBPASSWORD') if !$dbpass;
    109131exit ($PS_EXIT_CONFIG_ERROR) unless defined $dbserver and $dbname and $dbuser and $dbpass;
    110132
    111133my $dsn = "DBI:mysql:host=$dbserver;database=$dbname";
    112 
    113 my $dbh = DBI->connect($dsn, $dbuser, $dbpass) or die "Cannot connect to server\n";
    114 
    115134
    116135my $product_dir = "$dsroot/$product";
     
    118137
    119138if ($del) {
     139    my $dbh = DBI->connect($dsn, $dbuser, $dbpass) or die "Cannot connect to server\n";
    120140    #
    121141    # delete product
     
    129149    }
    130150    my $prod_id = $prod_row->{prod_id};
    131 
    132     # if requested, remove the product directory
    133     if ($remove) {
    134         if (system "rm -r $product_dir") {
    135             die("failed to remove $product_dir");
    136         }
    137     } else  {
    138         # otherwise just zap the index script
    139         unlink("$index_script_name");
    140     }
    141151
    142152
     
    152162    $dbh->do("DELETE from dsProduct where prod_id = $prod_id");
    153163
     164    print "Product $product deleted.\n";
     165
     166    # if requested, remove the product directory
     167    if ($remove) {
     168        print "Removing files from $product.\n";
     169        if (system "rm -r $product_dir") {
     170            die("failed to remove $product_dir");
     171        }
     172    } else  {
     173        # otherwise just zap the index script
     174        unlink("$index_script_name");
     175    }
     176
    154177    exit 0;
    155178
     
    158181    # add a new product
    159182    #
     183    my $dbh = DBI->connect($dsn, $dbuser, $dbpass) or die "Cannot connect to server\n";
     184
    160185    my $stmt = $dbh->prepare("SELECT prod_id FROM dsProduct WHERE prod_name = \'$product\'");
    161186    $stmt->execute();
     
    167192
    168193    # set up the product directory
     194    # if there is an old index file delete it
     195    if (-e $index_script_name ) {
     196        if (!unlink($index_script_name)) {
     197            die("failed trying to remove old $index_script_name");
     198        }
     199    }
    169200    if (! -e $product_dir) {
    170201        $we_created_dir = 1;
     
    172203            die("failed trying to make product directory $product_dir");
    173204        }
    174     }
    175     if (-e $index_script_name ) {
    176         if (!unlink($index_script_name)) {
    177             die("failed trying to remove old $index_script_name");
    178         }
    179     }
     205    } else {
     206        # directory alrady exists make sure that it's empty
     207        my @dirlist = glob("$product_dir/*");
     208        die ("existing product directory $product_dir is not empty") if scalar @dirlist;
     209    }
     210
    180211    if (!copy($root_index_script, $index_script_name)) {
    181212        print STDERR "failed trying to copy($root_index_script, $index_script_name)";
  • branches/eam_branches/20090715/DataStoreServer/scripts/dsreg

    r24196 r25744  
    203203                $new_last_fs = $new_newest->{fileset_name};
    204204            } else {
    205                 $new_last_fs = "none";
     205                $new_last_fs = undef;
    206206            }
    207207            $stmt->finish();
    208             $dbh->do("UPDATE dsProduct SET last_fs = \'$new_last_fs\' WHERE prod_id = $prod_id");
     208            $dbh->do("UPDATE dsProduct SET last_fs = ? WHERE prod_id = $prod_id", undef, ($new_last_fs));
    209209        }
    210210        $dbh->commit();
  • branches/eam_branches/20090715/DataStoreServer/scripts/installscripts

    r20217 r25744  
    5656# index.txt file for the root of the data store.
    5757my @dsroot_list = qw(
    58 index.txt
     58index.txt.template
    5959);
    6060
  • branches/eam_branches/20090715/Ohana/src/getstar/src/dvoImagesAtCoords.c

    r25406 r25744  
    11# include "dvoImagesAtCoords.h"
     2
     3// We'd like to do this but since pstamp gets built later this won't work
     4// so just redefine the macro
     5// # include "pstamp.h"
     6#define PSTAMP_NO_OVERLAP 28
    27
    38static int readPoints(char *filename, Point **pointsOut);
     
    1924  Npoints = readPoints(argv[1], &points);
    2025  if (!Npoints) {
    21     exit(0);
     26    exit(1);
    2227  }
    2328
     
    4954  if (MatchCoords (dbImages, NdbImages, points, Npoints)) {
    5055    ListImagesAtCoords(dbImages, points, Npoints);
     56    exit(0);
     57  } else {
     58    exit(PSTAMP_NO_OVERLAP);
    5159  }
    52   // XXX: should we exit with nonzero status if no matches were found?
    53   exit (0);
    5460}
    5561
  • branches/eam_branches/20090715/Ohana/src/relphot/src/StarOps.c

    r21508 r25744  
    193193  for (i = 0; i < Ncatalog; i++) {
    194194    for (j = 0; j < catalog[i].Naverage; j++) {
     195
     196      // update average photometry for each of the average filters
    195197      for (Ns = 0; Ns < Nsecfilt; Ns++) {
    196198
     
    207209          if (isnan(Msys)) continue;
    208210
    209           // XXX this is a hack for the 2MASS search; better to save an average value?
    210           if (catalog[i].measure[m].psfQual < 0.85) continue;
     211          // XXX only apply this filter for psphot data from GPC1 for now...
     212          if (0 && (catalog[i].measure[m].photcode > 10000) && (catalog[i].measure[m].photcode < 10500)) {
     213              if (catalog[i].measure[m].psfQual < 0.85) continue;
     214          }
    211215
    212216          list[N] = Msys - catalog[i].measure[m].Mcal;
     
    224228        catalog[i].secfilt[Nsecfilt*j+Ns].Ncode = N;
    225229        catalog[i].secfilt[Nsecfilt*j+Ns].Nused = stats.Nmeas;
     230      }
     231
     232      // update average flags based on the detection stats. 
     233      // XXX we need to clean this up -- this is a serious set of hacks...
     234      if (0) {
     235        int Galaxy2MASS, GalaxySDSS, goodPS1, nEXT, nPSF, good2MASS;
     236
     237        Galaxy2MASS = FALSE; // best guess for galaxy based on 2MASS J measurements (gal_contam == measure.flags[0x00400000 | 0x00800000])
     238        GalaxySDSS = FALSE;  // best guess for galaxy based on SDSS measurements (XXX need to fix SDSS flags)
     239        goodPS1 = FALSE;     // true if any PS1 measurements have psfQual > 0.85
     240        good2MASS = FALSE;   // true if 2MASS J measurements have significant detections
     241        nEXT = nPSF = 0;     // number of PS1 PSF vs EXT measurements
     242
     243        m = catalog[i].average[j].measureOffset;
     244        for (k = 0; k < catalog[i].average[j].Nmeasure; k++, m++) {
     245
     246          // PS1 data :
     247          if ((catalog[i].measure[m].photcode >= 10000) && (catalog[i].measure[m].photcode <= 10500)) {
     248            if (catalog[i].measure[m].psfQual > 0.85) {
     249              goodPS1 = TRUE;
     250              if (!isnan(catalog[i].measure[m].Map)) {
     251                if (catalog[i].measure[m].M - catalog[i].measure[m].Map > 0.5) {
     252                  nEXT ++;
     253                } else {
     254                  nPSF ++;
     255                }
     256              }
     257            }
     258          }
     259         
     260          // 2MASS data:
     261          if (catalog[i].measure[m].photcode == 2011) {
     262            if (catalog[i].measure[m].photFlags & 0x00c00000) {
     263              Galaxy2MASS = TRUE;
     264            }
     265            if (catalog[i].measure[m].photFlags & 0x00000007) {
     266              good2MASS = TRUE;
     267            }
     268          } 
     269        }
     270
     271        if (nEXT && (nEXT > nPSF)) {
     272          catalog[i].average[j].flags |= 0x00010000;
     273        }
     274        if (goodPS1) {
     275          catalog[i].average[j].flags |= 0x00020000;
     276        }
     277        if (Galaxy2MASS) {
     278          catalog[i].average[j].flags |= 0x00040000;
     279        }
     280        if (good2MASS) {
     281          catalog[i].average[j].flags |= 0x00080000;
     282        }
    226283      }
    227284    }
  • branches/eam_branches/20090715/Ohana/src/relphot/src/relphot_objects.c

    r25035 r25744  
    6868   
    6969    if (VERBOSE) fprintf (stderr, "saving catalog %s\n", catalog.filename);
     70   
     71    // we can optionally convert output format here
     72    // but it would be better to define a dvo crawler program to do this
     73    // catalog.catformat = DVO_FORMAT_PS1_V1; 
    7074    dvo_catalog_save (&catalog, VERBOSE);
    7175    dvo_catalog_unlock (&catalog);
  • branches/eam_branches/20090715/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm

    r25406 r25744  
    3434    my $img_type = shift;   # required
    3535    my $id       = shift;   # required unless req_type eq bycoord or byskycell
     36    my $tess_id  = shift;
    3637    my $component= shift;   # class_id or skycell_id
    3738    my $inverse  = shift;
     39    my $need_magic = shift;
    3840    my $x        = shift;
    3941    my $y        = shift;
     
    4143    my $mjd_max  = shift;
    4244    my $filter   = shift;
     45    my $label    = shift;
    4346    my $verbose  = shift;
    4447
    4548
    4649    # we die in response to bad data in request files
    47     die "Unknown req_type: $req_type" if ($req_type ne "byid") and ($req_type ne "byexp")
    48                                         and ($req_type ne "bycoord") and ($req_type ne "bydiff");
     50    die "Unknown req_type: $req_type"
     51        if ($req_type ne "byid") and
     52           ($req_type ne "byexp") and
     53           ($req_type ne "bycoord") and
     54           ($req_type ne "bydiff") and
     55           ($req_type ne "byskycell");
     56
     57    my $dateobs_begin;
     58    my $dateobs_end;
     59    if (!iszero($mjd_min)) {
     60        $dateobs_begin = mjd_to_dateobs($mjd_min);
     61    }
     62    if (!iszero($mjd_max)) {
     63        $dateobs_end = mjd_to_dateobs($mjd_max);
     64    }
    4965
    5066    if (($req_type eq "byid") and ($img_type eq "diff")) {
     
    95111        # regtool -dbname $image_db -processedimfile -time_begin $mjd_min -time_end = $mjd_max -filter $filter
    96112        #
    97         my $results = lookup_bycoord($ipprc, $image_db, $x, $y, $mjd_min, $mjd_max, $filter, $verbose);
     113        my $results = lookup_bycoord($ipprc, $image_db, $x, $y, $dateobs_begin, $dateobs_end, $filter, $verbose);
    98114
    99115        # now take the results and lookup byexp
     
    102118        $req_type = "byexp";
    103119        $id = $results->{exp_name};
    104     }
    105 
    106     my $results = lookup($ipprc, $image_db, $req_type, $img_type, $id, $component, $verbose);
     120    } elsif ($req_type eq "byskycell") {
     121        if (($img_type eq "raw") or ($img_type eq "chip")) {
     122            print STDERR "REQ_TYPE byskycell not supported for IMG_TYPE raw or chip\n";
     123            return undef;
     124        }
     125        if (!$tess_id or !$component) {
     126            print STDERR "component and tess_id are required for REQ_TYPE byskycell\n";
     127            return undef;
     128        }
     129    }
     130
     131    my $results = lookup($ipprc, $image_db, $req_type, $img_type, $id, $tess_id, $component, $need_magic, $dateobs_begin, $dateobs_end, $filter, $label, $verbose);
    107132
    108133    return $results;
     
    115140    my $img_type = shift;
    116141    my $id       = shift;
     142    my $tess_id  = shift;
    117143    my $component= shift;
     144    my $need_magic = shift;
     145    my $dateobs_begin = shift;
     146    my $dateobs_end   = shift;
     147    my $filter = shift;
     148    my $label = shift;
    118149    my $verbose  = shift;
    119150
     
    139170    my $skycell_id;
    140171
    141     # special class_id value "null" means ignore
    142     if ($component and ($component eq "null")) {
     172    if (isnull($component)) {
    143173        $component = undef;
    144174    }
    145175
     176    my $magic_arg = $need_magic ? " -destreaked" : "";
    146177    if ($img_type eq "raw") {
    147178        $class_id = $component;
     
    196227    } elsif ($req_type eq "byexp") {
    197228        $command .= " -exp_name $id";
     229    } elsif ($req_type eq "byskycell") {
     230        $command .= " -tess_id $tess_id -skycell_id $skycell_id";
    198231    } else {
    199232        die "Unknown req_type supplied: $req_type";
    200233    }
     234
     235    if ($img_type ne "stack") {
     236        $command .= $magic_arg;
     237        $command .= " -dateobs_begin $dateobs_begin" if $dateobs_begin;
     238        $command .= " -dateobs_end $dateobs_end" if $dateobs_end;
     239    }
     240
     241    $command .= " -filter $filter" if !isnull($filter);
     242    $command .= " -label $label" if !isnull($label);
    201243
    202244    # run the tool and parse the output
     
    386428    my $x        = shift;
    387429    my $y        = shift;
    388     my $mjd_min  = shift;
    389     my $mjd_max  = shift;
     430    my $dateobs_begin  = shift;
     431    my $dateobs_end  = shift;
    390432    my $filter   = shift;
    391433    my $verbose  = shift;
     
    403445
    404446    my $args;
    405     if ($mjd_min) {
    406         my $dateobs_min = mjd_to_dateobs($mjd_min);
    407         $args .= " -dateobs_begin $dateobs_min";
    408     }
    409     if ($mjd_max) {
    410         my $dateobs_max = mjd_to_dateobs($mjd_max);
    411         $args .= " -dateobs_end $dateobs_max";
    412     }
    413     if ($filter) {
     447    if (!isnull($dateobs_begin)) {
     448        $args .= " -dateobs_begin $dateobs_begin";
     449    }
     450    if (!isnull($dateobs_end)) {
     451        $args .= " -dateobs_end $dateobs_end";
     452    }
     453    if (!isnull($filter)) {
    414454        $args .= " -filter $filter";
    415455    }
     
    567607    my ($sec, $min, $hr, $day, $mon, $year) = gmtime($ticks);
    568608
    569     return sprintf "'%4d-%02d-%02d %02d:%02d:%02d'", $year+1900, $mon+1, $day, $hr, $min, $sec;
     609    return sprintf "'%4d-%02d-%02dT%02d:%02d:%02dZ'", $year+1900, $mon+1, $day, $hr, $min, $sec;
     610}
     611
     612sub isnull {
     613    my $val = shift;
     614
     615    return (!defined($val) or (lc($val) eq "null"));
     616}
     617
     618sub iszero {
     619    my $val = shift;
     620    return (!defined($val) or ($val == 0));
    570621}
    571622
  • branches/eam_branches/20090715/archive/ducttape

  • branches/eam_branches/20090715/catalyst

  • branches/eam_branches/20090715/catalyst/2007.0-specs

  • branches/eam_branches/20090715/catalyst/2008.0-specs

  • branches/eam_branches/20090715/catalyst/2008.0-specs/hardened

  • branches/eam_branches/20090715/dbconfig/changes.txt

    r25624 r25744  
    12981298
    12991299ALTER TABLE distRun ADD COLUMN magic_ds_id BIGINT AFTER stage_id;
     1300
     1301ALTER TABLE pstampJob ADD COLUMN options BIGINT;
  • branches/eam_branches/20090715/dbconfig/pstamp.md

    r25624 r25744  
    3939    exp_id      S64         0
    4040    outputBase  STR         255
     41    options     S64         64
    4142END
  • branches/eam_branches/20090715/doc/misc/docgen.pl

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/20090715/hardware

  • branches/eam_branches/20090715/ippScripts/scripts/dist_component.pl

    r25022 r25744  
    164164            or ($file_rule =~ /.JPEG2/));
    165165
     166    if ($stage eq "diff") {
     167        next if $file_rule =~ /CONV/;
     168    }
     169
    166170    my $file_name = $file->{name};
    167171    my $base = basename($file_name);
  • branches/eam_branches/20090715/ippScripts/scripts/dist_make_fileset.pl

    r25624 r25744  
    4040# Parse the command-line arguments
    4141my ($dist_id, $dist_dir, $target_id, $stage, $stage_id, $dest_id, $product_name, $ds_dbhost, $ds_dbname);
     42my ($label, $filter);
    4243my ($dbname, $save_temps, $verbose, $no_update, $logfile);
    4344
     
    5051           'dest_id=s'      => \$dest_id,    # id for the product
    5152           'product_name=s' => \$product_name,  # location of the data store directory for this product
     53           'label=s'       => \$label,
     54           'filter=s'      => \$filter,
    5255           'ds_dbhost=s'    => \$ds_dbhost,  # database host for the datastore database
    5356           'ds_dbname=s'    => \$ds_dbname,  # database name for the datastore database
     
    6063
    6164pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    62 pod2usage( -msg => "Required options: --dist_id --dist_dir --target_id --stage --stage_id --dest_id --ds_dbhost --ds_dbname",
     65pod2usage( -msg => "Required options: --dist_id --dist_dir --target_id --stage --stage_id --label --filter --dest_id --ds_dbhost --ds_dbname",
    6366           -exitval => 3) unless
    6467    defined $dist_id and
     
    6770    defined $stage and
    6871    defined $stage_id and
     72    defined $label and
     73    defined $filter and
    6974    defined $dest_id and
    7075    defined $product_name and
     
    147152
    148153{
    149     # XXX: need to chose an appropriate file set type
    150     my $command = "$dsreg --add $fileset_name --product $product_name --type notset --list $listFileName";
     154    my $command = "$dsreg --add $fileset_name --product $product_name --type IPP-DIST --list $listFileName";
    151155
    152156    # the data store will refer to the distribution bundle via symlinks back to distRun.outdir
     
    157161
    158162    $command .= " --ps0 $target_id --ps1 $stage --ps2 $stage_id --ps3 $prod_col_3";
    159 
    160     $command .= " --dbname $ds_dbname";    # XXX: notyet --dbhost $ds_dbhost
     163    $command .= " --ps4 $label --ps5 $filter";
     164
     165    $command .= " --dbname $ds_dbname --dbhost $ds_dbhost";
    161166
    162167    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
  • branches/eam_branches/20090715/ippScripts/scripts/magic_destreak_revert.pl

    r25624 r25744  
    193193revert_files($replace, $image, $mask, $weight, $sources, $astrom, $bimage, $bmask, $bweight, $bsources, $bastrom);
    194194
    195 if ($stage eq "diff") {
     195if ($stage eq "diff" and $inverse) {
    196196    my $name = "PPSUB.INVERSE";
    197197    $image  = $ipprc->filename($name, $path_base);
  • branches/eam_branches/20090715/ippTasks/addstar.pro

    r25402 r25744  
    2323    active true
    2424  end
     25  task addstar.revert
     26    active true
     27  end
    2528end
    2629
     
    3033  end
    3134  task addstar.exp.run
     35    active false
     36  end
     37  task addstar.revert
    3238    active false
    3339  end
  • branches/eam_branches/20090715/ippTasks/camera.pro

    r24596 r25744  
    2323    active true
    2424  end
     25  task camera.revert
     26    active true
     27  end
    2528end
    2629
     
    3033  end
    3134  task camera.exp.run
     35    active false
     36  end
     37  task camera.revert
    3238    active false
    3339  end
  • branches/eam_branches/20090715/ippTasks/chip.pro

    r24596 r25744  
    2626    active true
    2727  end
     28  task chip.revert
     29    active true
     30  end
    2831end
    2932
     
    3639  end
    3740  task chip.advanceexp
     41    active false
     42  end
     43  task chip.revert
    3844    active false
    3945  end
  • branches/eam_branches/20090715/ippTasks/destreak.pro

    r25625 r25744  
    172172
    173173  task.exec
     174    stdout $LOGSUBDIR/destreak.run.log
     175    stderr $LOGSUBDIR/destreak.run.log
    174176    book npages magicToDS -var N
    175177    if ($N == 0) break
     
    362364
    363365  task.exec
     366    stdout $LOGSUBDIR/destreak.revert.run.log
     367    stderr $LOGSUBDIR/destreak.revert.run.log
     368
    364369    book npages magicDSToRevert -var N
    365370    if ($N == 0) break
  • branches/eam_branches/20090715/ippTasks/fake.pro

    r24596 r25744  
    2626    active true
    2727  end
     28  task fake.revert
     29    active true
     30  end
    2831end
    2932
     
    3639  end
    3740  task fake.advanceexp
     41    active false
     42  end
     43  task fake.revert
    3844    active false
    3945  end
  • branches/eam_branches/20090715/ippTasks/pantasks.pro

    r25625 r25744  
    11## pantasks.pro : globals and support macros : -*- sh -*-
    22
     3# globals that may be modified by the user -- only init if not set
     4if ($?NEBULOUS == 0)      set NEBULOUS = 0
     5if ($?NETWORK == 0)       set NETWORK = 1
     6if ($?PARALLEL == 0)      set PARALLEL = 1
     7if ($?VERBOSE == 0)       set VERBOSE = 1
     8if ($?LABEL:n == 0)       set LABEL:n = 0
     9if ($?POLLLIMIT == 0)     set POLLLIMIT = 32
     10if ($?KEEP_FAILURES == 0) set KEEP_FAILURES = 0
     11
     12if ($?LOGDIR == 0)
     13  $LOGDIR = `pwd`
     14  $LOGDIR = $LOGDIR/pantasks_logs
     15  mkdir $LOGDIR
     16end
     17
    318# globals used to control system behavior : these should be in uppercase
    4 $NEBULOUS = 0
    5 $NETWORK = 1
    6 $PARALLEL = 1
    7 $VERBOSE = 1
    8 $LABEL:n = 0
    9 $POLLLIMIT = 32
    10 $LOGDIR = `pwd`
    11 $LOGDIR = $LOGDIR/pantasks_logs
    12 mkdir $LOGDIR
    13 $KEEP_FAILURES = 0
    14 
    1519$LOADPOLL = 1.0
    1620$LOADEXEC = 5.0
     
    144148  for i 0 $LABEL:n
    145149    echo $LABEL:$i
     150  end
     151end
     152
     153macro save.labels
     154  if ($0 != 1)
     155    echo "USAGE: save.labels"
     156    break
     157  end
     158  if ($?LABEL:n == 0)
     159    echo "no labels defined"
     160  end
     161  if ($LABEL:n == 0)
     162    echo "no labels defined"
     163  end
     164
     165  exec rm -f labels.list
     166  local i
     167  for i 0 $LABEL:n
     168    exec echo $LABEL:$i >> labels.list
     169  end
     170end
     171
     172macro load.labels
     173  if ($0 != 1)
     174    echo "USAGE: load.labels"
     175    break
     176  end
     177
     178  file labels.list found
     179  if (not($found))
     180    echo "no saved labels in labels.list"
     181    return
     182  end
     183 
     184  list mylabels -x "cat labels.list"
     185  local i
     186  for i 0 $mylabels:n
     187    add.label $mylabels:$i
    146188  end
    147189end
  • branches/eam_branches/20090715/ippTasks/rcserver.pro

    r25625 r25744  
    129129    book getword rcPendingFS $pageName stage -var STAGE
    130130    book getword rcPendingFS $pageName stage_id -var STAGE_ID
     131    book getword rcPendingFS $pageName label -var LABEL
     132    book getword rcPendingFS $pageName filter -var FILTER
    131133    book getword rcPendingFS $pageName dist_dir -var DIST_DIR
    132134#    book getword rcPendingFS $pageName clean -var CLEAN
     
    147149    book setword rcPendingFS $pageName pantaskState RUN
    148150
    149     $run = dist_make_fileset.pl --dist_id $DIST_ID --target_id $TARGET_ID --stage $STAGE --stage_id $STAGE_ID --dest_id $DEST_ID --product_name $PRODUCT_NAME  --ds_dbhost $DS_DBHOST --ds_dbname $DS_DBNAME --dist_dir $DIST_DIR
     151    $run = dist_make_fileset.pl --dist_id $DIST_ID --target_id $TARGET_ID --stage $STAGE --stage_id $STAGE_ID --label $LABEL --filter $FILTER --dest_id $DEST_ID --product_name $PRODUCT_NAME  --ds_dbhost $DS_DBHOST --ds_dbname $DS_DBNAME --dist_dir $DIST_DIR
    150152
    151153    add_standard_args run
  • branches/eam_branches/20090715/ippTasks/warp.pro

    r24596 r25744  
    4949    active true
    5050  end
     51  task warp.revert.overlap
     52    active true
     53  end
     54  task warp.revert.warped
     55    active true
     56  end
    5157end
    5258
     
    6672  end
    6773  task warp.advancerun
     74    active false
     75  end
     76  task warp.revert.overlap
     77    active false
     78  end
     79  task warp.revert.warped
    6880    active false
    6981  end
  • branches/eam_branches/20090715/ippTests/tap

  • branches/eam_branches/20090715/ippTools/share/Makefile.am

    r25624 r25744  
    195195     pstamptool_completedreq.sql \
    196196     pstamptool_datastore.sql \
     197     pstamptool_listjob.sql \
    197198     pstamptool_pendingjob.sql \
    198199     pstamptool_pendingreq.sql \
  • branches/eam_branches/20090715/ippTools/share/disttool_pendingfileset.sql

    r25624 r25744  
    44    distRun.stage,
    55    stage_id,
     6    distTarget.label,
     7    distTarget.filter,
    68    CONCAT_WS('.', distRun.outroot, CONVERT(distRun.dist_id, CHAR)) as dist_dir,
    79    rcDestination.name AS product_name,
  • branches/eam_branches/20090715/ippTools/share/disttool_revertcomponent.sql

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/20090715/ippTools/share/disttool_revertrun.sql

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/20090715/ippTools/share/pxadmin_create_tables.sql

    r25624 r25744  
    12491249        exp_id BIGINT,
    12501250        outputBase VARCHAR(255),
     1251        options BIGINT,
    12511252        PRIMARY KEY(job_id, req_id),
    12521253        KEY(job_id),
  • branches/eam_branches/20090715/ippTools/src/chiptool.c

    r25400 r25744  
    603603    PXOPT_COPY_STR(config->args, where, "-reduction", "chipRun.reduction", "==");
    604604    pxAddLabelSearchArgs (config, where, "-label", "chipRun.label", "LIKE");
    605     PXOPT_COPY_S64(config->args, where, "-magicked", "chipRun.magicked", "==");
     605    PXOPT_COPY_S64(config->args, where, "-magicked", "chipProcessedImfile.magicked", "==");
     606
     607    PXOPT_LOOKUP_U64(magicked, config->args, "-magicked", false, false);
     608    PXOPT_LOOKUP_BOOL(destreaked, config->args,     "-destreaked", false);
     609    PXOPT_LOOKUP_BOOL(not_destreaked, config->args, "-not_destreaked", false);
    606610
    607611    if (!psListLength(where->list) &&
     
    631635        // don't list faulted rows
    632636        psStringAppend(&query, " %s", "AND chipProcessedImfile.fault = 0");
     637    }
     638    if (not_destreaked) {
     639        if (destreaked) {
     640            psError(PXTOOLS_ERR_DATA, true, "providing -not_destreaked and -destreaked makes no sense");
     641            return false;
     642        }
     643        if (magicked) {
     644            psError(PXTOOLS_ERR_DATA, true, "providing -not_destreaked and -magicked makes no sense");
     645            return false;
     646        }
     647        psStringAppend(&query, " AND chipProcessedImfile.magicked = 0");
     648    }
     649    if (destreaked) {
     650        psStringAppend(&query, " AND chipProcessedImfile.magicked != 0");
    633651    }
    634652
  • branches/eam_branches/20090715/ippTools/src/chiptoolConfig.c

    r25400 r25744  
    158158    psMetadataAddStr(processedimfileArgs,  PS_LIST_TAIL, "-reduction",          0, "search by reduction class", NULL);
    159159    psMetadataAddStr(processedimfileArgs,  PS_LIST_TAIL, "-label",  PS_META_DUPLICATE_OK, "search by chipRun label (LIKE comparison)", NULL);
    160     psMetadataAddBool(processedimfileArgs, PS_LIST_TAIL, "-magicked",  0,        "search by magicked status", false);
     160
     161    psMetadataAddBool(processedimfileArgs, PS_LIST_TAIL, "-destreaked",  0,      "search for destreaked images", false);
     162    psMetadataAddBool(processedimfileArgs, PS_LIST_TAIL, "-not_destreaked",  0,  "search for images that have not been destreaked", false);
     163    psMetadataAddS64(processedimfileArgs, PS_LIST_TAIL, "-magicked",  0,        "search by magicked value", 0);
    161164    psMetadataAddU64(processedimfileArgs,  PS_LIST_TAIL, "-limit",  0,           "limit result set to N items", 0);
    162165    psMetadataAddBool(processedimfileArgs, PS_LIST_TAIL, "-all",  0,            "list everything without search terms", false);
  • branches/eam_branches/20090715/ippTools/src/difftool.c

    r25624 r25744  
    665665    PXOPT_COPY_S64(config->args, where,  "-diff_id", "diffSkyfile.diff_id", "==");
    666666    PXOPT_COPY_STR(config->args, where, "-skycell_id", "diffInputSkyfile.skycell_id", "==");
    667     PXOPT_COPY_S64(config->args, where,  "-diff_skyfile_id", "diffInputSkyfile.diff_skyfile_id", "==");
     667    PXOPT_COPY_S64(config->args, where, "-diff_skyfile_id", "diffInputSkyfile.diff_skyfile_id", "==");
    668668    PXOPT_COPY_STR(config->args, where, "-tess_id", "diffRun.tess_id", "==");
    669669    PXOPT_COPY_S16(config->args, where, "-fault", "diffSkyfile.fault", "==");
    670     PXOPT_COPY_S64(config->args, where, "-exp_id", "rawInput.exp_id", "==");
    671     PXOPT_COPY_STR(config->args, where, "-exp_name", "rawInput.exp_name", "==");
    672     PXOPT_COPY_STR(config->args, where, "-warp_id", "warpInput.warp_id", "==");
    673 
     670    PXOPT_COPY_S64(config->args, where,  "-magicked", "diffSkyfile.magicked", "==");
     671    pxAddLabelSearchArgs (config, where, "-label", "diffRun.label", "LIKE");
     672
     673    PXOPT_LOOKUP_BOOL(template, config->args, "-template", false);
     674    if (!template) {
     675        PXOPT_COPY_S64(config->args, where, "-exp_id", "rawInput.exp_id", "==");
     676        PXOPT_COPY_STR(config->args, where, "-exp_name", "rawInput.exp_name", "==");
     677        PXOPT_COPY_STR(config->args, where, "-warp_id", "warpInput.warp_id", "==");
     678        PXOPT_COPY_TIME(config->args, where, "-dateobs_begin", "rawInput.dateobs",  ">=");
     679        PXOPT_COPY_TIME(config->args, where, "-dateobs_end",   "rawInput.dateobs",  "<=");
     680        PXOPT_COPY_STR(config->args, where, "-filter",     "rawInput.filter", "==");
     681    } else {
     682        PXOPT_COPY_S64(config->args, where, "-exp_id", "rawTemplate.exp_id", "==");
     683        PXOPT_COPY_STR(config->args, where, "-exp_name", "rawTemplate.exp_name", "==");
     684        PXOPT_COPY_STR(config->args, where, "-warp_id", "warpTemplate.warp_id", "==");
     685        PXOPT_COPY_TIME(config->args, where, "-dateobs_begin", "rawTemplate.dateobs",  ">=");
     686        PXOPT_COPY_TIME(config->args, where, "-dateobs_end",   "rawTemplate.dateobs",  "<=");
     687        PXOPT_COPY_STR(config->args, where, "-filter",     "rawTemplate.filter", "==");
     688    }
     689
     690    PXOPT_LOOKUP_BOOL(all, config->args, "-all", false);
    674691    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
    675692    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
     693
     694    PXOPT_LOOKUP_U64(magicked, config->args,        "-magicked", false, false);
     695    PXOPT_LOOKUP_BOOL(destreaked, config->args,     "-destreaked", false);
     696    PXOPT_LOOKUP_BOOL(not_destreaked, config->args, "-not_destreaked", false);
    676697
    677698    psString query = pxDataGet("difftool_skyfile.sql");
     
    685706        psStringAppend(&query, " WHERE %s", whereClause);
    686707        psFree(whereClause);
     708    } else if (!all) {
     709        psError(PXTOOLS_ERR_DATA, true, "search parameters or -all are required");
    687710    }
    688711    psFree(where);
     712
     713    if (not_destreaked) {
     714        if (destreaked) {
     715            psError(PXTOOLS_ERR_DATA, true, "providing -not_destreaked and -destreaked makes no sense");
     716            return false;
     717        }
     718        if (magicked) {
     719            psError(PXTOOLS_ERR_DATA, true, "providing -not_destreaked and -magicked makes no sense");
     720            return false;
     721        }
     722        psStringAppend(&query, " AND diffSkyfile.magicked = 0");
     723    }
     724    if (destreaked) {
     725        psStringAppend(&query, " AND diffSkyfile.magicked != 0");
     726    }
     727
    689728
    690729    // treat limit == 0 as "no limit"
  • branches/eam_branches/20090715/ippTools/src/difftoolConfig.c

    r25624 r25744  
    123123    // -diffskyfile
    124124    psMetadata *diffskyfileArgs = psMetadataAlloc();
    125     psMetadataAddS64(diffskyfileArgs, PS_LIST_TAIL, "-diff_id", 0,            "search by diff ID", 0);
    126     psMetadataAddStr(diffskyfileArgs , PS_LIST_TAIL, "-skycell_id",  0,       "define skycell ID", NULL);
    127     psMetadataAddS64(diffskyfileArgs, PS_LIST_TAIL, "-diff_skyfile_id", 0,    "search by diff_skyfile_id ID", 0);
    128     psMetadataAddStr(diffskyfileArgs, PS_LIST_TAIL, "-tess_id",  0,            "define tessellation ID", NULL);
    129     psMetadataAddS64(diffskyfileArgs, PS_LIST_TAIL, "-exp_id",  0,            "define exposure ID", 0);
    130     psMetadataAddStr(diffskyfileArgs , PS_LIST_TAIL, "-exp_name",  0,         "define exposure name", NULL);
    131     psMetadataAddStr(diffskyfileArgs , PS_LIST_TAIL, "-warp_id",  0,         "define warp_id", NULL);
    132     psMetadataAddU64(diffskyfileArgs, PS_LIST_TAIL, "-limit",  0,            "limit result set to N items", 0);
    133     psMetadataAddBool(diffskyfileArgs, PS_LIST_TAIL, "-simple",  0,            "use the simple output format", false);
    134     psMetadataAddS16(diffskyfileArgs, PS_LIST_TAIL, "-fault",  0,            "define fault code", 0);
     125    psMetadataAddS64(diffskyfileArgs, PS_LIST_TAIL,  "-diff_id", 0,           "search by diff ID", 0);
     126    psMetadataAddStr(diffskyfileArgs , PS_LIST_TAIL, "-skycell_id",  0,      "search by skycell ID", NULL);
     127    psMetadataAddS64(diffskyfileArgs, PS_LIST_TAIL,  "-diff_skyfile_id", 0,   "search by diff_skyfile_id ID", 0);
     128    psMetadataAddStr(diffskyfileArgs, PS_LIST_TAIL,  "-tess_id",  0,          "search by tessellation ID", NULL);
     129    psMetadataAddStr(diffskyfileArgs , PS_LIST_TAIL, "-warp_id",  0,         "search by warp_id", NULL);
     130    psMetadataAddBool(diffskyfileArgs, PS_LIST_TAIL, "-template",  0,        "apply exposure args to template of bothways diff", false);
     131    psMetadataAddS64(diffskyfileArgs, PS_LIST_TAIL,  "-exp_id",  0,           "search by exposure ID", 0);
     132    psMetadataAddStr(diffskyfileArgs , PS_LIST_TAIL, "-exp_name",  0,        "search by exposure name", NULL);
     133    psMetadataAddTime(diffskyfileArgs, PS_LIST_TAIL, "-dateobs_begin", 0,    "search for exposures by time (>=)", NULL);
     134    psMetadataAddTime(diffskyfileArgs, PS_LIST_TAIL, "-dateobs_end", 0,      "search for exposures by time (<=)", NULL);
     135    psMetadataAddStr(diffskyfileArgs, PS_LIST_TAIL,  "-filter", 0,           "search for filter", NULL);
     136    psMetadataAddS64(diffskyfileArgs, PS_LIST_TAIL,  "-magicked", 0,         "search by magicked value", 0);
     137    psMetadataAddBool(diffskyfileArgs, PS_LIST_TAIL, "-destreaked",  0,      "search for destreaked images", false);
     138    psMetadataAddBool(diffskyfileArgs, PS_LIST_TAIL, "-not_destreaked",  0,  "search for images that are not destreaked", false);
     139    psMetadataAddStr(diffskyfileArgs,  PS_LIST_TAIL, "-label",  PS_META_DUPLICATE_OK, "search by diffRun label (LIKE comparison)", NULL);
     140    psMetadataAddS16(diffskyfileArgs, PS_LIST_TAIL,  "-fault",  0,           "search by fault code", 0);
     141
     142    psMetadataAddBool(diffskyfileArgs, PS_LIST_TAIL, "-all",  0,             "search without arguments", false);
     143    psMetadataAddU64(diffskyfileArgs, PS_LIST_TAIL,  "-limit",  0,            "limit result set to N items", 0);
     144    psMetadataAddBool(diffskyfileArgs, PS_LIST_TAIL, "-simple",  0,          "use the simple output format", false);
    135145
    136146    // -revertdiffskyfile
  • branches/eam_branches/20090715/ippTools/src/pstamptool.c

    r25624 r25744  
    544544    PXOPT_LOOKUP_S16(fault,       config->args, "-fault",      false, false);
    545545    PXOPT_LOOKUP_S64(exp_id,      config->args, "-exp_id",     false, false);
     546    PXOPT_LOOKUP_S64(options,     config->args, "-options",     false, false);
    546547
    547548    // unless the job is being inserted with stop state require outputBase
     
    568569            fault,
    569570            exp_id,
    570             outputBase
     571            outputBase,
     572            options
    571573            )) {
    572574        psError(PS_ERR_UNKNOWN, false, "database error");
     
    592594    PS_ASSERT_PTR_NON_NULL(config, false);
    593595
    594     PXOPT_LOOKUP_S64(req_id, config->args, "-req_id", false, false);
    595     PXOPT_LOOKUP_S64(job_id, config->args, "-job_id", false, false);
     596    psMetadata *where = psMetadataAlloc();
     597    PXOPT_COPY_S64(config->args, where, "-job_id", "job_id", "==");
     598    PXOPT_COPY_S64(config->args, where, "-req_id", "req_id", "==");
     599    PXOPT_COPY_S64(config->args, where, "-fault",  "fault", "==");
    596600
    597601    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
    598602    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
    599603
    600     psString query = NULL;
    601 
    602     if (!req_id && !job_id) {
    603         fprintf(stderr, "either req_id or job_id must be specified\n");
     604    if (!psListLength(where->list)) {
     605        fprintf(stderr, "search arguments are required\n");
    604606        exit (1);
    605607    }
    606608
    607     if (req_id) {
    608         psStringAppend(&query,
    609                 "SELECT"
    610                 " pstampJob.*, pstampRequest.name, pstampRequest.outProduct"
    611                 " FROM pstampJob"
    612                 " JOIN pstampRequest USING(req_id)"
    613                 " WHERE req_id = %" PRId64, req_id
    614             );
    615     } else {
    616         psStringAppend(&query,
    617                 "SELECT"
    618                 " pstampJob.*, pstampRequest.name, pstampRequest.outProduct"
    619                 " FROM pstampJob"
    620                 " JOIN pstampRequest USING(req_id)"
    621                 " WHERE job_id = %" PRId64, job_id
    622             );
    623     }
     609    psString query = pxDataGet("pstamptool_listjob.sql");
     610    if (!query) {
     611        psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
     612        return false;
     613    }
     614
     615    // use psDBGenerateWhereSQL because the SQL yields an intermediate table
     616    if (psListLength(where->list)) {
     617        psString whereClause = psDBGenerateWhereConditionSQL(where, "pstampJob");
     618        psStringAppend(&query, " WHERE %s", whereClause);
     619        psFree(whereClause);
     620    }
     621    psFree(where);
    624622
    625623    // treat limit == 0 as "no limit"
  • branches/eam_branches/20090715/ippTools/src/pstamptoolConfig.c

    r25624 r25744  
    105105    // -addjob
    106106    psMetadata *addjobArgs = psMetadataAlloc();
    107     psMetadataAddS64(addjobArgs, PS_LIST_TAIL, "-req_id", 0,            "define job req_id", 0);
    108     psMetadataAddStr(addjobArgs, PS_LIST_TAIL, "-rownum", 0,            "define job rownum", NULL);
    109     psMetadataAddStr(addjobArgs, PS_LIST_TAIL, "-job_type", 0,            "define job job_type", "stamp");
    110     psMetadataAddStr(addjobArgs, PS_LIST_TAIL, "-outputBase", 0,            "define job outputBase", NULL);
    111     psMetadataAddStr(addjobArgs, PS_LIST_TAIL, "-state", 0,            "new state", "run");
    112     psMetadataAddS64(addjobArgs, PS_LIST_TAIL, "-exp_id", 0,           "exposure id", 0);
    113     psMetadataAddS16(addjobArgs, PS_LIST_TAIL, "-fault", 0,            "new result", 0);
     107    psMetadataAddS64(addjobArgs, PS_LIST_TAIL, "-req_id", 0,           "define job req_id", 0);
     108    psMetadataAddStr(addjobArgs, PS_LIST_TAIL, "-rownum", 0,           "define job rownum", NULL);
     109    psMetadataAddStr(addjobArgs, PS_LIST_TAIL, "-job_type", 0,         "define job job_type", "stamp");
     110    psMetadataAddStr(addjobArgs, PS_LIST_TAIL, "-outputBase", 0,       "define job outputBase", NULL);
     111    psMetadataAddStr(addjobArgs, PS_LIST_TAIL, "-state", 0,            "define state", "run");
     112    psMetadataAddS64(addjobArgs, PS_LIST_TAIL, "-exp_id", 0,           "define exposure id", 0);
     113    psMetadataAddS64(addjobArgs, PS_LIST_TAIL, "-options", 0,          "define options", 0);
     114    psMetadataAddS16(addjobArgs, PS_LIST_TAIL, "-fault", 0,            "define job result", 0);
    114115
    115116    // -listjob
    116117    psMetadata *listjobArgs = psMetadataAlloc();
    117     psMetadataAddS64(listjobArgs, PS_LIST_TAIL, "-req_id", 0,            "define request", 0);
    118     psMetadataAddS64(listjobArgs, PS_LIST_TAIL, "-job_id", 0,            "define job", 0);
    119     psMetadataAddU64(listjobArgs, PS_LIST_TAIL, "-limit",  0,            "limit result set to N items", 0);
    120     psMetadataAddBool(listjobArgs, PS_LIST_TAIL, "-simple", 0,            "use the simple output format", false);
     118    psMetadataAddS64(listjobArgs, PS_LIST_TAIL, "-req_id", 0,          "select by request ID", 0);
     119    psMetadataAddS64(listjobArgs, PS_LIST_TAIL, "-job_id", 0,          "select by job ID", 0);
     120    psMetadataAddS16(listjobArgs, PS_LIST_TAIL, "-fault", 0,           "select by fault", 0);
     121    psMetadataAddU64(listjobArgs, PS_LIST_TAIL, "-limit",  0,          "limit result set to N items", 0);
     122    psMetadataAddBool(listjobArgs, PS_LIST_TAIL, "-simple", 0,         "use the simple output format", false);
    121123
    122124    // -pendingjob
  • branches/eam_branches/20090715/ippTools/src/regtool.c

    r25624 r25744  
    333333    PXOPT_COPY_TIME(config->args, where, "-dateobs_begin", "dateobs",  ">=");
    334334    PXOPT_COPY_TIME(config->args, where, "-dateobs_end",   "dateobs",  "<=");
     335    PXOPT_COPY_STR(config->args, where,  "-filter",        "filter", "==");
     336    PXOPT_COPY_S64(config->args, where,  "-magicked",      "magicked", "==");
     337
     338    PXOPT_LOOKUP_S64(magicked, config->args, "-magicked", false, false);
     339    PXOPT_LOOKUP_BOOL(destreaked, config->args,     "-destreaked", false);
     340    PXOPT_LOOKUP_BOOL(not_destreaked, config->args, "-not_destreaked", false);
    335341
    336342    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
     
    360366        psStringAppend(&query, " %s", "AND rawImfile.fault = 0");
    361367    }
     368
     369    if (not_destreaked) {
     370        if (destreaked) {
     371            psError(PXTOOLS_ERR_DATA, true, "providing -not_destreaked and -destreaked makes no sense");
     372            return false;
     373        }
     374        if (magicked) {
     375            psError(PXTOOLS_ERR_DATA, true, "providing -not_destreaked and -magicked makes no sense");
     376            return false;
     377        }
     378        psStringAppend(&query, " AND rawImfile.magicked = 0");
     379    }
     380    if (destreaked) {
     381        psStringAppend(&query, " AND rawImfile.magicked != 0");
     382    }
     383
    362384
    363385    // add the ORDER BY statement if desired
  • branches/eam_branches/20090715/ippTools/src/regtoolConfig.c

    r25624 r25744  
    136136    ADD_OPT(Str,  processedimfileArgs, "-exp_name",  "search by exposure name",               NULL);
    137137    ADD_OPT(Str,  processedimfileArgs, "-class_id",  "search by class ID",                    NULL);
     138    ADD_OPT(Str,  processedimfileArgs, "-filter",  "search by filter",                        NULL);
    138139    ADD_OPT(Time, processedimfileArgs, "-dateobs_begin", "search for exposures by time (>=)", NULL);
    139140    ADD_OPT(Time, processedimfileArgs, "-dateobs_end", "search for exposures by time (<)", NULL);
     141    ADD_OPT(S64,  processedimfileArgs, "-magicked",    "search by magicked value",            0);
     142    ADD_OPT(Bool, processedimfileArgs, "-destreaked",   "only return imfiles that have been destreaked", false);
     143    ADD_OPT(Bool, processedimfileArgs, "-not_destreaked", "only return imfiles that have not been destreaked", false);
    140144    ADD_OPT(U64,  processedimfileArgs, "-limit",     "limit result set to N items",           0);
    141145    ADD_OPT(Bool, processedimfileArgs, "-faulted",   "only return imfiles with a fault status set", false);
  • branches/eam_branches/20090715/ippTools/src/stacktool.c

    r25624 r25744  
    859859
    860860    psMetadata *where = psMetadataAlloc();
    861     PXOPT_COPY_S64(config->args, where, "-warp_id", "warpRun.warp_id", "==");
    862861    PXOPT_COPY_S64(config->args, where, "-stack_id", "stackSumSkyfile.stack_id", "==");
    863     PXOPT_COPY_S64(config->args, where, "-exp_id", "rawExp.exp_id", "==");
    864     PXOPT_COPY_STR(config->args, where, "-exp_name", "rawExp.exp_name", "==");
    865862    PXOPT_COPY_STR(config->args, where, "-tess_id", "stackRun.tess_id", "==");
    866863    PXOPT_COPY_STR(config->args, where, "-skycell_id", "stackRun.skycell_id", "==");
     864    PXOPT_COPY_STR(config->args, where, "-filter", "stackRun.filter", "LIKE");
     865    PXOPT_COPY_STR(config->args, where, "-label", "stackRun.label", "==");
     866    PXOPT_COPY_S16(config->args, where, "-fault", "stackSumSkyfile.fault", "==");
     867
     868//  The following three selectors are incompatible with the sql so omit them
     869//    PXOPT_COPY_S64(config->args, where, "-warp_id", "warpRun.warp_id", "==");
     870//     PXOPT_COPY_S64(config->args, where, "-exp_id", "rawExp.exp_id", "==");
     871//    PXOPT_COPY_STR(config->args, where, "-exp_name", "rawExp.exp_name", "==");
     872
     873    PXOPT_LOOKUP_BOOL(all, config->args, "-all", false);
    867874
    868875    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
     
    879886        psStringAppend(&query, " WHERE %s", whereClause);
    880887        psFree(whereClause);
    881     }
     888    } else if (!all) {
     889        psError(PXTOOLS_ERR_DATA, true, "search parameters or -all are required");
     890        return false;
     891    }
     892
    882893    psFree(where);
    883894
  • branches/eam_branches/20090715/ippTools/src/stacktoolConfig.c

    r25624 r25744  
    164164    psMetadata *sumskyfileArgs= psMetadataAlloc();
    165165    psMetadataAddS64(sumskyfileArgs, PS_LIST_TAIL, "-stack_id", 0,            "search by stack ID", 0);
    166     psMetadataAddS64(sumskyfileArgs, PS_LIST_TAIL, "-warp_id", 0,            "search by warp ID", 0);
    167166    psMetadataAddStr(sumskyfileArgs, PS_LIST_TAIL, "-tess_id", 0,            "search by tess ID", 0);
    168167    psMetadataAddStr(sumskyfileArgs, PS_LIST_TAIL, "-skycell_id", 0,         "search by skycell ID", 0);
     168#ifdef notdef
     169    // These don't work so omit (for now) We probably should create a different mode for this type of search.
     170    psMetadataAddS64(sumskyfileArgs, PS_LIST_TAIL, "-warp_id", 0,            "search by warp ID", 0);
    169171    psMetadataAddS64(sumskyfileArgs, PS_LIST_TAIL, "-exp_id", 0,            "search by exposure ID", 0);
    170172    psMetadataAddStr(sumskyfileArgs, PS_LIST_TAIL, "-exp_name", 0,          "search by exposure name", NULL);
     173#endif
     174    psMetadataAddStr(sumskyfileArgs, PS_LIST_TAIL, "-label", 0,             "search by stackRun.label", NULL);
     175    psMetadataAddStr(sumskyfileArgs, PS_LIST_TAIL, "-filter", 0,            "search by filter (LIKE comparison)", NULL);
     176    psMetadataAddS16(sumskyfileArgs, PS_LIST_TAIL, "-fault",  0,            "search by fault code", 0);
    171177    psMetadataAddU64(sumskyfileArgs, PS_LIST_TAIL, "-limit",  0,            "limit result set to N items", 0);
    172178    psMetadataAddBool(sumskyfileArgs, PS_LIST_TAIL, "-simple",  0,            "use the simple output format", false);
     179    psMetadataAddBool(sumskyfileArgs, PS_LIST_TAIL, "-all",  0,            "enable search without arguments", false);
    173180
    174181    // -revertsumskyfile
  • branches/eam_branches/20090715/ippTools/src/warptool.c

    r25400 r25744  
    11981198    PXOPT_COPY_STR(config->args, where, "-exp_name",   "rawExp.exp_name", "==");
    11991199    PXOPT_COPY_S64(config->args, where, "-fake_id",    "fakeRun.fake_id", "==");
     1200    PXOPT_COPY_TIME(config->args, where, "-dateobs_begin", "rawExp.dateobs",  ">=");
     1201    PXOPT_COPY_TIME(config->args, where, "-dateobs_end",   "rawExp.dateobs",  "<=");
     1202    PXOPT_COPY_STR(config->args, where, "-filter",    "rawExp.filter", "==");
     1203    PXOPT_COPY_S64(config->args, where, "-magicked", "warpSkyfile.magicked", "==");
     1204    pxAddLabelSearchArgs (config, where, "-label",   "warpRun.label", "LIKE");
     1205
     1206    PXOPT_LOOKUP_U64(magicked, config->args, "-magicked", false, false);
     1207    PXOPT_LOOKUP_BOOL(destreaked, config->args,     "-destreaked", false);
     1208    PXOPT_LOOKUP_BOOL(not_destreaked, config->args, "-not_destreaked", false);
     1209
     1210    PXOPT_LOOKUP_BOOL(all, config->args, "-all", false);
    12001211
    12011212    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
     
    12131224        psStringAppend(&query, " AND %s", whereClause);
    12141225        psFree(whereClause);
     1226    } else if (!all) {
     1227        psError(PXTOOLS_ERR_DATA, true, "search parameters or -all are required");
     1228        return false;
    12151229    }
    12161230    psFree(where);
     1231
     1232    if (not_destreaked) {
     1233        if (destreaked) {
     1234            psError(PXTOOLS_ERR_DATA, true, "providing -not_destreaked and -destreaked makes no sense");
     1235            return false;
     1236        }
     1237        if (magicked) {
     1238            psError(PXTOOLS_ERR_DATA, true, "providing -not_destreaked and -magicked makes no sense");
     1239            return false;
     1240        }
     1241        psStringAppend(&query, " AND warpSkyfile.magicked = 0");
     1242    }
     1243    if (destreaked) {
     1244        psStringAppend(&query, " AND warpSkyfile.magicked != 0");
     1245    }
    12171246
    12181247    // treat limit == 0 as "no limit"
  • branches/eam_branches/20090715/ippTools/src/warptoolConfig.c

    r25400 r25744  
    215215    psMetadataAddStr(warpedArgs, PS_LIST_TAIL, "-exp_name", 0,          "search by exposure tag", 0);
    216216    psMetadataAddS64(warpedArgs, PS_LIST_TAIL, "-fake_id", 0,           "search by phase 3 version of exposure tag", 0);
     217    psMetadataAddTime(warpedArgs, PS_LIST_TAIL, "-dateobs_begin", 0,    "search for exposures by time (>=)", NULL);
     218    psMetadataAddTime(warpedArgs, PS_LIST_TAIL, "-dateobs_end", 0,      "search for exposures by time (<=)", NULL);
     219    psMetadataAddStr(warpedArgs, PS_LIST_TAIL,  "-filter", 0,           "search for exposures by filter", NULL);
     220    psMetadataAddBool(warpedArgs, PS_LIST_TAIL, "-destreaked",  0,      "search for destreaked images", false);
     221    psMetadataAddBool(warpedArgs, PS_LIST_TAIL, "-not_destreaked",  0,  "search for images that have not been destreaked", false);
     222    psMetadataAddS64(warpedArgs, PS_LIST_TAIL,  "-magicked", 0,         "search by magicked value", 0);
     223    psMetadataAddS16(warpedArgs, PS_LIST_TAIL,  "-fault",  0,           "search by fault code", 0);
     224    psMetadataAddStr(warpedArgs, PS_LIST_TAIL,  "-label",  PS_META_DUPLICATE_OK, "search by warpRun label", NULL);
     225
     226    psMetadataAddBool(warpedArgs, PS_LIST_TAIL, "-all",  0,             "search without arguments", false);
    217227    psMetadataAddU64(warpedArgs, PS_LIST_TAIL, "-limit",  0,            "limit result set to N items", 0);
    218228    psMetadataAddBool(warpedArgs, PS_LIST_TAIL, "-simple",  0,          "use the simple output format", false);
  • branches/eam_branches/20090715/ppStack/src/ppStackLoop.c

    r23576 r25744  
    8080        return false;
    8181    }
    82     psLogMsg("ppStack", PS_LOG_INFO, "Stage 2: Generate Convolutions and Save: %f sec",
    83              psTimerClear("PPSTACK_STEPS"));
    8482    ppStackMemDump("convolve");
    85     psLogMsg("ppStack", PS_LOG_INFO, "Stage 4: Make Initial Stack: %f sec", psTimerClear("PPSTACK_STEPS"));
     83    psLogMsg("ppStack", PS_LOG_INFO, "Stage 3: Make Initial Stack: %f sec", psTimerClear("PPSTACK_STEPS"));
    8684
    8785
     
    9492        return false;
    9593    }
    96     psLogMsg("ppStack", PS_LOG_INFO, "Stage 5: Pixel Rejection: %f sec", psTimerClear("PPSTACK_STEPS"));
     94    psLogMsg("ppStack", PS_LOG_INFO, "Stage 4: Pixel Rejection: %f sec", psTimerClear("PPSTACK_STEPS"));
    9795    ppStackMemDump("reject");
    9896
     
    106104        return false;
    107105    }
    108     psLogMsg("ppStack", PS_LOG_INFO, "Stage 6: Final Stack: %f sec", psTimerClear("PPSTACK_STEPS"));
     106    psLogMsg("ppStack", PS_LOG_INFO, "Stage 5: Final Stack: %f sec", psTimerClear("PPSTACK_STEPS"));
    109107    ppStackMemDump("final");
    110108
     
    118116        return false;
    119117    }
    120     psLogMsg("ppStack", PS_LOG_INFO, "Stage 7: WCS & JPEGS: %f sec", psTimerClear("PPSTACK_STEPS"));
     118    psLogMsg("ppStack", PS_LOG_INFO, "Stage 6: WCS & JPEGS: %f sec", psTimerClear("PPSTACK_STEPS"));
    121119    ppStackMemDump("cleanup");
    122120
     
    131129        return false;
    132130    }
    133     psLogMsg("ppStack", PS_LOG_INFO, "Stage 8: Photometry Analysis: %f sec", psTimerClear("PPSTACK_STEPS"));
     131    psLogMsg("ppStack", PS_LOG_INFO, "Stage 7: Photometry Analysis: %f sec", psTimerClear("PPSTACK_STEPS"));
    134132    ppStackMemDump("photometry");
    135133
     
    142140        return false;
    143141    }
    144     psLogMsg("ppStack", PS_LOG_INFO, "Stage 9: Final output: %f sec", psTimerClear("PPSTACK_STEPS"));
     142    psLogMsg("ppStack", PS_LOG_INFO, "Stage 8: Final output: %f sec", psTimerClear("PPSTACK_STEPS"));
    145143    ppStackMemDump("finish");
    146144
  • branches/eam_branches/20090715/psconfig/tagsets/ipp-2.9.perl

    r25624 r25744  
    33  00    Module::Build                  Module-Build-0.2806.tar.gz               0.2806
    44  01    ExtUtils::MakeMaker            ExtUtils-MakeMaker-6.31.tar.gz           0
    5   02    Params::Validate               Params-Validate-0.91.tar.gz       0.77
     5  02    Params::Validate               Params-Validate-0.92.tar.gz              0.92
    66#  02    Apache::Test                   Apache-Test-1.29.tar.gz                  1.29
    77  03    DateTime::TimeZone             DateTime-TimeZone-0.59.tar.gz            0
     
    8282  78    SQL::Interp                     SQL-Interp-1.06.tar.gz
    8383  79    Log::Dispatch::Email::MailSend  Log-Dispatch-2.22.tar.gz
    84   80    Abstract::Meta::Class          Abstract-Meta-Class-0.11.tar.gz
     84  80    Abstract::Meta::Class          Abstract-Meta-Class-0.13.tar.gz
    8585  81    DBIx::Connection               DBIx-Connection-0.13.tar.gz
    8686  82    Simple::SAX::Serializer        Simple-SAX-Serializer-0.05.tar.gz
    8787  83    Test::Distribution             Test-Distribution-2.00.tar.gz
    88   84    Test::DBUnit                   Test::DBUnit-0.20.tar.gz
     88  84    Test::DBUnit                   Test-DBUnit-0.20.tar.gz                 0.20
  • branches/eam_branches/20090715/pstamp/scripts/Makefile.am

    r25406 r25744  
    1111        pstamp_parser_run.pl \
    1212        pstamp_queue_requests.pl \
     13        pstamp_request_file \
    1314        pstamp_results_file.pl \
    1415        pstamp_revert_request.pl \
  • branches/eam_branches/20090715/pstamp/scripts/pstamp_finish.pl

    r25624 r25744  
    8181    my $fileset = $req_name;
    8282
    83 
    84     # Here we invoke the assumption that the output for the request is placed in the
    85     # fileset directory directly
    86 #    my $out_dir = "$outputDataStoreRoot/$product/$fileset";
    87 
    88     # now we are assuming that the output directory is the dirname of the request file
    89     # XXX: put this in the database
    90 
    9183    print STDERR "product: $product  REQ_NAME: $req_name $out_dir\n" if $verbose;
    9284
     
    216208
    217209                    # ra_deg and dec_deg are the coordinates of center of the stamp
    218                     # XXX: parse the stamp header to find it
    219                     print $tdf "0.0|0.0|";
     210                    # XXX do this more cleanly
     211                    my (undef, $ra_deg, $dec_deg) = split " ", `echo $out_dir/$img_name | fields -x -1 RA_DEG DEC_DEG`;
     212                    $ra_deg = 0.0 if (!$ra_deg);
     213                    $dec_deg = 0.0 if (!$dec_deg);
     214                    print $tdf "$ra_deg|$dec_deg|";
    220215
    221216                    print $tdf "$exp_info|";
     
    302297
    303298    if ($rownum eq 0) {
    304         my $dummy_rowinfo = "0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|";
     299        my $dummy_rowinfo = "0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|";
    305300        return (undef, $dummy_rowinfo, "none");
    306301    }
     
    313308    my $tess_id = $row->{TESS_ID};
    314309    $tess_id = "null" if !$tess_id;
     310    my $comment = $row->{COMMENT};
     311    $comment = "null" if !$comment;
     312    my $label = $row->{LABEL};
     313    $label = "null" if !$label;
    315314
    316315    # This is ugly, error prone and hard to change.
    317316    # Create a results file module and provide a list of the names (we have the data in the columns)
    318317    my $rowinfo = "$row->{PROJECT}|$row->{JOB_TYPE}|$row->{REQ_TYPE}|$row->{IMG_TYPE}|";
    319     $rowinfo   .= "$row->{ID}|$tess_id|$component|$row->{OPTION_MASK}|$row->{MJD_MIN}|$row->{MJD_MAX}|";
     318    $rowinfo   .= "$row->{ID}|$tess_id|$component|$label|$row->{OPTION_MASK}|$row->{MJD_MIN}|$row->{MJD_MAX}|";
    320319    $rowinfo   .= "$row->{REQFILT}|$row->{COORD_MASK}|$row->{CENTER_X}|$row->{CENTER_Y}|";
    321     $rowinfo   .= "$row->{WIDTH}|$row->{HEIGHT}";
     320    $rowinfo   .= "$row->{WIDTH}|$row->{HEIGHT}|";
     321    $rowinfo   .= $comment;
    322322
    323323    return ($row, $rowinfo, $row->{PROJECT});
  • branches/eam_branches/20090715/pstamp/scripts/pstamp_job_run.pl

    r25406 r25744  
    1616use PS::IPP::PStamp::RequestFile qw( :standard );
    1717use IPC::Cmd 0.36 qw( can_run run );
     18use POSIX;
    1819
    1920use PS::IPP::Metadata::Config;
     
    9394        run(command => $command, verbose => $verbose);
    9495
    95     if ($success) {
     96    my $exitStatus;
     97    if (WIFEXITED($error_code)) {
     98        $exitStatus = WEXITSTATUS($error_code);
     99    } else {
     100        print STDERR "ppstamp failed error_code: $error_code\n";
     101        $exitStatus = $PS_EXIT_SYS_ERROR;
     102    }
     103
     104    if ($exitStatus == 0) {
    96105        my $dir = dirname($outputBase);
    97106
     
    133142        close F;
    134143        $jobStatus = $PS_EXIT_SUCCESS;
    135     } else {
    136         $jobStatus = $error_code >> 8;
    137         my_die( "ppstamp failed with error code: $jobStatus", $job_id, $jobStatus);
     144    } elsif ($exitStatus == $PSTAMP_NO_OVERLAP) {
     145        $jobStatus = $PSTAMP_NO_OVERLAP
     146    } else {
     147        my_die( "ppstamp failed with error code: $exitStatus", $job_id, $exitStatus);
    138148    }
    139149} elsif ($jobType eq "get_image") {
     
    162172{
    163173    my $command = "$pstamptool -updatejob -job_id $job_id -state stop";
     174    $command .= " -fault $jobStatus" if $jobStatus;
    164175    $command .= " -dbname $dbname" if $dbname;
    165176    $command .= " -dbserver $dbserver" if $dbserver;
  • branches/eam_branches/20090715/pstamp/scripts/pstamp_results_file.pl

    r25022 r25744  
    9090        { name => 'TESS_ID',    type => '64A', writetype => TSTRING },   
    9191        { name => 'COMPONENT',  type => '64A', writetype => TSTRING },   
     92        { name => 'LABEL',      type => '64A', writetype => TSTRING },   
    9293
    9394        # output parameters
     
    104105        { name => 'WIDTH',      type => 'D', writetype => TDOUBLE },   
    105106        { name => 'HEIGHT',     type => 'D', writetype => TDOUBLE }, 
     107        { name => 'COMMENT',    type => '64A', writetype => TSTRING },   
    106108];
    107109
  • branches/eam_branches/20090715/pstamp/scripts/pstampparse.pl

    r25624 r25744  
    1616use File::Basename qw(basename);
    1717use Carp;
    18 use POSIX qw( strftime );
     18use POSIX;
    1919
    2020my $verbose;
     
    7272}
    7373
     74# list_job is a deugging mode
    7475$no_update = 1 if $mode eq "list_job";
    7576
     
    185186    }
    186187    my $req_type = $row->{REQ_TYPE};
    187     $stage = $row->{IMG_TYPE};
    188     my $id       = $row->{ID};
     188    $stage       = $row->{IMG_TYPE};
     189    my $id      = $row->{ID};
    189190    my $component = $row->{COMPONENT};
    190 
    191     my $filter   = $row->{REQFILT};
     191    my $tess_id = $row->{TESS_ID};
     192
     193    my $filter  = $row->{REQFILT};
    192194    my $mjd_min = $row->{MJD_MIN};
    193195    my $mjd_max = $row->{MJD_MAX};
     196    my $label   = $row->{LABEL};
    194197
    195198    my $option_mask= $row->{OPTION_MASK};
     
    222225    my_die("job_type is list_uri but mode is $mode", $PS_EXIT_PROG_ERROR) if ($job_type eq "list_uri") and ($mode ne "list_uri");
    223226
    224 
    225227    my $image_db   = $proj_hash->{dbname};
    226228    my $camera     = $proj_hash->{camera};
     
    228230
    229231    # Temporary hack so that MOPS can get at non-magicked data
    230     if ($product eq "mops-pstamp-results") {
     232    if ($product and ($product eq "mops-pstamp-results")) {
    231233        $need_magic = 0;
    232234    }
     
    269271        my ($x, $y);
    270272
    271         $imageList = locate_images($ipprc, $image_db, $req_type, $stage, $id, $search_component,
    272                 $inverse, $skycenter, $x, $y, $mjd_min, $mjd_max, $filter, $verbose);
     273        $imageList = locate_images($ipprc, $image_db, $req_type, $stage, $id, $tess_id, $search_component,
     274                $inverse, $need_magic, $x, $y, $mjd_min, $mjd_max, $filter, $label, $verbose);
    273275
    274276        if (!$imageList or !@$imageList) {
     
    305307    my $num_jobs = 0;
    306308    my $rownum = $row->{ROWNUM};
     309    my $option_mask = $row->{OPTION_MASK};
    307310    my $components = $row->{components};
    308311
     
    346349        if (($stage ne "stack") and ($need_magic and !$image->{magicked})) {
    347350            # XXX: should we add a faulted job so the client can know what happened if no images come back?
     351            # This test is made in locate_images now so this code never runs. This leads to no feedback
     352            # to users, but speeds up processing significatnly
    348353            print STDERR "skipping non-magicked image $imagefile\n" if $verbose;
    349354
     
    369374        $args .= " -file $imagefile";
    370375
    371         if (($row->{OPTION_MASK} & $PSTAMP_SELECT_MASK) &&  $image->{mask} ) {
     376        if (($option_mask & $PSTAMP_SELECT_MASK) &&  $image->{mask} ) {
    372377            $args .= " -mask $image->{mask}";
    373378        }
    374         if (($row->{OPTION_MASK} & $PSTAMP_SELECT_WEIGHT) and $image->{weight} ) {
     379        if (($option_mask & $PSTAMP_SELECT_WEIGHT) and $image->{weight} ) {
    375380            $args .= " -variance $image->{weight}";
    376381        }
     
    407412        $num_jobs++;
    408413        my $command = "$pstamptool -addjob  -req_id $req_id -job_type $row->{JOB_TYPE}"
    409                         . " -outputBase $output_base -rownum $rownum -state $newState";
     414                        . " -outputBase $output_base -rownum $rownum -state $newState -options $option_mask";
    410415        $command .= " -fault $fault" if $fault;
    411416        $command .= " -exp_id $exp_id" if $exp_id;
     
    542547                    run(command => $command, verbose => $verbose);
    543548                unless ($success) {
    544                     print STDERR @$stderr_buf;
    545                     my $rc = $error_code >> 8;
    546                     my_die( "dvoImagesAtCoords failed: $rc", $PS_EXIT_UNKNOWN_ERROR);
     549                    # don't fail if the program exited normally and exit status was PSTAMP_NO_OVERLAP
     550                    # That just means that the coordinate didn't match any image/skycell
     551                    if (!WIFEXITED($error_code) || (WEXITSTATUS($error_code) ne $PSTAMP_NO_OVERLAP)) {
     552                        print STDERR @$stderr_buf;
     553                        my $rc = WIFEXITED($error_code) ? WEXITSTATUS($error_code) : $PS_EXIT_SYS_ERROR;
     554                        my_die( "dvoImagesAtCoords failed: $rc", $rc);
     555                    }
    547556                }
    548557                # now we have a list of row numbers and components
     
    659668    return 0 if ($r1->{IMG_TYPE} ne $r2->{IMG_TYPE});
    660669    return 0 if ($r1->{ID} ne $r2->{ID});
     670    return 0 if ($r1->{TESS_ID} ne $r2->{TESS_ID});
     671    return 0 if ($r1->{REQFILT} ne $r2->{REQFILT});
     672    return 0 if ($r1->{LABEL} ne $r2->{LABEL});
     673    return 0 if ($r1->{MJDMIN} ne $r2->{MJDMAX});
     674    return 0 if ($r1->{MJDMAX} ne $r2->{MJDMAX});
    661675    return 0 if ($r1->{inverse} ne $r2->{inverse});
    662676
  • branches/eam_branches/20090715/pstamp/src/Makefile.am

    r19229 r25744  
    11bin_PROGRAMS = ppstamp pstamprequest pstampdump
     2
     3include_HEADERS = \
     4        pstamp.h
    25
    36noinst_HEADERS = \
    47        ppstamp.h  \
     8        pstampint.h \
    59        pstampErrorCodes.h
    610
  • branches/eam_branches/20090715/pstamp/src/ppstamp.h

    r25406 r25744  
    66#endif
    77
    8 #include "pstamp.h"
     8#include "pstampint.h"
    99#include "ppstampOptions.h"
    1010
  • branches/eam_branches/20090715/pstamp/src/ppstampMakeStamp.c

    r25624 r25744  
    4848}
    4949
    50 static bool copyMetadata(pmFPAfile *output, pmFPAfile *input, pmChip *inChip, ppstampOptions *options)
     50static bool copyMetadata(pmFPAfile *output, pmFPAfile *input, pmChip *inChip, ppstampOptions *options, pmAstromObj *center)
    5151{
    5252    pmChip    *outChip;
     
    6161    // since some of the keywords might be duplicated we may not want to copy both
    6262
    63     // copy the fpa concepts
    64     outChip->parent->concepts = psMetadataCopy(outChip->parent->concepts, inChip->parent->concepts);
    65 
    6663    pmHDU *inHDU  = pmHDUFromChip(inChip);
    6764    pmHDU *outHDU = pmHDUGetHighest(output->fpa, outChip, NULL);
     
    7370    }
    7471
     72    // copy the fpa concepts
     73    pmConceptsCopyFPA(output->fpa, input->fpa, false, false);
     74    pmConceptsCopyChip(outChip, inChip, false);
     75    pmCell *outCell = outChip->cells->data[0]; // The only output cell
     76
     77    if (inChip->cells->n == 1) {
     78        pmConceptsCopyCell(outCell, inChip->cells->data[0]);
     79        // Need to fix up the trimsec and biassec to correspond to the output
     80        psMetadataItem *trimsec = psMetadataLookup(outCell->concepts, "CELL.TRIMSEC");
     81        psFree(trimsec->data.V);
     82        trimsec->data.V = NULL;
     83        psMetadataItem *biassec = psMetadataLookup(outCell->concepts, "CELL.BIASSEC");
     84        psFree(biassec->data.V);
     85        biassec->data.V = psListAlloc(NULL);
     86    } else {
     87        psList *inCells = psArrayToList(inChip->cells); // Input cells
     88        pmConceptsAverageCells(outCell, inCells, NULL, NULL, false);
     89        psFree(inCells);
     90    }
    7591
    7692    // If input had WCS convert it for stamp
     
    93109    }
    94110
     111    psMetadataAddF64(outHDU->header, PS_LIST_TAIL, "RA_DEG", PS_META_REPLACE, "Right Ascension of stamp center", RAD_TO_DEG(center->sky->r));
     112    psMetadataAddF64(outHDU->header, PS_LIST_TAIL, "DEC_DEG", PS_META_REPLACE, "Declination of stamp center", RAD_TO_DEG(center->sky->d));
     113
    95114    ppstampVersionMetadata(outHDU->header, options);
    96115
     
    178197
    179198static int makeStamp(pmConfig *config, ppstampOptions *options, pmFPAfile *input,
    180                 pmChip *inChip, pmFPAview *view)
     199                pmChip *inChip, pmFPAview *view, pmAstromObj *center)
    181200{
    182201    int status = false;
     
    285304
    286305    if (status) {
    287         status = copyMetadata(output, input, inChip, options);
     306        status = copyMetadata(output, input, inChip, options, center);
    288307    }
    289308    return status ? PS_EXIT_SUCCESS : PS_EXIT_UNKNOWN_ERROR;
     
    360379{
    361380    pmAstromObj *pt = pmAstromObjAlloc();
    362 
    363     if (!options->roip.celestialCenter) {
    364         // Center was specified in chip coordinates, transform to the sky and the TP
    365         chipToSky(center, fpa, chip);
    366     }
    367381
    368382    // calculate the four corners of the bounding box in sky coordinates, translate them to
     
    470484            center->chip->yErr = 0;
    471485            onChip = true;
     486            chipToSky(center, input->fpa, chip);
    472487        }
    473488    }
     
    573588        case PPSTAMP_ON:
    574589        case PPSTAMP_PARTIALLY_ON:
    575             returnval = makeStamp(config, options, input, chip, view);
     590            returnval = makeStamp(config, options, input, chip, view, center);
    576591            allDone = true;
    577592            foundOverlap = true;
  • branches/eam_branches/20090715/pstamp/src/pstamp.h

    r25624 r25744  
    11#ifndef PSTAMP_H
    22#define PSTAMP_H
    3 
    4 #include <stdio.h>
    5 #include <string.h>
    6 #include <strings.h>  // for strcasecmp
    7 #include <unistd.h>   // for unlink
    8 #include "pslib.h"
    9 #include "psmodules.h"
    10 #include "pstampErrorCodes.h"
    11 
    12 typedef enum {
    13     PSTAMP_UNKNOWN = -1,
    14     PSTAMP_RAW,
    15     PSTAMP_CHIP,
    16     PSTAMP_WARP,
    17     PSTAMP_DIFF,
    18     PSTAMP_STACK
    19 } pstampImageType;
    20 
    21 
    22 // command modes for pstampparse
    23 typedef enum {
    24     PSP_MODE_UNKNOWN = 0,
    25     PSP_MODE_QUEUE_JOB,
    26     PSP_MODE_LIST_URI,
    27     PSP_MODE_LIST_JOB
    28 } pspMode;
    293
    304// error codes returned to users in results flie
  • branches/eam_branches/20090715/pstamp/src/pstampGetROI.c

    r18243 r25744  
    33#endif
    44
    5 #include "pstamp.h"
     5#include "pstampint.h"
    66#include "pstampROI.h"
    77#include "ohana.h"
  • branches/eam_branches/20090715/pstamp/src/pstamprequest.c

    r21243 r25744  
    11#include <pslib.h>
    22#include <string.h>
    3 #include "pstamp.h"
     3#include "pstampint.h"
    44#include "pstampROI.h"
    55
  • branches/eam_branches/20090715/pstamp/test/asteroid.txt

    r25406 r25744  
    1616#
    1717
    18 
    1918# These coordinates get stamps from warp and diff images that show a moving object that mops found.
    2019
    21 # ROWNUM PROJECT       JOB_TYPE OPTION_MASK REQ_TYPE IMG_TYPE    ID      TESS_ID COMPONENT COORD_MASK CENTER_X   CENTER_Y             WIDTH HEIGHT  REQFILT MJD_MIN MJD_MAX
    22 
    23 1        gpc1           stamp     3         bydiff   warp      362483    NULL      NULL      2       284.688522833822 -3.86916140936841 200  200     null   0         0
    24 2        gpc1           stamp     3         bydiff   diff      362483    NULL      NULL      2       284.688522833822 -3.86916140936841 200  200     null   0         0
    25 3        gpc1           stamp     1027      bydiff   warp      362483    NULL      NULL      2       284.688522833822 -3.86916140936841 200  200     null   0         0
    26 4        gpc1           stamp     1027      bydiff   diff      362483    NULL      NULL      2       284.688522833822 -3.86916140936841 200  200     null   0         0
     20# ID    |     ROI Specification                   |  JOB Specification | Images of interest specification
     21# ROWNUM CENTER_X         CENTER_Y         WIDTH HEIGHT COORD_MASK JOB_TYPE OPTION_MASK PROJECT REQ_TYPE IMG_TYPE    ID   TESS_ID COMPONENTLABEL REQFILT MJD_MIN MJD_MAX | COMMENT
     22#
     231        284.688522833822 -3.86916140936841 200  200        2       stamp    3           gpc1     bydiff   warp      362483  NULL    NULL   null  null    0       0      |
     242        284.688522833822 -3.86916140936841 200  200        2       stamp    3           gpc1     bydiff   diff      362483  NULL    NULL   null  null    0       0      |
     253        284.688522833822 -3.86916140936841 200  200        2       stamp    1027        gpc1     bydiff   warp      362483  NULL    NULL   null  null    0       0      |
     264        284.688522833822 -3.86916140936841 200  200        2       stamp    1027        gpc1     bydiff   diff      362483  NULL    NULL   null  null    0       0      |
    2727
    2828
  • branches/eam_branches/20090715/pstamp/test/gpc1_sample.txt

    r25624 r25744  
    1515# subsequent lines define the rows in the table
    1616
    17 # ROWNUM PROJECT JOB_TYPE OPTION_MASK REQ_TYPE IMG_TYPE    ID      TESS_ID COMPONENT   COORD_MASK CENTER_X   CENTER_Y WIDTH HEIGHT REQFILT MJD_MIN MJD_MAX
     17## ID    |     ROI Specification                   |  JOB Specification | Images of interest specification
     18# ROWNUM CENTER_X       CENTER_Y WIDTH HEIGHT COORD_MASK JOB_TYPE OPTION_MASK PROJECT REQ_TYPE IMG_TYPE    ID   TESS_ID COMPONENT    LABEL REQFILT MJD_MIN MJD_MAX | COMMENT
    1819# warps from various epochs for one of the SN candidates. Specifiying the skycell speeds up processing
    19 1         gpc1   stamp      1        byid        warp     6245   null skycell.077 2 242.400666 55.273513 200 200 null 0 0
    20 2         gpc1   stamp      1        byid        warp     6254   null skycell.077 2 242.400666 55.273513 200 200 null 0 0
    21 3         gpc1   stamp      1        byid        warp     6264   null skycell.077 2 242.400666 55.273513 200 200 null 0 0
    22 4         gpc1   stamp      1        byid        warp     6317   null skycell.077 2 242.400666 55.273513 200 200 null 0 0
    23 5         gpc1   stamp      1        byid        warp     6324   null skycell.077 2 242.400666 55.273513 200 200 null 0 0
    24 6         gpc1   stamp      1        byid        warp     6465   null skycell.077 2 242.400666 55.273513 200 200 null 0 0
    25 7         gpc1   stamp      1        byid        warp     6466   null skycell.077 2 242.400666 55.273513 200 200 null 0 0
    26 
     201        242.400666     55.273513 200   200     2          stamp    1          gpc1   byid      warp     6245   null    skycell.077   null null     0        0     |
     212        242.400666     55.273513 200   200     2          stamp    1          gpc1   byid      warp     6254   null    skycell.077   null null     0        0     |
     223        242.400666     55.273513 200   200     2          stamp    1          gpc1   byid      warp     6264   null    skycell.077   null null     0        0     |
     234        242.400666     55.273513 200   200     2          stamp    1          gpc1   byid      warp     6317   null    skycell.077   null null     0        0     |
     245        242.400666     55.273513 200   200     2          stamp    1          gpc1   byid      warp     6324   null    skycell.077   null null     0        0     |
     256        242.400666     55.273513 200   200     2          stamp    1          gpc1   byid      warp     6465   null    skycell.077   null null     0        0     |
     267        242.400666     55.273513 200   200     2          stamp    1          gpc1   byid      warp     6466   null    skycell.077   null null     0        0     |
    2727
    2828# get a specific warp
    29 10        gpc1   stamp      1        byid         warp     6316  null skycell.077 2 242.400666 55.273513 200 200 null 0 0
     2910        242.400666     55.273513 200   200     2          stamp    1         gpc1   byid      warp     6316   null     skycell.077   null null     0        0     |
    3030
    3131# get stamps from all warps for exposure (only destreaked ones will succeed)
    32 11        gpc1   stamp      1        byexp        warp    o4973g0123o null skycell.077 2 242.400666 55.273513 200 200 null 0 0
     3211        242.400666     55.273513 200   200     2          stamp    1         gpc1   byexp     warp  o4973g0123o   null skycell.077   null null     0        0     |
    3333
    3434# get stamps from all chipRuns for exposure (only destreaked ones will succeed)
    3535# add the mask and weight images as well
    36 12        gpc1   stamp      7        byexp      chip    o4973g0123o null null  2 242.400666 55.273513 200 200 null 0 0
     3612        242.400666     55.273513 200   200     2          stamp    7         gpc1   byexp  chip  o4973g0123o   null    skycell.077   null null     0        0     |
    3737
    3838# get the corresponding diff
    39 13        gpc1   stamp      1        byexp      diff    o4973g0123o null null 2 242.400666 55.273513 200 200 null 0 0
     3913        242.400666     55.273513 200   200     2          stamp    1        gpc1   byexp   diff  o4973g0123o   null    null         null null     0        0     |
    4040
    41 # get the stack that was the templae for that stack
    42 14        gpc1   stamp      1        byid     stack    14031  null null 2 242.400666 55.273513 200 200 null 0 0
    43 #
     41# get the stack that was the template for that stack
     4214        242.400666     55.273513 200   200     2          stamp    1         gpc1   byid    stack      14031   null     null        null null     0        0     |
     43
    4444# get the same stamp by go through the diff
    45 15        gpc1   stamp      1        bydiff     stack    193939 null null 2 242.400666 55.273513 200 200 null 0 0
    46 
     4515        242.400666     55.273513 200   200     2          stamp    1         gpc1   bydiff   stack    193939   null     null        null null     0        0     |
  • branches/eam_branches/20090715/pstamp/test/pstamp_req_create

    r25022 r25744  
    11#!/usr/bin/env perl
     2
     3print STDERR "This script is obsolete. See ../scripts/pstamp_request_file\n";
     4exit 1;
    25
    36# create a Postage Stamp Request file from a textual description
  • branches/eam_branches/20090715/pswarp/src/pswarpDefine.c

    r21323 r25744  
    6565        int numCols = psMetadataLookupS32(NULL, hdu->header, "NAXIS1"); ///< Number of columns
    6666        int numRows = psMetadataLookupS32(NULL, hdu->header, "NAXIS2"); ///< Number of rows
     67        if ((numCols == 0) || (numRows == 0)) {
     68            psError(PS_ERR_UNKNOWN, false, "skycell has invalid dimensions %d x %d", numCols, numRows);
     69            psFree(view);
     70            return false;
     71        }
    6772
    6873        pmCell *target = pmFPAviewThisCell(view, output->fpa); ///< Target cell
  • branches/eam_branches/20090715/pswarp/src/pswarpLoop.c

    r25624 r25744  
    397397        }
    398398
     399        pmModelClassSetLimits(PM_MODEL_LIMITS_STRICT);
     400
    399401        // measure the PSF using these sources
    400402        if (!psphotReadoutFindPSF(config, view, sources)) {
Note: See TracChangeset for help on using the changeset viewer.