IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 20, 2007, 2:24:57 PM (19 years ago)
Author:
Paul Price
Message:

Take astrometry file rule from PSWARP recipe, ASTROM.SOURCE. If this value is NULL, then use the imfile as the astrometry source.

File:
1 edited

Legend:

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

    r14391 r14567  
    9494}
    9595
     96# Where do we get the astrometry source from?
     97my $astromSource;               # The astrometry source
     98{
     99    my $command = "$ppConfigDump -camera $camera -dump-recipe PSWARP -";
     100    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     101        run(command => $command, verbose => 1);
     102    unless ($success) {
     103        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     104        &my_die("Unable to perform ppConfigDump: $error_code", $warp_id, $error_code);
     105    }
     106    my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
     107        &my_die("Unable to parse metadata config doc", $warp_id, $PS_EXIT_PROG_ERROR);
     108    $astromSource = metadataLookupStr('ASTROM.SOURCE');
     109}
     110
    96111$workdir = caturi( $workdir, "tess_" . $tess_id, "sky_" . $skycell_id ) if defined $workdir;
    97112my $outputRoot = $ipprc->file_prepare( "$tess_id.$skycell_id.wrp$warp_id", $workdir, $$imfiles[0]->{uri} );
     
    113128    my $mask = $ipprc->filename("PPIMAGE.CHIP.MASK", $imfile->{chip_path_base}, $imfile->{class_id}); # Mask name
    114129    my $weight = $ipprc->filename("PPIMAGE.CHIP.WEIGHT", $imfile->{chip_path_base}, $imfile->{class_id}); # Mask name
    115    my $astrom = $ipprc->filename("PSASTRO.OUTPUT.MEF", $imfile->{cam_path_base}); # Astrometry file name
    116130
    117131    &my_die("Couldn't find input file: $image", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($image);
    118132    &my_die("Couldn't find input file: $mask", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($mask);
    119     &my_die("Couldn't find input file: $astrom", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($astrom);
     133
     134    my $astrom;                 # Astrometry file
     135    if ($astromSource and $astromSource ne 'NULL') {
     136        $astrom = $ipprc->filename($astromSource, $imfile->{cam_path_base});
     137        &my_die("Couldn't find input file: $astrom", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($astrom);
     138    }
    120139
    121140    print $imageFile ( $image . "\n");
    122141    print $maskFile ( $mask  . "\n");
    123142    print $weightFile ( $weight  . "\n");
    124     if (defined $inputAstrom) {
     143
     144    if (defined $inputAstrom and defined $astrom) {
    125145        &my_die("Astrometry files don't match: $inputAstrom vs $astrom", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $inputAstrom eq $astrom;
    126146    } else {
     
    137157    $command .= " -masklist $maskName";
    138158    $command .= " -weightlist $weightName";
    139     $command .= " -astrom $inputAstrom";
     159    $command .= " -astrom $inputAstrom" if defined $inputAstrom;
    140160    $command .= " $outputRoot $skyFile";
    141161    $command .= " -stats $outputStats";
Note: See TracChangeset for help on using the changeset viewer.