Changeset 3521
- Timestamp:
- Mar 27, 2005, 4:47:22 PM (21 years ago)
- Location:
- trunk/Ohana/src/addstar
- Files:
-
- 3 edited
-
Makefile (modified) (3 diffs)
-
include/addstar.h (modified) (3 diffs)
-
src/rfits.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/Makefile
r3517 r3521 1 default: addstar1 ,default: addstar 2 2 help: 3 3 @echo "make options: addstar (default)" … … 17 17 # 18 18 INCS = -I$(INC) -I$(LINC) -I$(XINC) 19 LIBS = -L$(LLIB) -l FITS -lohana-lz -lm19 LIBS = -L$(LLIB) -lohana -lFITS -lz -lm 20 20 CFLAGS = $(INCS) 21 21 LFLAGS = $(LIBS) … … 62 62 $(SRC)/wimage.$(ARCH).o \ 63 63 $(SRC)/rfits.$(ARCH).o \ 64 $(SRC)/rtext.$(ARCH).o \ 65 $(SRC)/ConvertStars.$(ARCH).o 64 $(SRC)/rtext.$(ARCH).o 66 65 67 66 EXTRA = \ -
trunk/Ohana/src/addstar/include/addstar.h
r3466 r3521 18 18 exit (0); } 19 19 20 # if (0) 20 21 /* this structure is used for loading the data from the FITS smp file */ 21 22 typedef struct { … … 33 34 char dummy[3]; 34 35 } StarData; 36 # endif 35 37 36 38 typedef struct { … … 215 217 GSCRegion *gregion_match (GSCRegion *regions, int *nregions); 216 218 GSCRegion *gregion_patch (GSCRegion *patch, int *nregions); 217 int ConvertStars (StarData *data, int size, int nitems);218 219 int dump_rawstars (Stars *stars, int Nstars); 219 220 Stars *rfits (FILE *f, int *nstars); -
trunk/Ohana/src/addstar/src/rfits.c
r3466 r3521 7 7 FTable table; 8 8 Stars *stars; 9 S tarData *stardata;9 SMPData *smpdata; 10 10 11 11 /* if no stars, no table */ 12 if (*nstars == 0) { 13 *nstars = 0; 14 return (NULL); 15 } 12 if (*nstars == 0) return (NULL); 16 13 17 14 /* init & load in table data */ … … 19 16 if (!fits_fread_ftable (f, &table, "SMPFILE")) goto escape; 20 17 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); 28 19 29 20 ALLOCATE (stars, Stars, Nstars); 30 21 for (i = 0; i < Nstars; i++) { 31 stars[i].X = s tardata[i].X;32 stars[i].Y = s tardata[i].Y;33 stars[i].M = s tardata[i].M;34 stars[i].dM = s tardata[i].dM;35 stars[i].dophot = s tardata[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; 36 27 37 stars[i].Mgal = s tardata[i].M;38 stars[i].Map = s tardata[i].dM;39 stars[i].fx = s tardata[i].fx;40 stars[i].fy = s tardata[i].fy;41 stars[i].df = s tardata[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; 42 33 } 43 34 *nstars = Nstars;
Note:
See TracChangeset
for help on using the changeset viewer.
