IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39300


Ignore:
Timestamp:
Jan 4, 2016, 7:59:05 AM (11 years ago)
Author:
eugene
Message:

working on restricted cpts

Location:
trunk/Ohana/src/dvomerge
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/dvomerge/Makefile

    r39281 r39300  
    2525dvoutils        : $(BIN)/dvoutils.$(ARCH)
    2626
    27 all: dvomerge dvomerge_client dvoconvert dvosecfilt dvosecfilt_client dvorepair dvoverify dvoverify_client dvoutils
     27# all: dvomerge dvomerge_client dvoconvert dvosecfilt dvosecfilt_client dvorepair dvoverify dvoverify_client dvoutils
     28all: dvoconvert dvosecfilt dvosecfilt_client dvorepair dvoverify dvoverify_client dvoutils
    2829
    2930#  $(SRC)/dvomergeContinue.$(ARCH).o
  • trunk/Ohana/src/dvomerge/include/dvomerge.h

    r39299 r39300  
    4545char  *UPDATE_CATFORMAT;
    4646char  *UPDATE_CATCOMPRESS;
     47char  *RESTRICT_CPT;
    4748
    4849int    MATCH_BY_EXTERN_ID;
  • trunk/Ohana/src/dvomerge/src/args.c

    r39299 r39300  
    7474  if ((N = get_argument (*argc, argv, "-force-merge"))) {
    7575    FORCE_MERGE = TRUE;
     76    remove_argument (N, argc, argv);
     77  }
     78
     79  RESTRICT_CPT = NULL;
     80  if ((N = get_argument (*argc, argv, "-restrict-cpt"))) {
     81    remove_argument (N, argc, argv);
     82    RESTRICT_CPT = strcreate (argv[N]);
    7683    remove_argument (N, argc, argv);
    7784  }
     
    259266  }
    260267
     268  RESTRICT_CPT = NULL;
     269  if ((N = get_argument (*argc, argv, "-restrict-cpt"))) {
     270    remove_argument (N, argc, argv);
     271    RESTRICT_CPT = strcreate (argv[N]);
     272    remove_argument (N, argc, argv);
     273  }
     274
    261275  UPDATE_CATFORMAT = NULL;
    262276  if ((N = get_argument (*argc, argv, "-update-catformat"))) {
  • trunk/Ohana/src/dvomerge/src/dvomergeFromList.c

    r38986 r39300  
    11# include "dvomerge.h"
    22
     3char **load_cptlist (char *filename, int *nlist);
     4
     5// merge from list implies 'continue' (ie, we must have already done a partial merge)
    36int dvomergeFromList (int argc, char **argv) {
    47
     
    710  char filename[256], *input, *output;
    811  IDmapType IDmap;
    9   PhotCodeData *inputPhotcodes;
    10   PhotCodeData *outputPhotcodes;
    1112  int *secfiltMap = NULL;
    12   char *listname, **list, inputfile[256], outputfile[256];
    13   int Nlist, NLIST;
     13  char inputfile[256], outputfile[256];
    1414  int NsecfiltInput, NsecfiltOutput;
     15
     16  INITTIME;
     17
     18  dvo_image_map_init (&IDmap);
    1519
    1620  if (strcasecmp (argv[2], "into")) dvomerge_usage();
     
    2125  listname = argv[5];
    2226
    23   Nlist = 0;
    24   NLIST = 100;
    25   ALLOCATE(list, char *, NLIST);
    26   for (i = 0; i < NLIST; i++) {
    27     ALLOCATE(list[i], char, 256);
    28     memset(list[i], 0, 256);
    29   }
    30  
    31   FILE *listfile = fopen(listname, "r");
    32   myAssert(listfile, "error opening list");
    33 
    34   for (i = 0; fscanf (listfile, "%s", list[i]) != EOF; i++) {
    35     if (i == NLIST - 1) {
    36       NLIST += 100;
    37       REALLOCATE(list, char *, NLIST);
    38       for (j = i + 1; j < NLIST; j++) {
    39         ALLOCATE(list[j], char, 256);
    40         memset(list[j], 0, 256);
    41       }
    42     }
    43   }     
    44   Nlist = i;
    45   fclose(listfile);
     27  char *cptlist = load_cptlist (listname, &Ncptlist);
    4628
    4729  if (ALTERNATE_PHOTCODE_FILE) {
     
    4931    exit (1);
    5032  }
     33
     34  PhotCodeData *inputPhotcodes = NULL;
     35  PhotCodeData *outputPhotcodes = NULL;
    5136
    5237  SetPhotcodeTable(NULL);
     
    5843  inputPhotcodes = GetPhotcodeTable();
    5944  NsecfiltInput = GetPhotcodeNsecfilt();
     45
     46  if (REPLACE_TYCHO) replace_tycho_init();
    6047
    6148  // since we are merging the input db into the output db, the output defines the photcode
     
    9178  }
    9279
    93   // XXX need to determine the mapping from the input to the output images
     80  // need to determine the mapping from the input to the output images
     81  // output dvo images must already have been merged
    9482  dvomergeImagesGetMap (&IDmap, input, output);
    9583
     84  // XXX we are not loading the skytable info
     85
    9686  SetPhotcodeTable(NULL);
     87
     88  // XXX the stuff below is equiv to stuff in dvomergeUpdate_catalogs()
    9789
    9890  // loop over the populated input regions
     
    162154  }
    163155
     156  // XXX we do not update the skytable
     157
     158  // XXX need to free things
     159
    164160  exit (0);
    165161}
     162
     163char **load_cptlist (char *filename, int *nlist) {
     164
     165  int NLIST = 100;
     166 
     167  char **list = NULL;
     168  ALLOCATE(list, char *, NLIST);
     169
     170  int i;
     171  for (i = 0; i < NLIST; i++) {
     172    ALLOCATE(list[i], char, DVO_MAX_PATH);
     173    memset(list[i], 0, DVO_MAX_PATH);
     174  }
     175 
     176  FILE *listfile = fopen(filename, "r");
     177  myAssert(listfile, "error opening list");
     178
     179  for (i = 0; fscanf (listfile, "%s", list[i]) != EOF; i++) {
     180    if (i == NLIST - 1) {
     181      NLIST += 100;
     182      REALLOCATE(list, char *, NLIST);
     183      for (j = i + 1; j < NLIST; j++) {
     184        ALLOCATE(list[j], char, DVO_MAX_PATH);
     185        memset(list[j], 0, DVO_MAX_PATH);
     186      }
     187    }
     188  }     
     189  *nlist = i;
     190  fclose(listfile);
     191
     192  return list;
     193}
  • trunk/Ohana/src/dvomerge/src/dvomergeUpdate.c

    r38553 r39300  
    9999  inlist = SkyListByPatch (insky, -1, &UserPatch);
    100100
     101  // modify the list if we are restricting:
     102  inlist = SkyListSubset (inlist, cptlist);
     103
    101104  // generate an output table populated at the desired depth
    102105  outsky = SkyTableLoadOptimal (output, NULL, GSCFILE, TRUE, SKY_DEPTH, VERBOSE);
Note: See TracChangeset for help on using the changeset viewer.