IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 13, 2005, 2:37:39 PM (21 years ago)
Author:
eugene
Message:

changed load_catalog to take the mode from the catalog structure rather than as an argument

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

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libdvo/include/dvo.h

    r5241 r5320  
    145145  int catmode;                          /* storage mode (raw, mef, split, mysql) */
    146146  int catformat;                        /* storage format (elixir, panstarrs, etc) */
     147  int catflags;                         /* choices to be loaded */
    147148  int sorted;                           /* is measure table average-sorted? */
    148149 
     
    181182int lock_catalog (Catalog *catalog, int lockmode);
    182183int unlock_catalog (Catalog *catalog);
    183 int load_catalog (Catalog *catalog, char mode, int VERBOSE);
     184int load_catalog (Catalog *catalog, int VERBOSE);
    184185int save_catalog (Catalog *catalog, char VERBOSE);
    185186int update_catalog (Catalog *catalog, char VERBOSE);
     
    292293int SecFiltToFtable (FTable *ftable, SecFilt *secfilt, int Nsecfilt, int format);
    293294
    294 int load_catalog_raw (Catalog *catalog, char mode, int VERBOSE);
     295int load_catalog_raw (Catalog *catalog, int VERBOSE);
    295296int save_catalog_raw (Catalog *catalog, char VERBOSE);
    296 int load_catalog_mef (Catalog *catalog, char mode, int VERBOSE);
     297int load_catalog_mef (Catalog *catalog, int VERBOSE);
    297298int save_catalog_mef (Catalog *catalog, char VERBOSE);
    298 int load_catalog_split (Catalog *catalog, char mode, int VERBOSE);
     299int load_catalog_split (Catalog *catalog, int VERBOSE);
    299300int save_catalog_split (Catalog *catalog, char VERBOSE);
    300301int update_catalog_split (Catalog *catalog, char VERBOSE);
  • trunk/Ohana/src/libdvo/src/dvo_catalog.c

    r5241 r5320  
    3535}
    3636
    37 int load_catalog (Catalog *catalog, char mode, int VERBOSE) {
     37int load_catalog (Catalog *catalog, int VERBOSE) {
    3838 
    3939  int Naxis, split;
     
    6363    case DVO_MODE_RAW:
    6464      if (VERBOSE) fprintf (stderr, "reading catalog (mode DVO_MODE_RAW)\n");
    65       load_catalog_raw (catalog, mode, VERBOSE);
     65      load_catalog_raw (catalog, VERBOSE);
    6666      break;
    6767    case DVO_MODE_MEF:
    6868      if (VERBOSE) fprintf (stderr, "reading catalog (mode DVO_MODE_MEF)\n");
    69       load_catalog_mef (catalog, mode, VERBOSE);
     69      load_catalog_mef (catalog, VERBOSE);
    7070      break;
    7171    case DVO_MODE_SPLIT:
    7272      if (VERBOSE) fprintf (stderr, "reading catalog (mode DVO_MODE_SPLIT)\n");
    73       load_catalog_split (catalog, mode, VERBOSE);
     73      load_catalog_split (catalog, VERBOSE);
    7474      break;
    7575    default:
  • trunk/Ohana/src/libdvo/src/dvo_catalog_mef.c

    r5241 r5320  
    11# include <dvo.h>
    22
    3 int load_catalog_mef (Catalog *catalog, char mode, int VERBOSE) {
     3int load_catalog_mef (Catalog *catalog, int VERBOSE) {
    44 
    55  int Nitems, Nbytes, Nexpect, Naverage, Nmeasure, Nmissing, Nsecfilt;
     
    3939  }
    4040  /* read Average table data (or skip) */
    41   if (mode & LOAD_AVES) {
     41  if (catalog[0].catflags & LOAD_AVES) {
    4242    if (!fits_fread_ftable_data (f, &ftable)) {
    4343      if (VERBOSE) fprintf (stderr, "can't read table average data");
     
    6161  }
    6262  /* read Measure table data */
    63   if (mode & LOAD_MEAS) {
     63  if (catalog[0].catflags & LOAD_MEAS) {
    6464    if (!fits_fread_ftable_data (f, &ftable)) {
    6565      if (VERBOSE) fprintf (stderr, "can't read table measure data");
     
    8181  }
    8282  /* read Missing table data */
    83   if (mode & LOAD_MISS) {
     83  if (catalog[0].catflags & LOAD_MISS) {
    8484    if (!fits_fread_ftable_data (f, &ftable)) {
    8585      if (VERBOSE) fprintf (stderr, "can't read table missing data");
     
    105105  }
    106106  /* read secfilt table data */
    107   if (mode & LOAD_SECF) {
     107  if (catalog[0].catflags & LOAD_SECF) {
    108108    if (!fits_fread_ftable_data (f, &ftable)) {
    109109      if (VERBOSE) fprintf (stderr, "can't read table secfilt data");
  • trunk/Ohana/src/libdvo/src/dvo_catalog_raw.c

    r5241 r5320  
    33/* read data from raw-style catalog file; set data format values based on file */
    44
    5 int load_catalog_raw (Catalog *catalog, char mode, int VERBOSE) {
     5int load_catalog_raw (Catalog *catalog, int VERBOSE) {
    66 
    77  int Nitems, nitems;
     
    113113
    114114  /* read and convert the averages (use a macro to clean this up?) */
    115   if (mode & LOAD_AVES) {
     115  if (catalog[0].catflags & LOAD_AVES) {
    116116    catalog[0].average = ReadRawAverage (catalog[0].f, catalog[0].Naverage, catalog[0].catformat);
    117117  } else {
     
    122122 
    123123  /* read and convert the measures (use a macro to clean this up?) */
    124   if (mode & LOAD_MEAS) {
     124  if (catalog[0].catflags & LOAD_MEAS) {
    125125    catalog[0].measure = ReadRawMeasure (catalog[0].f, catalog[0].Nmeasure, catalog[0].catformat);
    126126  } else {
     
    131131
    132132  /* read and convert missing */
    133   if (mode & LOAD_MISS) {
     133  if (catalog[0].catflags & LOAD_MISS) {
    134134    ALLOCATE (catalog[0].missing, Missing, MAX (catalog[0].Nmissing, 1));
    135135    Nitems = catalog[0].Nmissing;
     
    147147 
    148148  /* read and convert secfilt */
    149   if (mode & LOAD_SECF) {
     149  if (catalog[0].catflags & LOAD_SECF) {
    150150    Nitems = catalog[0].Naverage * catalog[0].Nsecfilt;
    151151    catalog[0].secfilt = ReadRawSecFilt (catalog[0].f, Nitems, catalog[0].catformat);
     
    160160
    161161  /* check data integrity */
    162   if (mode & LOAD_AVES) {
     162  if (catalog[0].catflags & LOAD_AVES) {
    163163    for (i = Nmeas = Nmiss = 0; i < catalog[0].Naverage; i++) {
    164164      Nmeas += catalog[0].average[i].Nm;
  • trunk/Ohana/src/libdvo/src/dvo_catalog_split.c

    r5241 r5320  
    11# include <dvo.h>
    22
    3 int load_catalog_split (Catalog *catalog, char mode, int VERBOSE) {
     3int load_catalog_split (Catalog *catalog, int VERBOSE) {
    44
    55  int Nitems, Nexpect, Naverage, Nmeasure, Nmissing, Nsecfilt;
     
    3636  /*** Average Table ***/
    3737
    38   if (mode & LOAD_AVES) {
     38  if (catalog[0].catflags & LOAD_AVES) {
    3939    /* move pointer past header -- must be already read (load_catalog) */
    4040    fseek (catalog[0].f, catalog[0].header.size, SEEK_SET);
     
    6666
    6767  /* (Full Load) */
    68   if (mode & LOAD_MEAS) {
     68  if (catalog[0].catflags & LOAD_MEAS) {
    6969    ALLOCATE (measure, Catalog, 1);
    7070
     
    111111
    112112  /* (Meta Load) */
    113   if (mode & LOAD_MEAS_META) {
     113  if (catalog[0].catflags & LOAD_MEAS_META) {
    114114    ALLOCATE (measure, Catalog, 1);
    115115
     
    143143
    144144  missing = NULL;
    145   if (mode & LOAD_MISS) {
     145  if (catalog[0].catflags & LOAD_MISS) {
    146146    ALLOCATE (missing, Catalog, 1);
    147147
     
    190190
    191191  secfilt = NULL;
    192   if (mode & LOAD_SECF) {
     192  if (catalog[0].catflags & LOAD_SECF) {
    193193    ALLOCATE (secfilt, Catalog, 1);
    194194 
Note: See TracChangeset for help on using the changeset viewer.