IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 25, 2010, 3:05:00 PM (16 years ago)
Author:
eugene
Message:

more work on the staticsky interactions

File:
1 edited

Legend:

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

    r28092 r28096  
    2121use PS::IPP::Metadata::List qw( parse_md_list );
    2222use Data::Dumper;
     23use File::Temp qw( tempfile );
     24use File::Basename;
    2325use PS::IPP::Config 1.01 qw( :standard );
    2426
     
    3638}
    3739
    38 my ($sky_id, $dbname, $threads, $outroot, $reduction, $inverse, $run_state, $verbose, $no_update, $no_op, $redirect, $save_temps);
     40my ($sky_id, $camera, $dbname, $threads, $outroot, $reduction, $inverse, $run_state, $verbose, $no_update, $no_op, $redirect, $save_temps);
    3941GetOptions(
    4042    'sky_id=s'          => \$sky_id, # Diff identifier
     43    'camera|c=s'        => \$camera, # Camera name
    4144    'dbname|d=s'        => \$dbname, # Database name
    4245    'threads=s'         => \$threads,   # Number of threads to use
     
    5356pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    5457pod2usage(
    55     -msg => "Required options: --sky_id --outroot",
     58    -msg => "Required options: --sky_id --outroot --camera (--run_state)",
    5659    -exitval => 3,
    5760          ) unless
    5861    defined $sky_id and
    59     defined $outroot;
    60 
    61 my $ipprc = PS::IPP::Config->new() or my_die( "Unable to set up", $sky_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration
    62 
    63 # XXX camera is not known here; cannot use filerules...
    64 # my $logDest = $ipprc->filename("LOG.EXP", $outroot);
    65 my $logDest = "$outroot.log";
    66 $logDest .= ".update" if $run_state eq "update";
     62    defined $outroot and
     63    defined $camera;
     64#   and defined $run_state;
     65
     66my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $sky_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration
     67
     68my $logDest = $ipprc->filename("LOG.EXP", $outroot);
     69# $logDest .= ".update" if $run_state eq "update";
    6770$ipprc->redirect_output($logDest) or my_die( "Unable to redirect output", $sky_id, $PS_EXIT_SYS_ERROR ) if $redirect;
    6871
    69 my $source_id = $ipprc->source_id($dbname, $PS_TABLE_ID_DIFF);
     72# my $source_id = $ipprc->source_id($dbname, $PS_TABLE_ID_STATICSKY);
    7073
    7174my $outbase = basename($outroot);
     
    9194}
    9295
    93 # XXX do we NEED to define the camera?
    94 # &my_die("Unable to identify camera", $sky_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless defined $camera;
    95 # $ipprc->define_camera($camera);
    96 
    9796# generate the input
    9897print $listFile "INPUT   MULTI\n";
     98my $nInputs = @$files;
    9999
    100100foreach my $file (@$files) {
     
    103103    # XXX if we take the input from 'warp', we will need to make different selections here
    104104    my $path_base = $file->{path_base};
     105    print "input: $path_base\n";
     106
    105107    my $imageCnv  = $ipprc->filename("PPSTACK.OUTPUT",          $path_base ); # Image name
    106108    my $maskCnv   = $ipprc->filename("PPSTACK.OUTPUT.MASK",     $path_base ); # Mask name
     
    235237        # if ($run_state eq 'new') {
    236238        $command .= " -addresult -path_base $outroot";
     239        $command .= " -num_inputs $nInputs";
    237240        $command .= " $cmdflags";
    238241        $command .= (" -dtime_script " . ((DateTime->now->mjd - $mjd_start) * 86400));
Note: See TracChangeset for help on using the changeset viewer.