Changeset 25072
- Timestamp:
- Aug 14, 2009, 10:36:13 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
ippScripts/scripts/publish_file.pl (modified) (7 diffs)
-
ppMops/src/ppMops.c (modified) (4 diffs)
-
ppMops/src/ppMops.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/publish_file.pl
r24957 r25072 39 39 40 40 # Parse the command-line arguments 41 my ( $pub_id, $ exp_id, $camera, $stage, $stage_id, $format, $product, $workdir );41 my ( $pub_id, $camera, $stage, $stage_id, $format, $product, $workdir ); 42 42 my ( $dbname, $verbose, $no_update, $save_temps, $redirect ); 43 43 44 44 GetOptions( 45 45 'pub_id=s' => \$pub_id, # Publish identifier 46 'exp_id=s' => \$exp_id, # Exposure identifier47 46 'camera=s' => \$camera, # Camera name 48 47 'stage=s' => \$stage, # Stage of interest … … 58 57 59 58 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 60 pod2usage( -msg => "Required options: --pub_id -- exp_id --camera --stage --stage_id --product --workdir",59 pod2usage( -msg => "Required options: --pub_id --camera --stage --stage_id --product --workdir", 61 60 -exitval => $PS_EXIT_CONFIG_ERROR) unless 62 61 defined $pub_id and 63 defined $exp_id and64 62 defined $camera and 65 63 defined $product and … … 68 66 defined $workdir; 69 67 70 my $outroot = "$workdir/$product.$pub_id .$exp_id"; # Output root name68 my $outroot = "$workdir/$product.$pub_id"; # Output root name 71 69 72 70 my $ipprc = PS::IPP::Config->new( $camera ) or … … 83 81 my %files; # Input filenames 84 82 my %zp; # Zero points 83 my %exp_id; # Exposure identifiers 85 84 { 86 85 my $command; # Command to run … … 119 118 $zp{"$skycell_id.pos"} = $zp; 120 119 $zp{"$skycell_id.neg"} = $zp if defined $comp->{bothways} and $comp->{bothways}; 120 $exp_id{"$skycell_id.pos"} = $comp->{exp1}; 121 $exp_id{"$skycell_id.neg"} = $comp->{exp2} if defined $comp->{bothways} and $comp->{bothways}; 121 122 } elsif ($stage eq 'camera') { 122 123 my $cam_id = $comp->{cam_id}; 123 124 $files{$cam_id} = $ipprc->filename( "PSASTRO.OUTPUT", $path_base ); 124 125 $zp{$cam_id} = $zp; 126 $exp_id{$cam_id} = $comp->{exp_id}; 125 127 } 126 128 } … … 137 139 138 140 my $zp = $zp{$comp}; 141 my $exp_id = $exp_id{$comp}; 139 142 if ($product eq "IPP-MOPS") { 140 143 my $outuri = "$outroot.$comp.fits"; … … 142 145 &my_die( "Unable to resolve output file $outuri", $pub_id, $PS_EXIT_SYS_ERROR); 143 146 144 my $command = "$ppMops $file $zp $ out";147 my $command = "$ppMops $file $zp $exp_id $out"; 145 148 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 146 149 run(command => $command, verbose => $verbose); -
trunk/ppMops/src/ppMops.c
r24986 r25072 6 6 int main(int argc, char *argv[]) 7 7 { 8 if (argc != 4) {8 if (argc != 5) { 9 9 fprintf(stderr, "Insufficient arguments.\n"); 10 fprintf(stderr, "Usage: %s DETECTIONS ZP OUTPUT\n", argv[0]);10 fprintf(stderr, "Usage: %s DETECTIONS ZP EXP_ID OUTPUT\n", argv[0]); 11 11 exit(PS_EXIT_CONFIG_ERROR); 12 12 } … … 15 15 data->detections = psStringCopy(argv[1]); 16 16 data->zp = atof(argv[2]); 17 data->output = psStringCopy(argv[3]); 17 data->exp_id = atoll(argv[3]); 18 data->output = psStringCopy(argv[4]); 18 19 19 20 if (!isfinite(data->zp)) { … … 120 121 double alt = psMetadataLookupF64(NULL, header, "FPA.ALT"); 121 122 double az = psMetadataLookupF64(NULL, header, "FPA.AZ"); 122 int imageid = psMetadataLookupS32(NULL, header, "IMAGEID");123 psS64 imageid = psMetadataLookupS64(NULL, header, "IMAGEID"); 123 124 double mjd = psMetadataLookupF64(NULL, header, "MJD-OBS") + exptime / 2.0 / 3600 / 24; 124 125 125 126 float psf = plateScale * 0.5 * (psMetadataLookupF32(NULL, header, "FWHM_MAJ") + 126 127 psMetadataLookupF32(NULL, header, "FWHM_MIN")); 127 128 // XXX This is wrong129 int fpaid = psMetadataLookupS32(NULL, header, "IMAGEID");130 128 131 129 … … 140 138 psMetadataAddF64(outHeader, PS_LIST_TAIL, "TEL_AZ", 0, "Telescope azimuth", az); 141 139 psMetadataAddS32(outHeader, PS_LIST_TAIL, "DIFFIMID", 0, "Difference image identifier", imageid); 142 psMetadataAddS32(outHeader, PS_LIST_TAIL, "FPA_ID", 0, "Exposure identifier", fpaid);140 psMetadataAddS32(outHeader, PS_LIST_TAIL, "FPA_ID", 0, "Exposure identifier", data->exp_id); 143 141 psMetadataAddStr(outHeader, PS_LIST_TAIL, "OBSCODE", 0, "IAU Observatory code", OBSERVATORY_CODE); 144 142 psMetadataAddF32(outHeader, PS_LIST_TAIL, "STARPSF", 0, "Stellar PSF (arcsec)", psf); -
trunk/ppMops/src/ppMops.h
r24385 r25072 16 16 psString detections; // Detections filename 17 17 float zp; // Magnitude zero point 18 psS64 exp_id; // Exposure identifier 18 19 psString output; // Output filename 19 20 } ppMopsData;
Note:
See TracChangeset
for help on using the changeset viewer.
