IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 58


Ignore:
Timestamp:
Feb 19, 2003, 1:33:52 PM (23 years ago)
Author:
eugene
Message:

abstracted the filter-dependent minflux, mincnts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/perl/src/dt.select

    r47 r58  
    22$SKIPDOME = 0;
    33
    4 if (@ARGV != 6) { die "ERROR: USAGE: imselect (type) (filter) (tstart) (tend) (output) (-split | -mef)\n" }
     4if (@ARGV != 6) { die "ERROR: USAGE: imselect (type) (filter) (tstart) (tend) (output) (SPLIT | MEF)\n" }
    55
    66$type   = "\U$ARGV[0]\E";
     
    1010$output = $ARGV[4];
    1111$mode   = $ARGV[5];
    12 
    13 $ptolemy = $ENV{'PTOLEMY'};
    14 print "PTOLEMY: $ptolemy\n";
    15 system ("cp $ptolemy /h/eugene/ptolemy.config");
    1612
    1713unless ($output =~ /CCDNUM/) { die "ERROR: output file needs CCDNUM component\n"; }
     
    2319if ($type eq "FLAT") {
    2420    # define some of the relevant parameters
    25     $min = 2000;
    2621    $max = 60000;
    27     $minrate = 100;
    28     $ratescale = 70;
    29     if ($filter eq "B") { $minrate = 0.5  * $ratescale;  }
    30     if ($filter eq "V") { $minrate = 1.0  * $ratescale;  }
    31     if ($filter eq "R") { $minrate = 3.5  * $ratescale;  }
    32     if ($filter eq "I") { $minrate = 14.2 * $ratescale; }
    33     if ($filter eq "Z") { $minrate = 10.5 * $ratescale; }
    34     if ($filter eq "HA")    { $min = 1000; }
    35     if ($filter eq "HAOFF") { $min = 1000; }
    36     # these should come from the filter tables
    37     # probably need to set these in a more intelligent fashion.
     22
     23    $tmp = `filtnames $filter`; chop $tmp;
     24    if ($?) { die "ERROR: invalid filter $filter\n"; }
     25    $filter = $tmp;
     26
     27    # recipe file defines detrend types & cutoff exptime values
     28    $recipefile = `gconfig DETREND_RECIPES`; chop $recipefile;
     29    if ($?) { die "ERROR: missing DETREND_RECIPES in configuration\n"; }
     30
     31    ($tmp, $tmp, $extras) = split (" ", `gconfig -c $recipefile $filter`);
     32    if ($?) { die "ERROR: missing detrend recipe for $filter\n"; }
     33
     34    # all filters have 'flat', grab extras:
     35    ($detype, $minflux, $min) = split (",", $extras);
     36    if ("\U$detype\E" ne "FLAT") { die "ERROR: flat extras are missing\n"; }
    3837}
    3938
     
    138137            # test for acceptable flux
    139138            $Flux = $words2[11] / $words2[7];
    140             if ($Flux < $minrate) { print STDERR "$words[5] rejected: flux too low: $Flux vs $minrate\n"; next FRAME; }
     139            if ($Flux < $minflux) { print STDERR "$words[5] rejected: flux too low: $Flux vs $minflux\n"; next FRAME; }
    141140        }
    142141    }
Note: See TracChangeset for help on using the changeset viewer.