IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 89


Ignore:
Timestamp:
May 29, 2003, 3:32:19 PM (23 years ago)
Author:
eugene
Message:

added phu support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/perl/src/dads.detrend

    r70 r89  
    155155@demlist = ();
    156156foreach $ccd (@ccdn) {
    157 
    158     # create output name
    159     $name = "$outdir/$base$ccd.fits";
    160     @fitlist = (@fitlist, $name);
    161 
    162     # create tmp detrended name
    163     $name = "$workdir/$base$ccd.det";
    164     @detlist = (@detlist, $name);
    165 
    166     # create tmp demoded name
    167     $name = "$workdir/$base$ccd.dem";
    168     @demlist = (@demlist, $name);
    169 
    170     # create tmp defringed name
    171     $name = "$workdir/$base$ccd.def";
    172     @deflist = (@deflist, $name);
    173 }
     157    push @fitlist, "$outdir/$base$ccd.fits";
     158    push @detlist, "$workdir/$base$ccd.det";
     159    push @demlist, "$workdir/$base$ccd.dem";
     160    push @deflist, "$workdir/$base$ccd.def";
     161}
     162# phu file:
     163$phufile = "$outdir/$base.phu";
     164goto skipall;
    174165
    175166# final output   is    @fitlist
     
    190181    if ($status) { &escape ("ERROR: problem running flatten on $input, $ccds[$i]"); }
    191182}
    192 
     183$status = &vsystem ("flatten.flips $close -quiet $input $phufile phu mef");
     184if ($status) { &escape ("ERROR: problem running flatten on $input, phu"); }
    193185
    194186# we need files containing detlist, demlist, deflist:
     
    229221}
    230222
     223# update the phu header with the results from ccd # 0
     224if ($DO_DEMODE || $DO_DEFRINGE) {
     225    $temp = `mktemp /tmp/elixir.XXXXXX`; chop ($temp);
     226    system ("fhead $detlist[0] > $temp.1.hdr");
     227    system ("fhead $fitlist[0] > $temp.2.hdr");
     228   
     229    @answer = `diff $temp.1.hdr $temp.2.hdr`;
     230    open (FILE, ">$temp.hdr");
     231    foreach $line (@answer) {
     232        if ($line =~ m|^>\s|) {
     233            ($head) = $line =~ m|^>\s(.*)$|;
     234            print FILE "$head\n";
     235        }
     236    }
     237    close FILE;
     238 
     239    vsystem ("fits_insert $phufile $temp.hdr");
     240    if ($?) { &escape ("ERROR: cannot update phu"); }
     241    unlink ("$temp");
     242    unlink ("$temp.1.hdr");
     243    unlink ("$temp.2.hdr");
     244    unlink ("$temp.hdr");
     245}
     246
     247 skipall:
     248    $temp = "/tmp/elixir.1yqFQu";
     249exit 1;
     250
    231251&goodbye ("SUCCESS: finished with dads.detrend");
    232252
Note: See TracChangeset for help on using the changeset viewer.