IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 6, 2008, 2:00:06 PM (18 years ago)
Author:
eugene
Message:

more flexible input options for astrometry

File:
1 edited

Legend:

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

    r15691 r16020  
    5050pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    5151pod2usage(
    52     -msg => "Required options: --warp_id --camera",
     52    -msg => "Required options: --warp_id --camera --workdir",
    5353    -exitval => 3,
    5454) unless defined $warp_id
    55     and defined $camera;
     55    and defined $camera
     56    and define $workdir;
    5657
    5758$ipprc->define_camera($camera);
     
    125126        my %unique_skycells = (); # Identified skycells (all unique by virtue of hash property)
    126127       
    127         if ($astromSource and $astromSource ne 'NULL') {
    128             # We have an astrometry file from psastro
     128        # XXX this is a bit too hard wired: the concept is that astrometry comes from the MOSAIC vs CHIP output
     129        if ($astromSource eq 'PSASTRO.OUTPUT.MEF') {
     130            # We have a MEF astrometry file from psastro
    129131            my $imfile = $imfiles->[0];
    130132            my $camRoot = $imfile->{cam_path_base};
     
    132134           
    133135            my @matchlist = get_overlaps($astromFile, $tess_dir, $astromAccept); # List of overlaps
    134            
     136            if (! @matchlist) {
     137                &my_die("Unable to perform dvoImageOverlaps: missing astrometry", $warp_id, $PS_EXIT_DATA_ERROR);
     138            }       
    135139            # Match each of the imfiles to this list
    136140            foreach my $imfile (@$imfiles) {
     
    138142            }
    139143        } else {
    140             # We have the imfiles themselves for the WCS
     144            # We have per-imfile astrometry
    141145            foreach my $imfile (@$imfiles) {
    142                 my $astromFile = $imfile->{chip_uri}; # Astrometry file
     146                my $astromFile;
     147                if ($astromSource eq 'PSASTRO.OUTPUT') {
     148                    my $chipRoot = $imfile->{chip_path_base};
     149                    my $classID = $imfile->{class_id};
     150                    $astromFile = $ipprc->filename($astromSource, $chipRoot, $classID); # Astrometry file
     151                } else {
     152                    $astromFile = $imfile->{chip_uri}; # Astrometry file
     153                }
    143154                my @matchlist = get_overlaps($astromFile, $tess_dir, $astromAccept); # List of overlaps
     155                if (! @matchlist) {
     156                    print "skipping $astromFile\n";
     157                }           
     158
    144159                extract_overlaps(\@matchlist, $imfile, $astromFile, $tess_id, \@overlaps, \%unique_skycells);
    145160            }
     
    222237    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    223238        run(command => $command, verbose => 1);
    224     unless ($success) {
    225         $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    226         &my_die("Unable to perform dvoImageOverlaps: $error_code", $warp_id, $error_code);
     239    if (!$success) {
     240        print "missing astrometry for $filename\n";
     241        return 0;
    227242    }
    228243    return split ('\n', (join "", @$stdout_buf));
Note: See TracChangeset for help on using the changeset viewer.