IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25100


Ignore:
Timestamp:
Aug 17, 2009, 4:45:20 PM (17 years ago)
Author:
Paul Price
Message:

MOPS needs to know the direction of subtraction. Added a new field in the IPP-MOPS format: POSITIVE, a boolean which indicates whether the subtraction is positive or not.

Location:
trunk
Files:
3 edited

Legend:

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

    r25074 r25100  
    8383my %exp_id;                     # Exposure identifiers
    8484my %exp_name;                   # Exposure names
     85my %direction;                  # Direction of subtraction
    8586{
    8687    my $command;                # Command to run
     
    114115        if ($stage eq 'diff') {
    115116            my $skycell_id = $comp->{skycell_id};
     117
     118            # Positive direction
    116119            $files{"$skycell_id.pos"} = $ipprc->filename( "PPSUB.OUTPUT.SOURCES", $path_base );
    117             $files{"$skycell_id.neg"} = $ipprc->filename( "PPSUB.INVERSE.SOURCES", $path_base ) if
    118                 defined $comp->{bothways} and $comp->{bothways};
    119120            $zp{"$skycell_id.pos"} = $zp;
    120             $zp{"$skycell_id.neg"} = $zp if defined $comp->{bothways} and $comp->{bothways};
    121121            $exp_id{"$skycell_id.pos"} = $comp->{exp_id_1};
    122             $exp_id{"$skycell_id.neg"} = $comp->{exp_id_2} if defined $comp->{bothways} and $comp->{bothways};
    123122            $exp_name{"$skycell_id.pos"} = $comp->{exp_name_1};
    124             $exp_name{"$skycell_id.neg"} = $comp->{exp_name_2} if defined $comp->{bothways} and $comp->{bothways};
     123            $direction{"$skycell_id.pos"} = 1;
     124
     125            # Negative direction
     126            if (defined $comp->{bothways} and $comp->{bothways}) {
     127                $files{"$skycell_id.neg"} = $ipprc->filename( "PPSUB.INVERSE.SOURCES", $path_base );
     128                $zp{"$skycell_id.neg"} = $zp;
     129                $exp_id{"$skycell_id.neg"} = $comp->{exp_id_2};
     130                $direction{"$skycell_id.neg"} = 0;
     131                $exp_name{"$skycell_id.neg"} = $comp->{exp_name_2};
     132            }
     133
    125134        } elsif ($stage eq 'camera') {
    126135            my $cam_id = $comp->{cam_id};
     
    129138            $exp_id{$cam_id} = $comp->{exp_id};
    130139            $exp_name{$cam_id} = $comp->{exp_name};
     140            $direction{$cam_id} = 1;
    131141        }
    132142    }
     
    145155    my $exp_id = $exp_id{$comp};
    146156    my $exp_name = $exp_name{$comp};
     157    my $direction = $direction{$comp};
    147158    if ($product eq "IPP-MOPS") {
    148159        my $outuri = "$outroot.$comp.fits";
     
    150161            &my_die( "Unable to resolve output file $outuri", $pub_id, $PS_EXIT_SYS_ERROR);
    151162
    152         my $command = "$ppMops $file $zp $exp_id $exp_name $out";
     163        my $command = "$ppMops $file $zp $exp_id $exp_name $direction $out";
    153164        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    154165            run(command => $command, verbose => $verbose);
  • trunk/ppMops/src/ppMops.c

    r25076 r25100  
    66int main(int argc, char *argv[])
    77{
    8     if (argc != 6) {
     8    if (argc != 7) {
    99        fprintf(stderr, "Insufficient arguments.\n");
    10         fprintf(stderr, "Usage: %s DETECTIONS ZP EXP_ID EXP_NAME OUTPUT\n", argv[0]);
     10        fprintf(stderr, "Usage: %s DETECTIONS ZP EXP_ID EXP_NAME DIRECTION OUTPUT\n", argv[0]);
    1111        exit(PS_EXIT_CONFIG_ERROR);
    1212    }
     
    1717    data->exp_id = atoll(argv[3]);
    1818    data->exp_name = psStringCopy(argv[4]);
    19     data->output = psStringCopy(argv[5]);
     19    data->direction = atoi(argv[5]);
     20    data->output = psStringCopy(argv[6]);
    2021
    2122    if (!isfinite(data->zp)) {
     
    128129                                        psMetadataLookupF32(NULL, header, "FWHM_MIN"));
    129130
    130 
    131131        psMetadataAddStr(outHeader, PS_LIST_TAIL, "RA", 0, "Right ascension of boresight", ra);
    132132        psMetadataAddStr(outHeader, PS_LIST_TAIL, "DEC", 0, "Declination of boresight", dec);
     
    141141        psMetadataAddStr(outHeader, PS_LIST_TAIL, "FPA_ID", 0, "Exposure name", data->exp_name);
    142142        psMetadataAddS64(outHeader, PS_LIST_TAIL, "EXP_ID", 0, "Exposure identifier", data->exp_id);
     143        psMetadataAddBool(outHeader, PS_LIST_TAIL, "POSITIVE", 0, "Positive subtraction?", data->direction);
    143144        psMetadataAddStr(outHeader, PS_LIST_TAIL, "OBSCODE", 0, "IAU Observatory code", OBSERVATORY_CODE);
    144145        psMetadataAddF32(outHeader, PS_LIST_TAIL, "STARPSF", 0, "Stellar PSF (arcsec)", psf);
    145146
    146147        // These are completely fake
    147         psMetadataAddF32(outHeader, PS_LIST_TAIL, "LIMITMAG", 0, "Limiting magnitude (FAKE)", 25.0);
     148        psMetadataAddF32(outHeader, PS_LIST_TAIL, "LIMITMAG", 0, "Limiting magnitude (FAKE)", 99.0);
    148149        psMetadataAddF32(outHeader, PS_LIST_TAIL, "DE1", 0, "Detection efficiency (FAKE)", 0.0);
    149150        psMetadataAddF32(outHeader, PS_LIST_TAIL, "DE2", 0, "Detection efficiency (FAKE)", 0.0);
  • trunk/ppMops/src/ppMops.h

    r25074 r25100  
    1818    psS64 exp_id;                       // Exposure identifier
    1919    psString exp_name;                  // Exposure name
     20    bool direction;                     // Direction of subtraction, 1=positive, 0=negative
    2021    psString output;                    // Output filename
    2122} ppMopsData;
Note: See TracChangeset for help on using the changeset viewer.