IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32846


Ignore:
Timestamp:
Dec 1, 2011, 5:01:48 AM (15 years ago)
Author:
eugene
Message:

fix fits vector read to load int64 columns

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20111122/Ohana/src/opihi/cmd.data/read_vectors.c

    r32632 r32846  
    314314  for (i = 1; i < argc; i++) {
    315315    void   *data;
    316     char   *Pc;
    317     short  *Ps;
    318     int    *Pi;
    319     float  *Pf;
    320     double *Pd;
    321316    int Nval;
    322317    char name[80];
     
    348343    }
    349344
     345    if (!strcmp (type, "char")) {
     346      char *Ptr = data;
     347      for (j = 0; j < Ny; j++) {
     348        for (k = 0; k < Nval; k++, Ptr++) {
     349          vec[k][0].elements.Int[j] = *Ptr;
     350        }
     351      }
     352    }
     353    if (!strcmp (type, "short")) {
     354      short *Ptr = data;
     355      for (j = 0; j < Ny; j++) {
     356        for (k = 0; k < Nval; k++, Ptr++) {
     357          vec[k][0].elements.Int[j] = *Ptr;
     358        }
     359      }
     360    }
     361    if (!strcmp (type, "int")) {
     362      int *Ptr = data;
     363      for (j = 0; j < Ny; j++) {
     364        for (k = 0; k < Nval; k++, Ptr++) {
     365          vec[k][0].elements.Int[j] = *Ptr;
     366        }
     367      }
     368    }
     369    if (!strcmp (type, "int64_t")) {
     370      int64_t *Ptr = data;
     371      for (j = 0; j < Ny; j++) {
     372        for (k = 0; k < Nval; k++, Ptr++) {
     373          vec[k][0].elements.Int[j] = *Ptr;
     374        }
     375      }
     376    }
     377    if (!strcmp (type, "float")) {
     378      float *Ptr = data;
     379      for (j = 0; j < Ny; j++) {
     380        for (k = 0; k < Nval; k++, Ptr++) {
     381          vec[k][0].elements.Flt[j] = *Ptr;
     382        }
     383      }
     384    }
    350385    if (!strcmp (type, "double")) {
    351       Pd = (double *) data;
     386      double *Ptr = data;
    352387      for (j = 0; j < Ny; j++) {
    353         for (k = 0; k < Nval; k++, Pd++) {
    354           vec[k][0].elements.Flt[j] = *Pd;
    355         }
    356       }
    357     }
    358     if (!strcmp (type, "float")) {
    359       Pf = (float *) data;
    360       for (j = 0; j < Ny; j++) {
    361         for (k = 0; k < Nval; k++, Pf++) {
    362           vec[k][0].elements.Flt[j] = *Pf;
    363         }
    364       }
    365     }
    366     if (!strcmp (type, "int")) {
    367       Pi = (int *) data;
    368       for (j = 0; j < Ny; j++) {
    369         for (k = 0; k < Nval; k++, Pi++) {
    370           vec[k][0].elements.Int[j] = *Pi;
    371         }
    372       }
    373     }
    374     if (!strcmp (type, "short")) {
    375       Ps = (short *) data;
    376       for (j = 0; j < Ny; j++) {
    377         for (k = 0; k < Nval; k++, Ps++) {
    378           vec[k][0].elements.Int[j] = *Ps;
    379         }
    380       }
    381     }
    382     if (!strcmp (type, "char")) {
    383       Pc = (char *) data;
    384       for (j = 0; j < Ny; j++) {
    385         for (k = 0; k < Nval; k++, Pc++) {
    386           vec[k][0].elements.Int[j] = *Pc;
     388        for (k = 0; k < Nval; k++, Ptr++) {
     389          vec[k][0].elements.Flt[j] = *Ptr;
    387390        }
    388391      }
Note: See TracChangeset for help on using the changeset viewer.