Changeset 16737
- Timestamp:
- Feb 28, 2008, 3:44:32 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/magic_tree.pl (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/magic_tree.pl
r16563 r16737 17 17 use PS::IPP::Metadata::Config; 18 18 use PS::IPP::Metadata::List qw( parse_md_list ); 19 use PS::IPP::Operations qw( skycell_file20 generate_skycells21 );22 19 23 20 use Astro::FITS::CFITSIO qw( :constants ); … … 44 41 45 42 # Parse the command-line arguments 46 my ($magic_id, $tess_id, $camera, $ra0, $dec0, $dbname, $ workdir, $save_temps, $verbose, $no_update, $no_op);43 my ($magic_id, $tess_id, $camera, $ra0, $dec0, $dbname, $outroot, $save_temps, $verbose, $no_update, $no_op); 47 44 GetOptions( 48 45 'magic_id=s' => \$magic_id, # Magic identifier … … 52 49 'dec=f' => \$dec0, # Boresight declination, radians 53 50 'dbname=s' => \$dbname, # Database name 54 ' workdir=s' => \$workdir, # Working directory, for output files51 'outroot=s' => \$outroot, # Output root name 55 52 'save-temps' => \$save_temps, # Save temporary files? 56 53 'verbose' => \$verbose, # Print stuff? … … 60 57 61 58 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 62 pod2usage( -msg => "Required options: --magic_id --camera -- workdir",59 pod2usage( -msg => "Required options: --magic_id --camera --outroot", 63 60 -exitval => 3) unless 64 61 defined $magic_id and … … 67 64 defined $dec0 and 68 65 defined $camera and 69 defined $ workdir;66 defined $outroot; 70 67 71 68 $ipprc->define_camera($camera); … … 106 103 } 107 104 108 generate_skycells($ipprc, $tess_id, \@skycells, $workdir, $verbose) or109 &my_die("Unable to generate skycells", $magic_id, $PS_EXIT_PROG_ERROR);110 111 105 ### For each skycell, project centre of skycell onto tangent plane of boresight 112 106 my @fields; 113 107 foreach 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 ); 120 112 &my_die("Unable to read skycell header: $status", $magic_id, $PS_EXIT_SYS_ERROR) if $status; 121 113
Note:
See TracChangeset
for help on using the changeset viewer.
