IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 6, 2008, 2:03:10 PM (18 years ago)
Author:
Paul Price
Message:

Adding dtime_script calculation. Updating the database tables.

File:
1 edited

Legend:

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

    r19560 r19932  
    1111print "Starting script $0 on $host\n\n";
    1212
     13use DateTime;
     14my $mjd_start = DateTime->now->mjd;   # MJD of starting script
     15
    1316use vars qw( $VERSION );
    1417$VERSION = '0.01';
     
    2831     $no_update, $no_op, $redirect );
    2932GetOptions(
    30     'exp_id=s'          => \$exp_id,    # Exposure identifier
    31     'chip_id=s'         => \$chip_id,   # Chiptool identifier
    32     'class_id=s'        => \$class_id,  # Class identifier
    33     'uri|u=s'           => \$uri,       # Input FITS file
    34     'camera|c=s'        => \$camera,    # Camera
    35     'outroot|w=s'       => \$outroot,   # output file base name
    36     'dbname|d=s'        => \$dbname,    # Database name
    37     'reduction=s'       => \$reduction, # Reduction class
     33    '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
    3841    'run-state=s'       => \$run_state, # current state of the run (new, update)
    39     'threads=s'         => \$threads,   # Number of threads to use for ppImage
    40     'verbose'           => \$verbose,   # Print to stdout
    41     '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?
    4346    'redirect-output'   => \$redirect,
    4447    ) or pod2usage( 2 );
     
    7376# values to extract from output metadata and the stats to calculate
    7477# XXX commented-out entries are not yet defined in the output files
    75 # XXX EAM : we are removing the astrometry analysis from chip, so we
    76 # do not bother to calculate those stats.
    7778my $STATS =
    7879   [
     
    8687       { name => "FRINGE_RESID_0", type => "rms",   flag => "-fringe_1",       dtype => "float" },
    8788       { 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" },
    9089       { name => "APMIFIT",        type => "mean",  flag => "-ap_resid",       dtype => "float" },
    9190       { 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" },
    9491       { name => "FWHM_X",         type => "mean",  flag => "-fwhm_major",     dtype => "float" },
    9592       { name => "FWHM_Y",         type => "mean",  flag => "-fwhm_minor",     dtype => "float" },
    9693       { name => "DT_DET",         type => "sum",   flag => "-dtime_detrend",  dtype => "float" },
    9794       { 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" },
    9996       { name => "NSTARS",         type => "sum",   flag => "-n_stars",        dtype => "int"   },
    10097#      { name => "?",              type => "sum",   flag => "-n_extended",     dtype => "int"   },
    10198#      { name => "?",              type => "sum",   flag => "-n_cr",           dtype => "int"   },
    102 #      { name => "NASTRO",         type => "sum",   flag => "-n_astrom",       dtype => "int"   },
    10399   ];
    104100my $stats = PS::IPP::Metadata::Stats->new($STATS); # Stats parser
     
    149145
    150146    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;
    155151        $command .= " -dumpconfig $configuration";
    156         $command .= " -tracedest $traceDest -log $logDest";
     152        $command .= " -tracedest $traceDest -log $logDest";
    157153        $do_stats = 1;
    158154    } 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";
    165161    }
    166162    if ($do_stats) {
    167         $command .= " -recipe PPSTATS CHIPSTATS";
    168         $command .= " -stats $outputStats";
     163        $command .= " -recipe PPSTATS CHIPSTATS";
     164        $command .= " -stats $outputStats";
    169165    }
    170166
     
    241237    $command .= " -dbname $dbname" if defined $dbname;
    242238    $command .= $stats->cmdflags();
     239    $command .= (" -dtime_script " . (($mjd_start - DateTime->now->mjd) * 86400));
    243240} else {
    244241    $command = "$chiptool -tofullimfile";
     
    279276            $command .= " -path_base $outroot";
    280277            $command .= " -hostname $host" if defined $host;
     278            $command .= (" -dtime_script " . (($mjd_start - DateTime->now->mjd) * 86400));
    281279        } else {
    282280            $command .= "$chiptool -updateprocessedimfile";
Note: See TracChangeset for help on using the changeset viewer.