IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23723


Ignore:
Timestamp:
Apr 7, 2009, 12:27:23 PM (17 years ago)
Author:
Paul Price
Message:

Adding bits and pieces to generate warp-warp diffs.

Location:
branches/pap
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/pap/ippScripts/scripts/diff_skycell.pl

    r23688 r23723  
    9595my $tess_id;                    # Tesselation identifier
    9696my $camera;                     # Camera
    97 my $magicked_0;
    98 my $magicked_1;
     97my ($inputMagic, $templateMagic); # Are the inputs been magicked?
     98my $inverse = 1;                # Generate inverse subtraction if warp-warp
    9999foreach my $file (@$files) {
    100100    if (defined $file->{template} and $file->{template}) {
     
    106106            $templateSources = "PSPHOT.OUT.CMF.MEF";  ## this must be consistent with the value in stack_skycell.pl:161
    107107            # template is a stack so it doesn't need to be magicked
    108             $magicked_1 = 1;
     108            $templateMagic = 1;
     109            $inverse = 0;
    109110            ## use an explicit stack name for psphot output objects
    110111        } else {
     
    112113            $templateVariance = "PSWARP.OUTPUT.VARIANCE";
    113114            $templateSources = "PSWARP.OUTPUT.SOURCES";
    114             $magicked_1 = $file->{magicked};
     115            $templateMagic = $file->{magicked};
    115116        }
    116117    } else {
    117118        $input = $file->{uri};
    118119        $inputPath = $file->{path_base};
    119         $magicked_0 = $file->{magicked};    # if input is a stack the output can't be "magicked"
     120        $inputMagic = $file->{magicked};    # if input is a stack the output can't be "magicked"
    120121        if ($file->{warp_id} == 0) {
    121122            $inputMask = "PPSTACK.OUTPUT.MASK";
    122123            $inputVariance = "PPSTACK.OUTPUT.VARIANCE";
    123124            $inputSources = "PSPHOT.OUT.CMF.MEF";  ## this must be consistent with the value in stack_skycell.pl:161
     125            $inverse = 0;
    124126        } else {
    125127            $inputMask = "PSWARP.OUTPUT.MASK";
     
    145147        $camera = $file->{camera};
    146148    }
    147 
    148149}
    149150
     
    158159# note that difftool -inputskyfile outputs the magicked boolean as an int not T or F
    159160# because the output is constructed from a union of two selects
    160 my $magicked = $magicked_0 && $magicked_1;
     161my $magicked = $inputMagic && $templateMagic;
    161162
    162163# Recipes to use based on reduction class
     
    207208my $outputMask = $ipprc->filename("PPSUB.OUTPUT.MASK", $outroot);
    208209my $outputVariance = $ipprc->filename("PPSUB.OUTPUT.VARIANCE", $outroot);
     210my $outputSources = $ipprc->filename("PPSUB.OUTPUT.SOURCES", $outroot);
     211my $jpeg1Name = $ipprc->filename("PPSUB.JPEG1", $outroot);
     212my $jpeg2Name = $ipprc->filename("PPSUB.JPEG2", $outroot);
    209213my $configuration = $ipprc->filename("PPSUB.CONFIG", $outroot);
    210 my $outputSources = $ipprc->filename("PSPHOT.OUT.CMF.MEF", $outroot);
    211 #my $bin1Name =  $ipprc->filename("PPSUB.BIN1", $outroot);
    212 #my $bin2Name =  $ipprc->filename("PPSUB.BIN2", $outroot);
    213214my $outputStats = $ipprc->filename("SKYCELL.STATS", $outroot);
    214215my $traceDest = $ipprc->filename("TRACE.EXP", $outroot);
     216
     217my ($inverseName, $inverseMask, $inverseVariance, $inverseSources);
     218if ($inverse) {
     219    $inverseName = $ipprc->filename("PPSUB.INVERSE", $outroot);
     220    $inverseMask = $ipprc->filename("PPSUB.INVERSE.MASK", $outroot);
     221    $inverseVariance = $ipprc->filename("PPSUB.INVERSE.VARIANCE", $outroot);
     222    $inverseSources = $ipprc->filename("PPSUB.INVERSE.SOURCES", $outroot);
     223}
    215224
    216225my $cmdflags;
     
    236245    $command .= " -F PSPHOT.BACKMDL PSPHOT.BACKMDL.MEF";
    237246    $command .= " -photometry";
     247    $command .= " -inverse" if $inverse;
    238248    $command .= " -tracedest $traceDest -log $logDest";
    239249    $command .= " -dumpconfig $configuration";
     
    271281        &my_die("Couldn't find expected output file: $outputMask", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputMask);
    272282        &my_die("Couldn't find expected output file: $outputVariance", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputVariance);
    273 #        &my_die("Couldn't find expected output file: $outputSources", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputSources);
    274 #        &my_die("Couldn't find expected output file: $bin1Name",    $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($bin1Name);
    275 #        &my_die("Couldn't find expected output file: $bin2Name",    $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($bin2Name);
     283        &my_die("Couldn't find expected output file: $outputSources", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputSources);
     284        &my_die("Couldn't find expected output file: $jpeg1Name",    $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($jpeg1Name);
     285        &my_die("Couldn't find expected output file: $jpeg2Name",    $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($jpeg2Name);
     286        if ($inverse) {
     287            &my_die("Couldn't find expected output file: $inverseName", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inverseName);
     288            &my_die("Couldn't find expected output file: $inverseMask", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inverseMask);
     289            &my_die("Couldn't find expected output file: $inverseVariance", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inverseVariance);
     290            &my_die("Couldn't find expected output file: $inverseSources", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inverseSources);
     291        }
    276292    }
    277293}
  • branches/pap/ippTools/src/difftool.c

    r23688 r23723  
    12751275    PXOPT_COPY_STR(config->args, selectWhere, "-input_label", "inputWarpRun.label", "==");
    12761276    PXOPT_COPY_STR(config->args, selectWhere, "-template_label", "templateWarpRun.label", "==");
     1277    PXOPT_COPY_F32(config->args, selectWhere, "-rotdiff", "ABS(inputRawExp.posang - templateRawExp.posang)", "<=");
    12771278    PXOPT_COPY_F32(config->args, selectWhere, "-timediff",
    12781279                   "ABS(TIME_TO_SEC(TIMEDIFF(inputRawExp.dateobs, templateRawExp.dateobs)))", "<=");
    1279     PXOPT_COPY_F32(config->args, selectWhere, "-rotdiff", "ABS(inputRawExp.posang - templateRawExp.posang)", "<=");
     1280
    12801281    // Haversine formula for great circle distance
    12811282    PXOPT_COPY_F32(config->args, selectWhere, "-distance",
    12821283                   "DEGREES(2*ASIN(SQRT(POW(SIN(inputRawExp.decl - templateRawExp.decl),2) + COS(inputRawExp.decl)*COS(templateRawExp.decl)*POW(SIN(inputRawExp.ra - templateRawExp.ra),2))))", "<=");
     1284
     1285    PXOPT_LOOKUP_BOOL(backwards, config->args, "-backwards", false);
     1286
     1287    psMetadataAddF32(selectWhere, PS_LIST_TAIL,
     1288                     "TIME_TO_SEC(TIMEDIFF(inputRawExp.dateobs, templateRawExp.dateobs))",
     1289                     PS_META_DUPLICATE_OK, backwards ? "<" : ">", 0.0);
    12831290
    12841291    // Restrictions for inserting skycells
  • branches/pap/ippTools/src/difftoolConfig.c

    r23688 r23723  
    174174    psMetadataAddStr(definewarpwarpArgs, PS_LIST_TAIL, "-obs_mode", 0, "search by observation mode", NULL);
    175175    psMetadataAddF32(definewarpwarpArgs, PS_LIST_TAIL, "-timediff", 0, "limit time difference between input and template", NAN);
     176    psMetadataAddBool(definewarpwarpArgs, PS_LIST_TAIL, "-backwards", 0, "Template comes after input?", false);
    176177    psMetadataAddF32(definewarpwarpArgs, PS_LIST_TAIL, "-rotdiff", 0, "limit rotator difference between input and template", NAN);
    177178    psMetadataAddStr(definewarpwarpArgs, PS_LIST_TAIL, "-input_label", 0, "search by warp label for input", NULL);
  • branches/pap/ippconfig/recipes/ppSub.config

    r23719 r23723  
    4545
    4646INVERSE         BOOL    FALSE           # Generate inverse subtraction?
    47 PHOTOMETRY      BOOL    FALSE           # Perform photometry?
     47PHOTOMETRY      BOOL    TRUE            # Perform photometry?
    4848
    4949
     
    6060DIFF    METADATA
    6161END
     62
     63# Difference of two warps
     64WARPWARP        METADATA
     65        INVERSE         BOOL    TRUE    # Generate inverse subtraction?
     66END
  • branches/pap/ppSub/src/ppSubArguments.c

    r23719 r23723  
    7575    psMetadataAddS32(arguments, PS_LIST_TAIL, "-threads", 0, "Number of threads", 0);
    7676    psMetadataAddStr(arguments, PS_LIST_TAIL, "-dumpconfig", 0, "file to dump configuration to", NULL);
     77    psMetadataAddBool(arguments, PS_LIST_TAIL, "-photometry", 0, "Perform photometry?", NULL);
     78    psMetadataAddBool(arguments, PS_LIST_TAIL, "-inverse", 0, "Generate inverse subtractions?", NULL);
    7779    psMetadataAddBool(arguments, PS_LIST_TAIL, "-visual", 0, "Show diagnostic plots", NULL);
    7880
  • branches/pap/ppSub/src/ppSubCamera.c

    r23719 r23723  
    202202        return false;
    203203    }
     204    if (psMetadataLookupBool(NULL, config->arguments, "-photometry")) {
     205        psMetadataAddBool(config->arguments, PS_LIST_TAIL, "PHOTOMETRY", PS_META_REPLACE,
     206                          "Perform photometry?", true);
     207    }
     208    if (psMetadataLookupBool(NULL, config->arguments, "-inverse")) {
     209        psMetadataAddBool(config->arguments, PS_LIST_TAIL, "INVERSE", PS_META_REPLACE,
     210                          "Generate inverse subtractions?", true);
     211    }
     212
    204213    data->inverse = psMetadataLookupBool(NULL, recipe, "INVERSE");
    205214    data->photometry = psMetadataLookupBool(NULL, recipe, "PHOTOMETRY");
Note: See TracChangeset for help on using the changeset viewer.