IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 7738


Ignore:
Timestamp:
Jun 28, 2006, 2:26:49 PM (20 years ago)
Author:
eugene
Message:

adding ppFocus elements

Location:
trunk/ppImage/src
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppImage/src/Makefile.am

    r7592 r7738  
    1 bin_PROGRAMS = ppImage ppTest
     1bin_PROGRAMS = ppImage ppFocus ppTest
    22
    33noinst_HEADERS = \
     
    2323        ppImageAstrom.c
    2424
    25 #       ppImageParseCamera.c \
    26 #       ppDetrendFlat.c \
    27 #       ppImageWeights.c \
    28 #       ppImageLoadPixels.c
    29 #       ppImageOutput.c
    30 #       ppImageDetrendPedestal.c
    31 #       ppImageOutput.c
    32 #       ppImagePhot.c
     25ppFocus_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PSPHOT_CFLAGS) $(PSASTRO_CFLAGS) $(ppImage_CFLAGS)
     26ppFocus_LDFLAGS = $(PSLIB_LIBS) $(PSMODULE_LIBS) $(PSPHOT_LIBS) $(PSASTRO_LIBS)
     27ppFocus_SOURCES = \
     28        ppFocus.c \
     29        ppFocusArguments.c \
     30        ppFocusParseCamera.c \
     31        ppFocusGetFWHM.c \
     32        ppFocusFitFWHM.c \
     33        ppImageLoop.c \
     34        ppImageCleanup.c \
     35        ppImageOptions.c \
     36        ppImageDetrendReadout.c \
     37        ppImageDetrendBias.c \
     38        ppImageDetrendNonLinear.c \
     39        ppImageRebinReadout.c \
     40        ppImageMosaic.c \
     41        ppImagePhotom.c \
     42        ppImageAstrom.c
    3343
    3444ppTest_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(ppImage_CFLAGS)
  • trunk/ppImage/src/ppFocus.c

    r7706 r7738  
    2525    }
    2626   
    27    
    28    
    29 
    30     // Image Arithmetic Loop
    31     if (!ppImageLoop(config, options)) {
    32         psErrorStackPrint(stderr, "");
     27    // we search the argument data for the named fileset (argname)
     28    psArray *infiles = psMetadataLookupPtr(NULL, config->arguments, "INPUT");
     29    if (!infiles) {
     30        psTrace("pmFPAfile", 5, "Failed to find INPUT in argument list");
    3331        exit(1);
    3432    }
    3533
    36     psLogMsg ("ppImage", 3, "complete ppImage run: %f sec\n", psTimerMark (TIMERNAME));
     34    // allocate vectors for analysis
     35    psVector *focus = psVectorAlloc (infiles->n, PS_TYPE_F32);
     36    psVector *fwhm = psVectorAlloc (infiles->n, PS_TYPE_F32);
     37
     38    for (int i = 0; i < infiles->n; i++) {
     39
     40        // Image Arithmetic Loop
     41        if (!ppImageLoop(config, options)) {
     42            psErrorStackPrint(stderr, "");
     43            exit(1);
     44        }
     45       
     46        // determine FWHM at reference location in image
     47        // (also removes PPIMAGE.INPUT from config->files)
     48        ppFocusGetFWHM (config, focus, fwhm);
     49
     50        // silently ignore failure for (i == infiles->n)
     51        pmFPAfileDefineSingleFromArgs (NULL, config, "PPIMAGE.INPUT", "INPUT", i+1);
     52    }
     53
     54    ppFocusFitFWHM (config, focus, fwhm);
     55
     56    psLogMsg ("ppFocus", 3, "complete ppFocus run: %f sec\n", psTimerMark (TIMERNAME));
    3757
    3858    // Cleaning up
     
    4464// - the input list is a set of independent images (not multiple files for a single image)
    4565// - each pass to ppImageLoop performs the analysis on a different pmFPAfile
    46 // -
     66// - after each ppImageLoop, grap the input pmFPAfile and extract the FWHM stats
  • trunk/ppImage/src/ppFocusArguments.c

    r7706 r7738  
    22
    33static void usage (void) {
    4     fprintf (stderr, "USAGE: ppFocus [-file INPUT.fits] [-list INPUT.txt] OUTPUT\n");
     4    fprintf (stderr, "USAGE: ppFocus [-file focus.*.fits] [-list INPUT.txt] OUTPUT\n");
    55    exit (2);
    66}
  • trunk/ppImage/src/ppFocusParseCamera.c

    r7706 r7738  
    88    // the first input image defines the camera, and all recipes and options that follow
    99    // select only the first file from the INPUT array
    10     pmFPAfile *input = pmFPAfileDefineFromArgs (&status, config, "PPIMAGE.INPUT", "INPUT");
     10    pmFPAfile *input = pmFPAfileDefineSingleFromArgs (&status, config, "PPIMAGE.INPUT", "INPUT", 0);
    1111    if (!status) {
    1212        psError(PS_ERR_IO, false, "Failed to build FPA from PPIMAGE.INPUT");
  • trunk/ppImage/src/ppImage.h

    r7677 r7738  
    4545void ppImageFileCheck (pmConfig *config);
    4646
     47// functions used by ppFocus
     48pmConfig *ppFocusArguments(int argc, char **argv);
     49ppImageOptions *ppFocusParseCamera (pmConfig *config);
     50bool ppFocusGetFWHM (pmConfig *config, psVector *focus, psVector *fwhm);
     51bool ppFocusFitFWHM (pmConfig *config, psVector *focus, psVector *fwhm);
     52
    4753#endif
  • trunk/ppImage/src/ppImageLoop.c

    r7733 r7738  
    77    pmCell *cell;
    88    pmReadout *readout;
    9     psMemId ID;
    109
    1110    pmFPAfile *input = psMetadataLookupPtr (&status, config->files, "PPIMAGE.INPUT");
     
    2423        if (!chip->process || !chip->file_exists) { continue; }
    2524
    26         ID = psMemGetId();
    2725        if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) return false;
    2826
Note: See TracChangeset for help on using the changeset viewer.