IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35901


Ignore:
Timestamp:
Aug 7, 2013, 12:27:21 PM (13 years ago)
Author:
bills
Message:

extract calibration information from database and insert into postage stamp headers

Location:
trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm

    r35625 r35901  
    176176        $need_magic, $dateobs_begin, $dateobs_end, $filter, $data_group, $option_mask, $mjd_min, $mjd_max,
    177177        0, 0,   # fwhm cuts are not applied here
    178         undef, undef, undef, $verbose);
     178        undef, 0, # no cam run information
     179        undef, undef, $verbose);
    179180
    180181    return $results;
     
    322323        0, $dateobs_begin, $dateobs_end, $filter, $data_group, $option_mask, $mjd_min, $mjd_max,
    323324        getValOrZero($row->{FWHM_MIN}), getValOrZero($row->{FWHM_MAX}),
    324         undef, $release_name, $survey,
     325        undef, 0, $release_name, $survey,
    325326        $verbose);
    326327
     
    351352    my $fwhm_max = shift;
    352353    my $selectedAstrom = shift;
     354    my $selected_cam_id = shift;
    353355    my $release_name = shift;
    354356    my $survey = shift;
     
    699701                $out->{astrom} = $selectedAstrom;
    700702                $out->{cam_path_base} = $selectedAstrom;
     703                $out->{cam_id} = $selected_cam_id if $selected_cam_id;
    701704                if ($selectedAstrom =~ /\.smf$/) {
    702705                    $out->{cam_path_base} =~ s/\.smf$//;
     
    946949                    $dateobs_begin, $dateobs_end, $filter, $data_group, $option_mask, $mjd_min, $mjd_max,
    947950                    $fwhm_min, $fwhm_max,
    948                     $chip->{astrom}, undef, undef,
     951                    $chip->{astrom}, $chip->{cam_id}, undef, undef,
    949952                    $verbose);
    950953
     
    970973                    $dateobs_begin, $dateobs_end, $filter, $data_group, $option_mask, $mjd_min, $mjd_max,
    971974                    $fwhm_min, $fwhm_max,
    972                     undef, $release_name, $survey,
     975                    undef, 0, $release_name, $survey,
    973976                    $verbose);
    974977
     
    13021305    $image->{astrom} = $astromFile;
    13031306    $image->{cam_path_base} = $camRoot;
     1307    $image->{cam_id} = $camRun->{cam_id};
    13041308
    13051309    return 1;
  • trunk/ippTools/share/releasetool_listrelexp.sql

    r35897 r35901  
    1515    relExp.zpt_stdev,
    1616    relExp.mcal,
     17    relExp.ubercal_dist,
    1718    relExp.path_base,
    1819    relExp.registered,
  • trunk/ippTools/share/warptool_warped.sql

    r28627 r35901  
    1313    rawExp.decl,
    1414    rawExp.exp_time,
     15    camRun.cam_id,
    1516    magicDSRun.state AS dsRun_state,
    1617    IFNULL(magicDSRun.magic_ds_id, 0) AS magic_ds_id
  • trunk/pstamp/scripts/Makefile.am

    r33324 r35901  
    2121        pstamp_get_image_job.pl \
    2222        psmkreq \
     23        psgetcalibinfo \
    2324        psstatus \
    2425        pstampstopfaulted \
  • trunk/pstamp/scripts/pstamp_job_run.pl

    r35900 r35901  
    7878my $ppstamp    = can_run('ppstamp') or (warn "Can't find ppstamp" and $missing_tools = 1);
    7979my $pstamp_get_image_job    = can_run('pstamp_get_image_job.pl') or (warn "Can't find pstamp_get_image_job.pl" and $missing_tools = 1);
     80my $psgetcalibinfo    = can_run('psgetcalibinfo') or (warn "Can't find psgetcalibinfo" and $missing_tools = 1);
    8081my $dquery_job_run = can_run('dquery_job_run.pl') or (warn "Can't find dquery_job_run.pl" and $missing_tools = 1);
    81 my $streaksreplace = can_run('streaksreplace')  or (warn "Can't find streaksreplace"  and $missing_tools = 1);
    8282my $whichnode = can_run('whichnode') or (warn "can't find whichnode" and $missing_tools = 1);
    8383
     
    151151    # find our output directory
    152152    my $outdir = dirname($outputBase);
    153     my ($tmpImage, $tmpMask, $tmpVariance, $tmproot);
    154    
     153
     154    my ($calib_fd, $calibfile);
     155    if ($stage eq 'chip' or $stage eq 'warp') {
     156        my $cam_id = $params->{cam_id};
     157        ($calib_fd, $calibfile) = tempfile ("$outdir/calib.XXXX", UNLINK => !$save_temps);
     158        close $calib_fd;
     159
     160        my $command = "$psgetcalibinfo --cam_id $cam_id --output $calibfile";
     161        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     162            run(command => $command, verbose => $verbose);
     163
     164        my $exitStatus;
     165        if (WIFEXITED($error_code)) {
     166            $exitStatus = WEXITSTATUS($error_code);
     167        } else {
     168            print STDERR "psgetcalibinfo failed error_code: $error_code\n";
     169            $exitStatus = $PS_EXIT_SYS_ERROR;
     170        }
     171        exit $exitStatus if $exitStatus;
     172
     173        if (-s $calibfile == 0) {
     174            print "no calibration information found for $cam_id\n";
     175            $calibfile = undef;
     176        }
     177    }
     178
     179    # my ($tmpImage, $tmpMask, $tmpVariance, $tmproot);
     180
    155181    my $command = "$ppstamp $outputBase $argString $fileArgs";
    156182    $command .= " -write_jpeg" if ($options & $PSTAMP_SELECT_JPEG);
    157183    $command .= " -nocompress" if ($options & $PSTAMP_SELECT_UNCOMPRESSED);
    158184    $command .= " -stage $stage";
     185    $command .= " -forheader $calibfile" if $calibfile;
    159186    $command .= " -dbname $dbname" if $dbname;
    160187    $command .= " -dbserver $dbserver" if $dbserver;
Note: See TracChangeset for help on using the changeset viewer.