- Timestamp:
- Nov 12, 2015, 2:56:26 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/tools/bills/comparep2detections (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/bills/comparep2detections
r39095 r39116 8 8 use File::Basename; 9 9 use PS::IPP::Config 1.01 qw( :standard ); 10 11 10 12 11 my $joinType = '1and2'; … … 20 19 GetOptions( 21 20 "testdata=s" => \$testdata, 22 #"sasdata=s" => \$sasdata,21 "sasdata=s" => \$sasdata, 23 22 "release=s" => \$release, 24 23 "join=s" => \$joinType, … … 34 33 35 34 die "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; 38 36 39 37 … … 48 46 my $stilts = "java -jar $stiltsJar"; 49 47 48 my $command; 49 50 # find exp_id and exp_name. 51 $command = "$stilts tcat in=$in'#'FrameMeta icmd='keepcols \"frameID frameName\";' ofmt=ascii | grep -v '#'"; 52 my $line = `$command`; 53 chomp $line; 54 my ($exp_id, $exp_name) = split " ", $line; 55 56 print "$exp_id $exp_name\n" if $verbose; 57 50 58 # file name for concatenated detection extensions 51 59 my $detcat = "cat." . basename($in); … … 53 61 runcommand( "concatp2batch $in $detcat"); 54 62 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 '#'";63 if (0) { 64 $command = "$stilts tcat in=$detcat icmd='head 1;keepcols imageID;' ofmt=ascii | grep -v '#'"; 57 65 my $imageID = `$command`; 58 66 # XXX TODO: check for success … … 60 68 my $exp_id = int($imageID / 100); 61 69 print "exp_id is $exp_id\n" if $verbose; 70 } 62 71 63 72 my $smf; … … 65 74 # my $testdata = "/data/ippc19.0/home/bills/ipp/ippToPsps/test/testdata"; 66 75 $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; 72 85 } else { 73 86 # XXX: look up the smf for the exposure here … … 79 92 die "failed to find path_base for $exp_id\n" unless $path_base; 80 93 $smf = "$path_base.smf"; 81 print "$smf for $exp_id is $smf\n";82 94 } 95 print "$smf for $exp_id is $smf\n" if $verbose; 83 96 84 97 my $ippcat = "cat." . basename($smf); 85 98 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 93 99 $command = "concatsmf $smf $ippcat"; 94 100 $command .= " --test" if $testdata; 101 $command .= " --exp_id $exp_id" if $sasdata; 95 102 96 103 runcommand($command); … … 106 113 $command = "adddeltacolumns $matched $out"; 107 114 $command .= " --check" if $check; 115 $command .= " --save-temps" if $save_temps; 108 116 109 117 runcommand($command);
Note:
See TracChangeset
for help on using the changeset viewer.
