IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39116 for trunk


Ignore:
Timestamp:
Nov 12, 2015, 2:56:26 PM (11 years ago)
Author:
bills
Message:

handle sas test runs where the frameIDs are different than the gpc1 values.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/bills/comparep2detections

    r39095 r39116  
    88use File::Basename;
    99use PS::IPP::Config 1.01 qw( :standard );
    10 
    1110
    1211my $joinType = '1and2';
     
    2019GetOptions(
    2120    "testdata=s"        =>  \$testdata,
    22 #    "sasdata=s"         =>  \$sasdata,
     21    "sasdata=s"         =>  \$sasdata,
    2322    "release=s"         =>  \$release,
    2423    "join=s"            =>  \$joinType,
     
    3433
    3534die "need one of --testdata or --release\n"
    36     unless defined $testdata or defined $release;
    37 
     35    unless defined $testdata or defined $release or defined $sasdata;
    3836
    3937
     
    4846my $stilts = "java -jar $stiltsJar";
    4947
     48my $command;
     49
     50# find exp_id and exp_name.
     51$command = "$stilts tcat in=$in'#'FrameMeta icmd='keepcols \"frameID frameName\";' ofmt=ascii | grep -v '#'";
     52my $line = `$command`;
     53chomp $line;
     54my ($exp_id, $exp_name) = split " ", $line;
     55
     56print "$exp_id $exp_name\n" if $verbose;
     57
    5058# file name for concatenated detection extensions
    5159my $detcat = "cat." . basename($in);
     
    5361runcommand( "concatp2batch $in $detcat");
    5462
    55 # find exp_id. XXX: I think that we could use file batch name for this or require user to supply it as an argument
    56 my $command = "$stilts tcat in=$detcat icmd='head 1;keepcols imageID;' ofmt=ascii | grep -v '#'";
     63if (0) {
     64$command = "$stilts tcat in=$detcat icmd='head 1;keepcols imageID;' ofmt=ascii | grep -v '#'";
    5765my $imageID = `$command`;
    5866# XXX TODO: check for success
     
    6068my $exp_id = int($imageID / 100);
    6169print "exp_id is $exp_id\n" if $verbose;
     70}
    6271
    6372my $smf;
     
    6574#    my $testdata = "/data/ippc19.0/home/bills/ipp/ippToPsps/test/testdata";
    6675    $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;
     76} elsif ($sasdata) {
     77    # go find the smf for this exposure in the sasdata directory
     78    my $pattern = "$sasdata/$exp_name*.smf";
     79    my @smfs = glob($pattern);
     80
     81    # there should only be one of these
     82    $smf = $smfs[0];
     83
     84    die "failed to find smf for $exp_name in sasdata\n" unless $smf;
    7285} else {
    7386    # XXX: look up the smf for the exposure here
     
    7992    die "failed to find path_base for $exp_id\n" unless $path_base;
    8093    $smf = "$path_base.smf";
    81     print "$smf for $exp_id is $smf\n";
    8294}
     95print "$smf for $exp_id is $smf\n" if $verbose;
    8396
    8497my $ippcat = "cat." . basename($smf);
    8598
    86 if ($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 }
    92 
    9399$command = "concatsmf $smf $ippcat";
    94100$command .= " --test" if $testdata;
     101$command .= " --exp_id $exp_id" if $sasdata;
    95102
    96103runcommand($command);
     
    106113$command = "adddeltacolumns $matched $out";
    107114$command .= " --check" if $check;
     115$command .= " --save-temps" if $save_temps;
    108116
    109117runcommand($command);
Note: See TracChangeset for help on using the changeset viewer.