IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 11, 2012, 2:04:31 PM (13 years ago)
Author:
watersc1
Message:

Merge from my branch including background restoration and stack stage projection cell binned images.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/ippScripts/scripts/warp_skycell.pl

    r33053 r34800  
    128128# Where do we get the astrometry source from?
    129129my $astromSource;               # The astrometry source
     130my $doBackground;               # Do we want to make background models?
    130131{
    131132    my $command = "$ppConfigDump -camera $camera -recipe PSWARP $recipe_pswarp -dump-recipe PSWARP -";
     
    139140        &my_die("Unable to parse metadata config doc", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_PROG_ERROR);
    140141    $astromSource = metadataLookupStr($metadata, 'ASTROM.SOURCE');
     142    $doBackground = metadataLookupBool($metadata, 'BACKGROUND.MODEL');   
    141143}
    142144
     
    168170if ($do_stats) {
    169171    $outputStats = prepare_output ("SKYCELL.STATS", $outroot, $skycell_id, 1) if $do_stats;
     172}
     173my $outputBKGs;
     174if ($doBackground) {
     175    $outputBKGs = prepare_output ("PSWARP.OUTPUT.BKGMODEL", $outroot, $skycell_id, 1);
    170176}
    171177my $configuration;
     
    209215my ($weightFile, $weightName) = tempfile( "$tempOutRoot.weight.list.XXXX", UNLINK => !$save_temps);
    210216my ($astromFile, $astromName) = tempfile( "$tempOutRoot.astrom.list.XXXX", UNLINK => !$save_temps);
    211 
     217my ($bkgFile, $bkgName);
     218if ($doBackground) {
     219    ($bkgFile, $bkgName) = tempfile( "$tempOutRoot.bkg.list.XXXX", UNLINK => !$save_temps);
     220}
    212221my $wrote_astrom = 0;
    213222foreach my $imfile (@$imfiles) {
     
    235244    print $maskFile   "$mask\n";
    236245    print $weightFile "$weight\n";
     246    my $bkg;
     247    if ($doBackground) {
     248        $bkg    = $ipprc->filename("PSPHOT.BACKMDL", $imfile->{chip_path_base}, $imfile->{class_id});
     249        print $bkgFile "$bkg\n";
     250    }
    237251
    238252    if (!$wrote_astrom) {
     
    245259close $weightFile;
    246260close $astromFile;
    247 
     261if ($doBackground) {
     262    close($bkgFile);
     263}
    248264# We need the recipe to determine if we care whether the PSF is generated or not
    249265my $recipe;
     
    269285    $command .= " -variancelist $weightName";
    270286    $command .= " -astromlist $astromName";
     287    $command .= " -bkglist $bkgName" if ($doBackground);
    271288    $command .= " $outroot $skyFile";
    272289    $command .= " -F PSPHOT.PSF.SAVE PSPHOT.PSF.SKY.SAVE";
Note: See TracChangeset for help on using the changeset viewer.