IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4826


Ignore:
Timestamp:
Aug 19, 2005, 4:34:27 PM (21 years ago)
Author:
eugene
Message:

update to new load_photcode with catmode and catformat capabilities

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

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/addstar/doc/Changes.txt

    r4800 r4826  
    23232005.08.15:
    2424        cleanup of the minor Wall,Werror messages
     25
     262005.08.19:
     27        changed load_photcode to handle CATMODE and CATFORMAT variations
     28        - addstar.h: added CATMODE and CATFORMAT globals
     29        - ConfigInit: read CATMODE and CATFORMAT from config
     30        - gcatalog: set catalog.catmode from CATMODE
     31        - mkcatalog: set CATFORMAT and CATMODE for new catalog
     32        - wcatalog: set CATFORMAT for new catalog
     33       
     34        using full photometry conversions in find_matches
     35        added SetZeroPoint to gstars to enable phot conversions
     36       
  • trunk/Ohana/src/addstar/include/addstar.h

    r4810 r4826  
    5959char   GSCFILE[256];
    6060char   CATDIR[256];
     61char   CATMODE[16];    /* raw, mef, split, mysql */
     62char   CATFORMAT[16];  /* internal, elixir, loneos, panstarrs */
    6163char   TWO_MASS_DIR_AS[256];
    6264char   TWO_MASS_DIR_DR2[256];
  • trunk/Ohana/src/addstar/src/ConfigInit.c

    r4299 r4826  
    1717  if (VERBOSE) fprintf (stderr, "loaded config file: %s\n", file);
    1818
    19   ScanConfig (config, "RADIUS",                 "%s", 0,  RadiusWord);
    20   if (!strcasecmp (RadiusWord, "header")) {
    21     DEFAULT_RADIUS = 0;
    22   } else {
    23     DEFAULT_RADIUS = atof (RadiusWord);
    24   }
     19  XMIN = XMAX = YMIN = YMAX = 0;
    2520
    26   XMIN = XMAX = YMIN = YMAX = 0;
     21  ScanConfig (config, "RADIUS",                 "%s",  0, RadiusWord);
    2722  ScanConfig (config, "NSIGMA",                 "%lf", 0, &NSIGMA);
    2823  ScanConfig (config, "XOVERSCAN",              "%d",  0, &XOVERSCAN);
     
    3227  ScanConfig (config, "ADDSTAR_YMIN",           "%d",  0, &YMIN);
    3328  ScanConfig (config, "ADDSTAR_YMAX",           "%d",  0, &YMAX);
     29  ScanConfig (config, "MIN_SN_FSTAT",           "%lf", 0, &SNLIMIT);
    3430
    3531  ScanConfig (config, "2MASS_DIR_AS",           "%s",  0, TWO_MASS_DIR_AS);
     
    4339  ScanConfig (config, "GSCFILE",                "%s",  0, GSCFILE);
    4440  ScanConfig (config, "CATDIR",                 "%s",  0, CATDIR);
    45   ScanConfig (config, "MIN_SN_FSTAT",           "%lf", 0, &SNLIMIT);
     41  ScanConfig (config, "CATMODE",                "%s",  0, CATMODE);
     42  ScanConfig (config, "CATFORMAT",              "%s",  0, CATFORMAT);
    4643  ScanConfig (config, "PHOTCODE_FILE",          "%s",  0, PhotCodeFile);
    4744
     
    6057  ScanConfig (config, "OBSERVATORY-LATITUDE",   "%lf", 0, &Latitude);
    6158  ScanConfig (config, "SUBPIX_DATAFILE",        "%s",  0, SubpixDatafile);
     59
     60  if (!strcasecmp (RadiusWord, "header")) {
     61    DEFAULT_RADIUS = 0;
     62  } else {
     63    DEFAULT_RADIUS = atof (RadiusWord);
     64  }
     65
     66  if (*CATMODE == 0) strcpy (CATMODE, "RAW");
     67  if (*CATFORMAT == 0) strcpy (CATFORMAT, "ELIXIR");
    6268
    6369  if (!LoadPhotcodes (PhotCodeFile)) {
  • trunk/Ohana/src/addstar/src/gcatalog.c

    r3361 r4826  
    55  int Nsecfilt;
    66  char mode;
     7
     8  /* no autodetect for CATMODE yet */
     9  strcpy (catalog[0].catmode, CATMODE);
    710
    811  /* read catalog header */
  • trunk/Ohana/src/addstar/src/mkcatalog.c

    r3361 r4826  
    33void mkcatalog (GSCRegion *region, Catalog *catalog) {
    44 
    5   char filename[64], line[64];
    6   struct tm *local;
    7   struct timeval now;
     5  char *line;
     6  time_t now;
    87
    98  if (VERBOSE) fprintf (stderr, "new catalog file: %s\n", region[0].filename);
    10   if (!fits_read_header (CatTemplate, &catalog[0].header)) {
    11     fprintf (stderr, "ERROR: can't find template header %s\n", CatTemplate);
    12     exit (1);
    13   }
     9
     10  fits_init_header (&catalog[0].header);
     11  fits_create_header (&catalog[0].header);
    1412 
    15   /* assign header values for RA, DEC, DATE, etc */
    16   fits_modify (&catalog[0].header, "RA0", "%lf", 1, region[0].RA[0]);
     13  /* write RA,DEC range in header */
     14  fits_modify (&catalog[0].header, "RA0",  "%lf", 1, region[0].RA[0]);
    1715  fits_modify (&catalog[0].header, "DEC0", "%lf", 1, region[0].DEC[0]);
    18   fits_modify (&catalog[0].header, "RA1", "%lf", 1, region[0].RA[1]);
     16  fits_modify (&catalog[0].header, "RA1",  "%lf", 1, region[0].RA[1]);
    1917  fits_modify (&catalog[0].header, "DEC1", "%lf", 1, region[0].DEC[1]);
    20   gettimeofday (&now, NULL);
    21   local = localtime (&now.tv_sec);
    22   sprintf (line, "%02d/%02d/%02d", local[0].tm_year, local[0].tm_mon + 1, local[0].tm_mday);
     18
     19  /* write creation date in header */
     20  str_to_time ("now", &now);
     21  line = sec_to_date (now);
    2322  fits_modify (&catalog[0].header, "DATE", "%s", 1, line);
    24   strcpy (filename, CatTemplate);
     23  free (line);
     24
    2525  ALLOCATE (catalog[0].average, Average, 1);
    2626  ALLOCATE (catalog[0].measure, Measure, 1);
     
    2828  catalog[0].Naverage = catalog[0].Nmeasure = catalog[0].Nmissing = 0;
    2929
    30   /* setup secondary filters to match photcodes */
     30  /* setup secondary filters to match photcodes:
     31   *  Nsecfilt is number of filters.  Number of entries in array is
     32   *  Nsecfilt * Naverage.  At this point, N entries == 0
     33   */
    3134  ALLOCATE (catalog[0].secfilt, SecFilt, 1);
    3235  catalog[0].Nsecfilt = GetPhotcodeNsecfilt ();
    3336
    34   /* Nsecfilt is number of filters.  Number of entries in array is
    35      Nsecfilt * Naverage.  At this point, N entries == 0 */
     37  /* set catalog mode (raw, mef, etc) - no autodetect for CATMODE yet */
     38  strcpy (catalog[0].catmode, CATMODE);
    3639
     40  /* set catalog format (elixir, loneos, etc) */
     41  if (!strcmp (CATFORMAT, "INTERNAL")) {
     42    sprintf (catalog[0].average_format, "DVO_AVERAGE");
     43    sprintf (catalog[0].measure_format, "DVO_MEASURE");
     44  } else {
     45    sprintf (catalog[0].average_format, "DVO_AVERAGE_%s", CATFORMAT);
     46    sprintf (catalog[0].measure_format, "DVO_MEASURE_%s", CATFORMAT);
     47  }
    3748}
  • trunk/Ohana/src/addstar/src/wcatalog.c

    r2457 r4826  
    33void wcatalog (Catalog *catalog) {
    44 
    5   /* we'll leave these for now, but they are LONEOS specific */
    6   fits_modify (&catalog[0].header, "MARKSTAR", "%t", 1, FALSE);
    7   fits_modify (&catalog[0].header, "ADDUSNO", "%t", 1, FALSE);
    8   fits_modify (&catalog[0].header, "MARKROCK", "%t", 1, FALSE);
     5  /* set catalog format (elixir, loneos, etc) */
     6  if (!strcmp (CATFORMAT, "INTERNAL")) {
     7    sprintf (catalog[0].average_format, "DVO_AVERAGE");
     8    sprintf (catalog[0].measure_format, "DVO_MEASURE");
     9  } else {
     10    sprintf (catalog[0].average_format, "DVO_AVERAGE_%s", CATFORMAT);
     11    sprintf (catalog[0].measure_format, "DVO_MEASURE_%s", CATFORMAT);
     12  }
    913
    1014  if (!save_catalog (catalog, VERBOSE)) {
Note: See TracChangeset for help on using the changeset viewer.