Changeset 14115 for trunk/ippScripts/scripts/register_exp.pl
- Timestamp:
- Jul 10, 2007, 3:18:44 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/register_exp.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/register_exp.pl
r14080 r14115 59 59 [ 60 60 # PPSTATS KEYWORD STATISTIC CHIPTOOL FLAG 61 { name => "exp_name", type => "constant", flag => "-exp_name" }, # File level62 { name => "telescope", type => "constant", flag => "-telescope" }, # File level63 { name => "camera", type => "constant", flag => "-inst" }, # File level64 { name => "filelevel", type => "constant", flag => "-filelevel" }, # File level65 { name => "object", type => "constant", flag => "-object" },66 { name => "exp_type", type => "constant", flag => "-exp_type" }, # File level67 { name => "filter", type => "constant", flag => "-filter" }, # File level68 { name => "dateobs", type => "constant", flag => "-dateobs" }, # File level69 { name => "ccd_temp", type => "mean", flag => "-ccd_temp"}, # CCD temperature70 { name => "exp_time", type => "mean", flag => "-exp_time"}, # Exposure time71 { name => "sat_pixel_frac", type => "mean", flag => "-sat_pixel_frac"}, # Fraction of saturated pixels72 { name => "airmass", type => "mean", flag => "-airmass"}, # Airmass73 { name => "ra", type => "mean", flag => "-ra"}, # Right ascension74 { name => "decl", type => "mean", flag => "-decl"}, # Declination75 { name => "posang", type => "mean", flag => "-posang"}, # Position angle76 { name => "alt", type => "mean", flag => "-alt"}, # Altitude77 { name => "az", type => "mean", flag => "-az"}, # Azimuth78 { name => "bg", type => "mean", flag => "-bg" }, # Azimuth79 { name => "bg", type => "stdev", flag => "-bg_mean_stdev"}, # Azimuth80 { name => "bg_stdev", type => "rms", flag => "-bg_stdev"}, # Azimuth61 { name => "exp_name", type => "constant", flag => "-exp_name", dtype => "string" }, # File level 62 { name => "telescope", type => "constant", flag => "-telescope", dtype => "string" }, # File level 63 { name => "camera", type => "constant", flag => "-inst", dtype => "string" }, # File level 64 { name => "filelevel", type => "constant", flag => "-filelevel", dtype => "string" }, # File level 65 { name => "object", type => "constant", flag => "-object", dtype => "string" }, 66 { name => "exp_type", type => "constant", flag => "-exp_type", dtype => "string" }, # File level 67 { name => "filter", type => "constant", flag => "-filter", dtype => "string" }, # File level 68 { name => "dateobs", type => "constant", flag => "-dateobs", dtype => "string" }, # File level 69 { name => "ccd_temp", type => "mean", flag => "-ccd_temp", dtype => "float" }, # CCD temperature 70 { name => "exp_time", type => "mean", flag => "-exp_time", dtype => "float" }, # Exposure time 71 { name => "sat_pixel_frac", type => "mean", flag => "-sat_pixel_frac", dtype => "float" }, # Fraction of saturated pixels 72 { name => "airmass", type => "mean", flag => "-airmass", dtype => "float" }, # Airmass 73 { name => "ra", type => "mean", flag => "-ra", dtype => "float" }, # Right ascension 74 { name => "decl", type => "mean", flag => "-decl", dtype => "float" }, # Declination 75 { name => "posang", type => "mean", flag => "-posang", dtype => "float" }, # Position angle 76 { name => "alt", type => "mean", flag => "-alt", dtype => "float" }, # Altitude 77 { name => "az", type => "mean", flag => "-az", dtype => "float" }, # Azimuth 78 { name => "bg", type => "mean", flag => "-bg", dtype => "float" }, # background 79 { name => "bg", type => "stdev", flag => "-bg_mean_stdev", dtype => "float" }, # Azimuth 80 { name => "bg_stdev", type => "rms", flag => "-bg_stdev", dtype => "float" }, # Azimuth 81 81 ]; 82 my $stats = PS::IPP::Metadata::Stats->new($STATS); # Stats parser 82 83 83 84 # Look for commands we need … … 117 118 118 119 # extract the stats from the metadata 119 my $stats = PS::IPP::Metadata::Stats->new($STATS); # Stats parser120 120 unless ($stats->parse($metadata)) { 121 121 &my_die ("Unable to find all values", $exp_id, $PS_EXIT_CONFIG_ERROR); … … 124 124 125 125 # we require at a minimum: -telescope, -inst, -filelevel, -class_id, -exp_type 126 if (uc( &STATS_value_for_flag ($STATS, "-telescope")) eq "NAN") { &my_die ("telescope not found", $exp_id, $PS_EXIT_CONFIG_ERROR); }127 if (uc( &STATS_value_for_flag ($STATS, "-inst")) eq "NAN") { &my_die ("inst not found", $exp_id, $PS_EXIT_CONFIG_ERROR); }128 if (uc( &STATS_value_for_flag ($STATS, "-filelevel")) eq "NAN") { &my_die ("filelevel not found", $exp_id, $PS_EXIT_CONFIG_ERROR); }129 if (uc( &STATS_value_for_flag ($STATS, "-exp_type")) eq "NAN") { &my_die ("exp_type not found", $exp_id, $PS_EXIT_CONFIG_ERROR); }130 if (uc( &STATS_value_for_flag ($STATS, "-exp_name")) eq "NAN") { &my_die ("exp_name not found", $exp_id, $PS_EXIT_CONFIG_ERROR); }126 if (uc($stats->value_for_flag ("-telescope")) eq "NULL") { &my_die ("telescope not found", $exp_id, $PS_EXIT_CONFIG_ERROR); } 127 if (uc($stats->value_for_flag ("-inst")) eq "NULL") { &my_die ("inst not found", $exp_id, $PS_EXIT_CONFIG_ERROR); } 128 if (uc($stats->value_for_flag ("-filelevel")) eq "NULL") { &my_die ("filelevel not found", $exp_id, $PS_EXIT_CONFIG_ERROR); } 129 if (uc($stats->value_for_flag ("-exp_type")) eq "NULL") { &my_die ("exp_type not found", $exp_id, $PS_EXIT_CONFIG_ERROR); } 130 if (uc($stats->value_for_flag ("-exp_name")) eq "NULL") { &my_die ("exp_name not found", $exp_id, $PS_EXIT_CONFIG_ERROR); } 131 131 132 132 my $command = "$regtool -addprocessedexp"; … … 134 134 $command .= " -exp_tag $exp_tag"; 135 135 $command .= " -dbname $dbname" if defined $dbname; 136 $command .= $stats->cmdflags(); 136 137 137 # add in the elements from the selected stats above 138 foreach my $entry (@$STATS) { 139 my $value = $entry->{value}; 140 my $flag = $entry->{flag}; 141 $command .= " $flag '$value'"; 142 } 143 144 my $exp_type = &STATS_value_for_flag ($STATS, "-exp_type"); 138 my $exp_type = $stats->value_for_flag ("-exp_type"); 145 139 146 140 # Add the detrend flag, if needed … … 196 190 } 197 191 198 sub STATS_value_for_flag199 {200 my $STATS = shift;201 my $flag = shift;202 203 foreach my $entry (@$STATS) {204 if ($flag eq $entry->{flag}) {205 return $entry->{value};206 }207 }208 return 'NAN';209 }210 211 192 END { 212 193 my $exit = $?;
Note:
See TracChangeset
for help on using the changeset viewer.
