IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25072


Ignore:
Timestamp:
Aug 14, 2009, 10:36:13 AM (17 years ago)
Author:
Paul Price
Message:

Put FPA_ID = exp_id in MOPS output.

Location:
trunk
Files:
3 edited

Legend:

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

    r24957 r25072  
    3939
    4040# Parse the command-line arguments
    41 my ( $pub_id, $exp_id, $camera, $stage, $stage_id, $format, $product, $workdir );
     41my ( $pub_id, $camera, $stage, $stage_id, $format, $product, $workdir );
    4242my ( $dbname, $verbose, $no_update, $save_temps, $redirect );
    4343
    4444GetOptions(
    4545    'pub_id=s'          => \$pub_id, # Publish identifier
    46     'exp_id=s'          => \$exp_id, # Exposure identifier
    4746    'camera=s'          => \$camera, # Camera name
    4847    'stage=s'           => \$stage,       # Stage of interest
     
    5857
    5958pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    60 pod2usage( -msg => "Required options: --pub_id --exp_id --camera --stage --stage_id --product --workdir",
     59pod2usage( -msg => "Required options: --pub_id --camera --stage --stage_id --product --workdir",
    6160           -exitval => $PS_EXIT_CONFIG_ERROR) unless
    6261    defined $pub_id and
    63     defined $exp_id and
    6462    defined $camera and
    6563    defined $product and
     
    6866    defined $workdir;
    6967
    70 my $outroot = "$workdir/$product.$pub_id.$exp_id"; # Output root name
     68my $outroot = "$workdir/$product.$pub_id"; # Output root name
    7169
    7270my $ipprc = PS::IPP::Config->new( $camera ) or
     
    8381my %files;                      # Input filenames
    8482my %zp;                         # Zero points
     83my %exp_id;                     # Exposure identifiers
    8584{
    8685    my $command;                # Command to run
     
    119118            $zp{"$skycell_id.pos"} = $zp;
    120119            $zp{"$skycell_id.neg"} = $zp if defined $comp->{bothways} and $comp->{bothways};
     120            $exp_id{"$skycell_id.pos"} = $comp->{exp1};
     121            $exp_id{"$skycell_id.neg"} = $comp->{exp2} if defined $comp->{bothways} and $comp->{bothways};
    121122        } elsif ($stage eq 'camera') {
    122123            my $cam_id = $comp->{cam_id};
    123124            $files{$cam_id} = $ipprc->filename( "PSASTRO.OUTPUT", $path_base );
    124125            $zp{$cam_id} = $zp;
     126            $exp_id{$cam_id} = $comp->{exp_id};
    125127        }
    126128    }
     
    137139
    138140    my $zp = $zp{$comp};
     141    my $exp_id = $exp_id{$comp};
    139142    if ($product eq "IPP-MOPS") {
    140143        my $outuri = "$outroot.$comp.fits";
     
    142145            &my_die( "Unable to resolve output file $outuri", $pub_id, $PS_EXIT_SYS_ERROR);
    143146
    144         my $command = "$ppMops $file $zp $out";
     147        my $command = "$ppMops $file $zp $exp_id $out";
    145148        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    146149            run(command => $command, verbose => $verbose);
  • trunk/ppMops/src/ppMops.c

    r24986 r25072  
    66int main(int argc, char *argv[])
    77{
    8     if (argc != 4) {
     8    if (argc != 5) {
    99        fprintf(stderr, "Insufficient arguments.\n");
    10         fprintf(stderr, "Usage: %s DETECTIONS ZP OUTPUT\n", argv[0]);
     10        fprintf(stderr, "Usage: %s DETECTIONS ZP EXP_ID OUTPUT\n", argv[0]);
    1111        exit(PS_EXIT_CONFIG_ERROR);
    1212    }
     
    1515    data->detections = psStringCopy(argv[1]);
    1616    data->zp = atof(argv[2]);
    17     data->output = psStringCopy(argv[3]);
     17    data->exp_id = atoll(argv[3]);
     18    data->output = psStringCopy(argv[4]);
    1819
    1920    if (!isfinite(data->zp)) {
     
    120121        double alt = psMetadataLookupF64(NULL, header, "FPA.ALT");
    121122        double az = psMetadataLookupF64(NULL, header, "FPA.AZ");
    122         int imageid = psMetadataLookupS32(NULL, header, "IMAGEID");
     123        psS64 imageid = psMetadataLookupS64(NULL, header, "IMAGEID");
    123124        double mjd = psMetadataLookupF64(NULL, header, "MJD-OBS") + exptime / 2.0 / 3600 / 24;
    124125
    125126        float psf = plateScale * 0.5 * (psMetadataLookupF32(NULL, header, "FWHM_MAJ") +
    126127                                        psMetadataLookupF32(NULL, header, "FWHM_MIN"));
    127 
    128         // XXX This is wrong
    129         int fpaid = psMetadataLookupS32(NULL, header, "IMAGEID");
    130128
    131129
     
    140138        psMetadataAddF64(outHeader, PS_LIST_TAIL, "TEL_AZ", 0, "Telescope azimuth", az);
    141139        psMetadataAddS32(outHeader, PS_LIST_TAIL, "DIFFIMID", 0, "Difference image identifier", imageid);
    142         psMetadataAddS32(outHeader, PS_LIST_TAIL, "FPA_ID", 0, "Exposure identifier", fpaid);
     140        psMetadataAddS32(outHeader, PS_LIST_TAIL, "FPA_ID", 0, "Exposure identifier", data->exp_id);
    143141        psMetadataAddStr(outHeader, PS_LIST_TAIL, "OBSCODE", 0, "IAU Observatory code", OBSERVATORY_CODE);
    144142        psMetadataAddF32(outHeader, PS_LIST_TAIL, "STARPSF", 0, "Stellar PSF (arcsec)", psf);
  • trunk/ppMops/src/ppMops.h

    r24385 r25072  
    1616    psString detections;                // Detections filename
    1717    float zp;                           // Magnitude zero point
     18    psS64 exp_id;                       // Exposure identifier
    1819    psString output;                    // Output filename
    1920} ppMopsData;
Note: See TracChangeset for help on using the changeset viewer.