Changeset 3508
- Timestamp:
- Mar 24, 2005, 4:50:29 PM (21 years ago)
- Location:
- trunk/Ohana/src/libohana
- Files:
-
- 14 added
- 8 edited
-
Makefile (modified) (4 diffs)
-
doc/autocode.txt (added)
-
dvo (added)
-
dvo/Makefile (added)
-
dvo/def (added)
-
dvo/def/common.h (added)
-
dvo/def/dvo-autocode.c (added)
-
dvo/def/dvo-autocode.h (added)
-
dvo/def/smpdata.d (added)
-
dvo/def/spectrum-ascii.d (added)
-
dvo/def/spectrum.d (added)
-
dvo/generate (added)
-
include/dvo.h (modified) (2 diffs)
-
include/elixir.h (modified) (3 diffs)
-
include/loneos.h (modified) (3 diffs)
-
include/ohana.h (modified) (6 diffs)
-
include/panstarrs.h (modified) (3 diffs)
-
src/Fseek.c (added)
-
src/backup.c (added)
-
src/findexec.c (modified) (1 diff)
-
src/fits_db.c (added)
-
src/string.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libohana/Makefile
r3466 r3508 6 6 MAN = $(HOME)/doc 7 7 INC = $(HOME)/include 8 DVO = $(HOME)/dvo/src 8 9 DESTBIN = $(LBIN) 9 10 DESTLIB = $(LLIB) … … 30 31 31 32 LOBJ = \ 32 $(SRC)/string.$(ARCH).o $(SRC)/findexec.$(ARCH).o \ 33 $(SRC)/config.$(ARCH).o $(SRC)/coordops.$(ARCH).o \ 34 $(SRC)/Fread.$(ARCH).o $(SRC)/glockfile.$(ARCH).o \ 35 $(SRC)/LoadPhotcodes.$(ARCH).o $(SRC)/photfits.$(ARCH).o \ 36 $(SRC)/phot_catalog.$(ARCH).o $(SRC)/imreg_datatypes.$(ARCH).o \ 37 $(SRC)/mosaic_astrom.$(ARCH).o 33 $(SRC)/string.$(ARCH).o \ 34 $(SRC)/findexec.$(ARCH).o \ 35 $(SRC)/glockfile.$(ARCH).o \ 36 $(SRC)/config.$(ARCH).o \ 37 $(SRC)/coordops.$(ARCH).o \ 38 $(SRC)/Fread.$(ARCH).o \ 39 $(SRC)/Fseek.$(ARCH).o \ 40 $(SRC)/LoadPhotcodes.$(ARCH).o \ 41 $(SRC)/photfits.$(ARCH).o \ 42 $(SRC)/phot_catalog.$(ARCH).o \ 43 $(SRC)/imreg_datatypes.$(ARCH).o \ 44 $(SRC)/mosaic_astrom.$(ARCH).o \ 45 $(SRC)/fits_db.$(ARCH).o 46 47 DOBJ = \ 48 $(DVO)/spectrum.$(ARCH).o \ 49 $(DVO)/spectrum-ascii.$(ARCH).o 38 50 39 51 $(DESTLIB)/libohana.a: $(LIB)/libohana.$(ARCH).a … … 43 55 44 56 $(LIB)/libohana.$(ARCH).a: $(HOBJ) $(LOBJ) 57 cd dvo && make install 45 58 @if [ ! -d $(LIB) ]; then mkdir -p $(LIB); fi 46 59 rm -f $(LIB)/libohana.$(ARCH).a 47 ar rcv $(LIB)/libohana.$(ARCH).a $(LOBJ) 60 ar rcv $(LIB)/libohana.$(ARCH).a $(LOBJ) $(DOBJ) 48 61 $(RANLIB) $(LIB)/libohana.$(ARCH).a 49 62 … … 60 73 rm -f */*.o 61 74 rm -f */*.a 75 cd dvo && make clean 62 76 63 77 dist: clean -
trunk/Ohana/src/libohana/include/dvo.h
r3473 r3508 3 3 # define LONEOS 0 4 4 # define PANSTARRS 0 5 6 /*** this file uses data types which must have fixed sizes regardless 7 of the platform. It originally used the basic C primitives: 8 float, double, int, short int, unsigned long int, etc. 9 this breaks under 64 bit (and probably on other systems). 10 I should define internal data types which should be set by the 11 use of # define statements if needed. I will cheat for now and use 12 the time_t to replace unsigned long int in this file 13 ***/ 14 15 # define e_time unsigned int 16 17 /* image data modes in RegImage */ 18 enum {T_UNDEF = -1, T_NONE, T_OBJECT, T_DARK, T_BIAS, T_FLAT, T_MASK, T_FRINGE, T_SCATTER, T_MODES, T_FRINGEPTS, T_ANY, N_TYPE}; 19 enum {M_UNDEF = -1, M_NONE, M_MEF, M_SPLIT, M_SINGLE, M_CUBE, M_SLICE, M_MODES, N_MODE}; 20 21 /* convert these to enums? */ 22 /* RegImage.flag values */ 23 # define IMREG_DIST 0x01 /* image distributed, only imregister-3.0 */ 24 25 /* catalog values to be loaded */ 26 # define LOAD_AVES 0x01 27 # define LOAD_MEAS 0x02 28 # define LOAD_MISS 0x04 29 # define LOAD_SECF 0x08 30 31 /* invalid mag value */ 32 # define NO_MAG 0x7fff 33 # define NO_ERR 0xff 34 35 /* photometry code types */ 36 # define PHOT_PRI 0x01 37 # define PHOT_SEC 0x02 38 # define PHOT_DEP 0x03 39 # define PHOT_REF 0x04 40 # define PHOT_ALT 0x05 /* never stored, only for look-ups */ 41 42 /* Image.code values. these are codes to note bad images */ 43 # define ID_IMAGE_NEW 0x0000 /* no nrphot attempted */ 44 # define ID_IMAGE_NOCAL 0x0001 /* used within nrphot to mean "don't apply fit" */ 45 # define ID_IMAGE_POOR 0x0002 /* relphot says image is bad */ 46 # define ID_IMAGE_SKIP 0x0004 /* external information image is bad */ 47 # define ID_IMAGE_FEW 0x0008 /* currently too few measurements for good value */ 48 49 /* Measure.flags values */ 50 # define ID_MEAS_NOCAL 0x0001 51 # define ID_MEAS_POOR 0x0002 52 # define ID_MEAS_SKIP 0x0004 53 # define ID_MEAS_AREA 0x0008 54 # define BLEND_IMAGE 0x0100 55 # define BLEND_CATALOG 0x0200 56 # define BLEND_IMAGE_NEIGHBOR 0x1000 57 # define ID_MEAS_TRAIL 0x2000 58 # define ID_MEAS_GHOST 0x4000 59 60 /* Average.code values */ 61 # define ID_STAR_FEW 0x0001 /* used within relphot: skip star */ 62 # define ID_STAR_POOR 0x0002 /* used within relphot: skip star */ 63 # define ID_PROPER 0x0400 /* star with large proper motion */ 64 # define ID_TRANSIENT 0x1000 /* is this mutually exclusive with USNO? */ 65 # define ID_VARIABLE 0x2000 /* not currently set? */ 66 # define ID_ASTEROID 0x2000 /* identified with an asteroid */ 67 # define ID_BAD_OBJECT 0x4000 /* if all measurements are bad, set this bit */ 68 # define ID_MOVING 0x8000 69 # define ID_ROCK 0xa000 /* 0x8000 + 0x2000 */ 70 # define ID_GHOST 0xc001 /* 0x8000 + 0x4000 + 0x0001 */ 71 # define ID_TRAIL 0xc002 /* 0x8000 + 0x4000 + 0x0002 */ 72 # define ID_BLEED 0xc003 /* 0x8000 + 0x4000 + 0x0003 */ 73 # define ID_COSMIC 0xc004 /* 0x8000 + 0x4000 + 0x0004 */ 74 75 /* 76 BLEND_IMAGE: the star on an image is matched with more 77 than one star in the catalog (image has worse seeing than catalog) 78 BLEND_CATALOG: the star in the catalog is matched with more 79 than one star on the image (image has better seeing than catalog) 80 CALIBRATED: relative photometry has been performed on this measurement 81 BLEND_IMAGE_NEIGHBOR: the star on an image is matched with more 82 than one star in the catalog, but not in the same catalog file. 83 */ 84 85 /*** FITS DB structure ***/ 86 typedef struct { 87 FILE *f; 88 char *filename; 89 int dbstate; 90 int lockstate; 91 double timeout; 92 Header header; 93 Matrix matrix; 94 Header theader; 95 FTable ftable; 96 } FITS_DB; 97 98 /* the standard astrometric coordinates structure */ 99 typedef struct { 100 double crval1, crval2; 101 float crpix1, crpix2; 102 float cdelt1, cdelt2; 103 float pc1_1, pc1_2; 104 float pc2_1, pc2_2; 105 float polyterms[7][2]; 106 char ctype[15]; 107 char Npolyterms; 108 } Coords; /* 120 bytes / Coords */ 109 110 /*** FITS_DB functions ***/ 111 112 /* in fits_db.c */ 113 int fits_db_init PROTO((FITS_DB *db)); 114 int fits_db_lock PROTO((FITS_DB *db, char *filename)); 115 int fits_db_load PROTO((FITS_DB *db)); 116 int fits_db_close PROTO((FITS_DB *db)); 117 int fits_db_free PROTO((FITS_DB *db)); 118 int fits_db_save PROTO((FITS_DB *db)); 119 int fits_db_update PROTO((FITS_DB *db, VTable *vtable)); 120 121 /* in coords.c */ 122 int XY_to_RD (double *ra, double *dec, double x, double y, Coords *coords); 123 int RD_to_XY (double *x, double *y, double ra, double dec, Coords *coords); 124 int fXY_to_RD (float *ra, float *dec, double x, double y, Coords *coords); 125 int fRD_to_XY (float *x, float *y, double ra, double dec, Coords *coords); 126 int GetCoords (Coords *coords, Header *header); 127 int PutCoords (Coords *coords, Header *header); 128 void RegisterMosaic (Coords *coords); 129 void coords_precess (double *ra, double *dec, double in_epoch, double out_epoch); 5 130 6 131 # if (LONEOS) … … 16 141 # endif 17 142 143 # include <dvo-autocode.h> 144 145 /* these functions refer to the DVO structures define in the includes above */ 146 int Fread (void *ptr, int size, int nitems, FILE *f, char *type); 147 int Fwrite (void *ptr, int size, int nitems, FILE *f, char *type); 148 int ByteSwap (char *ptr, int size, int nitems, char *type); 149 int ConvertStruct (char *buffer, int size, int Nbytes, char *type); -
trunk/Ohana/src/libohana/include/elixir.h
r3473 r3508 11 11 # ifndef ELIXIR_H 12 12 # define ELIXIR_H 13 14 # define e_time unsigned int15 16 /* image data modes in RegImage */17 enum {T_UNDEF = -1, T_NONE, T_OBJECT, T_DARK, T_BIAS, T_FLAT, T_MASK, T_FRINGE, T_SCATTER, T_MODES, T_FRINGEPTS, T_ANY, N_TYPE};18 enum {M_UNDEF = -1, M_NONE, M_MEF, M_SPLIT, M_SINGLE, M_CUBE, M_SLICE, M_MODES, N_MODE};19 20 /* convert these to enums? */21 /* RegImage.flag values */22 # define IMREG_DIST 0x01 /* image distributed, only imregister-3.0 */23 24 /* catalog values to be loaded */25 # define LOAD_AVES 0x0126 # define LOAD_MEAS 0x0227 # define LOAD_MISS 0x0428 # define LOAD_SECF 0x0829 30 /* invalid mag value */31 # define NO_MAG 0x7fff32 # define NO_ERR 0xff33 34 /* photometry code types */35 # define PHOT_PRI 0x0136 # define PHOT_SEC 0x0237 # define PHOT_DEP 0x0338 # define PHOT_REF 0x0439 # define PHOT_ALT 0x05 /* never stored, only for look-ups */40 41 /* Image.code values. these are codes to note bad images */42 # define ID_IMAGE_NEW 0x0000 /* no nrphot attempted */43 # define ID_IMAGE_NOCAL 0x0001 /* used within nrphot to mean "don't apply fit" */44 # define ID_IMAGE_POOR 0x0002 /* relphot says image is bad */45 # define ID_IMAGE_SKIP 0x0004 /* external information image is bad */46 # define ID_IMAGE_FEW 0x0008 /* currently too few measurements for good value */47 48 /* Measure.flags values */49 # define ID_MEAS_NOCAL 0x000150 # define ID_MEAS_POOR 0x000251 # define ID_MEAS_SKIP 0x000452 # define ID_MEAS_AREA 0x000853 # define BLEND_IMAGE 0x010054 # define BLEND_CATALOG 0x020055 # define BLEND_IMAGE_NEIGHBOR 0x100056 # define ID_MEAS_TRAIL 0x200057 # define ID_MEAS_GHOST 0x400058 59 /* Average.code values */60 # define ID_STAR_FEW 0x0001 /* used within relphot: skip star */61 # define ID_STAR_POOR 0x0002 /* used within relphot: skip star */62 # define ID_PROPER 0x0400 /* star with large proper motion */63 # define ID_TRANSIENT 0x1000 /* is this mutually exclusive with USNO? */64 # define ID_VARIABLE 0x2000 /* not currently set? */65 # define ID_ASTEROID 0x2000 /* identified with an asteroid */66 # define ID_BAD_OBJECT 0x4000 /* if all measurements are bad, set this bit */67 # define ID_MOVING 0x800068 # define ID_ROCK 0xa000 /* 0x8000 + 0x2000 */69 # define ID_GHOST 0xc001 /* 0x8000 + 0x4000 + 0x0001 */70 # define ID_TRAIL 0xc002 /* 0x8000 + 0x4000 + 0x0002 */71 # define ID_BLEED 0xc003 /* 0x8000 + 0x4000 + 0x0003 */72 # define ID_COSMIC 0xc004 /* 0x8000 + 0x4000 + 0x0004 */73 74 /*75 BLEND_IMAGE: the star on an image is matched with more76 than one star in the catalog (image has worse seeing than catalog)77 BLEND_CATALOG: the star in the catalog is matched with more78 than one star on the image (image has better seeing than catalog)79 CALIBRATED: relative photometry has been performed on this measurement80 BLEND_IMAGE_NEIGHBOR: the star on an image is matched with more81 than one star in the catalog, but not in the same catalog file.82 */83 13 84 14 /************ database structures ************************************/ … … 194 124 short int dM; /* scatter on alt mag */ 195 125 } SecFilt; /* 6 byte / SecFilt */ 196 197 /* the standard astrometric coordinates structure */198 typedef struct {199 double crval1, crval2;200 float crpix1, crpix2;201 float cdelt1, cdelt2;202 float pc1_1, pc1_2;203 float pc2_1, pc2_2;204 float polyterms[7][2];205 char ctype[15];206 char Npolyterms;207 } Coords; /* 120 bytes / Coords */208 126 209 127 /* image structure for binary data storage of image data */ … … 296 214 int save_catalog (Catalog *catalog, char VERBOSE); 297 215 298 int XY_to_RD (double *ra, double *dec, double x, double y, Coords *coords);299 int RD_to_XY (double *x, double *y, double ra, double dec, Coords *coords);300 int fXY_to_RD (float *ra, float *dec, double x, double y, Coords *coords);301 int fRD_to_XY (float *x, float *y, double ra, double dec, Coords *coords);302 int GetCoords (Coords *coords, Header *header);303 int PutCoords (Coords *coords, Header *header);304 void RegisterMosaic (Coords *coords);305 void coords_precess (double *ra, double *dec, double in_epoch, double out_epoch);306 int FindMosaicForImage (Image *images, int Nimages, int entry);307 int FindMosaicForImage_TableSearch (Image *images, int Nimages, int entry);308 int FindMosaicForImage_MatchSearch (Image *images, int Nimages, int entry);309 int BuildChipMatch (Image *images, int Nimages);310 311 216 int FindMosaicForImage (Image *images, int Nimages, int entry); 312 217 int FindMosaicForImage_TableSearch (Image *images, int Nimages, int entry); -
trunk/Ohana/src/libohana/include/loneos.h
r3466 r3508 1 2 /*** this file uses data types which must have fixed sizes regardless3 of the platform. It originally used the basic C primitives:4 float, double, int, short int, unsigned long int, etc.5 this breaks under 64 bit (and probably on other systems).6 I should define internal data types which should be set by the7 use of # define statements if needed. I will cheat for now and use8 the time_t to replace unsigned long int in this file9 ***/10 1 11 2 # ifndef LONEOS_H 12 3 # define LONEOS_H 13 4 14 # define e_time unsigned int 15 16 /* image data modes in RegImage */ 17 enum {T_UNDEF = -1, T_NONE, T_OBJECT, T_DARK, T_BIAS, T_FLAT, T_MASK, T_FRINGE, T_SCATTER, T_MODES, T_FRINGEPTS, T_ANY, N_TYPE}; 18 enum {M_UNDEF = -1, M_NONE, M_MEF, M_SPLIT, M_SINGLE, M_CUBE, M_SLICE, M_MODES, N_MODE}; 19 20 /* convert these to enums? */ 21 /* RegImage.flag values */ 22 # define IMREG_DIST 0x01 /* image distributed, only imregister-3.0 */ 23 24 /* catalog values to be loaded */ 25 # define LOAD_AVES 0x01 26 # define LOAD_MEAS 0x02 27 # define LOAD_MISS 0x04 28 # define LOAD_SECF 0x08 29 30 /* invalid mag value */ 31 # define NO_MAG 0x7fff 32 # define NO_ERR 0xff 33 34 /* photometry code types */ 35 # define PHOT_PRI 0x01 36 # define PHOT_SEC 0x02 37 # define PHOT_DEP 0x03 38 # define PHOT_REF 0x04 39 # define PHOT_ALT 0x05 /* never stored, only for look-ups */ 40 41 /* Image.code values. these are codes to note bad images */ 42 # define ID_IMAGE_NEW 0x0000 /* no nrphot attempted */ 43 # define ID_IMAGE_NOCAL 0x0001 /* used within nrphot to mean "don't apply fit" */ 44 # define ID_IMAGE_POOR 0x0002 /* relphot says image is bad */ 45 # define ID_IMAGE_SKIP 0x0004 /* external information image is bad */ 46 # define ID_IMAGE_FEW 0x0008 /* currently too few measurements for good value */ 47 48 /* Measure.flags values */ 49 # define ID_MEAS_NOCAL 0x0001 50 # define ID_MEAS_POOR 0x0002 51 # define ID_MEAS_SKIP 0x0004 52 # define ID_MEAS_AREA 0x0008 53 # define BLEND_IMAGE 0x0100 54 # define BLEND_CATALOG 0x0200 55 # define BLEND_IMAGE_NEIGHBOR 0x1000 56 # define ID_MEAS_TRAIL 0x2000 57 # define ID_MEAS_GHOST 0x4000 58 59 /* Average.code values */ 60 # define ID_STAR_FEW 0x0001 /* used within relphot: skip star */ 61 # define ID_STAR_POOR 0x0002 /* used within relphot: skip star */ 62 # define ID_PROPER 0x0400 /* star with large proper motion */ 63 # define ID_TRANSIENT 0x1000 /* is this mutually exclusive with USNO? */ 64 # define ID_VARIABLE 0x2000 /* not currently set? */ 65 # define ID_ASTEROID 0x2000 /* identified with an asteroid */ 66 # define ID_BAD_OBJECT 0x4000 /* if all measurements are bad, set this bit */ 67 # define ID_MOVING 0x8000 68 # define ID_ROCK 0xa000 /* 0x8000 + 0x2000 */ 69 # define ID_GHOST 0xc001 /* 0x8000 + 0x4000 + 0x0001 */ 70 # define ID_TRAIL 0xc002 /* 0x8000 + 0x4000 + 0x0002 */ 71 # define ID_BLEED 0xc003 /* 0x8000 + 0x4000 + 0x0003 */ 72 # define ID_COSMIC 0xc004 /* 0x8000 + 0x4000 + 0x0004 */ 73 74 /* 75 BLEND_IMAGE: the star on an image is matched with more 76 than one star in the catalog (image has worse seeing than catalog) 77 BLEND_CATALOG: the star in the catalog is matched with more 78 than one star on the image (image has better seeing than catalog) 79 CALIBRATED: relative photometry has been performed on this measurement 80 BLEND_IMAGE_NEIGHBOR: the star on an image is matched with more 81 than one star in the catalog, but not in the same catalog file. 82 */ 5 /************ database structures ************************************/ 83 6 84 7 /* structure for Image Registration Database */ … … 183 106 short int dM; /* scatter on alt mag */ 184 107 } SecFilt; /* 6 byte / SecFilt */ 185 186 /* the standard astrometric coordinates structure */187 typedef struct {188 double crval1, crval2;189 float crpix1, crpix2;190 float cdelt1, cdelt2;191 float pc1_1, pc1_2;192 float pc2_1, pc2_2;193 float polyterms[7][2];194 char ctype[15];195 char Npolyterms;196 } Coords; /* 120 bytes / Coords */197 108 198 109 /* image structure for binary data storage of image data */ … … 286 197 SecFilt *FixOldSecFilt (OldSecFilt *in, int Nvalues); 287 198 288 int XY_to_RD (double *ra, double *dec, double x, double y, Coords *coords);289 int RD_to_XY (double *x, double *y, double ra, double dec, Coords *coords);290 int fXY_to_RD (float *ra, float *dec, double x, double y, Coords *coords);291 int fRD_to_XY (float *x, float *y, double ra, double dec, Coords *coords);292 int GetCoords (Coords *coords, Header *header);293 int PutCoords (Coords *coords, Header *header);294 void RegisterMosaic (Coords *coords);295 void coords_precess (double *ra, double *dec, double in_epoch, double out_epoch);296 int FindMosaicForImage (Image *images, int Nimages, int entry);297 int FindMosaicForImage_TableSearch (Image *images, int Nimages, int entry);298 int FindMosaicForImage_MatchSearch (Image *images, int Nimages, int entry);299 int BuildChipMatch (Image *images, int Nimages);300 301 199 int FindMosaicForImage (Image *images, int Nimages, int entry); 302 200 int FindMosaicForImage_TableSearch (Image *images, int Nimages, int entry); -
trunk/Ohana/src/libohana/include/ohana.h
r3400 r3508 25 25 # define OHANA_H 26 26 27 extern double hypot();28 29 27 # define TRUE (1) 30 28 # define FALSE (0) … … 36 34 # define MAX(X,Y) ((X) > (Y) ? (X) : (Y)) 37 35 # define SWAP(X,Y) {double tmp=(X); (X) = (Y); (Y) = tmp;} 36 # define DTIME(A,B) ((A.tv_sec - B.tv_sec) + 1e-6*(A.tv_usec - B.tv_usec)) 38 37 39 38 # define LCK_UNLOCK 0 /* file is unlocked */ … … 55 54 # endif 56 55 57 int setlockfile2 (char *filename, double timeout, int type, int *state); 58 int clearlockfile2 (char *filename, int fd, int type, int *state); 59 60 FILE *fsetlockfile (char *filename, double timeout, int type, int *state); 61 int fclearlockfile (char *filename, FILE *f, int type, int *state); 56 # define DEG_RAD 57.295779513082322 57 # define RAD_DEG 0.017453292519943 62 58 63 59 # ifndef PROTO … … 103 99 # endif /* FOPEN */ 104 100 105 # define DEG_RAD 57.295779513082322 106 # define RAD_DEG 0.017453292519943 107 108 # define DTIME(A,B) ((A.tv_sec - B.tv_sec) + 1e-6*(A.tv_usec - B.tv_usec)) 101 extern double hypot(); 109 102 110 103 /* in string.c */ … … 118 111 int get_argument (int argc, char **argv, char *arg); 119 112 int remove_argument (int N, int *argc, char **argv); 113 void uppercase (char *string); 120 114 121 int Fread (void *ptr, int size, int nitems, FILE *f, char *type); 122 int Fwrite (void *ptr, int size, int nitems, FILE *f, char *type); 123 int ByteSwap (char *ptr, int size, int nitems, char *type); 124 int ConvertStruct (char *buffer, int size, int Nbytes, char *type); 125 115 /* in findexec.c */ 126 116 char *pathname (char *name); 127 117 char *filebasename (char *name); 128 118 char *filerootname (char *name); 129 119 char *findexec (int argc, char **argv); 130 int mkdirhier (char *path); 120 int mkdirhier (char *path); 121 void make_backup (char *filename); 131 122 123 /* in glockfile.c */ 132 124 FILE *fsetlockfile (char *filename, double timeout, int type, int *state); 133 int fclearlockfile (char *filename, FILE *f, int type, int *state);134 int setlockfile2 (char *filename, double timeout, int type, int *state);135 int clearlockfile2 (char *filename, int fd, int type, int *state);125 int fclearlockfile (char *filename, FILE *f, int type, int *state); 126 int setlockfile2 (char *filename, double timeout, int type, int *state); 127 int clearlockfile2 (char *filename, int fd, int type, int *state); 136 128 129 /* in config.c */ 137 130 char *SelectConfigFile (int *argc, char **argv, char *progname); 138 131 char *LoadConfigFile (char *filename); … … 141 134 char *fileextname (char *file); 142 135 char *LoadRawConfigFile (char *, int); 136 137 /* in Fseek.c */ 138 int Fseek (FILE *f, long offset, int whence); 143 139 144 140 /* -
trunk/Ohana/src/libohana/include/panstarrs.h
r3473 r3508 2 2 # ifndef PANSTARRS_H 3 3 # define PANSTARRS_H 4 5 # define e_time unsigned int6 7 /* image data modes in RegImage */8 enum {T_UNDEF = -1, T_NONE, T_OBJECT, T_DARK, T_BIAS, T_FLAT, T_MASK, T_FRINGE, T_SCATTER, T_MODES, T_FRINGEPTS, T_ANY, N_TYPE};9 enum {M_UNDEF = -1, M_NONE, M_MEF, M_SPLIT, M_SINGLE, M_CUBE, M_SLICE, M_MODES, N_MODE};10 11 /* convert these to enums? */12 /* RegImage.flag values */13 # define IMREG_DIST 0x01 /* image distributed, only imregister-3.0 */14 15 /* catalog values to be loaded */16 # define LOAD_AVES 0x0117 # define LOAD_MEAS 0x0218 # define LOAD_MISS 0x0419 # define LOAD_SECF 0x0820 21 /* invalid mag value */22 # define NO_MAG 0x7fff23 # define NO_ERR 0xff24 25 /* photometry code types */26 # define PHOT_PRI 0x0127 # define PHOT_SEC 0x0228 # define PHOT_DEP 0x0329 # define PHOT_REF 0x0430 # define PHOT_ALT 0x05 /* never stored, only for look-ups */31 32 /* Image.code values. these are codes to note bad images */33 # define ID_IMAGE_NEW 0x0000 /* no nrphot attempted */34 # define ID_IMAGE_NOCAL 0x0001 /* used within nrphot to mean "don't apply fit" */35 # define ID_IMAGE_POOR 0x0002 /* relphot says image is bad */36 # define ID_IMAGE_SKIP 0x0004 /* external information image is bad */37 # define ID_IMAGE_FEW 0x0008 /* currently too few measurements for good value */38 39 /* Measure.flags values */40 # define ID_MEAS_NOCAL 0x000141 # define ID_MEAS_POOR 0x000242 # define ID_MEAS_SKIP 0x000443 # define ID_MEAS_AREA 0x000844 # define BLEND_IMAGE 0x010045 # define BLEND_CATALOG 0x020046 # define BLEND_IMAGE_NEIGHBOR 0x100047 # define ID_MEAS_TRAIL 0x200048 # define ID_MEAS_GHOST 0x400049 50 /* Average.code values */51 # define ID_STAR_FEW 0x0001 /* used within relphot: skip star */52 # define ID_STAR_POOR 0x0002 /* used within relphot: skip star */53 # define ID_PROPER 0x0400 /* star with large proper motion */54 # define ID_TRANSIENT 0x1000 /* is this mutually exclusive with USNO? */55 # define ID_VARIABLE 0x2000 /* not currently set? */56 # define ID_ASTEROID 0x2000 /* identified with an asteroid */57 # define ID_BAD_OBJECT 0x4000 /* if all measurements are bad, set this bit */58 # define ID_MOVING 0x800059 # define ID_ROCK 0xa000 /* 0x8000 + 0x2000 */60 # define ID_GHOST 0xc001 /* 0x8000 + 0x4000 + 0x0001 */61 # define ID_TRAIL 0xc002 /* 0x8000 + 0x4000 + 0x0002 */62 # define ID_BLEED 0xc003 /* 0x8000 + 0x4000 + 0x0003 */63 # define ID_COSMIC 0xc004 /* 0x8000 + 0x4000 + 0x0004 */64 65 /*66 BLEND_IMAGE: the star on an image is matched with more67 than one star in the catalog (image has worse seeing than catalog)68 BLEND_CATALOG: the star in the catalog is matched with more69 than one star on the image (image has better seeing than catalog)70 CALIBRATED: relative photometry has been performed on this measurement71 BLEND_IMAGE_NEIGHBOR: the star on an image is matched with more72 than one star in the catalog, but not in the same catalog file.73 */74 4 75 5 /************ database structures ************************************/ … … 185 115 short int dM; /* scatter on alt mag */ 186 116 } SecFilt; /* 6 byte / SecFilt */ 187 188 /* the standard astrometric coordinates structure */189 typedef struct {190 double crval1, crval2;191 float crpix1, crpix2;192 float cdelt1, cdelt2;193 float pc1_1, pc1_2;194 float pc2_1, pc2_2;195 float polyterms[7][2];196 char ctype[15];197 char Npolyterms;198 } Coords; /* 120 bytes / Coords */199 117 200 118 /* image structure for binary data storage of image data */ … … 287 205 int save_catalog (Catalog *catalog, char VERBOSE); 288 206 289 int XY_to_RD (double *ra, double *dec, double x, double y, Coords *coords);290 int RD_to_XY (double *x, double *y, double ra, double dec, Coords *coords);291 int fXY_to_RD (float *ra, float *dec, double x, double y, Coords *coords);292 int fRD_to_XY (float *x, float *y, double ra, double dec, Coords *coords);293 int GetCoords (Coords *coords, Header *header);294 int PutCoords (Coords *coords, Header *header);295 void RegisterMosaic (Coords *coords);296 void coords_precess (double *ra, double *dec, double in_epoch, double out_epoch);297 int FindMosaicForImage (Image *images, int Nimages, int entry);298 int FindMosaicForImage_TableSearch (Image *images, int Nimages, int entry);299 int FindMosaicForImage_MatchSearch (Image *images, int Nimages, int entry);300 int BuildChipMatch (Image *images, int Nimages);301 302 207 int FindMosaicForImage (Image *images, int Nimages, int entry); 303 208 int FindMosaicForImage_TableSearch (Image *images, int Nimages, int entry); -
trunk/Ohana/src/libohana/src/findexec.c
r2413 r3508 250 250 251 251 } 252 253 void make_backup (char *filename) { 254 255 int status, cmode; 256 struct stat filestat; 257 char line[256]; 258 259 status = stat (filename, &filestat); 260 if (status == 0) { /* file exists, make backup copy */ 261 sprintf (line, "cp %s %s~", filename, filename); 262 status = system (line); 263 if (status) { 264 fprintf (stderr, "ERROR: unable to create %s~, exiting\n", filename); 265 exit (0); 266 } 267 cmode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH; 268 sprintf (line, "%s~", filename); 269 chmod (line, cmode); 270 } 271 } -
trunk/Ohana/src/libohana/src/string.c
r2413 r3508 156 156 return (N); 157 157 } 158 159 void uppercase (char *string) { 160 161 int i; 162 163 for (i = 0; i < strlen (string); i++) string[i] = toupper (string[i]); 164 165 }
Note:
See TracChangeset
for help on using the changeset viewer.
