IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 94


Ignore:
Timestamp:
Jul 23, 2003, 3:37:02 PM (23 years ago)
Author:
eugene
Message:

fixed-up phot.db errors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/perl/src/grab.keywords

    r79 r94  
    11#!/usr/bin/env perl
    22
    3 $version = 1.0;
     3$version = 2.0;
    44
    55if (@ARGV != 3) { die "USAGE: grab.keywords (infile) (cmproot) (outfile)\n" ; }
     
    1212# $cmproot is the rootname of the processed output for this file (contains astrom keywords)
    1313# $outfile is the output header data file
     14
     15if ($cmproot eq "phu") { goto photometry; }
    1416
    1517# grab astrometry keywords from $cmpfile:
     
    9698if ($Nastro == 0) {
    9799    print STDERR "can't find all astrometry keywords from $cmproot\n";
    98     $line = sprintf "COMMENT   Elixir failed to find an astrometry solution for this image\n";
     100    $line = sprintf "COMMENT  Elixir:  no astrometry solution for this image\n";
    99101    @astrom = ($line);
    100102} else {
     
    111113
    112114# 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     }
    115122
    116123# grab the appropriate photometry data
    117124@photom = ();
    118 @photlist = `transearch -image $infile $ccd split -equiv`;
     125@photlist = `photsearch -trans -image $infile $ccd split -equiv`;
    119126if ($?) { @photlist = (); }
    120127
     
    123130if ($Nphot == 0) {
    124131    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";
    126133    @photom = ($line);
    127134} else {
     
    131138    $line = sprintf "PHOT_C0 = %20G / Nightly zero point - nominal                  \n", $words[3];  @photom = (@photom, $line);
    132139    $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);
    139146   
    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        }
    155164    }
    156165
     
    166175@comment = ();
    167176$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);
    174183# (line < 80)    12345678901234567890123456789012345678901234567890123456789012345678901234567890
    175184
Note: See TracChangeset for help on using the changeset viewer.