IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34690


Ignore:
Timestamp:
Nov 23, 2012, 8:51:06 PM (14 years ago)
Author:
eugene
Message:

delstar -photcodes works for objects, but not yet images

Location:
branches/eam_branches/ipp-20120905/Ohana/src/delstar
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20120905/Ohana/src/delstar/include/delstar.h

    r34686 r34690  
    1212
    1313/* global variables set in parameter file */
    14 char   ImageCat[256];
    15 char   ImageTemplate[256];
    16 char   CatTemplate[256];
    17 char   GSCFILE[256];
    18 char   CATDIR[256];
     14char   ImageCat[DVO_MAX_PATH];
     15char   ImageTemplate[DVO_MAX_PATH];
     16char   CatTemplate[DVO_MAX_PATH];
     17char   GSCFILE[DVO_MAX_PATH];
     18
     19char  *CATDIR;
     20
    1921char   CATMODE[16];    /* raw, mef, split, mysql */
    2022char   CATFORMAT[16];  /* internal, elixir, loneos, panstarrs */
     
    2729int    ORPHAN;
    2830int    MISSED;
    29 char   SKY_TABLE[256];
     31char   SKY_TABLE[DVO_MAX_PATH];
    3032int    SKY_DEPTH;  /** XXX EAM : depth of catalog tables, fix usage */
    3133
  • branches/eam_branches/ipp-20120905/Ohana/src/delstar/src/ConfigInit.c

    r25757 r34690  
    55  char *config, *file;
    66  char CatdirPhotcodeFile[256];
    7   char MasterPhotcodeFile[256];
    87
    98  /*** load configuration info ***/
     
    2019  ScanConfig (config, "ALPHA",                  "%lf", 0, &ALPHA);
    2120  ScanConfig (config, "GSCFILE",                "%s", 0, GSCFILE);
    22   ScanConfig (config, "CATDIR",                 "%s", 0, CATDIR);
    2321  ScanConfig (config, "CATMODE",                "%s",  0, CATMODE);
    2422  ScanConfig (config, "CATFORMAT",              "%s",  0, CATFORMAT);
    25   ScanConfig (config, "PHOTCODE_FILE",          "%s",  0, MasterPhotcodeFile);
    2623
    27   sprintf (ImageCat, "%s/Images.dat", CATDIR);
     24  // force CATDIR to be absolute (so parallel mode will work)
     25  char *tmpcatdir = NULL;
     26  ALLOCATE (tmpcatdir, char, DVO_MAX_PATH);
     27  ScanConfig (config, "CATDIR",                 "%s",  0, tmpcatdir);
     28  CATDIR = abspath (tmpcatdir, DVO_MAX_PATH);
     29  free (tmpcatdir);
     30
     31  snprintf (ImageCat, DVO_MAX_PATH, "%s/Images.dat", CATDIR);
    2832
    2933  ScanConfig (config, "DATE-KEYWORD",           "%s", 0, DateKeyword);
     
    4549  /* XXX this does not yet write out the master photcode table */
    4650  sprintf (CatdirPhotcodeFile, "%s/Photcodes.dat", CATDIR);
    47   if (!LoadPhotcodes (CatdirPhotcodeFile, MasterPhotcodeFile, TRUE)) {
    48     fprintf (stderr, "error loading photcode table %s or master file %s\n", CatdirPhotcodeFile, MasterPhotcodeFile);
     51  if (!LoadPhotcodes (CatdirPhotcodeFile, NULL, FALSE)) {
     52    fprintf (stderr, "error loading photcode table %s\n", CatdirPhotcodeFile);
    4953    exit (1);
    5054  }
  • branches/eam_branches/ipp-20120905/Ohana/src/delstar/src/args.c

    r34686 r34690  
    156156goodtime:
    157157
    158   /* restrict to a single photcode (not compatible with -image) */
     158  /* restrict to a single photcode (not compatible with -image)
    159159  PHOTCODE = NULL;
    160160  if ((N = get_argument (argc, argv, "-photcode"))) {
     
    162162    PHOTCODE = GetPhotcodebyName (argv[N]);
    163163    remove_argument (N, &argc, argv);
    164   }
     164  }*/
    165165
    166166  if (argc != 1) usage ();
  • branches/eam_branches/ipp-20120905/Ohana/src/delstar/src/delete_photcodes.c

    r34686 r34690  
    11# include "delstar.h"
    2 
    3 # if (0)
    4 void delete_photcodes (FITS_DB *db, photcodes, Nphotcodes) {
    5 
    6   int found, code;
    7   off_t i, j, k, n;
    8   off_t Nregions, NREGIONS;
    9   off_t *imlist;
    10   SkyList *skylist, *skyset;
    11   SkyTable *sky;
    12   Catalog catalog;
    13 
    14   // xxx where does this go?
    15   photcodesDrop = ParsePhotcodeList (PHOTCODE_LIST, &NphotcodesDrop, FALSE);
    16 
    17   /* load sky from correct table */
    18   sky = SkyTableLoadOptimal (CATDIR, SKY_TABLE, GSCFILE, TRUE, SKY_DEPTH, VERBOSE);
    19   SkyTableSetFilenames (sky, CATDIR, "cpt");
    20 
    21   // determine the populated SkyRegions overlapping the requested area (default depth)
    22   skylist = SkyListByPatch (sky, -1, &UserPatch);
    23 
    24   // delete images with these photcodes
    25   delete_photcodes_catalogs (db, photcodesDrop, NphotcodesDrop);
    26 
    27   fprintf (stderr, "SUCCESS\n");
    28   exit (0);
    29 }
    30 # endif
    312
    323int delete_photcodes (SkyList *skylist, int hostID, char *hostpath) {
     
    7344
    7445    delete_photcodes_catalog (&catalog, photcodes, Nphotcodes);
    75     dvo_catalog_save (&catalog, VERBOSE);
     46    dvo_catalog_save_complete (&catalog, VERBOSE);
    7647    dvo_catalog_unlock (&catalog);
    7748    dvo_catalog_free (&catalog);
     
    165136  Measure *measureOut = NULL;
    166137  Average *averageOut = NULL;
     138  SecFilt *secfiltOut = NULL;
    167139
    168140  off_t *measureDrop, *measureSeqRaw, *measureSeqOut, *measureRefOut, *measureAveRaw, *averageNmeas, *averageDmeas, *averageSeqOut, *averageRefOut, *measureAveOut;
     141
     142  int Nsecfilt = GetPhotcodeNsecfilt ();
    169143
    170144  /* internal counters */
     
    174148  Measure *measure = catalog[0].measure;
    175149  Average *average = catalog[0].average;
     150  SecFilt *secfilt = catalog[0].secfilt;
    176151 
    177152  if (VERBOSE) fprintf (stderr, "starting with Nave, Nmeas: "OFF_T_FMT" "OFF_T_FMT"\n",  catalog[0].Naverage,  catalog[0].Nmeasure);
     
    286261  }
    287262
     263  // copy the secfilt entries for the (kept) average entries
     264  ALLOCATE (secfiltOut, SecFilt, NaveOut*Nsecfilt);
     265  for (i = 0; i < NaveOut; i++) {
     266    j = averageSeqOut[i];
     267    for (m = 0; m < Nsecfilt; m++) {
     268      secfiltOut[i*Nsecfilt + m] = secfilt[j*Nsecfilt + m];
     269    }
     270  }
     271
    288272  // update the values of average.measureOffset and average.Nmeasure
    289273  FREE(measure);
     
    291275  catalog[0].measure = measureOut;
    292276  catalog[0].average = averageOut;
     277  catalog[0].secfilt = secfiltOut;
     278  catalog[0].Nmeasure = NmeasOut;
     279  catalog[0].Naverage = NaveOut;
    293280
    294281  // update catalog.Nmeasure and catalog.Naverage, double check
     
    296283  int measureOffsetOK = TRUE;
    297284  int averefOK = TRUE;
    298   for (i = 0; i < Naverage; i++) {
     285  for (i = 0; i < NaveOut; i++) {
    299286    NmeasureTotal += catalog[0].average[i].Nmeasure;
    300287    if (VERBOSE && !(NmeasureTotal <= catalog[0].Nmeasure)) {
     
    333320
    334321  catalog[0].sorted = TRUE;
     322
     323  if (VERBOSE) fprintf (stderr, "ending with Nave, Nmeas: "OFF_T_FMT" "OFF_T_FMT"\n",  catalog[0].Naverage,  catalog[0].Nmeasure);
    335324
    336325  FREE (measureDrop);
Note: See TracChangeset for help on using the changeset viewer.