IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36794


Ignore:
Timestamp:
Jun 2, 2014, 5:41:30 AM (12 years ago)
Author:
eugene
Message:

checkastro works

Location:
branches/eam_branches/ipp-20140423/Ohana/src/checkastro
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140423/Ohana/src/checkastro/include/checkastro.h

    r36793 r36794  
    8383
    8484float MinBadQF;
    85 float MaxMeanOffset;
    8685
    8786int TimeSelect;
    8887time_t TSTART, TSTOP;
    89 
    90 int FlagOutlier;
    91 int    CLIP_THRESH;
    9288
    9389SkyRegion UserPatch;
  • branches/eam_branches/ipp-20140423/Ohana/src/checkastro/src/ConfigInit.c

    r36793 r36794  
    1919
    2020  // set defaults for all of these if they are not used by parallel / remote clients
    21   // if (!ScanConfig (config, "RELASTRO_SIGMA_LIM",         "%lf", 0, &SIGMA_LIM))       SIGMA_LIM = 0.01;
    22  
     21  if (!ScanConfig (config, "RELASTRO_SIGMA_LIM",         "%lf", 0, &SIGMA_LIM))       SIGMA_LIM = 0.01;
     22  if (!ScanConfig (config, "RELASTRO_SRC_MEAS_TOOFEW",   "%d",  0, &SRC_MEAS_TOOFEW)) SRC_MEAS_TOOFEW = 3;
     23
    2324  // force CATDIR to be absolute (so parallel mode will work)
    2425  GetConfig (config, "CATDIR",                 "%s",  0, CATDIR);
  • branches/eam_branches/ipp-20140423/Ohana/src/checkastro/src/ImageOps.c

    r36793 r36794  
    130130  }
    131131
     132  BuildChipMatch (image, Nimage);
     133
     134  char output[128];
     135  snprintf (output, 128, "checkastrom.%+3.0f.%+3.0f.%03.0f.%03.0f.dat", UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
     136  FILE *f = fopen (output, "w");
     137  if (!f) {
     138    fprintf (stderr, "problem opening %s for output\n", output);
     139  }
     140
    132141  // watch for chips with few stars
    133142  int Nfew = 0;
     
    139148    name = GetPhotcodeNamebyCode (image[i].photcode);
    140149
    141     if (VERBOSE2) {
    142       char *date = ohana_sec_to_date(image[i].tzero);
    143       fprintf (stderr, "image "OFF_T_FMT" (%d, %s) has "OFF_T_FMT" total and "OFF_T_FMT" ref of %d measures (%s, %s)\n", 
    144                i,  image[i].imageID, image[i].name, N_onImage[i], Nref_onImage[i], image[i].nstar,
    145                date, name);
    146       free (date);
    147     }
     150    off_t myMosaic = FindMosaicForImage (image, Nimage, i);
     151
     152    /* only check exposure center */
     153    double Rexp = NAN, Dexp = NAN, Rccd = NAN, Dccd = NAN;
     154
     155    if (myMosaic) {
     156      myMosaic --;
     157      XY_to_RD (&Rccd, &Dccd, 0.5*image[i].NX, 0.5*image[i].NY, &image[i].coords);
     158      XY_to_RD (&Rexp, &Dexp, 0.0, 0.0, &image[myMosaic].coords);
     159    }
     160
     161    char *date = ohana_sec_to_date(image[i].tzero);
     162    FILE *outfile = f ? f : stderr;
     163    fprintf (outfile, "%d %s : %10.6f %10.6f : %10.6f %10.6f "OFF_T_FMT" "OFF_T_FMT" %d %s %s\n", 
     164             image[i].imageID, image[i].name, Rccd, Dccd, Rexp, Dexp, N_onImage[i], Nref_onImage[i], image[i].nstar,
     165             date, name);
     166    free (date);
    148167
    149168    if (N_onImage[i] < 20) {
     
    154173    }
    155174  }
     175  if (f) { fclose (f); }
    156176  fprintf (stderr, OFF_T_FMT" total images, %d with < 20 measurements, %d with < 15\n", Nimage, Nfew, Nbad);
    157177}
  • branches/eam_branches/ipp-20140423/Ohana/src/checkastro/src/args.c

    r36793 r36794  
    189189  }
    190190
    191   MaxMeanOffset = 10.0;
    192   if ((N = get_argument (argc, argv, "-max-mean-offset"))) {
    193     remove_argument (N, &argc, argv);
    194     MaxMeanOffset = atof (argv[N]);
    195     remove_argument (N, &argc, argv);
    196   }
    197 
    198191  if (argc != 1) usage ();
    199192  return TRUE;
     
    371364
    372365void usage () {
    373   fprintf (stderr, "ERROR: USAGE: checkastro -images -update-simple [options]\n");
    374   fprintf (stderr, "       OR:    checkastro -images -update-chips [options]\n");
    375   fprintf (stderr, "       OR:    checkastro -images -update-mosaic [options]\n");
    376   fprintf (stderr, "       OR:    checkastro -parallel-regions -update-simple [options]\n");
    377   fprintf (stderr, "       OR:    checkastro -parallel-regions -update-chips [options]\n");
    378   fprintf (stderr, "       OR:    checkastro -parallel-regions -update-mosaic [options]\n");
    379   fprintf (stderr, "       OR:    checkastro -parallel-images -update-simple [options]\n");
    380   fprintf (stderr, "       OR:    checkastro -parallel-images -update-chips [options]\n");
    381   fprintf (stderr, "       OR:    checkastro -parallel-images -update-mosaic [options]\n");
    382   fprintf (stderr, "       OR:    checkastro -update-objects [options]\n");
    383   fprintf (stderr, "       OR:    checkastro -high-speed [options]\n");
    384   fprintf (stderr, "       OR:    checkastro -hpm [options]\n");
    385   fprintf (stderr, "       OR:    checkastro -merge-source [options]\n\n");
    386 
    387   fprintf (stderr, "  specify one of the following modes: \n");
    388   fprintf (stderr, "  -update-objects\n");
    389   fprintf (stderr, "    -pm\n");
    390   fprintf (stderr, "    -par\n");
    391   fprintf (stderr, "    -pmpar\n");
    392   fprintf (stderr, "  -update-simple\n");
    393   fprintf (stderr, "  -update-chips\n");
    394   fprintf (stderr, "  -update-mosaics\n");
    395   fprintf (stderr, "  -high-speed (code[,code,code]) (code[,code,code]) (radius) (output catdir)\n");
    396   fprintf (stderr, "  -hpm (radius) (output catdir)\n");
    397   fprintf (stderr, "  -merge-source (objID) (catID) into (objID) (catID)\n\n");
    398 
    399   fprintf (stderr, " additional options: \n");
     366  fprintf (stderr, "ERROR: USAGE: checkastro [options]\n");
     367  fprintf (stderr, " options: \n");
    400368  fprintf (stderr, "  -region RA RA DEC DEC\n");
    401369  fprintf (stderr, "  -catalog (ra) (dec)\n\n");
     
    403371  fprintf (stderr, "  +photcode (code)[,code,code...]\n");
    404372  fprintf (stderr, "  -photcode (code)[,code,code...]\n");
    405   fprintf (stderr, "  -plot\n");
    406   fprintf (stderr, "  -plotdelay (seconds)\n");
    407   fprintf (stderr, "  -statmode (mode)\n");
    408   fprintf (stderr, "  -reset\n");
    409   fprintf (stderr, "  -nloop (N) : number of image-fit iterations\n");
    410   fprintf (stderr, "  -update : apply new fit to database\n");
    411   fprintf (stderr, "  -params\n");
    412   fprintf (stderr, "  -plrange\n");
     373  fprintf (stderr, "  -reset-to-photcode (code)[,code,code...]\n");
     374  fprintf (stderr, "  -max-density (rho)\n");
     375  fprintf (stderr, "  -minerror\n");
    413376  fprintf (stderr, "  -minerror\n");
    414377  fprintf (stderr, "  -instmag min max\n\n");
     
    417380  fprintf (stderr, "  -photflagpoor\n");
    418381  fprintf (stderr, "  -v\n");
     382  fprintf (stderr, "  -vv\n");
     383  fprintf (stderr, "  -parallel\n");
     384  fprintf (stderr, "  -parallel-manual\n");
     385  fprintf (stderr, "  -parallel-serial\n");
    419386  fprintf (stderr, "  \n");
    420387  exit (2);
  • branches/eam_branches/ipp-20140423/Ohana/src/checkastro/src/bcatalog.c

    r36793 r36794  
    3737  /* exclude stars not in range or with too few measurements */
    3838  for (i = 0; i < catalog[0].Naverage; i++) {
    39     if (catalog[0].average[i].Nmeasure <= SRC_MEAS_TOOFEW) {
    40       continue;
    41       // XXX can't (easily) count this for a given chip
    42     }
     39    if (catalog[0].average[i].Nmeasure <= SRC_MEAS_TOOFEW) continue;
    4340   
    4441    /* start with all stars good */
     
    278275   
    279276    // if we are resetting to a given photcode, we need to have that photcode...
    280     if (NphotcodesReset) {
     277    // XXX this is not relevant for the check...
     278    if (FALSE && NphotcodesReset) {
    281279      int k;
    282280      int foundReset = FALSE;
  • branches/eam_branches/ipp-20140423/Ohana/src/checkastro/src/load_catalogs.c

    r36793 r36794  
    128128    if (VERBOSE)       { snprintf (tmpline, 1024, "%s -v",              command);                    strcpy (command, tmpline); }
    129129    if (VERBOSE2)      { snprintf (tmpline, 1024, "%s -vv",             command);                    strcpy (command, tmpline); }
     130    if (MaxDensityUse) { snprintf (tmpline, 1024, "%s -max-density %f", command, MaxDensityValue);   strcpy (command, tmpline); }
     131    if (ImagSelect)    { snprintf (tmpline, 1024, "%s -instmag %f %f",  command, ImagMin, ImagMax);  strcpy (command, tmpline); }
    130132
    131133    if (PHOTCODE_KEEP_LIST) { snprintf (tmpline, 1024, "%s +photcode %s", command, PHOTCODE_KEEP_LIST); strcpy (command, tmpline); }
    132134    if (PHOTCODE_SKIP_LIST) { snprintf (tmpline, 1024, "%s -photcode %s", command, PHOTCODE_SKIP_LIST); strcpy (command, tmpline); }
     135    if (PHOTCODE_RESET_LIST) { snprintf (tmpline, 1024, "%s -reset-to-photcode %s", command, PHOTCODE_RESET_LIST); strcpy (command, tmpline); }
    133136    if (PhotFlagSelect)    { snprintf (tmpline, 1024, "%s +photflags",   command);                     strcpy (command, tmpline); }
    134137    if (PhotFlagBad)       { snprintf (tmpline, 1024, "%s +photflagbad %d", command, PhotFlagBad);     strcpy (command, tmpline); }
  • branches/eam_branches/ipp-20140423/Ohana/src/checkastro/src/select_images.c

    r36793 r36794  
    100100
    101101    // check that this image is even in range of the searched region
    102     if (Dexp - 1.5 > DmaxSkyRegion) continue;
    103     if (Dexp + 1.5 < DminSkyRegion) continue;
     102    if (Dexp + 1.5 > UserPatch.Dmax) continue;
     103    if (Dexp - 1.5 < UserPatch.Dmin) continue;
    104104   
    105105    // the sky region RA is defined to be 0 - 360.0
    106106    if ((Dexp < 88) && (Dexp > -88)) {
    107       if (Rexp - 1.5/cos(Dexp*RAD_DEG) > RmaxSkyRegion) continue;
    108       if (Rexp + 1.5/cos(Dexp*RAD_DEG) < RminSkyRegion) continue;
     107      if (Rexp + 1.5/cos(Dexp*RAD_DEG) > UserPatch.Rmax) continue;
     108      if (Rexp - 1.5/cos(Dexp*RAD_DEG) < UserPatch.Rmin) continue;
    109109    }
    110110
Note: See TracChangeset for help on using the changeset viewer.