IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 15741


Ignore:
Timestamp:
Dec 5, 2007, 3:25:35 PM (18 years ago)
Author:
eugene
Message:

working on the segmented load / save

Location:
branches/eam_branch_20071130/Ohana/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20071130/Ohana/src/addstar/src/UpdateDatabase_Image.c

    r15732 r15741  
    7474      SetProtect (TRUE);
    7575      if (options[0].update) {
     76        catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
    7677        dvo_catalog_update (&catalog, VERBOSE);
    7778      } else {
  • branches/eam_branch_20071130/Ohana/src/addstar/src/UpdateDatabase_Refcat.c

    r15732 r15741  
    6363      SetProtect (TRUE);
    6464      if (options[0].update) {
     65        catalog.catflags  = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
    6566        dvo_catalog_update (&catalog, VERBOSE);
    6667      } else {
  • branches/eam_branch_20071130/Ohana/src/addstar/src/UpdateDatabase_Reflist.c

    r15732 r15741  
    5959      SetProtect (TRUE);
    6060      if (options[0].update) {
     61        catalog.catflags  = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
    6162        dvo_catalog_update (&catalog, VERBOSE);
    6263      } else {
  • branches/eam_branch_20071130/Ohana/src/addstar/src/addstar.c

    r15732 r15741  
    143143      SetProtect (TRUE);
    144144      if (options.update) {
     145        catalog.catflags  = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
    145146        dvo_catalog_update (&catalog, VERBOSE);
    146147      } else {
  • branches/eam_branch_20071130/Ohana/src/getstar/src/getstar.c

    r15732 r15741  
    2121  output.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
    2222  output.catmode   = dvo_catalog_catmode (CATMODE);      // set the default catmode from config data
     23  output.catflags  = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
    2324  output.Nsecfilt  = GetPhotcodeNsecfilt ();
    2425
  • branches/eam_branch_20071130/Ohana/src/libdvo/src/dvo_catalog_split.c

    r15734 r15741  
    374374    catalog[0].average = FtableToAverage (&ftable, &Naverage, &catalog[0].catformat, &primary);
    375375    if (Naverage != Nrows) {
    376       // XXX this is only an error if Nrows or more are available...
    377       // XXX allow Nrows to go beyond end of the data?
    378       fprintf (stderr, "Warning: mismatch between Naverage in PHU and Table headers (%d vs %d)\n", Naverage, Nrows);
     376      // XXX this condition denotes the eof has been reached; not an error or a warning
     377      // fprintf (stderr, "Warning: mismatch between Naverage in PHU and Table headers (%d vs %d)\n", Naverage, Nrows);
    379378    }
    380379    gfits_free_header (&header);
     
    392391      return (FALSE);
    393392    }
    394     /* read Measure table header */
     393    /* read Secfilt table header */
    395394    if (!gfits_fread_header (subcat[0].f, &header)) {
    396395      if (VERBOSE) fprintf (stderr, "can't read table measure header");
    397396      return (FALSE);
    398397    }
    399     /* read Measure table data : format is irrelevant here */
    400     if (!gfits_fread_ftable_range (subcat[0].f, &ftable, start, Nrows)) {
     398    /* read Secfilt table data : format is irrelevant here */
     399    if (!gfits_fread_ftable_range (subcat[0].f, &ftable, start*catalog[0].Nsecfilt, catalog[0].Naverage*catalog[0].Nsecfilt)) {
    401400      if (VERBOSE) fprintf (stderr, "can't read table measure data");
    402401      return (FALSE);
    403402    }
    404403
    405     Nexpect = Nrows * Nsecfilt;
     404    Nexpect = catalog[0].Naverage * catalog[0].Nsecfilt;
    406405    catalog[0].secfilt = FtableToSecFilt (&ftable, &Nitems, &catalog[0].catformat);
    407406    if (Nitems != Nexpect) {
    408407      fprintf (stderr, "Warning: mismatch between Nsecfilt items in PHU and Table headers (%d vs %d)\n", Nitems, Nexpect);
    409408    }
    410     catalog[0].Nsecf_mem = Nrows * Nsecfilt;
    411     catalog[0].Nsecf_off = start * Nsecfilt;
     409    catalog[0].Nsecf_mem = catalog[0].Naverage * catalog[0].Nsecfilt;
     410    catalog[0].Nsecf_off = start               * catalog[0].Nsecfilt;
    412411
    413412    /* if primary is defined, we were supplied with one additional average magnitude from Average
     
    542541
    543542  /*** Average Table ***/
    544   if (catalog[0].average != NULL) {
     543  if ((catalog[0].catflags & LOAD_AVES) && (catalog[0].average != NULL)) {
    545544
    546545    first  = 0;                    // first row in memory to write
     
    579578
    580579  /*** Measure Table ***/
    581   if (catalog[0].measure != NULL) {
     580  if ((catalog[0].catflags & LOAD_MEAS) && (catalog[0].measure != NULL)) {
    582581
    583582    first  = 0;                    // first row in memory to write
     
    606605
    607606  /*** Missing Table ***/
    608   if (catalog[0].missing != NULL) {
     607  if ((catalog[0].catflags & LOAD_MISS) && (catalog[0].missing != NULL)) {
    609608
    610609    if (catalog[0].Nmiss_off != 0) {
     
    629628
    630629  /*** Secfilt Table ***/
    631   if (catalog[0].secfilt != NULL) {
     630  if ((catalog[0].catflags & LOAD_SECF) && (catalog[0].secfilt != NULL)) {
    632631
    633632    first  = 0;                    // first row in memory to write
  • branches/eam_branch_20071130/Ohana/src/libfits/table/F_read_T.c

    r15733 r15741  
    7171
    7272  int Nbytes, Nread, Nskip, Nx, Ny;
    73   char *buffer;
    7473
    7574  /* find disk table size */
     
    7776  Ny = table[0].header[0].Naxis[1];
    7877
     78  // it is an error to ask for data starting out-of-bounds
    7979  if (start < 0) return (FALSE);
    80   if (start + Nrows >= Ny) return (FALSE);
     80  if (start >= Ny) return (FALSE);
    8181 
     82  // if we request more data than is available, we will stop at the table end.
     83  Nrows = MIN (Nrows, Ny - start);
     84
    8285  Nskip = start * Nx;
    8386  Nbytes = Nrows * Nx;
     
    8588
    8689  fseek (f, Nskip, SEEK_CUR);
    87   fprintf (stderr, "file is at %ld\n", ftell(f));
    88 
    89   Nread = fread (buffer, sizeof (char), Nbytes, f);
     90
     91  Nread = fread (table[0].buffer, sizeof (char), Nbytes, f);
    9092  if (Nread != Nbytes) {
    91     perror ("fits read error");
    92     free (buffer);
     93    if (ferror (f)) {
     94      perror ("fits read error");
     95    } else {
     96      fprintf (stderr, "unexpected eof\n");
     97    }     
     98    free (table[0].buffer);
    9399    return (FALSE);
    94100  }
  • branches/eam_branch_20071130/Ohana/src/relastro/src/load_catalogs.c

    r15732 r15741  
    1313  for (i = 0; i < skylist[0].Nregions; i++) {
    1414
     15    // we only allow output if we do not use a subset.  in this case,
     16    // the output parameters are correctly set for catalog[i] via pcatalog
    1517    pcatalog = subselect ? &tcatalog : &catalog[i];
    1618
Note: See TracChangeset for help on using the changeset viewer.