IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38054


Ignore:
Timestamp:
Mar 29, 2015, 5:45:15 AM (11 years ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/eam_branches/ipp-20150112/ippScripts/scripts
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20150112/ippScripts/scripts

  • branches/eam_branches/ipp-20150112/ippScripts/scripts/mergedvodb_merge.pl

    r35306 r38054  
    156156            $merge_command = "rsync -rvat $minidvodb_path/* $mergedvodb_path";
    157157        } else {
    158             $merge_command = "$dvomerge -parallel $minidvodb_path into $mergedvodb_path";
     158#           $merge_command = "$dvomerge -parallel $minidvodb_path into $mergedvodb_path";
     159            $merge_command = "$dvomerge -matched-tables $minidvodb_path into $mergedvodb_path";
    159160        }
    160161        print "\n$merge_command\n";
  • branches/eam_branches/ipp-20150112/ippScripts/scripts/psphot_fullforce_warp.pl

    r37053 r38054  
    124124}
    125125
    126 # XXX: need to figure out whether this works or not
    127 # We probably want to create a specific recipe that looks at the results
    128 my $recipe_ppstats = 'WARPSTATS';
    129 my $doStats = 0;
     126my $doStats = 1;
    130127
    131128print "reduction: $reduction\n";
     
    166163
    167164my $cmdflags = "";
     165my $quality = 0;
    168166
    169167# Perform psphotFullForce
     
    182180    if ($doStats) {
    183181        $command .= " -stats $outputStats";
    184         $command .= " -recipe PPSTATS $recipe_ppstats";
    185182    }
    186183    $command .= " -F PSPHOT.OUTPUT PSPHOT.OUT.CMF.MEF";
     
    198195        }
    199196
    200         # Stats: TODO
    201197        if ($doStats) {
    202198            check_output($outputStats, 1);
    203199            my $outputStatsReal = $ipprc->file_resolve($outputStats);
    204200
    205             # measure chip stats
     201            # analyze the stats file
    206202            $command = "$ppStatsFromMetadata $outputStatsReal - WARP_SKYCELL";
    207203            ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    216212            chomp $cmdflags;
    217213        }
    218         my ($quality) = $cmdflags =~ /-quality (\d+)/; # Quality flag
    219 
    220         if (!$quality) {
    221             check_output($outputSources, 1);
    222         }
     214        ($quality) = $cmdflags =~ /-quality (\d+)/; # Quality flag
     215
    223216    } else {
    224217        print "Not executing: $command\n";
    225218    }
     219}
     220
     221if (!$quality) {
     222    check_output($outputSources, 1);
    226223}
    227224
  • branches/eam_branches/ipp-20150112/ippScripts/scripts/sc_prepare_camera.pl

    r37833 r38054  
    1414use Data::Dumper;
    1515use File::Basename;
     16use File::Temp qw( tempfile );
    1617
    1718use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
     
    3031my $remotetool = can_run('remotetool') or (warn "Can't find remotetool" and $missing_tools = 1);
    3132my $camtool    = can_run('camtool') or (warn "Can't find camtool" and $missing_tools = 1);
     33my $ppStatsFromMetadata = can_run('ppStatsFromMetadata') or (warn "Can't find ppStatsFromMetadata" and $missing_tools = 1);
    3234
    3335if ($missing_tools) {
     
    8890my ($workdir,$exp_tag,$reduction);
    8991{
     92###    $command    = "$camtool -processedexp -cam_id $cam_id "; ### THIS LINE ONLY TO TEST! 
    9093    my $command = "$camtool -pendingexp -cam_id $cam_id ";
    9194    $command   .= " -dbname $dbname " if defined($dbname);
     
    142145    my $pre_cmd_cmfs = "ls -1 ${remote_chip_path}*.cmf > ${remote_outroot}.cmflist";
    143146    my $pre_cmd_masks= "ls -1 ${remote_chip_path}*.mk.fits > ${remote_outroot}.masklist";
     147
     148    # Despite the previous comment, we do care about the output of pendingimfile, as that
     149    # contains information for the exposure.
     150    my ($statFile, $statName) = tempfile( "/tmp/cm.$cam_id.stats.XXXX", UNLINK => 1 );
     151    foreach my $line (@$stdout_buf) {
     152        print $statFile $line;
     153    }
     154    close $statFile;
     155   
     156    # parse the stats in the metadata file
     157    $command = "$ppStatsFromMetadata $statName - CAMERA_EXP_IMFILE";
     158    ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     159        run(command => $command, verbose => $verbose);
     160    unless ($success) {
     161        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     162        warn("Unable to perform ppStatsFromMetadata: $error_code\n");
     163        exit($error_code);
     164    }
     165
     166    my $results = '';
     167    foreach my $line (@$stdout_buf) {
     168        $results .= " $line";
     169    }
     170    chomp($results);
     171
     172
    144173
    145174    my $recipe_psastro = $ipprc->reduction($reduction, 'PSASTRO'); # Recipe to use
     
    163192    $camtool_post_cmd  .=  " -dbname $dbname " if defined $dbname;
    164193    $camtool_post_cmd  .=  " -path_base $ipp_outroot -hostname $remote_hostname -dtime_script 0 ";
     194    $camtool_post_cmd  .=  " $results "; # Add exposure information
    165195    my $post_cmd_echo = " echo -n \"$camtool_post_cmd\" > ${remote_outroot}.dbinfo ";
    166196    my $post_cmd_SfM  = " ppStatsFromMetadata ${remote_outroot}.stats - CAMERA_EXP_FPA >> ${remote_outroot}.dbinfo ";
  • branches/eam_branches/ipp-20150112/ippScripts/scripts/sc_prepare_stack.pl

    r37833 r38054  
    2323my $remote_hostname = "LANL/Mustang";         # Name of the remote node.
    2424my $threads_req     = 4;                      # How many threads are we going to use?
     25my $have_warps      = 0;                      # Do we have a copy of the warp if we don't find one there?
    2526
    2627my $fail_state = "prep_fail";
     
    156157        my $ipp_disk;
    157158        #  ${remote_root}/tmp/${ipp_disk}
    158         (undef,$remote_file) = &uri_to_outputs($warp_path_base . ".fits");
    159         ($ipp_disk,undef)    = &uri_convert($warp_path_base . ".fits");
    160         print COMPMAP "$remote_file ${remote_root}/tmp/${ipp_disk}\n";
    161         (undef,$remote_file) = &uri_to_outputs($warp_path_base . ".wt.fits");
    162         ($ipp_disk,undef)    = &uri_convert($warp_path_base . ".wt.fits");
    163         print COMPMAP "$remote_file ${remote_root}/tmp/${ipp_disk}\n";
    164         (undef,$remote_file) = &uri_to_outputs($warp_path_base . ".mask.fits");
    165         ($ipp_disk,undef)    = &uri_convert($warp_path_base . ".mask.fits");
    166         print COMPMAP "$remote_file ${remote_root}/tmp/${ipp_disk}\n";
    167         (undef,$remote_file) = &uri_to_outputs($warp_path_base . ".cmf");
    168         ($ipp_disk,undef)    = &uri_convert($warp_path_base . ".cmf");
    169         print COMPMAP "$remote_file ${remote_root}/tmp/${ipp_disk}\n";
    170         (undef,$remote_file) = &uri_to_outputs($warp_path_base . ".psf");
    171         ($ipp_disk,undef)    = &uri_convert($warp_path_base . ".psf");
    172         print COMPMAP "$remote_file ${remote_root}/tmp/${ipp_disk}\n";
     159
     160        if ($have_warps != 0) { # Check to see if we have a copy, because if we do, then we can send it over if it's missing.
     161            (undef,$remote_file) = &uri_to_outputs($warp_path_base . ".fits");
     162            ($ipp_disk,undef)    = &uri_convert($warp_path_base . ".fits");
     163            print COMPMAP "$remote_file ${remote_root}/tmp/${ipp_disk}\n";
     164
     165            (undef,$remote_file) = &uri_to_outputs($warp_path_base . ".wt.fits");
     166            ($ipp_disk,undef)    = &uri_convert($warp_path_base . ".wt.fits");
     167            print COMPMAP "$remote_file ${remote_root}/tmp/${ipp_disk}\n";
     168
     169            (undef,$remote_file) = &uri_to_outputs($warp_path_base . ".mask.fits");
     170            ($ipp_disk,undef)    = &uri_convert($warp_path_base . ".mask.fits");
     171            print COMPMAP "$remote_file ${remote_root}/tmp/${ipp_disk}\n";
     172
     173            (undef,$remote_file) = &uri_to_outputs($warp_path_base . ".cmf");
     174            ($ipp_disk,undef)    = &uri_convert($warp_path_base . ".cmf");
     175            print COMPMAP "$remote_file ${remote_root}/tmp/${ipp_disk}\n";
     176
     177            (undef,$remote_file) = &uri_to_outputs($warp_path_base . ".psf");
     178            ($ipp_disk,undef)    = &uri_convert($warp_path_base . ".psf");
     179            print COMPMAP "$remote_file ${remote_root}/tmp/${ipp_disk}\n";
     180
     181        }
     182        else {
     183            $remote_file = &uri_local_to_remote($warp_path_base . ".fits");
     184            print COMPMAP "$remote_file $remote_file\n";  # No other option, really.
     185
     186            $remote_file = &uri_local_to_remote($warp_path_base . ".wt.fits");
     187            print COMPMAP "$remote_file $remote_file\n";  # No other option, really.
     188
     189            $remote_file = &uri_local_to_remote($warp_path_base . ".mask.fits");
     190            print COMPMAP "$remote_file $remote_file\n";  # No other option, really.
     191
     192            $remote_file = &uri_local_to_remote($warp_path_base . ".cmf");
     193            print COMPMAP "$remote_file $remote_file\n";  # No other option, really.
     194
     195            $remote_file = &uri_local_to_remote($warp_path_base . ".psf");
     196            print COMPMAP "$remote_file $remote_file\n";  # No other option, really.
     197
     198        }
    173199    }
    174200
  • branches/eam_branches/ipp-20150112/ippScripts/scripts/sc_remote_exec.pl

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20150112/ippScripts/scripts/skycalibration.pl

    r35195 r38054  
    235235    $command .= " -dumpconfig $configuration" if $configuration;
    236236    $command .= " -tracedest $traceDest";
     237    $command .= " -dbname $dbname" if defined $dbname;
    237238
    238239    unless ($no_op) {
  • branches/eam_branches/ipp-20150112/ippScripts/scripts/stack_bkg_mk_mdc.pl

    r37738 r38054  
    1212
    1313
    14 my ($dbname,$stack_id,$label,$camera,$filter);
     14my ($dbname,$stack_id,$sass_id,$label,$camera,$filter);
    1515
    1616my $ipprc =  PS::IPP::Config->new(); # IPP Configuration
     
    2121GetOptions(
    2222    'stack_id=s'   => \$stack_id,
     23    'sass_id=s'    => \$sass_id,
    2324    'label=s'      => \$label,
    2425    'filter=s'     => \$filter,
     
    2627    'camera=s'     => \$camera,
    2728    ) or pod2usage ( 2 );
    28 pod2usage( -msg => "Required options; --stack_id | --label", -exitval => 3) unless
     29pod2usage( -msg => "Required options; --stack_id | --label | --sass_id", -exitval => 3) unless
    2930    ((defined $stack_id)||(defined $label));
    3031pod2usage( -msg => "Required options; --camera --dbname ", -exitval => 3) unless
     
    4950
    5051
    51 my $query = "SELECT DISTINCT chip_id,cam_id,path_base FROM stackRun JOIN stackInputSkyfile USING(stack_id) JOIN warpRun USING(warp_id) JOIN fakeRun USING(fake_id) JOIN camRun USING(cam_id) JOIN camProcessedExp USING(cam_id) JOIN chipRun USING (chip_id) WHERE 1 ";
     52my $query = "SELECT DISTINCT chip_id,cam_id,path_base FROM stackRun JOIN stackInputSkyfile USING(stack_id) JOIN stackAssociationMap USING(stack_id) JOIN warpRun USING(warp_id) JOIN fakeRun USING(fake_id) JOIN camRun USING(cam_id) JOIN camProcessedExp USING(cam_id) JOIN chipRun USING (chip_id) WHERE 1 ";
    5253
    5354if (defined($label)) {    $query .= " AND stackRun.label = '${label}' "; }
    5455if (defined($stack_id)) { $query .= " AND stack_id = ${stack_id} "; }
    5556if (defined($filter)) {   $query .= " AND stackRun.filter = '${filter}' "; }
     57if (defined($sass_id))  { $query .= " AND sass_id = ${sass_id} "; }
    5658
    5759my $cams = $db->selectall_arrayref( $query );
  • branches/eam_branches/ipp-20150112/ippScripts/scripts/staticsky.pl

    r36441 r38054  
    4848    print "  --outroot (root)    : Output root name\n";
    4949    print "  --reduction (class) : Reduction class\n";
     50    print "  --require_sources   : Require that the stack source files exist\n";
    5051    print "  --verbose           : Be extra verbose\n";
    5152    print "  --no-update         : Don't update the database?\n";
     
    6061print "run staticsky.pl @ARGV\n";
    6162
    62 my ($sky_id, $camera, $dbname, $threads, $outroot, $reduction, $verbose, $no_update, $no_op, $redirect, $save_temps);
     63my ($sky_id, $camera, $dbname, $threads, $outroot, $reduction, $require_sources, $verbose, $no_update, $no_op, $redirect, $save_temps);
    6364GetOptions(
    6465    'sky_id=s'          => \$sky_id, # Diff identifier
     
    6869    'outroot=s'         => \$outroot, # Output root name
    6970    'reduction=s'       => \$reduction, # Reduction class
     71    'require_sources'   => \$require_sources, # Require that the stack sources exist.
    7072    'verbose'           => \$verbose,   # Print to stdout
    7173    'no-update'         => \$no_update, # Don't update the database?
     
    178180                &my_die("Couldn't find input: $psfCnv",    $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$psfCnv");
    179181            }
    180             &my_die("Couldn't find input: $sources",   $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$sources");
    181 
     182           
     183            my $have_sources = $ipprc->file_exists("$sources");
     184            if ($require_sources) {
     185                &my_die("Couldn't find input: $sources",   $sky_id, $PS_EXIT_SYS_ERROR) unless $have_sources;
     186            }
     187           
    182188            print $listFile "  STACK_ID      S64  " . $stack_id  . "\n";
    183189            print $listFile "  RAW:IMAGE     STR  " . $imageRaw  . "\n";
     
    185191            print $listFile "  RAW:VARIANCE  STR  " . $weightRaw . "\n";
    186192            print $listFile "  RAW:EXPNUM    STR  " . $expnumRaw . "\n";
    187             print $listFile "  SOURCES       STR  " . $sources   . "\n";
     193            if ($have_sources) {
     194                print $listFile "  SOURCES       STR  " . $sources   . "\n";
     195            }
    188196            if ($needConvolvedImages) {
    189197                print $listFile "  CNV:IMAGE     STR  " . $imageCnv  . "\n";
Note: See TracChangeset for help on using the changeset viewer.