IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 12, 2009, 12:16:20 PM (17 years ago)
Author:
Paul Price
Message:

Updating arguments and file definition to support update mode. This is complicated by having an in-between product that can be either an input or an output --- the convolution kernel. I've put code in (defineCalcFile) that I hope will handle this. This is untested. I also still need to update the processing part to handle the case that the convolution kernel is already known.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppSub/src/ppSubArguments.c

    r23242 r23298  
    2929{
    3030    fprintf(stderr, "\nPan-STARRS PSF-matched image subtraction\n\n");
    31     fprintf(stderr, "Usage: %s INPUT.fits REFERENCE.fits OUTPUT_ROOT \n"
     31    fprintf(stderr, "Usage: %s OUTPUT_ROOT \n"
    3232            "\t[-psf REFERENCE.psf.fits]\n\n"
    3333            "This subtracts the convolved REFERENCE from the INPUT, by default.\n",
     
    202202
    203203    psMetadata *arguments = config->arguments; // Command-line arguments
     204    psMetadataAddStr(arguments, PS_LIST_TAIL, "-inimage", 0, "Input image", NULL);
    204205    psMetadataAddStr(arguments, PS_LIST_TAIL, "-inmask", 0, "Input mask image", NULL);
    205206    psMetadataAddStr(arguments, PS_LIST_TAIL, "-invariance", 0, "Input variance image", NULL);
    206207    psMetadataAddStr(arguments, PS_LIST_TAIL, "-insources", 0, "Input source list", NULL);
     208    psMetadataAddStr(arguments, PS_LIST_TAIL, "-refimage", 0, "Reference image", NULL);
    207209    psMetadataAddStr(arguments, PS_LIST_TAIL, "-refmask", 0, "Reference mask image", NULL);
    208210    psMetadataAddStr(arguments, PS_LIST_TAIL, "-refvariance", 0, "Reference variance image", NULL);
    209211    psMetadataAddStr(arguments, PS_LIST_TAIL, "-refsources", 0, "Reference source list", NULL);
     212    psMetadataAddStr(arguments, PS_LIST_TAIL, "-kernel", 0, "Precalculated kernel to apply", NULL);
    210213    psMetadataAddStr(arguments, PS_LIST_TAIL, "-stats", 0, "Statistics file", NULL);
    211214    psMetadataAddF32(arguments, PS_LIST_TAIL, "-region", 0, "Size of iso-kernel region", NAN);
     
    253256    psMetadataAddBool(arguments, PS_LIST_TAIL, "-visual", 0, "Show diagnostic plots", NULL);
    254257
    255     if (argc == 1 || !psArgumentParse(arguments, &argc, argv) || argc != 4) {
     258    if (argc == 1 || !psArgumentParse(arguments, &argc, argv) || argc != 2) {
    256259        usage(argv[0], arguments, config);
    257260    }
    258261
    259     fileList("INPUT", argv[1], "Name of the input image",     config);
    260     fileList("REF",   argv[2], "Name of the reference image", config);
    261262    psMetadataAddStr(config->arguments, PS_LIST_TAIL, "OUTPUT", 0, "Name of the output image", argv[3]);
    262263
     264
     265    const char *inImage = psMetadataLookupStr(NULL, arguments, "-inimage"); // Name of input image
     266    if (inImage && strlen(inImage) > 0) {
     267        fileList("INPUT", inImage, "Name of the input image", config);
     268    }
    263269    const char *inMask = psMetadataLookupStr(NULL, arguments, "-inmask"); // Name of input mask
    264270    if (inMask && strlen(inMask) > 0) {
     
    274280    }
    275281
     282    const char *refImage = psMetadataLookupStr(NULL, arguments, "-refimage"); // Name of reference image
     283    if (refImage && strlen(refImage) > 0) {
     284        fileList("INPUT", refImage, "Name of the reference image", config);
     285    }
    276286    const char *refMask = psMetadataLookupStr(NULL, arguments, "-refmask"); // Name of reference mask
    277287    if (refMask && strlen(refMask) > 0) {
     
    285295    if (refSources && strlen(refSources) > 0) {
    286296        fileList("REF.SOURCES", refSources, "Name of the reference source list", config);
     297    }
     298
     299    const char *kernel = psMetadataLookupStr(NULL, arguments, "-kernel"); // Name of kernel
     300    if (kernel && strlen(kernel) > 0) {
     301        fileList("KERNEL", kernel, "Name of the kernel to apply", config);
    287302    }
    288303
Note: See TracChangeset for help on using the changeset viewer.