Changeset 5980 for trunk/psphot/src/psphotTestArguments.c
- Timestamp:
- Jan 13, 2006, 8:24:10 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotTestArguments.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotTestArguments.c
r5672 r5980 2 2 static int usage (); 3 3 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; 4 void psphotTestArguments (int *argc, char **argv) { 10 5 11 6 // basic pslib options … … 13 8 psArgumentVerbosity (argc, argv); 14 9 15 // identify options in args list - these go on config16 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 40 10 if (*argc != 3) usage (); 41 11 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; 60 13 } 61 14 62 15 static int usage () { 63 16 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"); 69 18 exit (2); 70 19 }
Note:
See TracChangeset
for help on using the changeset viewer.
