Changeset 19932
- Timestamp:
- Oct 6, 2008, 2:03:10 PM (18 years ago)
- Location:
- trunk/ippScripts/scripts
- Files:
-
- 6 edited
-
camera_exp.pl (modified) (3 diffs)
-
chip_imfile.pl (modified) (7 diffs)
-
diff_skycell.pl (modified) (3 diffs)
-
fake_imfile.pl (modified) (13 diffs)
-
stack_skycell.pl (modified) (3 diffs)
-
warp_skycell.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/camera_exp.pl
r19665 r19932 10 10 print "\n\n"; 11 11 print "Starting script $0 on $host\n\n"; 12 13 use DateTime; 14 my $mjd_start = DateTime->now->mjd; # MJD of starting script 12 15 13 16 use vars qw( $VERSION ); … … 353 356 $fpaCommand .= $camStats->cmdflags(); 354 357 $fpaCommand .= " -hostname $host" if defined $host; 358 $fpaCommand .= (" -dtime_script " . (($mjd_start - DateTime->now->mjd) * 86400)); 355 359 } else { 356 360 $fpaCommand .= " -updaterun -state full"; … … 387 391 $command .= " -path_base $outroot"; 388 392 $command .= " -path_base $outroot" if defined $outroot; 393 $command .= (" -dtime_script " . (($mjd_start - DateTime->now->mjd) * 86400)); 389 394 } else { 390 395 $command .= " -updateprocessedexp"; -
trunk/ippScripts/scripts/chip_imfile.pl
r19560 r19932 11 11 print "Starting script $0 on $host\n\n"; 12 12 13 use DateTime; 14 my $mjd_start = DateTime->now->mjd; # MJD of starting script 15 13 16 use vars qw( $VERSION ); 14 17 $VERSION = '0.01'; … … 28 31 $no_update, $no_op, $redirect ); 29 32 GetOptions( 30 'exp_id=s' => \$exp_id, # Exposure identifier31 'chip_id=s' => \$chip_id, # Chiptool identifier32 'class_id=s' => \$class_id, # Class identifier33 'uri|u=s' => \$uri, # Input FITS file34 'camera|c=s' => \$camera, # Camera35 'outroot|w=s' => \$outroot, # output file base name36 'dbname|d=s' => \$dbname, # Database name37 'reduction=s' => \$reduction, # Reduction class33 'exp_id=s' => \$exp_id, # Exposure identifier 34 'chip_id=s' => \$chip_id, # Chiptool identifier 35 'class_id=s' => \$class_id, # Class identifier 36 'uri|u=s' => \$uri, # Input FITS file 37 'camera|c=s' => \$camera, # Camera 38 'outroot|w=s' => \$outroot, # output file base name 39 'dbname|d=s' => \$dbname, # Database name 40 'reduction=s' => \$reduction, # Reduction class 38 41 'run-state=s' => \$run_state, # current state of the run (new, update) 39 'threads=s' => \$threads, # Number of threads to use for ppImage40 'verbose' => \$verbose, # Print to stdout41 'no-update' => \$no_update, # Don't update the database?42 'no-op' => \$no_op, # Don't do any operations?42 'threads=s' => \$threads, # Number of threads to use for ppImage 43 'verbose' => \$verbose, # Print to stdout 44 'no-update' => \$no_update, # Don't update the database? 45 'no-op' => \$no_op, # Don't do any operations? 43 46 'redirect-output' => \$redirect, 44 47 ) or pod2usage( 2 ); … … 73 76 # values to extract from output metadata and the stats to calculate 74 77 # XXX commented-out entries are not yet defined in the output files 75 # XXX EAM : we are removing the astrometry analysis from chip, so we76 # do not bother to calculate those stats.77 78 my $STATS = 78 79 [ … … 86 87 { name => "FRINGE_RESID_0", type => "rms", flag => "-fringe_1", dtype => "float" }, 87 88 { name => "FRINGE_ERR_0", type => "rms", flag => "-fringe_2", dtype => "float" }, 88 # { name => "CERROR", type => "rms", flag => "-sigma_ra", dtype => "float" },89 # { name => "CERROR", type => "rms", flag => "-sigma_dec", dtype => "float" },90 89 { name => "APMIFIT", type => "mean", flag => "-ap_resid", dtype => "float" }, 91 90 { name => "DAPMIFIT", type => "rms", flag => "-ap_resid_stdev", dtype => "float" }, 92 # { name => "ZP??", type => "mean", flag => "-zp_mean", dtype => "float" },93 # { name => "ZP??", type => "rms", flag => "-zp_stdev", dtype => "float" },94 91 { name => "FWHM_X", type => "mean", flag => "-fwhm_major", dtype => "float" }, 95 92 { name => "FWHM_Y", type => "mean", flag => "-fwhm_minor", dtype => "float" }, 96 93 { name => "DT_DET", type => "sum", flag => "-dtime_detrend", dtype => "float" }, 97 94 { name => "DT_PHOT", type => "sum", flag => "-dtime_photom", dtype => "float" }, 98 # { name => "DT_ASTR", type => "sum", flag => "-dtime_astrom",dtype => "float" },95 { name => "DT_TOTAL", type => "sum", flag => "-dtime_total", dtype => "float" }, 99 96 { name => "NSTARS", type => "sum", flag => "-n_stars", dtype => "int" }, 100 97 # { name => "?", type => "sum", flag => "-n_extended", dtype => "int" }, 101 98 # { name => "?", type => "sum", flag => "-n_cr", dtype => "int" }, 102 # { name => "NASTRO", type => "sum", flag => "-n_astrom", dtype => "int" },103 99 ]; 104 100 my $stats = PS::IPP::Metadata::Stats->new($STATS); # Stats parser … … 149 145 150 146 if ($run_state eq "new") { 151 $command = "$ppImage -file $uri $outroot";152 $command .= " -recipe PPIMAGE $recipe";153 $command .= " -threads $threads" if defined $threads;154 $command .= " -dbname $dbname" if defined $dbname;147 $command = "$ppImage -file $uri $outroot"; 148 $command .= " -recipe PPIMAGE $recipe"; 149 $command .= " -threads $threads" if defined $threads; 150 $command .= " -dbname $dbname" if defined $dbname; 155 151 $command .= " -dumpconfig $configuration"; 156 $command .= " -tracedest $traceDest -log $logDest";152 $command .= " -tracedest $traceDest -log $logDest"; 157 153 $do_stats = 1; 158 154 } else { 159 $command = "$ppImage -file $uri $outroot";160 $command .= " -ipprc $configuration";161 $command .= " -threads $threads" if defined $threads;162 $command .= " -dbname $dbname" if defined $dbname;163 $command .= " -tracedest $traceDest -log $logDest";164 $command .= " -Db PPIMAGE:PHOTOM FALSE";155 $command = "$ppImage -file $uri $outroot"; 156 $command .= " -ipprc $configuration"; 157 $command .= " -threads $threads" if defined $threads; 158 $command .= " -dbname $dbname" if defined $dbname; 159 $command .= " -tracedest $traceDest -log $logDest"; 160 $command .= " -Db PPIMAGE:PHOTOM FALSE"; 165 161 } 166 162 if ($do_stats) { 167 $command .= " -recipe PPSTATS CHIPSTATS";168 $command .= " -stats $outputStats";163 $command .= " -recipe PPSTATS CHIPSTATS"; 164 $command .= " -stats $outputStats"; 169 165 } 170 166 … … 241 237 $command .= " -dbname $dbname" if defined $dbname; 242 238 $command .= $stats->cmdflags(); 239 $command .= (" -dtime_script " . (($mjd_start - DateTime->now->mjd) * 86400)); 243 240 } else { 244 241 $command = "$chiptool -tofullimfile"; … … 279 276 $command .= " -path_base $outroot"; 280 277 $command .= " -hostname $host" if defined $host; 278 $command .= (" -dtime_script " . (($mjd_start - DateTime->now->mjd) * 86400)); 281 279 } else { 282 280 $command .= "$chiptool -updateprocessedimfile"; -
trunk/ippScripts/scripts/diff_skycell.pl
r19638 r19932 9 9 print "\n\n"; 10 10 print "Starting script $0 on $host\n\n"; 11 12 use DateTime; 13 my $mjd_start = DateTime->now->mjd; # MJD of starting script 11 14 12 15 use vars qw( $VERSION ); … … 241 244 my $command = "$difftool -adddiffskyfile -diff_id $diff_id -uri $outputName -path_base $outroot"; 242 245 $command .= $stats->cmdflags(); 246 $command .= (" -dtime_script " . (($mjd_start - DateTime->now->mjd) * 86400)); 243 247 $command .= " -hostname $host" if defined $host; 244 248 $command .= " -dbname $dbname" if defined $dbname; … … 263 267 if (defined $diff_id and not $no_update) { 264 268 my $command = "$difftool -adddiffskyfile -diff_id $diff_id -code $exit_code"; 269 $command .= (" -dtime_script " . (($mjd_start - DateTime->now->mjd) * 86400)); 265 270 $command .= " -hostname $host" if defined $host; 266 271 $command .= " -dbname $dbname" if defined $dbname; -
trunk/ippScripts/scripts/fake_imfile.pl
r18562 r19932 2 2 3 3 ## this script is run on every imfile to perform the fake source 4 ## analysis and the forced photometry analysis. 4 ## analysis and the forced photometry analysis. 5 5 6 6 ## For the fake source analysis, we load the image, inject a number of … … 12 12 13 13 ## For the forced photometry, we need to use the measured astrometry 14 ## to select the desired locations in pixel coord. 14 ## to select the desired locations in pixel coord. 15 15 16 16 # XXX : seeing needs to be determined from the input PSF (not currently done in ppSim) … … 27 27 print "Starting script $0 on $host\n\n"; 28 28 29 use DateTime; 30 my $mjd_start = DateTime->now->mjd; # MJD of starting script 31 29 32 use vars qw( $VERSION ); 30 33 $VERSION = '0.01'; … … 41 44 42 45 # Parse the command-line arguments 43 my ( $exp_id, $fake_id, $class_id, $chiproot, $camroot, $camera, $outroot, 46 my ( $exp_id, $fake_id, $class_id, $chiproot, $camroot, $camera, $outroot, 44 47 $dbname, $reduction, $verbose, $no_update, $no_op, $redirect ); 45 48 GetOptions( 46 'exp_id=s' => \$exp_id, # Exposure identifier47 'fake_id=s' => \$fake_id, # Chiptool identifier48 'class_id=s' => \$class_id, # Class identifier49 'chiproot=s' => \$chiproot, # Input Chip files (root)50 'camroot=s' => \$camroot, # Input Camera files (root)51 'camera|c=s' => \$camera,# Camera52 'outroot|w=s' => \$outroot, # output file base name53 'dbname|d=s' => \$dbname, # Database name54 'reduction=s' => \$reduction, # Reduction class55 'verbose' => \$verbose, # Print to stdout56 'no-update' => \$no_update, # Don't update the database?57 'no-op' => \$no_op,# Don't do any operations?49 'exp_id=s' => \$exp_id, # Exposure identifier 50 'fake_id=s' => \$fake_id, # Chiptool identifier 51 'class_id=s' => \$class_id, # Class identifier 52 'chiproot=s' => \$chiproot, # Input Chip files (root) 53 'camroot=s' => \$camroot, # Input Camera files (root) 54 'camera|c=s' => \$camera, # Camera 55 'outroot|w=s' => \$outroot, # output file base name 56 'dbname|d=s' => \$dbname, # Database name 57 'reduction=s' => \$reduction, # Reduction class 58 'verbose' => \$verbose, # Print to stdout 59 'no-update' => \$no_update, # Don't update the database? 60 'no-op' => \$no_op, # Don't do any operations? 58 61 'redirect-output' => \$redirect, 59 62 ) or pod2usage( 2 ); … … 61 64 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 62 65 pod2usage( -msg => "Required options: --exp_id --fake_id --class_id --chiproot --camroot --camera --outroot", 63 -exitval => 3) unless66 -exitval => 3) unless 64 67 defined $exp_id and 65 68 defined $fake_id and … … 104 107 } 105 108 106 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files109 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files 107 110 108 111 # outroot examples (HOST components must be set) … … 120 123 my $chipPSF = $ipprc->filename("PSPHOT.PSF.SAVE", $chiproot, $class_id) or &my_die("Missing entry from camera config", $exp_id, $fake_id, $class_id, $PS_EXIT_CONFIG_ERROR); 121 124 my $cameraObjects = $ipprc->filename("PSASTRO.OUTPUT", $camroot) or &my_die("Missing entry from camera config", $exp_id, $fake_id, $class_id, $PS_EXIT_CONFIG_ERROR); 122 my $traceDest = $ipprc->filename("TRACE.IMFILE", $outroot, $class_id) or &my_die("Missing entry from camera config", $exp_id, $fake_id, $class_id, $PS_EXIT_CONFIG_ERROR);125 my $traceDest = $ipprc->filename("TRACE.IMFILE", $outroot, $class_id) or &my_die("Missing entry from camera config", $exp_id, $fake_id, $class_id, $PS_EXIT_CONFIG_ERROR); 123 126 124 127 # XXX check for existence of input data … … 128 131 my $command = "$ppConfigDump -camera $camera -dump-recipe PPSIM -recipe PPSIM $recipe -"; 129 132 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 130 run(command => $command, verbose => $verbose);133 run(command => $command, verbose => $verbose); 131 134 unless ($success) { 132 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);133 &my_die("Unable to perform ppConfigDump: $error_code", $exp_id, $fake_id, $class_id, $PS_EXIT_SYS_ERROR);135 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 136 &my_die("Unable to perform ppConfigDump: $error_code", $exp_id, $fake_id, $class_id, $PS_EXIT_SYS_ERROR); 134 137 } 135 138 my $recipeData = $mdcParser->parse(join "", @$stdout_buf) or 136 &my_die("Unable to parse metadata config doc", $exp_id, $fake_id, $class_id, $PS_EXIT_SYS_ERROR);139 &my_die("Unable to parse metadata config doc", $exp_id, $fake_id, $class_id, $PS_EXIT_SYS_ERROR); 137 140 138 141 ## allow the output images to be optional, depending on the recipe / reduction class … … 156 159 157 160 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 158 run(command => $command, verbose => $verbose);161 run(command => $command, verbose => $verbose); 159 162 unless ($success) { 160 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);161 &my_die("Unable to perform ppSim: $error_code", $exp_id, $fake_id, $class_id, $error_code);163 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 164 &my_die("Unable to perform ppSim: $error_code", $exp_id, $fake_id, $class_id, $error_code); 162 165 } 163 166 … … 167 170 # XXX use this to parse the output metadata : eg, detection limits, Nfakes, Nforced 168 171 # Get the statistics on the processed image 169 # my $statsFile; # File handle172 # my $statsFile; # File handle 170 173 # open $statsFile, $ipprc->file_resolve($outputStats) or &my_die("Can't open statistics file $outputStats: $!", $exp_id, $fake_id, $class_id, $PS_EXIT_SYS_ERROR); 171 174 # my @contents = <$statsFile>; # Contents of file 172 175 # close $statsFile; 173 # 176 # 174 177 # # parse the statistics MDC file 175 # my $mdcParser = PS::IPP::Metadata::Config->new(); # Parser for metadata config files178 # my $mdcParser = PS::IPP::Metadata::Config->new(); # Parser for metadata config files 176 179 # my $metadata = $mdcParser->parse(join "", @contents); 177 180 # unless ($metadata) { 178 # &my_die("Unable to parse metadata config doc", $exp_id, $fake_id, $class_id, $PS_EXIT_PROG_ERROR);181 # &my_die("Unable to parse metadata config doc", $exp_id, $fake_id, $class_id, $PS_EXIT_PROG_ERROR); 179 182 # } 180 # 183 # 181 184 # # extract the stats from the metadata 182 185 # unless ($stats->parse($metadata)) { 183 # &my_die("Failure extracting metadata from the statistics output file.\n", $exp_id, $fake_id, $class_id, $PS_EXIT_PROG_ERROR);186 # &my_die("Failure extracting metadata from the statistics output file.\n", $exp_id, $fake_id, $class_id, $PS_EXIT_PROG_ERROR); 184 187 # } 185 188 } else { … … 194 197 $command .= " -path_base $outroot"; 195 198 $command .= " -dbname $dbname" if defined $dbname; 199 $command .= (" -dtime_script " . (($mjd_start - DateTime->now->mjd) * 86400)); 196 200 # XXX add this after defined 197 201 # $command .= $stats->cmdflags(); … … 200 204 unless ($no_update) { 201 205 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 202 run(command => $command, verbose => $verbose);206 run(command => $command, verbose => $verbose); 203 207 unless ($success) { 204 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);205 warn("Unable to perform faketool -addprocessedimfile: $error_code\n");206 exit($error_code);208 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 209 warn("Unable to perform faketool -addprocessedimfile: $error_code\n"); 210 exit($error_code); 207 211 } 208 212 } else { … … 220 224 carp($msg); 221 225 if (defined $exp_id and defined $fake_id and defined $class_id and not $no_update) { 222 my $command = "$faketool -addprocessedimfile"; 223 $command .= " -fake_id $fake_id"; 224 $command .= " -exp_id $exp_id"; 225 $command .= " -class_id $class_id"; 226 $command .= " -path_base $outroot"; 227 $command .= " -code $exit_code"; 228 $command .= " -dbname $dbname" if defined $dbname; 226 my $command = "$faketool -addprocessedimfile"; 227 $command .= " -fake_id $fake_id"; 228 $command .= " -exp_id $exp_id"; 229 $command .= " -class_id $class_id"; 230 $command .= " -path_base $outroot"; 231 $command .= (" -dtime_script " . (($mjd_start - DateTime->now->mjd) * 86400)); 232 $command .= " -code $exit_code"; 233 $command .= " -dbname $dbname" if defined $dbname; 229 234 system ($command); 230 235 } -
trunk/ippScripts/scripts/stack_skycell.pl
r19689 r19932 10 10 print "\n\n"; 11 11 print "Starting script $0 on $host\n\n"; 12 13 use DateTime; 14 my $mjd_start = DateTime->now->mjd; # MJD of starting script 12 15 13 16 use vars qw( $VERSION ); … … 264 267 $command .= " -uri $outputName -path_base $outroot"; 265 268 $command .= " -hostname $host" if defined $host; 269 $command .= (" -dtime_script " . (($mjd_start - DateTime->now->mjd) * 86400)); 266 270 } else { 267 271 $mode = "-updaterun -state full"; … … 294 298 $command .= " -addsumskyfile"; 295 299 $command .= " -hostname $host" if defined $host; 300 $command .= (" -dtime_script " . (($mjd_start - DateTime->now->mjd) * 86400)); 296 301 } else { 297 302 $command .= " -updatesumskyfile"; -
trunk/ippScripts/scripts/warp_skycell.pl
r19561 r19932 9 9 print "\n\n"; 10 10 print "Starting script $0 on $host\n\n"; 11 12 use DateTime; 13 my $mjd_start = DateTime->now->mjd; # MJD of starting script 11 14 12 15 use vars qw( $VERSION ); … … 252 255 $command .= " -ignore" if not $accept; # Completed succesfully, but can't produce product 253 256 $command .= " -uri $outputImage" if $accept; 257 $command .= (" -dtime_script " . (($mjd_start - DateTime->now->mjd) * 86400)); 254 258 $command .= $stats->cmdflags() if $accept; 255 259 $command .= " -hostname $host" if defined $host; … … 305 309 $command .= " -warp_id $warp_id"; 306 310 $command .= " -skycell_id $skycell_id"; 311 $command .= (" -dtime_script " . (($mjd_start - DateTime->now->mjd) * 86400)); 307 312 $command .= " -code $exit_code"; 308 313 $command .= " -dbname $dbname" if defined $dbname;
Note:
See TracChangeset
for help on using the changeset viewer.
