IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 28096


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

more work on the staticsky interactions

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/dbconfig/changes.txt

    r28090 r28096  
    17001700      dtime_script FLOAT,              -- elapsed time for script
    17011701      sources INT,                     -- number of sources
     1702      num_inputs INT,                  -- number inputs used
    17021703      hostname VARCHAR(64) NOT NULL,   -- host that executed script
    17031704      good_frac FLOAT,                 -- good fraction of skycell
  • trunk/dbconfig/staticsky.md

    r28090 r28096  
    2121staticskyResult METADATA
    2222    sky_id             S64    0       # Primary Key fkey(sky_id) ref staticskyRun(sky_id)
    23     stack_id           S64    0       # Primary Key fkey(stack_id) ref stackSumSkyfile(stack_id)
    2423    path_base          STR    255
    2524    dtime_phot         F32    0.0
    2625    dtime_script       F32    0.0
    2726    sources            S32    0
     27    num_inputs         S32    0
    2828    hostname           STR    64
    2929    good_frac          F32    0.0     # Key
  • 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));
  • trunk/ippTools/share/pxadmin_create_tables.sql

    r28091 r28096  
    16501650      dtime_script FLOAT,              -- elapsed time for script
    16511651      sources INT,                     -- number of sources
     1652      num_inputs INT,                  -- number of input images
    16521653      hostname VARCHAR(64) NOT NULL,   -- host that executed script
    16531654      good_frac FLOAT,                 -- good fraction of skycell
  • trunk/ippTools/share/staticskytool_inputs.sql

    r28091 r28096  
    11SELECT
    22  staticskyRun.*,
     3  staticskyInput.stack_id,
    34  stackSumSkyfile.path_base
    45FROM staticskyRun
  • trunk/ippTools/src/staticskytool.c

    r28091 r28096  
    511511    // required
    512512    PXOPT_LOOKUP_S64(sky_id, config->args, "-sky_id", true, false);
    513     PXOPT_LOOKUP_S64(stack_id, config->args, "-stack_id", true, false);
    514513
    515514    // optional
     
    520519    PXOPT_LOOKUP_STR(hostname, config->args, "-hostname", false, false);
    521520    PXOPT_LOOKUP_F32(good_frac, config->args, "-good_frac", false, false);
     521    PXOPT_LOOKUP_S32(num_inputs, config->args, "-num_inputs", false, false);
    522522
    523523    // default values
     
    533533    if (!staticskyResultInsert(config->dbh,
    534534                               sky_id,
    535                                stack_id,
    536535                               path_base,
    537536                               dtime_phot,
    538537                               dtime_script,
    539538                               sources,
     539                               num_inputs,
    540540                               hostname,
    541541                               good_frac,
  • trunk/ippTools/src/staticskytoolConfig.c

    r28091 r28096  
    9090    psMetadata *addresultArgs = psMetadataAlloc();
    9191    psMetadataAddS64(addresultArgs, PS_LIST_TAIL, "-sky_id", 0, "define sky ID (required)", 0);
    92     psMetadataAddS64(addresultArgs, PS_LIST_TAIL, "-stack_id", 0, "define stack ID (required)", 0);
    9392    psMetadataAddStr(addresultArgs, PS_LIST_TAIL, "-path_base", 0, "define base output location", 0);
    9493    psMetadataAddF32(addresultArgs, PS_LIST_TAIL, "-dtime_phot", 0, "define photometry time", NAN);
    9594    psMetadataAddF32(addresultArgs, PS_LIST_TAIL, "-dtime_script", 0, "define elapsed time in script (seconds)", NAN);
    9695    psMetadataAddS32(addresultArgs, PS_LIST_TAIL, "-sources", 0, "number of sources", 0);
     96    psMetadataAddS32(addresultArgs, PS_LIST_TAIL, "-num_inputs", 0, "number of inputs", 0);
    9797    psMetadataAddStr(addresultArgs, PS_LIST_TAIL, "-hostname", 0, "define hostname", 0);
    9898    psMetadataAddF32(addresultArgs, PS_LIST_TAIL, "-good_frac", 0, "define fraction of good pixels", NAN);
Note: See TracChangeset for help on using the changeset viewer.