Changeset 7917 for trunk/Ohana/src/opihi/dvo/photometry.c
- Timestamp:
- Jul 16, 2006, 10:58:49 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/dvo/photometry.c (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/dvo/photometry.c
r7680 r7917 101 101 mode = GetMagMode (p + 1); 102 102 if (mode == MAG_NONE) { 103 fprintf (stderr, "syntax error in magnitude mode\n");103 gprint (GP_ERR, "syntax error in magnitude mode\n"); 104 104 free (tmpstring); 105 105 return (FALSE); … … 119 119 code = GetPhotcodebyName (tmpstring); 120 120 if (code == NULL) { 121 fprintf (stderr, "photcode not found in photcode table\n");121 gprint (GP_ERR, "photcode not found in photcode table\n"); 122 122 free (tmpstring); 123 123 return (FALSE); … … 156 156 157 157 if (!status) { 158 fprintf (stderr, "mismatch in photcode and magmode\n");158 gprint (GP_ERR, "mismatch in photcode and magmode\n"); 159 159 free (tmpstring); 160 160 return (FALSE); … … 213 213 if (!strcasecmp (parname, "YMOSAIC")) param = MEAS_YMOSAIC; 214 214 if (!strcasecmp (parname, "help")) { 215 fprintf (stderr, "value may be one of the following:\n");216 fprintf (stderr, " ra dR dec dD mag dmag Mrel Mcal photcode time fwhm dophot xccd yccd xmosaic ymosaic flags\n");217 fprintf (stderr, "value may also be a valid photcode\n");218 fprintf (stderr, "photcodes or 'mag' may have optional magnitude type: mag,[Minst, Mcat, Msys, Mrel, Mcal]\n");215 gprint (GP_ERR, "value may be one of the following:\n"); 216 gprint (GP_ERR, " ra dR dec dD mag dmag Mrel Mcal photcode time fwhm dophot xccd yccd xmosaic ymosaic flags\n"); 217 gprint (GP_ERR, "value may also be a valid photcode\n"); 218 gprint (GP_ERR, "photcodes or 'mag' may have optional magnitude type: mag,[Minst, Mcat, Msys, Mrel, Mcal]\n"); 219 219 } 220 220 return (param); … … 250 250 if (!strcasecmp (parname, "typefrac")) { 251 251 if (!TypefracType) { 252 fprintf (stderr, "typefrac needs to specify type to use\n");252 gprint (GP_ERR, "typefrac needs to specify type to use\n"); 253 253 return (param); 254 254 } … … 269 269 if (code[0] != NULL) { 270 270 if (PhotcodeSelect) { 271 fprintf (stderr, "photcode selection rules violated: cannot restrict photcode with a photcode\n");271 gprint (GP_ERR, "photcode selection rules violated: cannot restrict photcode with a photcode\n"); 272 272 return (FALSE); 273 273 } else { … … 295 295 if (NeedPhotcode || Needcode || NcodeSelect || PhotcodeSelect) { 296 296 if (!PhotcodeSelect) { 297 fprintf (stderr, "photcode selection problem: value requires photcode\n");297 gprint (GP_ERR, "photcode selection problem: value requires photcode\n"); 298 298 return (FALSE); 299 299 } … … 304 304 if (code[0][0].type == PHOT_PRI) return (TRUE); 305 305 if (code[0][0].type == PHOT_SEC) return (TRUE); 306 fprintf (stderr, "photcode selection problem: average value requires PRI/SEC photcode\n");306 gprint (GP_ERR, "photcode selection problem: average value requires PRI/SEC photcode\n"); 307 307 return (FALSE); 308 308 } … … 311 311 312 312 void GetAverageParamHelp () { 313 fprintf (stderr, "value may be one of the following:\n");314 fprintf (stderr, " ra dec dmag Nmeas Nmiss Xm Xp Nphot Ncode flag type typefrac\n\n");315 fprintf (stderr, "value may also be a valid photcode\n");316 fprintf (stderr, "photcodes or 'mag' may have optional magnitude mode: mag,[Mave, Mref]\n");313 gprint (GP_ERR, "value may be one of the following:\n"); 314 gprint (GP_ERR, " ra dec dmag Nmeas Nmiss Xm Xp Nphot Ncode flag type typefrac\n\n"); 315 gprint (GP_ERR, "value may also be a valid photcode\n"); 316 gprint (GP_ERR, "photcodes or 'mag' may have optional magnitude mode: mag,[Mave, Mref]\n"); 317 317 return; 318 318 } … … 329 329 if (VarConfig ("PHOTCODE_FILE", "%s", PhotCodeFile) == (char *) NULL) return (FALSE); 330 330 if (!LoadPhotcodes (PhotCodeFile)) { 331 fprintf (stderr, "error loading photcodes\n");331 gprint (GP_ERR, "error loading photcodes\n"); 332 332 return (FALSE); 333 333 } … … 337 337 int ListPhotSelections () { 338 338 339 fprintf (stderr, "TimeSelect: %d, %d - %d\n", TimeSelect, tzero, tend);340 fprintf (stderr, "MagSelect: %d, %f - %f\n", MagSelect, MagMax, MagMin);341 fprintf (stderr, "TypeSelect: %d, %d\n", TypeSelect, TypeValue);342 fprintf (stderr, "ErrSelect: %d, %f\n", ErrSelect, ErrValue);343 fprintf (stderr, "iMagSelect: %d, %f\n", iMagSelect, iMagMin);344 fprintf (stderr, "FlagSelect: %d, %x\n", FlagSelect, FlagValue);345 fprintf (stderr, "TypefracSelect: %d, %d %d %f\n", TypefracSelect, TypefracType, TypefracSign, TypefracValue);346 fprintf (stderr, "ApplySelections: %d,%d,%d,%d : %d\n", ApplySelections[0], ApplySelections[1], ApplySelections[2], ApplySelections[3], SelectionParam);339 gprint (GP_ERR, "TimeSelect: %d, %d - %d\n", TimeSelect, tzero, tend); 340 gprint (GP_ERR, "MagSelect: %d, %f - %f\n", MagSelect, MagMax, MagMin); 341 gprint (GP_ERR, "TypeSelect: %d, %d\n", TypeSelect, TypeValue); 342 gprint (GP_ERR, "ErrSelect: %d, %f\n", ErrSelect, ErrValue); 343 gprint (GP_ERR, "iMagSelect: %d, %f\n", iMagSelect, iMagMin); 344 gprint (GP_ERR, "FlagSelect: %d, %x\n", FlagSelect, FlagValue); 345 gprint (GP_ERR, "TypefracSelect: %d, %d %d %f\n", TypefracSelect, TypefracType, TypefracSign, TypefracValue); 346 gprint (GP_ERR, "ApplySelections: %d,%d,%d,%d : %d\n", ApplySelections[0], ApplySelections[1], ApplySelections[2], ApplySelections[3], SelectionParam); 347 347 if (PhotcodeSelect) { 348 fprintf (stderr, "PhotcodeSelect: %d, %s\n", PhotcodeSelect, PhotcodeValue[0].name);348 gprint (GP_ERR, "PhotcodeSelect: %d, %s\n", PhotcodeSelect, PhotcodeValue[0].name); 349 349 } else { 350 fprintf (stderr, "PhotcodeSelect: %d, none\n", PhotcodeSelect);351 } 352 fprintf (stderr, "ChiSelect: %d, %f\n", ChiSelect, ChiLimit);353 fprintf (stderr, "NphotSelect: %d, %d - %d\n", NphotSelect, NphotSign, NphotValue);354 fprintf (stderr, "NcodeSelect: %d, %d - %d\n", NcodeSelect, NcodeSign, NcodeValue);355 fprintf (stderr, "FWHMSelect: %d, %d %f %f\n", FWHMSelect, FWHMsign, FWHMvalue, FWHMfrac);350 gprint (GP_ERR, "PhotcodeSelect: %d, none\n", PhotcodeSelect); 351 } 352 gprint (GP_ERR, "ChiSelect: %d, %f\n", ChiSelect, ChiLimit); 353 gprint (GP_ERR, "NphotSelect: %d, %d - %d\n", NphotSelect, NphotSign, NphotValue); 354 gprint (GP_ERR, "NcodeSelect: %d, %d - %d\n", NcodeSelect, NcodeSign, NcodeValue); 355 gprint (GP_ERR, "FWHMSelect: %d, %d %f %f\n", FWHMSelect, FWHMsign, FWHMvalue, FWHMfrac); 356 356 } 357 357 … … 364 364 365 365 if ((N = get_argument (*argc, argv, "-phothelp"))) { 366 fprintf (stderr, "optional photometry selection criteria:\n");367 fprintf (stderr, " -magrange min max\n");368 fprintf (stderr, " -imaglim min\n");369 fprintf (stderr, " -flag value\n");370 fprintf (stderr, " -chisq value\n");371 fprintf (stderr, " -photcode code\n");372 fprintf (stderr, " -time start range\n");373 fprintf (stderr, " -errorlim value\n");374 fprintf (stderr, " -type type\n");375 fprintf (stderr, " -nmeas [+/-]N\n");376 fprintf (stderr, " -fwhm [+/-]fraction\n");366 gprint (GP_ERR, "optional photometry selection criteria:\n"); 367 gprint (GP_ERR, " -magrange min max\n"); 368 gprint (GP_ERR, " -imaglim min\n"); 369 gprint (GP_ERR, " -flag value\n"); 370 gprint (GP_ERR, " -chisq value\n"); 371 gprint (GP_ERR, " -photcode code\n"); 372 gprint (GP_ERR, " -time start range\n"); 373 gprint (GP_ERR, " -errorlim value\n"); 374 gprint (GP_ERR, " -type type\n"); 375 gprint (GP_ERR, " -nmeas [+/-]N\n"); 376 gprint (GP_ERR, " -fwhm [+/-]fraction\n"); 377 377 return (FALSE); 378 378 } … … 413 413 remove_argument (N, argc, argv); 414 414 if (strlen(argv[N]) != Nparams) { 415 fprintf (stderr, "-apply selection must define all parameter choices\n");415 gprint (GP_ERR, "-apply selection must define all parameter choices\n"); 416 416 return (FALSE); 417 417 } … … 433 433 GetPhotcodeInfo (argv[N], &PhotcodeValue, &PhotcodeMode); 434 434 if (PhotcodeValue == NULL) { 435 fprintf (stderr, "photcode not found in photcode table\n");435 gprint (GP_ERR, "photcode not found in photcode table\n"); 436 436 return (FALSE);; 437 437 } … … 444 444 remove_argument (N, argc, argv); 445 445 if (!str_to_time (argv[N], &tzero)) { 446 fprintf (stderr, "syntax error\n");446 gprint (GP_ERR, "syntax error\n"); 447 447 return (FALSE); 448 448 } 449 449 remove_argument (N, argc, argv); 450 450 if (!str_to_dtime (argv[N], &trange)) { 451 fprintf (stderr, "syntax error\n");451 gprint (GP_ERR, "syntax error\n"); 452 452 return (FALSE); 453 453 }
Note:
See TracChangeset
for help on using the changeset viewer.
