IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16737


Ignore:
Timestamp:
Feb 28, 2008, 3:44:32 PM (18 years ago)
Author:
Paul Price
Message:

Moving to scheme where outroot is provided to the script instead of workdir.

File:
1 edited

Legend:

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

    r16563 r16737  
    1717use PS::IPP::Metadata::Config;
    1818use PS::IPP::Metadata::List qw( parse_md_list );
    19 use PS::IPP::Operations qw( skycell_file
    20                             generate_skycells
    21                             );
    2219
    2320use Astro::FITS::CFITSIO qw( :constants );
     
    4441
    4542# Parse the command-line arguments
    46 my ($magic_id, $tess_id, $camera, $ra0, $dec0, $dbname, $workdir, $save_temps, $verbose, $no_update, $no_op);
     43my ($magic_id, $tess_id, $camera, $ra0, $dec0, $dbname, $outroot, $save_temps, $verbose, $no_update, $no_op);
    4744GetOptions(
    4845           'magic_id=s'    => \$magic_id,   # Magic identifier
     
    5249           'dec=f'         => \$dec0,       # Boresight declination, radians
    5350           'dbname=s'      => \$dbname,     # Database name
    54            'workdir=s'     => \$workdir,    # Working directory, for output files
     51           'outroot=s'     => \$outroot,    # Output root name
    5552           'save-temps'    => \$save_temps, # Save temporary files?
    5653           'verbose'       => \$verbose,    # Print stuff?
     
    6057
    6158pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    62 pod2usage( -msg => "Required options: --magic_id --camera --workdir",
     59pod2usage( -msg => "Required options: --magic_id --camera --outroot",
    6360           -exitval => 3) unless
    6461    defined $magic_id and
     
    6764    defined $dec0 and
    6865    defined $camera and
    69     defined $workdir;
     66    defined $outroot;
    7067
    7168$ipprc->define_camera($camera);
     
    106103}
    107104
    108 generate_skycells($ipprc, $tess_id, \@skycells, $workdir, $verbose) or
    109     &my_die("Unable to generate skycells", $magic_id, $PS_EXIT_PROG_ERROR);
    110 
    111105### For each skycell, project centre of skycell onto tangent plane of boresight
    112106my @fields;
    113107foreach my $skycell_id ( @skycells ) {
    114     my $skyfile = skycell_file($tess_id, $skycell_id, $workdir) or
    115         &my_die("Unable to get name of skycell file", $magic_id, $PS_EXIT_PROG_ERROR);
    116     &my_die("Unable to find skycell file", $magic_id, $PS_EXIT_SYS_ERROR) unless
    117         $ipprc->file_exists( $skyfile );
    118 
    119     my ($header, $status) = Astro::FITS::CFITSIO::fits_read_header( $skyfile );
     108    my $skyfile = $ipprc->filename("SKYCELL.TEMPLATE", $outroot, $skycell_id );
     109    $ipprc->skycell_file($tess_id, $skycell_id, $skyFile, $verbose) or &my_die("Unable to generate skycells $skycell_id", $magic_id, $PS_EXIT_PROG_ERROR);
     110    my $skyfileResolved = $ipprc->file_resolve( $skyfile );
     111    my ($header, $status) = Astro::FITS::CFITSIO::fits_read_header( $skyfileResolved );
    120112    &my_die("Unable to read skycell header: $status", $magic_id, $PS_EXIT_SYS_ERROR) if $status;
    121113   
Note: See TracChangeset for help on using the changeset viewer.