IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12732


Ignore:
Timestamp:
Apr 3, 2007, 10:55:41 AM (19 years ago)
Author:
eugene
Message:

added max errors, sanity checks on some image parameters

Location:
trunk/Ohana/src/addstar
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/addstar/include/addstar.h

    r12461 r12732  
    104104int    VERBOSE;
    105105int    PLOT;
     106double MAX_CERROR;
    106107
    107108/* modify server behavior (make this an addstar cleanup mode?) */
  • trunk/Ohana/src/addstar/src/ConfigInit.c

    r12332 r12732  
    3838  ScanConfig (config, "MIN_SN_FSTAT",           "%lf", 0, &SNLIMIT);
    3939  ScanConfig (config, "ADDSTAR_SNLIMIT",        "%lf", 0, &SNLIMIT);
     40
     41  MAX_CERROR = 0.5; // arcseconds
     42  ScanConfig (config, "ADDSTAR_MAX_CERROR",     "%lf", 0, &MAX_CERROR);
    4043
    4144  /* used by parse_time to find time-related keywords */
  • trunk/Ohana/src/addstar/src/FilterStars.c

    r12332 r12732  
    66  float MTIME, dMs;
    77  Stars *stars;
     8  float RMIN, RMAX, DMIN, DMAX;
    89
    910  /* correct instrumental mags for exposure time */
    1011  MTIME = (image[0].exptime > 0) ? 2.500*log10(image[0].exptime) : 0.0;
     12
     13  RMIN = 360.0;
     14  RMAX =   0.0;
     15  DMIN = +90.0;
     16  DMAX = -90.0;
    1117
    1218  /* modify resulting star list */
     
    2733    stars[N].code = image[0].photcode;
    2834
     35    RMIN = MIN (RMIN, stars[N].R);
     36    RMAX = MAX (RMAX, stars[N].R);
     37    DMIN = MIN (DMIN, stars[N].D);
     38    DMAX = MAX (DMAX, stars[N].D);
    2939    /** additional quantities to supply to Stars based on the image data **/
    3040
     
    5464
    5565  if (VERBOSE) fprintf (stderr, "read %d stars from target file\n", image[0].nstar);
     66  if (VERBOSE) fprintf (stderr, "stars cover region %f,%f - %f,%f\n", RMIN, DMIN, RMAX, DMAX);
    5667  return (stars);
    5768}
  • trunk/Ohana/src/addstar/src/ReadImageHeader.c

    r12487 r12732  
    66
    77  int Nastro, ccdnum, hour, min, Nx, Ny;
    8   double tmp, sec;
     8  double tmp, sec, Cerror;
    99  char *c, photname[64], line[80];
    1010
     
    3737  Nastro = 0;
    3838  gfits_scan (header, "NASTRO", "%d", 1, &Nastro);
    39   if ((Nastro == 0) && !ACCEPT_ASTROM) {
     39  Cerror = 0;
     40  gfits_scan (header, "CERROR", "%lf", 1, &Cerror);
     41  if (((Nastro == 0) || (Cerror > MAX_CERROR)) && !ACCEPT_ASTROM) {
    4042    fprintf (stderr, "bad astrometric solution in header\n");
    4143    return (FALSE);
     
    5153    while (image[0].coords.crval1 < 0) image[0].coords.crval1 += 360.0;
    5254    while (image[0].coords.crval1 > 360.0) image[0].coords.crval1 -= 360.0;
     55  }
     56
     57  {
     58    double R, D;
     59    /* sanity check on the image coordinates */
     60    XY_to_RD (&R, &D, 0.5*Nx, 0.5*Ny, &image[0].coords);
     61    if (!finite(R) || !finite(D)) {
     62      fprintf (stderr, "corrupted header coordinates, skipping\n");
     63      return (FALSE);
     64    }
    5365  }
    5466   
  • trunk/Ohana/src/addstar/src/ReadStarsFITS.c

    r12461 r12732  
    7777}
    7878
     79// XXX I need to make the IPP I/O functions and these functions
     80// consistent wrt ZERO_POINT....
    7981Stars *ConvertPS1_DEV_0 (FTable *table, int *nstars) {
    8082
     
    9193    stars[i].dX      = ps1data[i].dX;
    9294    stars[i].dY      = ps1data[i].dY;
    93     stars[i].M       = ps1data[i].M;
     95    stars[i].M       = ps1data[i].M + 25.0;
    9496    stars[i].dM      = ps1data[i].dM;
    9597    stars[i].Mpeak   = ps1data[i].Mpeak;
  • trunk/Ohana/src/addstar/src/addstar.c

    r12690 r12732  
    7979
    8080    // set the parameters which guide catalog open/load/create
     81    catalog.filename  = skylist[0].filename[i];
    8182    catalog.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
    8283    catalog.catmode   = dvo_catalog_catmode (CATMODE);      // set the default catmode from config data
    83     catalog.filename  = skylist[0].filename[i];
     84    catalog.catflags  = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
    8485    catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
    85     catalog.catflags  = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
    8686    if (options.update) catalog.catflags = LOAD_AVES | LOAD_MEAS_META | LOAD_MISS | LOAD_SECF;
    8787
  • trunk/Ohana/src/addstar/src/get2mass_ops.c

    r7780 r12732  
    217217    Rs *= 15.0;
    218218    Re *= 15.0;
     219
     220    // don't restrict by RA, but limit by DEC
     221    if (De < UserPatch.Dmin) continue;
     222    if (Ds > UserPatch.Dmax) continue;
     223
    219224    regions[Nregions].Rmin = Rs;
    220225    regions[Nregions].Rmax = Re;
  • trunk/Ohana/src/addstar/src/gstars.c

    r12488 r12732  
    229229        snprintf (image[N].name, 32, "%s", name);
    230230      } else {
    231         snprintf (image[N].name, 32, "%s.%s", name, exthead[i]);
     231        snprintf (image[N].name, 32, "%s[%s]", name, exthead[i]);
    232232      }
    233233
  • trunk/Ohana/src/addstar/src/load2mass_as_rawdata.c

    r8361 r12732  
    120120        if (tstars[j].D < region[0].Dmin) continue;
    121121        if (tstars[j].D > region[0].Dmax) continue;
     122         
     123        // check if in UserPatch
     124        if (tstars[j].R < UserPatch.Rmin) continue;
     125        if (tstars[j].R > UserPatch.Rmax) continue;
     126        if (tstars[j].D < UserPatch.Dmin) continue;
     127        if (tstars[j].D > UserPatch.Dmax) continue;
    122128         
    123129        offset = tstars[j].offset;
Note: See TracChangeset for help on using the changeset viewer.