Changeset 3519
- Timestamp:
- Mar 25, 2005, 6:58:32 PM (21 years ago)
- Location:
- trunk/Ohana/src
- Files:
-
- 1 deleted
- 16 edited
-
imclean/Makefile (modified) (2 diffs)
-
imclean/include/imclean.h (modified) (1 diff)
-
imclean/src/LoadStarsChad.c (modified) (3 diffs)
-
imclean/src/LoadStarsDophot.c (modified) (3 diffs)
-
imclean/src/LoadStarsSex.c (modified) (3 diffs)
-
imclean/src/addastro.c (deleted)
-
imclean/src/find_group.c (modified) (1 diff)
-
imclean/src/find_line.c (modified) (3 diffs)
-
imclean/src/find_trails.c (modified) (1 diff)
-
imclean/src/imclean.c (modified) (1 diff)
-
imclean/src/sort_stars.c (modified) (1 diff)
-
imclean/src/star_stats.c (modified) (1 diff)
-
imclean/src/wfits.c (modified) (3 diffs)
-
imclean/src/wstars.c (modified) (1 diff)
-
libautocode/Makefile (modified) (1 diff)
-
libautocode/def/smpdata.d (modified) (1 diff)
-
libohana/Makefile (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/imclean/Makefile
r3412 r3519 14 14 # 15 15 INCS = -I$(INC) -I$(LINC) -I$(XINC) 16 LIBS = -L$(LLIB) -l FITS -lohana-lm16 LIBS = -L$(LLIB) -lohana -lFITS -lm 17 17 CFLAGS = -o $*.$(ARCH).o $(INCS) 18 18 CCFLAGS = $(INCS) $(LIBS) … … 23 23 $(SRC)/AdjustHeader.$(ARCH).o $(SRC)/find_group.$(ARCH).o \ 24 24 $(SRC)/find_trails.$(ARCH).o $(SRC)/find_line.$(ARCH).o \ 25 $(SRC)/ LoadStarsDophot.$(ARCH).o $(SRC)/wstars.$(ARCH).o\25 $(SRC)/wstars.$(ARCH).o $(SRC)/LoadStarsDophot.$(ARCH).o \ 26 26 $(SRC)/LoadStarsSex.$(ARCH).o $(SRC)/LoadStarsChad.$(ARCH).o \ 27 27 $(SRC)/wfits.$(ARCH).o -
trunk/Ohana/src/imclean/include/imclean.h
r3466 r3519 31 31 char **KEYWORD, **KEYVALU, **KEYFMT; 32 32 33 typedef struct { 34 double X; 35 double Y; 36 double M, dM; 37 char dophot; 38 double sky; 39 double fx, fy, df; 40 double Mgal, Map; 41 } StarsOld; 42 43 typedef struct { 44 float X; 45 float Y; 46 float M; 47 float dM; 48 float Mgal; 49 float Map; 50 float sky; 51 float fx; 52 float fy; 53 float df; 54 char dophot; 55 char dummy[3]; 56 } Stars; 57 58 Stars *LoadStars (); 59 Stars *LoadStarsChad (); 60 Stars *LoadStarsSex (); 61 62 Stars *LoadStarsDophot (char *filename, int *nstars, Header *header); 63 Stars *LoadStarsChad (char *filename, int *nstars, Header *header); 64 Stars *LoadStarsSex (char *filename, int *nstars, Header *header); 33 SMPData *LoadStarsDophot (char *filename, int *nstars, Header *header); 34 SMPData *LoadStarsChad (char *filename, int *nstars, Header *header); 35 SMPData *LoadStarsSex (char *filename, int *nstars, Header *header); 65 36 66 37 void ConfigInit (int *argc, char **argv); 67 38 void AdjustHeader (Header *header); 68 void sort_stars (S tars*X, int N);69 void find_trails (S tars*stars, int Nstars);70 int find_group (S tars*stars, char *mark, int Npts, int i, double *ANGLE);71 void wstars (char *filename, S tars*stars, int Nstars, Header *header);39 void sort_stars (SMPData *X, int N); 40 void find_trails (SMPData *stars, int Nstars); 41 int find_group (SMPData *stars, char *mark, int Npts, int i, double *ANGLE); 42 void wstars (char *filename, SMPData *stars, int Nstars, Header *header); 72 43 73 void fix_total (S tars*stars, int Nstars, Header *header);74 int find_line (S tars*stars, char *mark, int Npts, int i, double *M, double *B, double Angle);75 void find_better_line (S tars*stars, char *mark, int Npts, int i, double *M, double *B, int axis);44 void fix_total (SMPData *stars, int Nstars, Header *header); 45 int find_line (SMPData *stars, char *mark, int Npts, int i, double *M, double *B, double Angle); 46 void find_better_line (SMPData *stars, char *mark, int Npts, int i, double *M, double *B, int axis); 76 47 77 48 void help (); 78 49 void args (int argc, char **argv); 79 int ConvertStars (Stars *data, int size, int nitems); 80 void wfits (char *filename, Stars *stars, int Nstars, Header *header); 50 void wfits (char *filename, SMPData *stars, int Nstars, Header *header); -
trunk/Ohana/src/imclean/src/LoadStarsChad.c
r2423 r3519 3 3 # define HIST_BINS 150 4 4 5 S tars*LoadStarsChad (char *filename, int *nstars, Header *header) {5 SMPData *LoadStarsChad (char *filename, int *nstars, Header *header) { 6 6 7 7 FILE *f; 8 S tars*stars;8 SMPData *stars; 9 9 int NSTARS, Nstars, i, N; 10 10 int status; … … 30 30 Nstars = 0; 31 31 NSTARS = 500; 32 ALLOCATE (stars, S tars, NSTARS);32 ALLOCATE (stars, SMPData, NSTARS); 33 33 34 34 /* for now assume file 'header' is fixed-format */ … … 92 92 if (Nstars == NSTARS - 1) { 93 93 NSTARS += 500; 94 REALLOCATE (stars, S tars, NSTARS);94 REALLOCATE (stars, SMPData, NSTARS); 95 95 } 96 96 } -
trunk/Ohana/src/imclean/src/LoadStarsDophot.c
r2423 r3519 5 5 /* m = 0.1*Mhist[i] */ 6 6 7 S tars*LoadStarsDophot (char *filename, int *nstars, Header *header) {7 SMPData *LoadStarsDophot (char *filename, int *nstars, Header *header) { 8 8 9 9 FILE *f; 10 S tars*stars;10 SMPData *stars; 11 11 int NSTARS, Nstars, i, Nline, N; 12 12 int type, status; … … 38 38 Nstars = 0; 39 39 NSTARS = 500; 40 ALLOCATE (stars, S tars, NSTARS);40 ALLOCATE (stars, SMPData, NSTARS); 41 41 42 42 /* read average values from first line */ … … 112 112 if (Nstars == NSTARS - 1) { 113 113 NSTARS += 500; 114 REALLOCATE (stars, S tars, NSTARS);114 REALLOCATE (stars, SMPData, NSTARS); 115 115 } 116 116 } -
trunk/Ohana/src/imclean/src/LoadStarsSex.c
r2423 r3519 5 5 /* good for sextractor */ 6 6 7 S tars*LoadStarsSex (char *filename, int *nstars, Header *header) {7 SMPData *LoadStarsSex (char *filename, int *nstars, Header *header) { 8 8 9 9 FILE *f; 10 S tars*stars;10 SMPData *stars; 11 11 int NSTARS, Nstars, i, Nline, N; 12 12 int type, status; … … 37 37 Nstars = 0; 38 38 NSTARS = 500; 39 ALLOCATE (stars, S tars, NSTARS);39 ALLOCATE (stars, SMPData, NSTARS); 40 40 41 41 /* read in data from obj file */ … … 105 105 if (Nstars == NSTARS - 1) { 106 106 NSTARS += 500; 107 REALLOCATE (stars, S tars, NSTARS);107 REALLOCATE (stars, SMPData, NSTARS); 108 108 } 109 109 } -
trunk/Ohana/src/imclean/src/find_group.c
r2423 r3519 1 1 # include "imclean.h" 2 2 3 int find_group (S tars*stars, char *mark, int Npts, int i, double *ANGLE) {3 int find_group (SMPData *stars, char *mark, int Npts, int i, double *ANGLE) { 4 4 5 5 int j, N, bin, Ndegbin; -
trunk/Ohana/src/imclean/src/find_line.c
r2423 r3519 1 1 # include "imclean.h" 2 2 3 int find_line (S tars*stars, char *mark, int Npts, int i, double *M, double *B, double Angle) {3 int find_line (SMPData *stars, char *mark, int Npts, int i, double *M, double *B, double Angle) { 4 4 5 5 int j, N; … … 73 73 74 74 75 void find_better_line (S tars*stars, char *mark, int Npts, int i, double *M, double *B, int axis) {75 void find_better_line (SMPData *stars, char *mark, int Npts, int i, double *M, double *B, int axis) { 76 76 77 77 int j, N; … … 150 150 } 151 151 152 void fix_total (S tars*stars, int Nstars, Header *header) {152 void fix_total (SMPData *stars, int Nstars, Header *header) { 153 153 154 154 int Ngood, i; -
trunk/Ohana/src/imclean/src/find_trails.c
r2423 r3519 1 1 # include "imclean.h" 2 2 3 void find_trails (S tars*stars, int Nstars) {3 void find_trails (SMPData *stars, int Nstars) { 4 4 5 5 int i; -
trunk/Ohana/src/imclean/src/imclean.c
r3412 r3519 4 4 5 5 Header header; 6 S tars*stars;6 SMPData *stars; 7 7 int Nstars; 8 8 -
trunk/Ohana/src/imclean/src/sort_stars.c
r2423 r3519 1 1 # include "imclean.h" 2 2 3 void sort_stars (S tars*X, int N) {3 void sort_stars (SMPData *X, int N) { 4 4 5 5 int l,j,ir,i; 6 S tarstX;6 SMPData tX; 7 7 8 8 if (N < 1) return; -
trunk/Ohana/src/imclean/src/star_stats.c
r2423 r3519 1 1 # include "imclean.h" 2 2 3 star_stats (Header *header, S tars*stars, int Nstars) {3 star_stats (Header *header, SMPData *stars, int Nstars) { 4 4 5 5 int i; -
trunk/Ohana/src/imclean/src/wfits.c
r3466 r3519 1 1 # include "imclean.h" 2 2 3 void wfits (char *filename, S tars*stars, int Nstars, Header *header) {3 void wfits (char *filename, SMPData *stars, int Nstars, Header *header) { 4 4 5 5 Matrix matrix; … … 18 18 fits_create_matrix (header, &matrix); 19 19 20 /* create bintable header */ 21 fits_create_table_header (&theader, "BINTABLE", "SMPFILE"); 22 23 /* define bintable layout */ 24 fits_define_bintable_column (&theader, "E", "X_PIX", "x coord", "pixels", 1.0, 0.0); 25 fits_define_bintable_column (&theader, "E", "Y_PIX", "y coord", "pixels", 1.0, 0.0); 26 fits_define_bintable_column (&theader, "E", "MAG_RAW", "inst mags", "mags", 1.0, 0.0); 27 fits_define_bintable_column (&theader, "E", "MAG_ERR", "inst mag error", "mags", 1.0, 0.0); 28 fits_define_bintable_column (&theader, "E", "MAG_GAL", "galaxy mag", "mags", 1.0, 0.0); 29 fits_define_bintable_column (&theader, "E", "MAG_AP", "aperture mag", "mags", 1.0, 0.0); 30 fits_define_bintable_column (&theader, "E", "LOG_SKY", "log-10 of sky", "mags", 1.0, 0.0); 31 fits_define_bintable_column (&theader, "E", "FWHM_X", "semi-major", "mags", 1.0, 0.0); 32 fits_define_bintable_column (&theader, "E", "FWHM_Y", "semi-minor", "mags", 1.0, 0.0); 33 fits_define_bintable_column (&theader, "E", "THETA", "ellipse angle", "mags", 1.0, 0.0); 34 fits_define_bintable_column (&theader, "B", "DOPHOT", "dophot type", "", 1.0, 0.0); 35 fits_define_bintable_column (&theader, "3A", "DUMMY", "padding", "", 1.0, 0.0); 36 37 /* create table, add data values */ 38 fits_create_table (&theader, &table); 39 40 ConvertStars (stars, sizeof (Stars), Nstars); 41 fits_add_rows (&table, (char *) stars, Nstars, sizeof (Stars)); 20 table.header = &theader; 21 fits_table_set_SMPData (&table, stars, Nstars); 42 22 43 23 fits_write_header (filename, header); … … 47 27 exit (0); 48 28 } 49 50 # define SWAP_BYTE(X) \51 tmp = byte[X+0]; byte[X+0] = byte[X+1]; byte[X+1] = tmp;52 # define SWAP_WORD(X) \53 tmp = byte[X+0]; byte[X+0] = byte[X+3]; byte[X+3] = tmp; \54 tmp = byte[X+1]; byte[X+1] = byte[X+2]; byte[X+2] = tmp;55 # define SWAP_DBLE(X) \56 tmp = byte[X+0]; byte[X+0] = byte[X+7]; byte[X+7] = tmp; \57 tmp = byte[X+1]; byte[X+1] = byte[X+6]; byte[X+6] = tmp; \58 tmp = byte[X+2]; byte[X+2] = byte[X+5]; byte[X+5] = tmp; \59 tmp = byte[X+3]; byte[X+3] = byte[X+4]; byte[X+4] = tmp;60 61 # ifdef linux62 # define BYTE_SWAP63 # endif64 65 # ifdef sid66 # define BYTE_SWAP67 # endif68 69 # ifdef dec70 # define BYTE_SWAP71 # endif72 73 # define STARS_SIZE 4474 75 int ConvertStars (Stars *data, int size, int nitems) {76 77 int i;78 unsigned char *byte, tmp;79 80 # ifdef BYTE_SWAP81 82 if (size != STARS_SIZE) {83 fprintf (stderr, "mismatch in type sizes (Stars) %d vs %d\n", size, STARS_SIZE);84 return (FALSE);85 }86 87 byte = (char *) data;88 for (i = 0; i < nitems; i++, byte += size) {89 SWAP_WORD (0); /* R */90 SWAP_WORD (4); /* Y */91 SWAP_WORD (8); /* M */92 SWAP_WORD (12); /* dM */93 SWAP_WORD (16); /* Mgal */94 SWAP_WORD (20); /* Map */95 SWAP_WORD (24); /* sky */96 SWAP_WORD (28); /* fx */97 SWAP_WORD (32); /* fy */98 SWAP_WORD (36); /* df */99 }100 return (TRUE);101 102 # else103 return (TRUE);104 # endif105 }106 -
trunk/Ohana/src/imclean/src/wstars.c
r2423 r3519 2 2 # define NCHAR 66 /* 65 char EXCLUDING return */ 3 3 4 void wstars (char *filename, S tars*stars, int Nstars, Header *header) {4 void wstars (char *filename, SMPData *stars, int Nstars, Header *header) { 5 5 6 6 int i, Nchar; -
trunk/Ohana/src/libautocode/Makefile
r3515 r3519 28 28 29 29 LIBOBJ = \ 30 $(SRC)/smpdata.$(ARCH).o \ 30 31 $(SRC)/spectrum.$(ARCH).o \ 31 32 $(SRC)/spectrum-ascii.$(ARCH).o 32 33 33 34 LIBINC = \ 35 $(INC)/smpdata.h \ 34 36 $(INC)/spectrum.h \ 35 37 $(INC)/spectrum-ascii.h -
trunk/Ohana/src/libautocode/def/smpdata.d
r3515 r3519 2 2 STRUCT SMPData 3 3 EXTNAME SMPFILE 4 TYPE BINTABLE 5 SIZE 44 4 6 5 7 # elements of data structure / FITS table -
trunk/Ohana/src/libohana/Makefile
r3516 r3519 47 47 48 48 AOBJ = \ 49 $(ASRC)/smpdata.$(ARCH).o \ 49 50 $(ASRC)/spectrum.$(ARCH).o \ 50 51 $(ASRC)/spectrum-ascii.$(ARCH).o
Note:
See TracChangeset
for help on using the changeset viewer.
