IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 29, 2015, 11:03:02 AM (11 years ago)
Author:
bills
Message:

various cleanup primarily removing hard coded refereces to bill's environment and test locations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/bills/comparep2detections

    r38860 r39002  
    1212my $in;
    1313my $out;
    14 my $ofmt;
    15 my $stiltsJar = '/home/panstarrs/bills/jars/stilts.jar';
    16 my $stilts = "java -jar $stiltsJar";
    1714
    18 my $test = 1;
     15my $testdata;
    1916
    2017my ($verbose, $save_temps);
    2118
    2219GetOptions(
    23     "test"              =>  \$test,
    24     "ofmt=s"            =>  \$ofmt,
     20    "testdata=s"        =>  \$testdata,
    2521    "join=s"            =>  \$joinType,
    2622    "verbose|v"         =>  \$verbose,
     
    2824) or pod2usage( 2 );
    2925
    30 die "usage: $0 [--ofmt <ofmt>] <p2 batch file> [<out>]\n" unless (scalar @ARGV == 1) or (scalar @ARGV == 2);
     26die "usage: $0 <p2 batch file> [<out>]\n" unless (scalar @ARGV == 2);
    3127
    3228$in = shift;
    3329$out = shift;
    3430
     31my $jardir = $ENV{JARDIR};
     32unless ($jardir) {
     33    $jardir = '/home/panstarrs/bills/jars' unless $jardir;
     34    print STDERR "JARDIR envrionment variable not found. Using $jardir\n" if $verbose;
     35    # add it to the enviorment so that the other programs can use it
     36    $ENV{JARDIR} = $jardir;
     37}
     38my $stiltsJar = "$jardir/stilts.jar";
     39my $stilts = "java -jar $stiltsJar";
     40
     41# file name for concatenated detection extensions
    3542my $detcat = "cat." . basename($in);
    3643
    3744runcommand( "concatp2batch $in $detcat");
    3845
    39 # find exp_id. XXX: we could use batch name for this or require user to find this
     46# find exp_id. XXX: I think that we could use file batch name for this or require user to supply it as an argument
    4047my $command = "$stilts tcat in=$detcat icmd='head 1;keepcols imageID;' ofmt=ascii | grep -v '#'";
    4148my $imageID = `$command`;
     
    4653
    4754my $smf;
    48 if ($test) {
    49     # XXX: make an option
    50     my $testdata = "/data/ippc19.0/home/bills/ipp/ippToPsps/test/testdata";
     55if ($testdata) {
     56#    my $testdata = "/data/ippc19.0/home/bills/ipp/ippToPsps/test/testdata";
    5157    $smf = sprintf "%s/test.%02d.smf", $testdata, $exp_id;
    5258} else {
     
    5864
    5965$command = "concatsmf $smf $ippcat";
    60 $command .= " --test" if $test;
     66$command .= " --test" if $testdata;
    6167
    6268runcommand($command);
Note: See TracChangeset for help on using the changeset viewer.