IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 28857


Ignore:
Timestamp:
Aug 5, 2010, 6:08:59 PM (16 years ago)
Author:
bills
Message:

put back support for dvomerge to an empty output catdir

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/dvomerge/src/dvomergeUpdate.c

    r28855 r28857  
    2424  }
    2525
    26   // since we are merging the input db into the output db, the output defines the photcode
    27   sprintf (filename, "%s/Photcodes.dat", output);
    28   if (!LoadPhotcodes (filename, NULL, FALSE)) {
    29     fprintf (stderr, "error loading photcode table: %s/Photcodes.dat\n", output);
    30     exit (1);
    31   }
    32   outputPhotcodes = GetPhotcodeTable();
    33 
    3426  SetPhotcodeTable(NULL);
    3527  sprintf (filename, "%s/Photcodes.dat", input);
     
    3931  }     
    4032  inputPhotcodes = GetPhotcodeTable();
    41   secfiltMap = GetSecFiltMap(outputPhotcodes, inputPhotcodes);
    42   if (!secfiltMap) {
    43     fprintf (stderr, "failed to map input secfilt photcodes to output photcodes table\n");
    44     exit (1);
     33
     34  // since we are merging the input db into the output db, the output defines the photcode
     35  // table & db layout but, this requires the output to exist.  if it does not, instead use the
     36  // input.
     37
     38  SetPhotcodeTable(NULL);
     39  sprintf (filename, "%s/Photcodes.dat", output);
     40  if (LoadPhotcodes (filename, NULL, FALSE)) {
     41
     42    outputPhotcodes = GetPhotcodeTable();
     43
     44    secfiltMap = GetSecFiltMap(outputPhotcodes, inputPhotcodes);
     45    if (!secfiltMap) {
     46      fprintf (stderr, "failed to map input secfilt photcodes to output photcodes table\n");
     47      exit (1);
     48    }
     49  } else {
     50    fprintf(stderr, "%s not found using photcodes from %s/Photcodes.dat\n", filename, input);
     51    outputPhotcodes = inputPhotcodes;
     52    if (!check_dir_access (output, VERBOSE)) {
     53      fprintf (stderr, "error creating output database directory %s\n", output);
     54      exit (1);
     55    }
     56    SetPhotcodeTable(inputPhotcodes);
     57    if (!SavePhotcodesFITS (filename)) {
     58      fprintf (stderr, "error saving photcode table in %s/Photcodes.dat\n", output);
     59      exit (1);
     60    }
    4561  }
    4662
Note: See TracChangeset for help on using the changeset viewer.