Changeset 94
- Timestamp:
- Jul 23, 2003, 3:37:02 PM (23 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/perl/src/grab.keywords (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/perl/src/grab.keywords
r79 r94 1 1 #!/usr/bin/env perl 2 2 3 $version = 1.0;3 $version = 2.0; 4 4 5 5 if (@ARGV != 3) { die "USAGE: grab.keywords (infile) (cmproot) (outfile)\n" ; } … … 12 12 # $cmproot is the rootname of the processed output for this file (contains astrom keywords) 13 13 # $outfile is the output header data file 14 15 if ($cmproot eq "phu") { goto photometry; } 14 16 15 17 # grab astrometry keywords from $cmpfile: … … 96 98 if ($Nastro == 0) { 97 99 print STDERR "can't find all astrometry keywords from $cmproot\n"; 98 $line = sprintf "COMMENT Elixir failed to find anastrometry solution for this image\n";100 $line = sprintf "COMMENT Elixir: no astrometry solution for this image\n"; 99 101 @astrom = ($line); 100 102 } else { … … 111 113 112 114 # define a reference chip to grab the photometry data 113 $ccd = `cameraconfig -ID 0`; chop $ccd; 114 if (?) { die ("error in camera config\n"); } 115 photometry: 116 if ($cmproot eq "phu") { 117 $ccd = "phu"; 118 } else { 119 $ccd = `cameraconfig -ID 0`; chop $ccd; 120 if ($?) { die ("error in camera config\n"); } 121 } 115 122 116 123 # grab the appropriate photometry data 117 124 @photom = (); 118 @photlist = ` transearch-image $infile $ccd split -equiv`;125 @photlist = `photsearch -trans -image $infile $ccd split -equiv`; 119 126 if ($?) { @photlist = (); } 120 127 … … 123 130 if ($Nphot == 0) { 124 131 print STDERR "can't get photometry data for this image\n"; 125 $line = sprintf "COMMENT Elixir failed to find photometry data for this image\n";132 $line = sprintf "COMMENT Elixir: No photometry calibrations for this night & filter\n"; 126 133 @photom = ($line); 127 134 } else { … … 131 138 $line = sprintf "PHOT_C0 = %20G / Nightly zero point - nominal \n", $words[3]; @photom = (@photom, $line); 132 139 $line = sprintf "PHOT_CS = %20G / Nightly zero point - scatter \n", $words[4]; @photom = (@photom, $line); 133 $line = sprintf "PHOT_ X = %20G / Nightly zero point - color term\n", $words[5]; @photom = (@photom, $line);134 $line = sprintf "PHOT_ K = %20G / Nightly zero point - airmass term\n", $words[6]; @photom = (@photom, $line);135 $line = sprintf "PHOT_ C1 = '%-18s' / Nightly zero point - color 1\n", $words[7]; @photom = (@photom, $line);136 $line = sprintf "PHOT_ C2 = '%-18s' / Nightly zero point - color 2\n", $words[8]; @photom = (@photom, $line);137 $line = sprintf "PHOT_ NM = %20d / Nightly zero point - N images\n", $words[9]; @photom = (@photom, $line);138 $line = sprintf "PHOT_ NS = %20d / Nightly zero point - N stars\n", $words[10]; @photom = (@photom, $line);140 $line = sprintf "PHOT_NS = %20d / Nightly zero point - N stars \n", $words[5]; @photom = (@photom, $line); 141 $line = sprintf "PHOT_NM = %20d / Nightly zero point - N images \n", $words[6]; @photom = (@photom, $line); 142 $line = sprintf "PHOT_X = %20G / Nightly zero point - color term \n", $words[7]; @photom = (@photom, $line); 143 $line = sprintf "PHOT_K = %20G / Nightly zero point - airmass term \n", $words[8]; @photom = (@photom, $line); 144 $line = sprintf "PHOT_C1 = '%-18s' / Nightly zero point - color 1 \n", $words[9]; @photom = (@photom, $line); 145 $line = sprintf "PHOT_C2 = '%-18s' / Nightly zero point - color 2 \n", $words[10]; @photom = (@photom, $line); 139 146 140 # is there was no cmpfile, we should not set the SAT and LIM values. 141 if ($exptime == 0) { 142 $line = sprintf "COMMENT Photometric Analysis is incomplete for this image.\n"; 143 @photom = (@photom, $line); 144 $line = sprintf "COMMENT MAG_SAT and MAG_LIM cannot be determined.\n"; 145 @photom = (@photom, $line); 146 } else { 147 # adjust fsatur & flimit values by phot data 148 $fsatur = $fsatur - 25.0 + $words[2] + 2.5*log($exptime) / log(10.0); 149 $line = sprintf "MAG_SAT = %20G / approx saturation (mag) \n", $fsatur; 150 @photom = (@photom, $line); 151 152 $flimit = $flimit - 25.0 + $words[2] + 2.5*log($exptime) / log(10.0); 153 $line = sprintf "MAG_LIM = %20G / approx completeness limit (mag) \n", $flimit; 154 @photom = (@photom, $line); 147 if ($cmproot ne "phu") { 148 # is there was no cmpfile, we should not set the SAT and LIM values. 149 if ($exptime == 0) { 150 $line = sprintf "COMMENT Photometric Analysis is incomplete for this image.\n"; 151 @photom = (@photom, $line); 152 $line = sprintf "COMMENT MAG_SAT and MAG_LIM cannot be determined.\n"; 153 @photom = (@photom, $line); 154 } else { 155 # adjust fsatur & flimit values by phot data 156 $fsatur = $fsatur - 25.0 + $words[2] + 2.5*log($exptime) / log(10.0); 157 $line = sprintf "MAG_SAT = %20G / approx saturation (mag) \n", $fsatur; 158 @photom = (@photom, $line); 159 160 $flimit = $flimit - 25.0 + $words[2] + 2.5*log($exptime) / log(10.0); 161 $line = sprintf "MAG_LIM = %20G / approx completeness limit (mag) \n", $flimit; 162 @photom = (@photom, $line); 163 } 155 164 } 156 165 … … 166 175 @comment = (); 167 176 $line = sprintf "COMMENT --------------- Elixir Analysis --------------- \n"; @comment = (@comment, $line); 168 $line = sprintf "COMMENT Elixir processing performed \@ CFHT, version $version \n"; @comment = (@comment, $line);169 $line = sprintf "COMMENT Elixir version: $version \n"; @comment = (@comment, $line);170 $line = sprintf "COMMENT Elixir processing date: $now \n"; @comment = (@comment, $line);171 $line = sprintf "COMMENT Elixir website: http://www.cfht.hawaii.edu/Instruments/Elixir \n"; @comment = (@comment, $line);172 $line = sprintf "COMMENT Elixir email: elixir\@cfht.hawaii.edu \n"; @comment = (@comment, $line);173 $line = sprintf "COMMENT Elixir team: Eugene Magnier & Jean-Charles Cuillandre \n"; @comment = (@comment, $line);177 $line = sprintf "COMMENT Elixir: processing performed \@ CFHT, version $version \n"; @comment = (@comment, $line); 178 $line = sprintf "COMMENT Elixir: version: $version \n"; @comment = (@comment, $line); 179 $line = sprintf "COMMENT Elixir: processing date: $now \n"; @comment = (@comment, $line); 180 $line = sprintf "COMMENT Elixir: website: http://www.cfht.hawaii.edu/Instruments/Elixir \n"; @comment = (@comment, $line); 181 $line = sprintf "COMMENT Elixir: email: elixir\@cfht.hawaii.edu \n"; @comment = (@comment, $line); 182 $line = sprintf "COMMENT Elixir: team: Eugene Magnier & Jean-Charles Cuillandre \n"; @comment = (@comment, $line); 174 183 # (line < 80) 12345678901234567890123456789012345678901234567890123456789012345678901234567890 175 184
Note:
See TracChangeset
for help on using the changeset viewer.
