IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3521


Ignore:
Timestamp:
Mar 27, 2005, 4:47:22 PM (21 years ago)
Author:
eugene
Message:

converted to autocode SMPData

Location:
trunk/Ohana/src/addstar
Files:
3 edited

Legend:

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

    r3517 r3521  
    1 default: addstar
     1,default: addstar
    22help:
    33        @echo "make options: addstar (default)"
     
    1717
    1818INCS    =       -I$(INC) -I$(LINC) -I$(XINC)
    19 LIBS    =       -L$(LLIB) -lFITS -lohana -lz -lm
     19LIBS    =       -L$(LLIB) -lohana -lFITS -lz -lm
    2020CFLAGS  =       $(INCS)
    2121LFLAGS  =       $(LIBS)
     
    6262$(SRC)/wimage.$(ARCH).o \
    6363$(SRC)/rfits.$(ARCH).o \
    64 $(SRC)/rtext.$(ARCH).o \
    65 $(SRC)/ConvertStars.$(ARCH).o
     64$(SRC)/rtext.$(ARCH).o
    6665
    6766EXTRA = \
  • trunk/Ohana/src/addstar/include/addstar.h

    r3466 r3521  
    1818    exit (0); }
    1919
     20# if (0)
    2021/* this structure is used for loading the data from the FITS smp file */
    2122typedef struct {
     
    3334  char  dummy[3];
    3435} StarData;
     36# endif
    3537
    3638typedef struct {
     
    215217GSCRegion *gregion_match (GSCRegion *regions, int *nregions);
    216218GSCRegion *gregion_patch (GSCRegion *patch, int *nregions);
    217 int ConvertStars (StarData *data, int size, int nitems);
    218219int dump_rawstars (Stars *stars, int Nstars);
    219220Stars *rfits (FILE *f, int *nstars);
  • trunk/Ohana/src/addstar/src/rfits.c

    r3466 r3521  
    77  FTable table;
    88  Stars *stars;
    9   StarData *stardata;
     9  SMPData *smpdata;
    1010
    1111  /* if no stars, no table */
    12   if (*nstars == 0) {
    13     *nstars = 0;
    14     return (NULL);
    15   }
     12  if (*nstars == 0) return (NULL);
    1613
    1714  /* init & load in table data */
     
    1916  if (!fits_fread_ftable (f, &table, "SMPFILE")) goto escape;
    2017
    21   /* convert to internal format */
    22   stardata = (StarData *) table.buffer;
    23   fits_scan (table.header, "NAXIS1", "%d", 1, &Nx);
    24   fits_scan (table.header, "NAXIS2", "%d", 1, &Ny);
    25   Nstars = Ny;
    26 
    27   if (!ConvertStars (stardata, sizeof (StarData), Nstars)) goto escape;
     18  smpdata = fits_table_get_SMPData (&table, &Nstars);
    2819
    2920  ALLOCATE (stars, Stars, Nstars);
    3021  for (i = 0; i < Nstars; i++) {
    31     stars[i].X      = stardata[i].X;
    32     stars[i].Y      = stardata[i].Y;
    33     stars[i].M      = stardata[i].M;
    34     stars[i].dM     = stardata[i].dM;
    35     stars[i].dophot = stardata[i].dophot;
     22    stars[i].X      = smpdata[i].X;
     23    stars[i].Y      = smpdata[i].Y;
     24    stars[i].M      = smpdata[i].M;
     25    stars[i].dM     = smpdata[i].dM;
     26    stars[i].dophot = smpdata[i].dophot;
    3627
    37     stars[i].Mgal   = stardata[i].M;
    38     stars[i].Map    = stardata[i].dM;
    39     stars[i].fx     = stardata[i].fx;
    40     stars[i].fy     = stardata[i].fy;
    41     stars[i].df     = stardata[i].df;
     28    stars[i].Mgal   = smpdata[i].M;
     29    stars[i].Map    = smpdata[i].dM;
     30    stars[i].fx     = smpdata[i].fx;
     31    stars[i].fy     = smpdata[i].fy;
     32    stars[i].df     = smpdata[i].df;
    4233  }   
    4334  *nstars = Nstars;
Note: See TracChangeset for help on using the changeset viewer.