IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 16, 2006, 10:58:49 PM (20 years ago)
Author:
eugene
Message:

major updates to use gprint for buffered / threaded printing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/dvo/photometry.c

    r7680 r7917  
    101101    mode = GetMagMode (p + 1);
    102102    if (mode == MAG_NONE) {
    103       fprintf (stderr, "syntax error in magnitude mode\n");
     103      gprint (GP_ERR, "syntax error in magnitude mode\n");
    104104      free (tmpstring);
    105105      return (FALSE);
     
    119119  code = GetPhotcodebyName (tmpstring);
    120120  if (code == NULL) {
    121     fprintf (stderr, "photcode not found in photcode table\n");
     121    gprint (GP_ERR, "photcode not found in photcode table\n");
    122122    free (tmpstring);
    123123    return (FALSE);
     
    156156
    157157  if (!status) {
    158     fprintf (stderr, "mismatch in photcode and magmode\n");
     158    gprint (GP_ERR, "mismatch in photcode and magmode\n");
    159159    free (tmpstring);
    160160    return (FALSE);
     
    213213  if (!strcasecmp (parname, "YMOSAIC"))  param = MEAS_YMOSAIC;
    214214  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");
    219219  }
    220220  return (param);
     
    250250  if (!strcasecmp (parname, "typefrac")) {
    251251    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");
    253253      return (param);
    254254    }
     
    269269  if (code[0] != NULL) {
    270270    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");
    272272      return (FALSE);
    273273    } else {
     
    295295  if (NeedPhotcode || Needcode || NcodeSelect || PhotcodeSelect) {
    296296    if (!PhotcodeSelect) {
    297       fprintf (stderr, "photcode selection problem: value requires photcode\n");
     297      gprint (GP_ERR, "photcode selection problem: value requires photcode\n");
    298298      return (FALSE);
    299299    }
     
    304304    if (code[0][0].type == PHOT_PRI) return (TRUE);
    305305    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");
    307307    return (FALSE);
    308308  }
     
    311311
    312312void 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");
    317317  return;
    318318}
     
    329329  if (VarConfig ("PHOTCODE_FILE", "%s", PhotCodeFile) == (char *) NULL) return (FALSE);
    330330  if (!LoadPhotcodes (PhotCodeFile)) {
    331     fprintf (stderr, "error loading photcodes\n");
     331    gprint (GP_ERR, "error loading photcodes\n");
    332332    return (FALSE);
    333333  }
     
    337337int ListPhotSelections () {
    338338
    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);
    347347  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);
    349349  } 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);
    356356}
    357357
     
    364364
    365365  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");
    377377    return (FALSE);
    378378  }
     
    413413    remove_argument (N, argc, argv);
    414414    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");
    416416      return (FALSE);
    417417    }
     
    433433    GetPhotcodeInfo (argv[N], &PhotcodeValue, &PhotcodeMode);
    434434    if (PhotcodeValue == NULL) {
    435       fprintf (stderr, "photcode not found in photcode table\n");
     435      gprint (GP_ERR, "photcode not found in photcode table\n");
    436436      return (FALSE);;
    437437    }
     
    444444    remove_argument (N, argc, argv);
    445445    if (!str_to_time (argv[N], &tzero)) {
    446       fprintf (stderr, "syntax error\n");
     446      gprint (GP_ERR, "syntax error\n");
    447447      return (FALSE);
    448448    }
    449449    remove_argument (N, argc, argv);
    450450    if (!str_to_dtime (argv[N], &trange)) {
    451       fprintf (stderr, "syntax error\n");
     451      gprint (GP_ERR, "syntax error\n");
    452452      return (FALSE);
    453453    }
Note: See TracChangeset for help on using the changeset viewer.