IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39095 for trunk/tools


Ignore:
Timestamp:
Nov 10, 2015, 8:54:57 AM (11 years ago)
Author:
bills
Message:

changes intended to make the program work with real gpc1 data

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/bills/comparep2detections

    r39002 r39095  
    77use Pod::Usage qw( pod2usage );
    88use File::Basename;
     9use PS::IPP::Config 1.01 qw( :standard );
    910
    1011
     
    1314my $out;
    1415
    15 my $testdata;
     16my ($check, $testdata, $sasdata, $release);
    1617
    1718my ($verbose, $save_temps);
     
    1920GetOptions(
    2021    "testdata=s"        =>  \$testdata,
     22#    "sasdata=s"         =>  \$sasdata,
     23    "release=s"         =>  \$release,
    2124    "join=s"            =>  \$joinType,
     25    "check"             =>  \$check,
    2226    "verbose|v"         =>  \$verbose,
    2327    "save-temps"        =>  \$save_temps,
     
    2832$in = shift;
    2933$out = shift;
     34
     35die "need one of --testdata or --release\n"
     36    unless defined $testdata or defined $release;
     37
     38
    3039
    3140my $jardir = $ENV{JARDIR};
     
    4958# XXX TODO: check for success
    5059chomp $imageID;
    51 my $exp_id = $imageID / 100;
     60my $exp_id = int($imageID / 100);
    5261print "exp_id is $exp_id\n" if $verbose;
    5362
     
    5665#    my $testdata = "/data/ippc19.0/home/bills/ipp/ippToPsps/test/testdata";
    5766    $smf = sprintf "%s/test.%02d.smf", $testdata, $exp_id;
     67#} elsif ($sasdata) {
     68    # this attempted hack did not work
     69#    die "only exp_id 1 works right now for sasdata\n" unless $exp_id eq 1;
     70#
     71#    $smf = sprintf "%s/o5748g0363o.358745.cm.1218981.smf", $sasdata;
    5872} else {
    5973    # XXX: look up the smf for the exposure here
    60     die "only test mode works right now\n";
     74    # die "only test mode works right now\n";
     75    my $cmd = "releasetool -listrelexp -release_name $release -exp_id $exp_id | grep path_base | awk '{print \$3}'";
     76    print "$cmd\n" if $verbose;
     77    my $path_base = `$cmd`;
     78    chomp $path_base;
     79    die "failed to find path_base for $exp_id\n" unless $path_base;
     80    $smf = "$path_base.smf";
     81    print "$smf for $exp_id is $smf\n";
    6182}
    6283
    6384my $ippcat = "cat." . basename($smf);
     85
     86if ($smf =~ /^neb:/) {
     87    my $ipprc = PS::IPP::Config->new();
     88    my $resolved = $ipprc->file_resolve($smf);
     89    die "failed to resolve $smf\n" unless $resolved;
     90    $smf = $resolved;
     91}
    6492
    6593$command = "concatsmf $smf $ippcat";
     
    76104}
    77105
    78 runcommand("adddeltacolumns $matched $out");
     106$command = "adddeltacolumns $matched $out";
     107$command .= " --check" if $check;
     108
     109runcommand($command);
    79110
    80111exit 0;
Note: See TracChangeset for help on using the changeset viewer.