IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9097


Ignore:
Timestamp:
Oct 2, 2006, 12:16:03 PM (20 years ago)
Author:
Paul Price
Message:

Changing 'exp id' to 'exp tag' throughout, following corresponding change in database.

Location:
trunk/ippScripts/scripts
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/detrend_norm_calc.pl

    r9093 r9097  
    6161my %matrix; # Matrix of statistics as a function of exposures and classes
    6262foreach my $file (@$files) {
    63     my $expId = $file->{'exp_id'}; # Exposure ID
     63    my $expTag = $file->{'exp_tag'}; # Exposure ID
    6464    my $classId = $file->{'class_id'}; # Class ID
    6565    my $stat = $file->{STATISTIC()}; # Statistic of interest
    6666
    6767    # Create matrix elements
    68     $matrix{$expId} = {} if not defined $matrix{$expId};
    69     $matrix{$expId}->{$classId} = $stat;
     68    $matrix{$expTag} = {} if not defined $matrix{$expId};
     69    $matrix{$expTag}->{$classId} = $stat;
    7070}
    7171
    7272# Generate the input for ppNormCalc
    7373my $normData;                   # Normalisation data
    74 foreach my $expId (keys %matrix) {
    75     $normData .= "$expId\tMETADATA\n";
    76     foreach my $classId (keys %{$matrix{$expId}}) {
    77         $normData .= "\t" . $classId . "\tF32\t" . $matrix{$expId}->{$classId} . "\n";
     74foreach my $expTag (keys %matrix) {
     75    $normData .= "$expTag\tMETADATA\n";
     76    foreach my $classId (keys %{$matrix{$expTag}}) {
     77        $normData .= "\t" . $classId . "\tF32\t" . $matrix{$expTag}->{$classId} . "\n";
    7878    }
    7979    $normData .= "END\n\n";
  • trunk/ippScripts/scripts/detrend_process_imfile.pl

    r9092 r9097  
    1414use Pod::Usage qw( pod2usage );
    1515
    16 my ($det_id, $exp_id, $class, $class_id, $det_type, $input_uri, $output_uri, $no_update);
     16my ($det_id, $exp_tag, $class, $class_id, $det_type, $input_uri, $output_uri, $no_update);
    1717GetOptions(
    1818    'det_id|d=s'        => \$det_id,
    19     'exp_id|e=s'        => \$exp_id,
     19    'exp_tag|e=s'        => \$exp_tag,
    2020    'class=s'           => \$class,     # unused
    2121    'class_id|i=s'      => \$class_id,
     
    2727pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    2828pod2usage(
    29     -msg => "Required options: --det_id --exp_id --class_id --det_type --input_uri",
     29    -msg => "Required options: --det_id --exp_tag --class_id --det_type --input_uri",
    3030    -exitval => 3,
    3131) unless defined $det_id
    32     and defined $exp_id
     32    and defined $exp_tag
    3333    and defined $class_id
    3434    and defined $det_type
     
    5555
    5656### Output file name --- must match camera configuration!
    57 my $outputRoot =  $exp_id . '.detproc.' . $det_id;
     57my $outputRoot =  $exp_tag . '.detproc.' . $det_id;
    5858my $outputName = $outputRoot . '.' . $class_id ;
    5959my $outputImage = $outputName . '.fits';
     
    8787# Add the processed file to the database
    8888unless ($no_update) {
    89     my $command = "$dettool -addprocessed -det_id $det_id -exp_id $exp_id " .
     89    my $command = "$dettool -addprocessed -det_id $det_id -exp_tag $exp_tag " .
    9090        "-class_id $class_id -recip $recipe -uri $outputImage"; # Command to run dettool
    9191    $command .= " -bg " . $stats->bg_mean();
     
    100100    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    101101        run(command => $command, verbose => 1);
    102     die "Unable to perform dettool -addprocessed for $det_id/$exp_id/$class_id: $error_code\n"
     102    die "Unable to perform dettool -addprocessed for $det_id/$exp_tag/$class_id: $error_code\n"
    103103        if not $success;
    104104}
  • trunk/ippScripts/scripts/detrend_reject_exp.pl

    r9091 r9097  
    7373}
    7474
    75 my @expIds;                     # Array of exposure IDs
     75my @expTags;                    # Array of exposure IDs
    7676my @means;                      # Array of means
    7777my @stdevs;                     # Array of stdevs
    7878my @meanStdevs;                 # Array of mean stdevs
    7979foreach my $exposure (@$exposures) {
    80     die "Unable to find exposure id.\n" if not defined $exposure->{exp_id};
     80    die "Unable to find exposure id.\n" if not defined $exposure->{exp_tag};
    8181    die "Unable to find mean.\n" if not defined $exposure->{bg};
    8282    die "Unable to find stdev.\n" if not defined $exposure->{bg_stdev};
    8383    die "Unable to find mean stdev.\n" if not defined $exposure->{bg_mean_stdev};
    84     push @expIds, $exposure->{exp_id};
     84    push @expTags, $exposure->{exp_tag};
    8585    push @means, $exposure->{bg};
    8686    push @stdevs, $exposure->{bg_stdev};
     
    105105my $numRejected = 0;            # Number of exposures rejected
    106106for (my $i = 0; $i < scalar @means; $i++) {
    107     my $expId = $expIds[$i];    # Exposure ID
    108     my $command = "$dettool -updateresidexp -det_id $det_id -iteration $iter -exp_id $expId"; # Command to run
     107    my $expTag = $expTags[$i];  # Exposure ID
     108    my $command = "$dettool -updateresidexp -det_id $det_id -iteration $iter -exp_tag $expTag"; # Command to run
    109109    my $reject = 0;             # Reject this exposure?
    110110    if (defined REJECT_MEAN->{$det_type} and
     
    112112        $meanStats->standard_deviation() > 0 and
    113113        ($means[$i] - $meanStats->mean()) / $meanStats->standard_deviation() > REJECT_MEAN->{$det_type}) {
    114         print "Rejecting $expId based on bad mean: " .
     114        print "Rejecting $expTag based on bad mean: " .
    115115            (($means[$i] - $meanStats->mean()) / $meanStats->standard_deviation()) .
    116116            " vs " . REJECT_MEAN->{$det_type} . "\n";
     
    121121             ($stdevs[$i] - $stdevStats->mean()) / $stdevStats->standard_deviation() >
    122122             REJECT_STDEV->{$det_type}) {
    123         print "Rejecting $expId based on bad stdev: " .
     123        print "Rejecting $expTag based on bad stdev: " .
    124124            (($stdevs[$i] - $stdevStats->mean()) / $stdevStats->standard_deviation()) .
    125125            " vs " . REJECT_STDEV->{$det_type} . "\n";
     
    130130             ($meanStdevs[$i] - $meanStdevStats->mean()) / $meanStdevStats->standard_deviation() >
    131131             REJECT_MEAN_STDEV->{$det_type}) {
    132         print "Rejecting $expId based on bad stdev: " .
     132        print "Rejecting $expTag based on bad stdev: " .
    133133            (($meanStdevs[$i] - $meanStdevStats->mean()) / $meanStdevStats->standard_deviation()) .
    134134            " vs " . REJECT_MEAN_STDEV->{$det_type} . "\n";
  • trunk/ippScripts/scripts/detrend_reject_imfile.pl

    r9091 r9097  
    1515use Pod::Usage qw( pod2usage );
    1616
    17 my ($det_id, $iter, $exp_id, $det_type, $no_update);
     17my ($det_id, $iter, $exp_tag, $det_type, $no_update);
    1818GetOptions(
    1919    'det_id|d=s'        => \$det_id,
    2020    'iteration=s'       => \$iter,
    21     'exp_id|e=s'        => \$exp_id,
     21    'exp_tag|e=s'        => \$exp_tag,
    2222    'det_type|t=s'      => \$det_type,
    2323    'no-update'         => \$no_update
     
    2626pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    2727pod2usage(
    28     -msg => "Required options: --det_id --iteration --exp_id --det_type",
     28    -msg => "Required options: --det_id --iteration --exp_tag --det_type",
    2929    -exitval => 3,
    3030) unless defined $det_id
    3131    and defined $iter
    32     and defined $exp_id
     32    and defined $exp_tag
    3333    and defined $det_type;
    3434
     
    8787my $files;                      # Array of component files
    8888{
    89     my $command = "$dettool -residimfile -det_id $det_id -iteration $iter -exp_id $exp_id"; # Command to run
     89    my $command = "$dettool -residimfile -det_id $det_id -iteration $iter -exp_tag $exp_tag"; # Command to run
    9090    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    9191        run(command => $command, verbose => 1);
     
    9797
    9898# Generate the file list, and get the statistics
    99 my $outputRoot = $exp_id . '.detresid.' . $det_id . '.' . $iter; # Root output name
     99my $outputRoot = $exp_tag . '.detresid.' . $det_id . '.' . $iter; # Root output name
    100100my $list1Name = $outputRoot . '.b1.list'; # Name for the input file list for binning 1
    101101my $list2Name = $outputRoot . '.b2.list'; # Name for the input file list for binning 2
     
    195195# Add the result into the database
    196196unless ($no_update) {
    197     my $command = "$dettool -addresidexp -det_id $det_id -iteration $iter -exp_id $exp_id " .
     197    my $command = "$dettool -addresidexp -det_id $det_id -iteration $iter -exp_tag $exp_tag " .
    198198        "-recip " . RECIPE1() . "," . RECIPE2() . " -b1_uri $jpeg1Name -b2_uri $jpeg2Name " .
    199199        "-bg $mean -bg_stdev $stdev -bg_mean_stdev $meanStdev"; # Command to run
  • trunk/ippScripts/scripts/detrend_resid.pl

    r9095 r9097  
    1515use Pod::Usage qw( pod2usage );
    1616
    17 my ($det_id, $iter, $exp_id, $class_id, $det_type, $detrend,
     17my ($det_id, $iter, $exp_tag, $class_id, $det_type, $detrend,
    1818        $input_uri, $no_update);
    1919GetOptions(
    2020    'det_id|d=s'        => \$det_id,
    2121    'iteration=s'       => \$iter,
    22     'exp_id|e=s'        => \$exp_id,
     22    'exp_tag|e=s'        => \$exp_tag,
    2323    'class_id|i=s'      => \$class_id,
    2424    'det_type|t=s'      => \$det_type,
     
    3030pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    3131pod2usage(
    32     -msg => "Required options: --det_id --iteration --exp_id --class_id --det_type --detrend --input_uri",
     32    -msg => "Required options: --det_id --iteration --exp_tag --class_id --det_type --detrend --input_uri",
    3333    -exitval => 3,
    3434) unless defined $det_id
    3535    and defined $iter
    36     and defined $exp_id
     36    and defined $exp_tag
    3737    and defined $class_id
    3838    and defined $det_type
     
    7171
    7272### Output file names --- must match camera configuration!
    73 my $outputRoot = $exp_id . '.detresid.' . $det_id . '.' . $iter; # Root name
     73my $outputRoot = $exp_tag . '.detresid.' . $det_id . '.' . $iter; # Root name
    7474my $outputName = $outputRoot . '.' . $class_id . '.fits'; # Name for
    7575my $outputStats = $outputRoot . '.' . $class_id . '.stats';
     
    106106# Add the processed file to the database
    107107unless ($no_update) {
    108     my $command = "$dettool -addresidimfile -det_id $det_id -iteration $iter -exp_id $exp_id " .
     108    my $command = "$dettool -addresidimfile -det_id $det_id -iteration $iter -exp_tag $exp_tag " .
    109109        "-class_id $class_id -recip $recipe -uri $outputName -b1_uri $bin1Name " .
    110110        "-b2_uri $bin2Name"; # Command to run dettool
     
    120120    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    121121        run(command => $command, verbose => 1);
    122     die "Unable to perform dettool -addprocessed for $det_id/$exp_id/$class_id: $error_code\n"
     122    die "Unable to perform dettool -addprocessed for $det_id/$exp_tag/$class_id: $error_code\n"
    123123        if not $success;
    124124}
  • trunk/ippScripts/scripts/phase0exp.pl

    r9091 r9097  
    1212use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
    1313
    14 my ($expid, $no_update);
     14my ($exptag, $no_update);
    1515
    1616GetOptions(
    17     'exp_id|e=s'    => \$expid,
     17    'exp_tag|e=s'    => \$exptag,
    1818    'no-update'     => \$no_update
    1919) or pod2usage( 2 );
     
    2121pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    2222pod2usage(
    23     -msg => "Required options: --exp_id",
     23    -msg => "Required options: --exp_tag",
    2424    -exitval => 3,
    25 ) unless defined $expid;
     25) unless defined $exptag;
    2626
    2727# Define setup
     
    7373my $imfiles;
    7474{
    75     my $command = "$p0tool -rawimfile -exp_id $expid";
     75    my $command = "$p0tool -rawimfile -exp_tag $exptag";
    7676    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    7777        run(command => $command, verbose => 1);
    78     die "Unable to perform p0tool on exposure id $expid: $error_code\n" if not $success;
     78    die "Unable to perform p0tool on exposure id $exptag: $error_code\n" if not $success;
    7979    my $metadata = $mdcParser->parse(join "", @$stdout_buf)
    8080            or die "unable to parse metadata config doc";
     
    117117# Output results to the database
    118118unless ($no_update) {
    119     my $command = "$p0tool -updateexp -exp_id $expid"; # Command to execute to update exposure parameters
     119    my $command = "$p0tool -updateexp -exp_tag $exptag"; # Command to execute to update exposure parameters
    120120   
    121121    # Add the values of interest
     
    157157    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    158158        run(command => $command, verbose => 1);
    159     die "Unable to run phase0 update for $expid: $error_code\n" if not $success;
     159    die "Unable to run phase0 update for $exptag: $error_code\n" if not $success;
    160160}
    161161
  • trunk/ippScripts/scripts/phase0imfile.pl

    r9091 r9097  
    1515use Pod::Usage qw( pod2usage );
    1616
    17 my ($exp_id, $class_id, $uri, $no_update);
     17my ($exp_tag, $class_id, $uri, $no_update);
    1818
    1919GetOptions(
    20     'exp_id|e=s'    => \$exp_id,
     20    'exp_tag|e=s'    => \$exp_tag,
    2121    'class_id|i=s'  => \$class_id,
    2222    'uri|u=s'       => \$uri,
     
    2626pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    2727pod2usage(
    28     -msg => "Required options: --exp_id --class_id --uri",
     28    -msg => "Required options: --exp_tag --class_id --uri",
    2929    -exitval => 3,
    30 ) unless defined $exp_id
     30) unless defined $exp_tag
    3131    and defined $class_id
    3232    and defined $uri;
     
    6060# Switches for p0tool
    6161use constant P0TOOL_MODE => '-updateimfile'; # Mode for p0tool
    62 use constant P0TOOL_EXPID => '-exp_id'; # Switch to specify the exposure id
     62use constant P0TOOL_EXPTAG => '-exp_tag'; # Switch to specify the exposure id
    6363use constant P0TOOL_CLASSID => '-class_id'; # Switch to specify the class id
    6464use constant P0TOOL_BG_MEAN => '-bg'; # Switch to add the background
     
    7878    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    7979        run(command => $command, verbose => 1);
    80     die "Unable to perform ppStats on exposure id $exp_id: $error_code\n" if not $success;
     80    die "Unable to perform ppStats on exposure id $exp_tag: $error_code\n" if not $success;
    8181   
    8282    # Parse the output
     
    9292# Push the results into the database
    9393unless ($no_update) {
    94     my $command = $p0tool . " " . P0TOOL_MODE() . " " . P0TOOL_EXPID() . " " . $exp_id . " " .
     94    my $command = $p0tool . " " . P0TOOL_MODE() . " " . P0TOOL_EXPTAG() . " " . $exp_tag . " " .
    9595        P0TOOL_CLASSID() . " " . $class_id; # Command to run p0tool
    9696   
  • trunk/ippScripts/scripts/phase2.pl

    r8716 r9097  
    1818        "Usage: $0 EXP_ID CLASS_ID INPUT.fits OUTPUT_ROOT\n\n";
    1919}
    20 my $expId = shift @ARGV;        # Exposure ID
     20my $expTag = shift @ARGV;       # Exposure ID
    2121my $classId = shift @ARGV;      # Class ID
    2222my $input = shift @ARGV;        # Input FITS file
     
    6565    # Command to run dettool
    6666    my $command = "$p2tool -processed";
    67     $command .= " -exp_id $expId";
     67    $command .= " -exp_tag $expTag";
    6868    $command .= " -class_id $classId";
    6969    $command .= " -recip " . RECIPE;
     
    7777    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    7878        run(command => $command, verbose => 1);
    79     die "Unable to perform p2tool -processed for $expId/$classId: $error_code\n"
     79    die "Unable to perform p2tool -processed for $expTag/$classId: $error_code\n"
    8080        if not $success;
    8181}
Note: See TracChangeset for help on using the changeset viewer.