IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 13, 2006, 8:24:10 PM (21 years ago)
Author:
eugene
Message:

substantial work on the aperture residuals

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotTestArguments.c

    r5672 r5980  
    22static int usage ();
    33
    4 psMetadata *psphotTestArguments (int *argc, char **argv) {
    5 
    6   int N;
    7   unsigned int Nfail;
    8   int mode = PS_DATA_STRING | PS_META_REPLACE;
    9   psF32 UseCoords_X, UseCoords_Y;
     4void psphotTestArguments (int *argc, char **argv) {
    105
    116  // basic pslib options
     
    138  psArgumentVerbosity (argc, argv);
    149
    15   // identify options in args list - these go on config
    16   bool UseCoords = false;
    17   if ((N = psArgumentGet (*argc, argv, "-coords"))) {
    18     UseCoords = true;
    19     psArgumentRemove (N, argc, argv);
    20     UseCoords_X = atof (argv[N]);
    21     psArgumentRemove (N, argc, argv);
    22     UseCoords_Y = atof (argv[N]);
    23     psArgumentRemove (N, argc, argv);
    24   }
    25 
    26   float threshold = -1;
    27   if ((N = psArgumentGet (*argc, argv, "-threshold"))) {
    28     psArgumentRemove (N, argc, argv);
    29     threshold = atof (argv[N]);
    30     psArgumentRemove (N, argc, argv);
    31   }
    32 
    33   float fraction = 0.5;
    34   if ((N = psArgumentGet (*argc, argv, "-frac"))) {
    35     psArgumentRemove (N, argc, argv);
    36     fraction = atof (argv[N]);
    37     psArgumentRemove (N, argc, argv);
    38   }
    39 
    4010  if (*argc != 3) usage ();
    4111
    42   // load config information
    43   psMetadata *config = psMetadataAlloc ();
    44   psMetadataAdd (config, PS_LIST_HEAD, "PSF_MODEL", PS_DATA_METADATA_MULTI, "folder for psf model entries", NULL);
    45   config = psMetadataConfigParse (config, &Nfail, argv[2], FALSE);
    46 
    47   // identify input image
    48   psMetadataAdd (config, PS_LIST_HEAD, "IMAGE", mode, "", argv[1]);
    49 
    50   mode = PS_DATA_F32 | PS_META_REPLACE;
    51   psMetadataAdd (config, PS_LIST_HEAD, "TEST_THRESHOLD", mode, "", threshold);
    52   psMetadataAdd (config, PS_LIST_HEAD, "TEST_FRACTION",  mode, "", fraction);
    53 
    54   if (UseCoords) {
    55     psMetadataAdd (config, PS_LIST_HEAD, "TEST_FIT_X", mode, "", UseCoords_X);
    56     psMetadataAdd (config, PS_LIST_HEAD, "TEST_FIT_Y", mode, "", UseCoords_Y);
    57   }
    58 
    59   return (config);
     12  return;
    6013}
    6114
    6215static int usage () {
    6316
    64     fprintf (stderr, "USAGE: psphotModelTest (image.fits) (config)\n");
    65     fprintf (stderr, "options: \n");
    66     fprintf (stderr, "  -coords x y   : specify object center\n");
    67     fprintf (stderr, "  -threshold (threshold) : (defaults to FRAC of peak\n");
    68     fprintf (stderr, "  -frac (FRAC) : specify how to determine threshold\n");
     17    fprintf (stderr, "USAGE: psphotModelTest (apresid.dat) (power)\n");
    6918    exit (2);
    7019}
Note: See TracChangeset for help on using the changeset viewer.