IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36745


Ignore:
Timestamp:
May 12, 2014, 5:44:57 PM (12 years ago)
Author:
eugene
Message:

generate image subset when generating database subset; rename -photcodes-skip to -photcodes-keep (more accurate description)

Location:
branches/eam_branches/ipp-20140423/Ohana/src/photdbc
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140423/Ohana/src/photdbc/Makefile

    r33655 r36745  
    3131$(SRC)/args.$(ARCH).o              \
    3232$(SRC)/copy_images.$(ARCH).o       \
     33$(SRC)/select_images.$(ARCH).o     \
    3334$(SRC)/Shutdown.$(ARCH).o          \
    3435$(SRC)/join_stars.$(ARCH).o        \
     
    4142$(SRC)/ConfigInit.$(ARCH).o        \
    4243$(SRC)/args.$(ARCH).o              \
    43 $(SRC)/copy_images.$(ARCH).o       \
    4444$(SRC)/Shutdown.$(ARCH).o          \
    4545$(SRC)/join_stars.$(ARCH).o        \
  • branches/eam_branches/ipp-20140423/Ohana/src/photdbc/include/photdbc.h

    r33963 r36745  
    2020  int    Nmeas;
    2121} StatType;
     22
     23typedef struct {
     24  double Xc[5];
     25  double Yc[5];
     26  double Rc;
     27  double Dc;
     28} SkyRegionCoords;
     29
     30# define MARKTIME(MSG,...) {                    \
     31    gettimeofday (&stopTimer, (void *) NULL);   \
     32    float dtime = DTIME (stopTimer, startTimer);        \
     33    fprintf (stderr, MSG, __VA_ARGS__); }
     34
     35# define INITTIME \
     36  struct timeval startTimer, stopTimer; \
     37  gettimeofday (&startTimer, (void *) NULL);
    2238
    2339int    PARALLEL;
     
    8096PhotCodeData photcodes;
    8197
    82 char          *PHOTCODE_DROP_LIST, *PHOTCODE_SKIP_LIST;
    83 int           NphotcodesDrop,      NphotcodesSkip;
    84 PhotCode     **photcodesDrop,     **photcodesSkip;
     98char          *PHOTCODE_DROP_LIST, *PHOTCODE_KEEP_LIST;
     99int           NphotcodesDrop,      NphotcodesKeep;
     100PhotCode     **photcodesDrop,     **photcodesKeep;
    85101
    86102# define FLAG_AREA            0X0001
     
    131147void SetProtect (int mode);
    132148int SetSignals (void);
    133 int copy_images (char *outdir);
     149int copy_images (char *outdir, SkyList *skylist);
    134150void usage();
     151
     152void dsortindex (double *X, off_t *Y, int N);
     153off_t getRegionStartByRA (double R, double *Rref, off_t Nregions);
     154
     155Image *select_images (SkyList *skylist, Image *timage, off_t Ntimage, off_t **LineNumber, off_t *Nimage, int UseFullOverlap);
    135156
    136157int photdbc_catalogs (char *outroot, SkyList *skylist, int hostID);
  • branches/eam_branches/ipp-20140423/Ohana/src/photdbc/src/args.c

    r33655 r36745  
    8585  }
    8686
     87  // measurements with these photcodes are not copied to the output
    8788  PHOTCODE_DROP_LIST = NULL;
    8889  if ((N = get_argument (argc, argv, "-photcode-drop"))) {
     
    9293  }
    9394
    94   PHOTCODE_SKIP_LIST = NULL;
    95   if ((N = get_argument (argc, argv, "-photcode-skip"))) {
    96     remove_argument (N, &argc, argv);
    97     PHOTCODE_SKIP_LIST = strcreate(argv[N]);
     95  // measurements with these photcodes are kept ***regardless of quality***
     96  // -photcode-keep J will keep all J-band measurements of all kinds
     97  // -photcode-keep GPC1.02.g will keep all g-band measurements from chip XY02
     98  PHOTCODE_KEEP_LIST = NULL;
     99  if ((N = get_argument (argc, argv, "-photcode-keep"))) {
     100    remove_argument (N, &argc, argv);
     101    PHOTCODE_KEEP_LIST = strcreate(argv[N]);
    98102    remove_argument (N, &argc, argv);
    99103  }
     
    254258  }
    255259
    256   PHOTCODE_SKIP_LIST = NULL;
    257   if ((N = get_argument (argc, argv, "-photcode-skip"))) {
    258     remove_argument (N, &argc, argv);
    259     PHOTCODE_SKIP_LIST = strcreate(argv[N]);
     260  PHOTCODE_KEEP_LIST = NULL;
     261  if ((N = get_argument (argc, argv, "-photcode-keep"))) {
     262    remove_argument (N, &argc, argv);
     263    PHOTCODE_KEEP_LIST = strcreate(argv[N]);
    260264    remove_argument (N, &argc, argv);
    261265  }
     
    290294 
    291295  fprintf (stderr, " -photcode-drop   : remove these photcodes from the output (REF or DEP only)\n");
    292   fprintf (stderr, " -photcode-skip  : ignore these photcodes when assessing the validity (keep unless object is dropped)\n");
     296  fprintf (stderr, " -photcode-keep  : ignore these photcodes when assessing the validity (keep unless object is dropped)\n");
    293297
    294298  fprintf (stderr, " -instmag (min) (max) : range of valid instrumental magnitudes (or measurements are dropped)\n");
  • branches/eam_branches/ipp-20140423/Ohana/src/photdbc/src/copy_images.c

    r33655 r36745  
    11# include "photdbc.h"
    22
    3 int copy_images (char *outdir) {
     3int copy_images (char *outdir, SkyList *skylist) {
    44
    55  int status;
    6   off_t Nimage;
     6  off_t Nimage, Nsubset;
     7  off_t *LineNumber;
    78  char *ImageOut;
    89  unsigned int imageID;
    910  FITS_DB in;
    1011  FITS_DB out;
    11   Image *image;
     12  Image *image, *subset;
    1213  struct stat filestat;
    1314  char *path;
     
    5051      exit (2);
    5152  }
    52   dvo_image_addrows (&out, image, Nimage);
     53
     54  subset = select_images (skylist, image, Nimage, &LineNumber, &Nsubset, FALSE);
     55
     56  dvo_image_addrows (&out, subset, Nsubset);
    5357
    5458  // note that imageID is unsigned int
  • branches/eam_branches/ipp-20140423/Ohana/src/photdbc/src/initialize.c

    r33655 r36745  
    1313
    1414  photcodesDrop = ParsePhotcodeList (PHOTCODE_DROP_LIST, &NphotcodesDrop, FALSE);
    15   photcodesSkip = ParsePhotcodeList (PHOTCODE_SKIP_LIST, &NphotcodesSkip, FALSE);
     15  photcodesKeep = ParsePhotcodeList (PHOTCODE_KEEP_LIST, &NphotcodesKeep, FALSE);
    1616
    1717  if (SHOW_PARAMS) {
     
    5454
    5555  photcodesDrop = ParsePhotcodeList (PHOTCODE_DROP_LIST, &NphotcodesDrop, FALSE);
    56   photcodesSkip = ParsePhotcodeList (PHOTCODE_SKIP_LIST, &NphotcodesSkip, FALSE);
     56  photcodesKeep = ParsePhotcodeList (PHOTCODE_KEEP_LIST, &NphotcodesKeep, FALSE);
    5757
    5858  if (SHOW_PARAMS) {
  • branches/eam_branches/ipp-20140423/Ohana/src/photdbc/src/make_subcatalog.c

    r31635 r36745  
    99  off_t NAVERAGE, NMEASURE, Naverage, Nmeasure, Nm, Nsecfilt;
    1010  double mag, minMag, minSigma;
    11   int keep, *secSkip;
     11  int keep, *secKeep;
    1212  PhotCode *photcode;
    1313 
     
    1616
    1717  // set up a list of SEC entries to ignore when evaluating a source
    18   ALLOCATE (secSkip, int, Nsecfilt);
     18  ALLOCATE (secKeep, int, Nsecfilt);
    1919  for (i = 0; i < Nsecfilt; i++) {
    20       secSkip[i] = FALSE;
     20      secKeep[i] = FALSE;
    2121      photcode = GetPhotcodebyNsec(i);
    22       for (k = 0; k < NphotcodesSkip; k++) {
    23           if (photcodesSkip[k][0].code != photcode[0].code) continue;
    24           secSkip[i] = TRUE;
     22      for (k = 0; k < NphotcodesKeep; k++) {
     23          if (photcodesKeep[k][0].code != photcode[0].code) continue;
     24          secKeep[i] = TRUE;
    2525      }
    2626  }
     
    6767      keep = FALSE;
    6868      for (j = 0; !keep && (j < Nsecfilt); j++) {
    69           if (secSkip[j]) continue;
     69          if (secKeep[j]) continue;
    7070          if (catalog[0].secfilt[Nsecfilt*i+j].Ncode >= NCODE_MIN) {
    7171              keep = TRUE;
     
    101101      if (NphotcodesDrop > 0) {
    102102          found = FALSE;
    103           for (k = 0; (k < NphotcodesSkip) && !found; k++) {
    104               if (photcodesSkip[k][0].code == catalog[0].measure[offset].photcode) found = TRUE;
    105               if (photcodesSkip[k][0].code == GetPhotcodeEquivCodebyCode(catalog[0].measure[offset].photcode)) found = TRUE;
     103          for (k = 0; (k < NphotcodesDrop) && !found; k++) {
     104              if (photcodesDrop[k][0].code == catalog[0].measure[offset].photcode) found = TRUE;
     105              if (photcodesDrop[k][0].code == GetPhotcodeEquivCodebyCode(catalog[0].measure[offset].photcode)) found = TRUE;
    106106          }
    107107          if (found) continue;
     
    109109 
    110110      // ignore certain photcodes to assess the measurements
    111       if (NphotcodesSkip > 0) {
     111      if (NphotcodesKeep > 0) {
    112112          found = FALSE;
    113           for (k = 0; (k < NphotcodesSkip) && !found; k++) {
    114               if (photcodesSkip[k][0].code == catalog[0].measure[offset].photcode) found = TRUE;
    115               if (photcodesSkip[k][0].code == GetPhotcodeEquivCodebyCode(catalog[0].measure[offset].photcode)) found = TRUE;
     113          for (k = 0; (k < NphotcodesKeep) && !found; k++) {
     114              if (photcodesKeep[k][0].code == catalog[0].measure[offset].photcode) found = TRUE;
     115              if (photcodesKeep[k][0].code == GetPhotcodeEquivCodebyCode(catalog[0].measure[offset].photcode)) found = TRUE;
    116116          }
    117117          if (found) goto keep;
  • branches/eam_branches/ipp-20140423/Ohana/src/photdbc/src/photdbc.c

    r33655 r36745  
    99  initialize (argc, argv);
    1010
    11   // load and copy the image table
    12   copy_images (argv[1]);
    13 
    1411  // the output catalog needs to inherit the SKY_DEPTH of the input catalog
    1512  sky = SkyTableLoadOptimal (CATDIR, NULL, NULL, TRUE, 0, VERBOSE);
    1613  SkyTableSetFilenames (sky, CATDIR, "cpt");
    1714  skylist = SkyListByPatch (sky, -1, &REGION);
     15
     16  // load and copy the image table
     17  copy_images (argv[1], skylist);
    1818
    1919  // hostID is 0 for master program
  • branches/eam_branches/ipp-20140423/Ohana/src/photdbc/src/photdbc_catalogs.c

    r33963 r36745  
    120120    if (ExcludeByMaxMinMag) { snprintf (tmpline, DVO_MAX_PATH, "%s -maxminmag %f",     command, MAX_MIN_MAG);                   strcpy (command, tmpline); }
    121121    if (PHOTCODE_DROP_LIST) { snprintf (tmpline, DVO_MAX_PATH, "%s -photcode-drop %s", command, PHOTCODE_DROP_LIST);    strcpy (command, tmpline); }
    122     if (PHOTCODE_SKIP_LIST) { snprintf (tmpline, DVO_MAX_PATH, "%s -photcode-skip %s", command, PHOTCODE_SKIP_LIST);    strcpy (command, tmpline); }
     122    if (PHOTCODE_KEEP_LIST) { snprintf (tmpline, DVO_MAX_PATH, "%s -photcode-keep %s", command, PHOTCODE_KEEP_LIST);    strcpy (command, tmpline); }
    123123    if (CATFORMAT)          { snprintf (tmpline, DVO_MAX_PATH, "%s -set-format %s",    command, CATFORMAT);                     strcpy (command, tmpline); }
    124124    if (CATMODE)            { snprintf (tmpline, DVO_MAX_PATH, "%s -set-mode %s",      command, CATMODE);                       strcpy (command, tmpline); }
Note: See TracChangeset for help on using the changeset viewer.