Changeset 21508
- Timestamp:
- Feb 16, 2009, 11:33:52 AM (17 years ago)
- Location:
- trunk/Ohana
- Files:
-
- 19 added
- 8 deleted
- 114 edited
-
configure.tcsh (modified) (4 diffs)
-
src/addstar/Makefile (modified) (7 diffs)
-
src/addstar/doc/notes.txt (modified) (1 diff)
-
src/addstar/include/addstar.h (modified) (6 diffs)
-
src/addstar/include/skycells.h (modified) (1 diff)
-
src/addstar/src/ConfigInit.c (modified) (1 diff)
-
src/addstar/src/FilterStars.c (modified) (3 diffs)
-
src/addstar/src/GetFileMode.c (modified) (2 diffs)
-
src/addstar/src/LoadData.c (modified) (1 diff)
-
src/addstar/src/LoadDataPMM.c (modified) (3 diffs)
-
src/addstar/src/LoadStars.c (modified) (3 diffs)
-
src/addstar/src/MatchHeaders.c (modified) (1 diff)
-
src/addstar/src/PSPS_IDs.c (added)
-
src/addstar/src/ReadImageHeader.c (modified) (1 diff)
-
src/addstar/src/ReadStarsFITS.c (modified) (4 diffs)
-
src/addstar/src/ReadStarsSDSS.c (modified) (6 diffs)
-
src/addstar/src/ReadStarsTEXT.c (modified) (3 diffs)
-
src/addstar/src/SEDfit.c (modified) (2 diffs)
-
src/addstar/src/SkyListForStars.c (modified) (2 diffs)
-
src/addstar/src/StarOps.c (added)
-
src/addstar/src/UpdateImageIDs.c (modified) (1 diff)
-
src/addstar/src/addstar.c (modified) (1 diff)
-
src/addstar/src/airmass.c (modified) (2 diffs)
-
src/addstar/src/args.c (modified) (7 diffs)
-
src/addstar/src/dump.c (modified) (1 diff)
-
src/addstar/src/fakeimage.c (modified) (2 diffs)
-
src/addstar/src/find_matches.c (modified) (4 diffs)
-
src/addstar/src/find_matches_closest.c (modified) (9 diffs)
-
src/addstar/src/find_matches_refstars.c (modified) (3 diffs)
-
src/addstar/src/find_subset.c (modified) (1 diff)
-
src/addstar/src/get2mass_dr2.c (modified) (1 diff)
-
src/addstar/src/get2mass_full.c (modified) (11 diffs)
-
src/addstar/src/get2mass_ops.c (modified) (3 diffs)
-
src/addstar/src/getgsc.c (modified) (1 diff)
-
src/addstar/src/gettycho.c (modified) (1 diff)
-
src/addstar/src/getusno.c (modified) (1 diff)
-
src/addstar/src/getusnob.c (modified) (3 diffs)
-
src/addstar/src/greference.c (modified) (2 diffs)
-
src/addstar/src/grefstars.c (modified) (2 diffs)
-
src/addstar/src/load2mass_as_rawdata.c (modified) (1 diff)
-
src/addstar/src/load2mass_catalog.c (modified) (2 diffs)
-
src/addstar/src/replace_match.c (modified) (1 diff)
-
src/addstar/src/sky_tessalation.c (modified) (4 diffs)
-
src/getstar/src/ReadImageFiles.c (modified) (1 diff)
-
src/getstar/src/ReadImageHeader.c (modified) (1 diff)
-
src/getstar/src/write_getstar_ps1_dev_0.c (modified) (1 diff)
-
src/getstar/src/write_getstar_ps1_dev_1.c (modified) (1 diff)
-
src/getstar/src/write_getstar_ps1_dev_2.c (modified) (1 diff)
-
src/imregister/imphot/modify.c (modified) (1 diff)
-
src/imregister/imphot/output.c (modified) (1 diff)
-
src/imregister/imphot/subset.c (modified) (1 diff)
-
src/libautocode/Makefile.Targets (modified) (12 diffs)
-
src/libautocode/def/Stars.d (modified) (3 diffs)
-
src/libautocode/def/average-ps1-v1.d (added)
-
src/libautocode/def/average.d (modified) (2 diffs)
-
src/libautocode/def/cmf-ps1-dev-0.d (added)
-
src/libautocode/def/cmf-ps1-dev-1.d (added)
-
src/libautocode/def/cmf-ps1-v1.d (added)
-
src/libautocode/def/cmf-smpdata.d (added)
-
src/libautocode/def/getstar-ps1-v1.d (added)
-
src/libautocode/def/image-ps1-v1.d (added)
-
src/libautocode/def/image.d (modified) (3 diffs)
-
src/libautocode/def/measure-panstarrs-dev-0.d (modified) (1 diff)
-
src/libautocode/def/measure-panstarrs-dev-1.d (modified) (1 diff)
-
src/libautocode/def/measure-ps1-dev-1.d (modified) (1 diff)
-
src/libautocode/def/measure-ps1-dev-2.d (modified) (1 diff)
-
src/libautocode/def/measure-ps1-v1.d (added)
-
src/libautocode/def/measure.d (modified) (1 diff)
-
src/libautocode/def/photcode-ps1-v1.d (added)
-
src/libautocode/def/ps1_dev_0.d (deleted)
-
src/libautocode/def/ps1_dev_1.d (deleted)
-
src/libautocode/def/secfilt-ps1-v1.d (added)
-
src/libautocode/def/secfilt.d (modified) (2 diffs)
-
src/libautocode/def/smpdata.d (deleted)
-
src/libautocode/doc/autocode.txt (modified) (1 diff)
-
src/libautocode/generate (modified) (6 diffs)
-
src/libdvo/Makefile (modified) (2 diffs)
-
src/libdvo/doc/notes.txt (modified) (3 diffs)
-
src/libdvo/include/dvo.h (modified) (3 diffs)
-
src/libdvo/include/ps1_v1_defs.h (added)
-
src/libdvo/src/LoadPhotcodesFITS.c (modified) (2 diffs)
-
src/libdvo/src/SavePhotcodesFITS.c (modified) (1 diff)
-
src/libdvo/src/dvo_catalog.c (modified) (1 diff)
-
src/libdvo/src/dvo_catalog_raw.c (modified) (8 diffs)
-
src/libdvo/src/dvo_convert.c (modified) (9 diffs)
-
src/libdvo/src/dvo_convert_PS1_DEV_1.c (modified) (15 diffs)
-
src/libdvo/src/dvo_convert_PS1_DEV_2.c (modified) (17 diffs)
-
src/libdvo/src/dvo_convert_PS1_DEV_3.c (modified) (6 diffs)
-
src/libdvo/src/dvo_convert_PS1_V1.c (added)
-
src/libdvo/src/dvo_convert_elixir.c (modified) (18 diffs)
-
src/libdvo/src/dvo_convert_loneos.c (modified) (15 diffs)
-
src/libdvo/src/dvo_convert_panstarrs_DEV_0.c (modified) (13 diffs)
-
src/libdvo/src/dvo_convert_panstarrs_DEV_1.c (modified) (13 diffs)
-
src/libdvo/src/dvo_image.c (modified) (1 diff)
-
src/libdvo/src/dvo_image_raw.c (modified) (2 diffs)
-
src/libdvo/src/dvosorts.c (modified) (2 diffs)
-
src/libohana/include/ohana.h (modified) (1 diff)
-
src/opihi/cmd.data/Makefile (modified) (5 diffs)
-
src/opihi/cmd.data/applyfit.c (deleted)
-
src/opihi/cmd.data/applyfit1d.c (added)
-
src/opihi/cmd.data/clip.c (deleted)
-
src/opihi/cmd.data/fit.c (deleted)
-
src/opihi/cmd.data/fit1d.c (added)
-
src/opihi/cmd.data/imclip.c (added)
-
src/opihi/cmd.data/imstats.c (added)
-
src/opihi/cmd.data/init.c (modified) (8 diffs)
-
src/opihi/cmd.data/stats.c (deleted)
-
src/opihi/cmd.data/vstat.c (deleted)
-
src/opihi/cmd.data/vstats.c (added)
-
src/opihi/dvo/dbExtractAverages.c (modified) (1 diff)
-
src/opihi/dvo/dbExtractImages.c (modified) (1 diff)
-
src/opihi/dvo/dbExtractMeasures.c (modified) (5 diffs)
-
src/opihi/dvo/dbFields.c (modified) (2 diffs)
-
src/opihi/dvo/gimages.c (modified) (1 diff)
-
src/opihi/dvo/gstar.c (modified) (4 diffs)
-
src/opihi/dvo/paverage.c (modified) (1 diff)
-
src/opihi/dvo/photometry.c (modified) (14 diffs)
-
src/opihi/dvo/pmeasure.c (modified) (1 diff)
-
src/opihi/include/dvoshell.h (modified) (1 diff)
-
src/relastro/include/relastro.h (modified) (1 diff)
-
src/relastro/src/MosaicOps.c (modified) (1 diff)
-
src/relastro/src/UpdateObjects.c (modified) (1 diff)
-
src/relastro/src/bcatalog.c (modified) (2 diffs)
-
src/relastro/src/load_catalogs.c (modified) (1 diff)
-
src/relastro/src/relastro_objects.c (modified) (1 diff)
-
src/relastro/src/select_images.c (modified) (2 diffs)
-
src/relphot/include/relphot.h (modified) (1 diff)
-
src/relphot/src/GridOps.c (modified) (1 diff)
-
src/relphot/src/ImageOps.c (modified) (9 diffs)
-
src/relphot/src/MosaicOps.c (modified) (11 diffs)
-
src/relphot/src/StarOps.c (modified) (12 diffs)
-
src/relphot/src/bcatalog.c (modified) (2 diffs)
-
src/relphot/src/plot_scatter.c (modified) (1 diff)
-
src/relphot/src/relphot_objects.c (modified) (1 diff)
-
src/relphot/src/select_images.c (modified) (1 diff)
-
src/relphot/src/setMrelFinal.c (modified) (3 diffs)
-
src/uniphot/src/find_image_sgroups.c (modified) (2 diffs)
-
src/uniphot/src/find_image_tgroups.c (modified) (1 diff)
-
src/uniphot/src/fit_groups.c (modified) (2 diffs)
-
src/uniphot/src/subset_images.c (modified) (2 diffs)
-
src/uniphot/src/update.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/configure.tcsh
r19564 r21508 12 12 set memcheck = 0 13 13 set use_tcmalloc = 0 14 set use_gnu99 = 0 14 15 15 16 set prefix = "" … … 70 71 set use_tcmalloc = 1 71 72 breaksw; 73 case --use-gnu99 74 set use_gnu99 = 1 75 breaksw; 72 76 case --pedantic 73 77 set pedantic = 1 … … 167 171 set CFLAGS = "-g -O0" 168 172 endif 173 169 174 # optimize overrides user-supplied CFLAGS 170 175 if ($optimize) set CFLAGS = "-O2" … … 172 177 # profiler code 173 178 if ($profile) set CFLAGS = "$CFLAGS -pg" 179 180 # use_gnu99 181 if ($use_gnu99) set CFLAGS = "$CFLAGS -std=gnu99" 174 182 175 183 if (! $?CPPFLAGS) then -
trunk/Ohana/src/addstar/Makefile
r20936 r21508 27 27 mkcmf : $(BIN)/mkcmf.$(ARCH) 28 28 29 all: addstar addstarc addstard addstart sedstar load2mass skycells 29 all: addstar sedstar load2mass skycells 30 31 # I need to fix the client/server version of addstar now that I have dropped Stars 32 # as an autocode type and have converted to carrying average and measure 33 # all: addstar addstarc addstard addstart sedstar load2mass skycells 30 34 31 35 ADDSTAR = \ … … 48 52 $(SRC)/find_matches_refstars.$(ARCH).o \ 49 53 $(SRC)/find_subset.$(ARCH).o \ 50 $(SRC)/get2mass.$(ARCH).o \51 $(SRC)/get2mass_as.$(ARCH).o \52 $(SRC)/get2mass_as_raw.$(ARCH).o \53 $(SRC)/get2mass_dr2.$(ARCH).o \54 $(SRC)/get2mass_ops.$(ARCH).o \55 54 $(SRC)/getgsc.$(ARCH).o \ 56 55 $(SRC)/gettycho.$(ARCH).o \ … … 71 70 $(SRC)/replace_match.$(ARCH).o \ 72 71 $(SRC)/resort_catalog.$(ARCH).o \ 72 $(SRC)/StarOps.$(ARCH).o \ 73 73 $(SRC)/ReadStarsFITS.$(ARCH).o \ 74 74 $(SRC)/ReadStarsTEXT.$(ARCH).o \ … … 106 106 $(SRC)/find_matches_refstars.$(ARCH).o \ 107 107 $(SRC)/find_subset.$(ARCH).o \ 108 $(SRC)/get2mass.$(ARCH).o \109 $(SRC)/get2mass_as.$(ARCH).o \110 $(SRC)/get2mass_as_raw.$(ARCH).o \111 $(SRC)/get2mass_dr2.$(ARCH).o \112 $(SRC)/get2mass_ops.$(ARCH).o \113 108 $(SRC)/getgsc.$(ARCH).o \ 114 109 $(SRC)/gettycho.$(ARCH).o \ … … 141 136 $(SRC)/find_matches_refstars.$(ARCH).o \ 142 137 $(SRC)/find_subset.$(ARCH).o \ 143 $(SRC)/get2mass.$(ARCH).o \144 $(SRC)/get2mass_as.$(ARCH).o \145 $(SRC)/get2mass_as_raw.$(ARCH).o \146 $(SRC)/get2mass_dr2.$(ARCH).o \147 $(SRC)/get2mass_ops.$(ARCH).o \148 138 $(SRC)/getgsc.$(ARCH).o \ 149 139 $(SRC)/getusno.$(ARCH).o \ … … 209 199 $(SRC)/replace_match.$(ARCH).o \ 210 200 $(SRC)/update_coords.$(ARCH).o \ 201 $(SRC)/StarOps.$(ARCH).o \ 211 202 $(SRC)/ConfigInit.$(ARCH).o \ 212 203 $(SRC)/Shutdown.$(ARCH).o \ … … 252 243 $(BIN)/mkcmf.$(ARCH) : $(MKCMF) 253 244 254 INSTALL = addstar addstarc addstard addstart sedstar load2mass skycells mkcmf 245 INSTALL = addstar sedstar load2mass skycells mkcmf 246 247 # I need to fix the client/server version of addstar now that I have dropped Stars 248 # as an autocode type and have converted to carrying average and measure 249 # all: addstar addstarc addstard addstart sedstar load2mass skycells 250 # INSTALL = addstar addstarc addstard addstart sedstar load2mass skycells mkcmf 255 251 256 252 # dependancy rules for binary code ######################### -
trunk/Ohana/src/addstar/doc/notes.txt
r20652 r21508 1 2 2009.02.11 3 4 updating DVO tables with more fields: cleaning up the conversions 5 from external formats to the DVO internal formats: I am changing 6 the APIs to convert directly to the Measure structure, including 7 conversion functions for the compressed fields (ie, pixels carried 8 as short). 9 10 A few remaining issues: 11 12 * t_msec : I've added a field to carry the fractional seconds, but 13 nothing is yet setting this value, and the query functions do not 14 use this value. 15 16 * various fields are reported in either arcseconds or pixels (eg, 17 FWHMx, moments, error in centroid). These are currently not very 18 consistent, and should be tightened up... 19 20 ** if we store these values in pixels, then cameras with a wide 21 range of plate scales (GPC1 << SkyProbe << AllSky) will all fit 22 in field with a small dynamic range; since we also provide the 23 plate scale (as a float), conversions are easy: 24 GPC1 : 0.26 arcsec / pixel 25 SkyProbe : 4.5 arcsec / pixel 26 AllSky : 3600.0 arcsec / pixel 1 27 2 28 2008.10.11 -
trunk/Ohana/src/addstar/include/addstar.h
r21153 r21508 28 28 fprintf (stderr, "ERROR: photcode %s not found in photcode table\n", NAME); \ 29 29 exit (0); } 30 31 typedef struct { 32 char *exthead; 33 char *extdata; 34 char *exttype; 35 int extnum_head; 36 int extnum_data; 37 } HeaderSet; 38 39 typedef struct { 40 Average average; 41 Measure measure; 42 int found; 43 } Stars; 30 44 31 45 typedef struct { … … 39 53 char *refcat; 40 54 } DVO_DATA; 41 42 typedef struct {43 char *exthead;44 char *extdata;45 char *exttype;46 int extnum_head;47 int extnum_data;48 } HeaderSet;49 55 50 56 typedef struct sockaddr_in SockAddress; … … 92 98 /* these globals modify the behavior of gstars (KEEP) */ 93 99 double SNLIMIT; 100 int PHOTFLAG_EXCLUDE; 94 101 int ACCEPT_ASTROM; // accept even bad astrometry solutions (NASTRO == 0) 95 102 int ACCEPT_MOTION; // accept reference proper motion measurements … … 137 144 /*** addstar prototypes ***/ 138 145 146 AddstarClientOptions ConfigInit PROTO((int *argc, char **argv)); 147 AddstarClientOptions args PROTO((int argc, char **argv, AddstarClientOptions options)); 148 139 149 void AddToCalibration PROTO((Average *average, SecFilt *secfilt, Measure *measure, Measure *new, int *next, int Nstar)); 140 AddstarClientOptions ConfigInit PROTO((int *argc, char **argv));141 150 void FindCalibration PROTO((Image *image)); 142 151 FILE *GetDB PROTO((int *state)); … … 145 154 void SetProtect PROTO((int mode)); 146 155 int SetSignals PROTO((void)); 147 int Shutdown PROTO((char *message, ...) ; )156 int Shutdown PROTO((char *message, ...)); 148 157 void TrapSignal PROTO((int sig)); 149 158 float airmass PROTO((float secz_image, double ra, double dec, double st, double latitude)); 159 float azimuth PROTO((double ha, double dec, double latitude)); 150 160 void SetAirmassQuality PROTO((int quality)); 151 161 SkyTable *SkyTableFromTychoIndex PROTO((char *filename, int VERBOSE)); 152 AddstarClientOptions args PROTO((int argc, char **argv, AddstarClientOptions options));153 162 void check_permissions PROTO((char *basefile)); 154 163 int dump_rawstars PROTO((Stars *stars, int Nstars)); 155 164 int edge_check PROTO((double *x1, double *y1, double *x2, double *y2)); 156 165 Image *fakeimage PROTO((char *rootname, int *Nimage, int photcode)); 166 157 167 int find_matches PROTO((SkyRegion *region, Stars *stars, int Nstars, Catalog *catalog, AddstarClientOptions options)); 158 168 int find_matches_closest PROTO((SkyRegion *region, Stars *stars, int Nstars, Catalog *catalog, AddstarClientOptions options)); 159 169 int find_matches_refstars PROTO((SkyRegion *region, Stars **stars, int Nstars, Catalog *catalog, AddstarClientOptions options)); 170 160 171 Stars **find_subset PROTO((SkyRegion *region, Stars *stars, int Nstars, int *NSTARS)); 161 172 int gcatalog PROTO((Catalog *catalog)); 162 173 Stars *get2mass PROTO((SkyRegion *patch, int photcode, int mode, int *NSTARS)); 163 174 double get_subpix PROTO((double x, double y)); 175 176 Stars *greference PROTO((char *Refcat, SkyRegion *catstats, int photcode, int *nstars)); 164 177 Stars *getgsc PROTO((SkyRegion *patch, int *NSTARS)); 165 178 Stars *gettycho PROTO((SkyRegion *catstats, int photcode, int *Nstars)); 166 179 Stars *getusno PROTO((SkyRegion *catstats, int photcode, int *Nstars)); 167 180 Stars *getusnob PROTO((SkyRegion *catstats, int photcode, int *Nstars)); 168 Image *gimages PROTO((FITS_DB *db, Image *image, Coords *mosaic, int *Npimage)); 169 Stars *grefcat PROTO((char *Refcat, SkyRegion *catstats, int photcode, int *nstars)); 181 182 // load text-based stars (REF only in the sense of REF photcodes) 170 183 Stars *grefstars PROTO((char *file, int photcode, int *Nstars)); 171 184 … … 249 262 Stars *Convert_PS1_DEV_0 PROTO((FTable *table, int *nstars)); 250 263 Stars *Convert_PS1_DEV_1 PROTO((FTable *table, int *nstars)); 264 Stars *Convert_PS1_V1 PROTO((FTable *table, int *nstars)); 265 266 int InitStar PROTO((Stars *star)); 267 short ShortPixels PROTO((float pixels)); 268 short ShortDegree PROTO((float degrees)); 251 269 252 270 int args_skycells (int argc, char **argv); -
trunk/Ohana/src/addstar/include/skycells.h
r21153 r21508 30 30 int NX; 31 31 int NY; 32 int code;32 int photcode; 33 33 char name[64]; 34 34 } SkyRectangle; -
trunk/Ohana/src/addstar/src/ConfigInit.c
r20936 r21508 39 39 ScanConfig (config, "MIN_SN_FSTAT", "%lf", 0, &SNLIMIT); 40 40 ScanConfig (config, "ADDSTAR_SNLIMIT", "%lf", 0, &SNLIMIT); 41 42 /* exclude stars with bits that match the given photFlags bits */ 43 PHOTFLAG_EXCLUDE = 0; 44 ScanConfig (config, "ADDSTAR_PHOTFLAG_EXCLUDE", "%d", 0, &PHOTFLAG_EXCLUDE); 41 45 42 46 MAX_CERROR = 0.5; // arcseconds -
trunk/Ohana/src/addstar/src/FilterStars.c
r19823 r21508 1 1 # include "addstar.h" 2 # define EXTERNAL_ID FALSE 2 3 4 /* exclude some detections based on various filter options: 5 * *** S/N limit 6 * *** Acceptable window on detector 7 * *** bad photFlags 8 */ 9 10 // the imageID supplied here is the sequence **within this set** 11 // this value is updated based on the image table later 3 12 Stars *FilterStars (Stars *instars, Image *image, unsigned int imageID) { 4 13 … … 19 28 ALLOCATE (stars, Stars, image[0].nstar); 20 29 for (N = j = 0; j < image[0].nstar; j++) { 30 21 31 /* allow for some dynamic filtering of star list */ 22 if (SNLIMIT && instars[j].dM > SNLIMIT) continue; 23 if (XMAX && (instars[j].X > XMAX)) continue; 24 if (XMIN && (instars[j].X < XMIN)) continue; 25 if (YMAX && (instars[j].Y > YMAX)) continue; 26 if (YMIN && (instars[j].Y < YMIN)) continue; 32 if (SNLIMIT && instars[j].measure.dM > SNLIMIT) continue; 33 if (XMAX && (instars[j].measure.Xccd > XMAX)) continue; 34 if (XMIN && (instars[j].measure.Xccd < XMIN)) continue; 35 if (YMAX && (instars[j].measure.Yccd > YMAX)) continue; 36 if (YMIN && (instars[j].measure.Yccd < YMIN)) continue; 37 if (PHOTFLAG_EXCLUDE && (instars[j].measure.photFlags & PHOTFLAG_EXCLUDE)) continue; 38 27 39 stars[N] = instars[j]; 28 40 29 XY_to_RD (&stars[N].R, &stars[N].D, stars[N].X, stars[N].Y, &image[0].coords); 30 stars[N].R = ohana_normalize_angle (stars[N].R); 31 stars[N].found = -1; 32 stars[N].code = image[0].photcode; 41 XY_to_RD (&stars[N].average.R, &stars[N].average.D, stars[N].measure.Xccd, stars[N].measure.Yccd, &image[0].coords); 42 stars[N].average.R = ohana_normalize_angle (stars[N].average.R); 33 43 34 RMIN = MIN (RMIN, stars[N].R); 35 RMAX = MAX (RMAX, stars[N].R); 36 DMIN = MIN (DMIN, stars[N].D); 37 DMAX = MAX (DMAX, stars[N].D); 44 stars[N].measure.photcode = image[0].photcode; 45 46 // determine the full coverage of this set of measurements 47 RMIN = MIN (RMIN, stars[N].average.R); 48 RMAX = MAX (RMAX, stars[N].average.R); 49 DMIN = MIN (DMIN, stars[N].average.D); 50 DMAX = MAX (DMAX, stars[N].average.D); 51 38 52 /** additional quantities to supply to Stars based on the image data **/ 39 53 40 /* calculate accurate per-star airmass */ 41 stars[N].airmass = airmass (image[0].secz, stars[N].R, stars[N].D, image[0].sidtime, image[0].latitude); 42 stars[N].Mcal = image[0].Mcal; 43 stars[N].t = image[0].tzero + 1e-4*stars[N].Y*image[0].trate; /* trate is in 0.1 msec / row */ 44 stars[N].dt = MTIME; 54 /* calculate accurate per-star airmass and azimuth */ 55 stars[N].measure.airmass = airmass (image[0].secz, stars[N].average.R, stars[N].average.D, image[0].sidtime, image[0].latitude); 56 stars[N].measure.az = azimuth (image[0].sidtime - stars[N].average.R, stars[N].average.D, image[0].latitude); 57 stars[N].measure.Mcal = image[0].Mcal; 58 stars[N].measure.t = image[0].tzero + 1e-4*stars[N].measure.Yccd*image[0].trate; /* trate is in 0.1 msec / row */ 59 stars[N].measure.dt = MTIME; 45 60 46 if ((stars[N].M > 25.0) && (stars[N].M < 32.0)) { 61 // watch out for any strange values: 62 if ((stars[N].measure.M > 25.0) && (stars[N].measure.M < 32.0)) { 47 63 fprintf (stderr, "*"); 48 64 } 49 50 65 // stars->M is either NAN or a valid inst magnitude 51 66 // stars->dM is either NAN or a valid error … … 54 69 dMx = 0.0; 55 70 if (SUBPIX) { 56 dMs = get_subpix (stars[N].X, stars[N].Y);57 dMx = scat_subpix (stars[N]. X, stars[N].Y);58 if (!isnan(stars[N]. dM)) {59 stars[N]. dM = hypot (stars[N].dM, dMx);71 dMs = get_subpix (stars[N].measure.Xccd, stars[N].measure.Yccd); 72 dMx = scat_subpix (stars[N].measure.Xccd, stars[N].measure.Yccd); 73 if (!isnan(stars[N].measure.dM)) { 74 stars[N].measure.dM = hypot (stars[N].measure.dM, dMx); 60 75 } 61 76 } 62 77 63 if (!isnan(stars[N]. M)) {64 stars[N]. M+= MTIME - dMs;78 if (!isnan(stars[N].measure.M)) { 79 stars[N].measure.M += MTIME - dMs; 65 80 } 66 if (!isnan(stars[N]. Map)) {67 stars[N]. Map += MTIME - dMs;81 if (!isnan(stars[N].measure.Map)) { 82 stars[N].measure.Map += MTIME - dMs; 68 83 } 69 84 70 // XXX currently, this ID is internal only; 71 // should we use the psphot / other external ID, if available? 72 stars[N].detID = N; // sequence number within image 73 stars[N].imageID = imageID; // does this need to be updated? 85 // the external ID is supplied, but do we trust it? 86 if (!EXTERNAL_ID) { 87 stars[N].measure.detID = N; // sequence number within image 88 } 89 90 # if (0) 91 if (PSPS_ID) { 92 double mjd; 93 mjd = ohana_sec_to_mjd (image[0].tzero); 94 // XXX this is clearly wrong : what does PSPS want? 95 stars[N].measure.extID = PSPS_create_detectid (mjd, imageID); 96 } 97 # endif 98 99 stars[N].measure.imageID = imageID; // this value is update in UpdateImageIDs 74 100 75 101 N ++; -
trunk/Ohana/src/addstar/src/GetFileMode.c
r20545 r21508 7 7 int Naxis; 8 8 int simple, extend, haveNaxis, haveCTYPE; 9 int tmp, havePHOT_VER, haveTARG_VER; 9 10 10 11 gfits_scan (header, "SIMPLE", "%t", 1, &simple); … … 14 15 gfits_scan (header, "EXTEND", "%t", 1, &extend); 15 16 16 { 17 int tmp, havePHOT_VER, haveTARG_VER; 18 19 // SDSS tsObj files have a version number for the PHOTO and 20 // TS (target selection) pipelines present as header keywords 21 havePHOT_VER = gfits_scan (header, "PHOT_VER", "%s", 1, &tmp); 22 haveTARG_VER = gfits_scan (header, "TARG_VER", "%s", 1, &tmp); 23 if (havePHOT_VER && haveTARG_VER) return SDSS_OBJ; 24 } 17 // SDSS tsObj files have a version number for the PHOTO and 18 // TS (target selection) pipelines present as header keywords 19 havePHOT_VER = gfits_scan (header, "PHOT_VER", "%s", 1, &tmp); 20 haveTARG_VER = gfits_scan (header, "TARG_VER", "%s", 1, &tmp); 21 if (havePHOT_VER && haveTARG_VER) return SDSS_OBJ; 25 22 26 23 if ((Naxis == 2) || TEXTMODE || !simple) { -
trunk/Ohana/src/addstar/src/LoadData.c
r19259 r21508 41 41 // I need to detect them here and load them with ReadStarsTEXT instead of calling the code 42 42 // below. 43 // inStars = ReadStarsFITS (f, headers[Nhead], headers[Ndata], &images[0][Nvalid].nstar); 43 44 44 45 // XXX use something to set the chip name? EXTNAME? -
trunk/Ohana/src/addstar/src/LoadDataPMM.c
r19259 r21508 82 82 83 83 for (i = 0; i < Nline; i++) { 84 // fscanf (f, "%lf %lf %lf", &ra, &dec, &mag) != EOF) {85 86 84 dparse (&ra, 1, &buffer[i*NBYTE_ASC_TABLE]); 87 85 dparse (&dec, 2, &buffer[i*NBYTE_ASC_TABLE]); 88 86 dparse (&mag, 3, &buffer[i*NBYTE_ASC_TABLE]); 89 87 90 memset (&inStars[Ninstars], 0, sizeof(Stars));88 InitStar (&inStars[Ninstars]); 91 89 92 90 if (ra > 180) { … … 100 98 maxD = MAX(maxD, dec); 101 99 102 inStars[Ninstars].M = mag - ZeroPoint + ZeroPt; 103 inStars[Ninstars].R = ra; 104 inStars[Ninstars].D = dec; 105 inStars[Ninstars].t = images[0][0].tzero; 106 inStars[Ninstars].dt = images[0][0].exptime; 107 inStars[Ninstars].code = code; 108 inStars[Ninstars].airmass = airmass; 109 inStars[Ninstars].az = az; 110 inStars[Ninstars].found = -1; // found starts at -1 == not yet found 100 inStars[Ninstars].average.R = ra; 101 inStars[Ninstars].average.D = dec; 102 103 inStars[Ninstars].measure.M = mag - ZeroPoint + ZeroPt; 104 inStars[Ninstars].measure.t = images[0][0].tzero; 105 inStars[Ninstars].measure.dt = images[0][0].exptime; 106 inStars[Ninstars].measure.photcode = code; 107 inStars[Ninstars].measure.airmass = airmass; 108 inStars[Ninstars].measure.az = az; 109 111 110 Ninstars++; 112 111 CHECK_REALLOCATE (inStars, Stars, NINSTARS, Ninstars, 10000); … … 238 237 image[0].Mcal = 0.0; 239 238 image[0].Xm = NAN_S_SHORT; 240 image[0]. code= 0;239 image[0].flags = 0; 241 240 242 241 image[0].nstar = 0; -
trunk/Ohana/src/addstar/src/LoadStars.c
r16973 r21508 63 63 } 64 64 65 // load PMM data if specified (these are not stored as FITS-tables) 65 66 if (PMM_CCD_TABLE != NULL) { 66 67 LoadDataPMM (f, file[i], images, Nimages, &stars, Nstars); … … 68 69 } 69 70 71 // otherwise, we have FITS-table files: parse their headers to determine the contents 70 72 headers = LoadHeaders (f, &mode, &Nheaders); 71 73 headerSets = MatchHeaders (&extsize, &NheaderSets, mode, headers, Nheaders); … … 86 88 } 87 89 90 // if these are SDSS data, load with SDSS-specific wrapper 88 91 if (headerSets[0].exttype && !strcmp (headerSets[0].exttype, "SDSS_OBJ")) { 89 92 LoadDataSDSS (f, file[i], images, Nimages, &stars, Nstars, headers, extsize, headerSets, NheaderSets); -
trunk/Ohana/src/addstar/src/MatchHeaders.c
r16810 r21508 51 51 if (!strcmp (exttype, "PS1_DEV_0")) goto keep; 52 52 if (!strcmp (exttype, "PS1_DEV_1")) goto keep; 53 if (!strcmp (exttype, "PS1_V1")) goto keep; 53 54 continue; 54 55 -
trunk/Ohana/src/addstar/src/ReadImageHeader.c
r20936 r21508 200 200 image[0].Mcal = 0.0; 201 201 image[0].Xm = NAN_S_SHORT; 202 image[0]. code= 0;202 image[0].flags = 0; 203 203 204 204 /* find expected number of stars */ -
trunk/Ohana/src/addstar/src/ReadStarsFITS.c
r17191 r21508 40 40 stars = Convert_PS1_DEV_1 (&table, &Nstars); 41 41 } 42 if (!strcmp (type, "PS1_V1")) { 43 stars = Convert_PS1_V1 (&table, &Nstars); 44 } 42 45 if (stars == NULL) { 43 46 fprintf (stderr, "ERROR: invalid table type %s\n", type); … … 62 65 ZeroPt = GetZeroPoint(); 63 66 64 /* XXX we need to check at least the size of the loaded table */ 65 // XXX use memset to zero-out the elements before setting 66 67 ALLOCATE (stars, Stars, Nstars); 68 for (i = 0; i < Nstars; i++) { 69 stars[i].X = smpdata[i].X; 70 stars[i].Y = smpdata[i].Y; 67 ALLOCATE (stars, Stars, Nstars); 68 for (i = 0; i < Nstars; i++) { 69 InitStar (&stars[i]); 70 71 stars[i].measure.Xccd = smpdata[i].X; 72 stars[i].measure.Yccd = smpdata[i].Y; 71 73 72 74 if ((smpdata[i].M >= ZeroPt) || isnan(smpdata[i].M)) { 73 stars[i].M = NAN; 74 stars[i].Map = NAN; 75 } else { 76 stars[i].M = smpdata[i].M; 77 stars[i].Map = smpdata[i].M; 78 } 79 80 stars[i].dM = smpdata[i].dM*0.001; 81 stars[i].dophot = smpdata[i].dophot; 82 83 stars[i].fx = smpdata[i].fx; 84 stars[i].fy = smpdata[i].fy; 85 stars[i].df = smpdata[i].df; 75 stars[i].measure.M = NAN; 76 stars[i].measure.Map = NAN; 77 } else { 78 stars[i].measure.M = smpdata[i].M; 79 stars[i].measure.Map = smpdata[i].M; 80 } 81 82 stars[i].measure.dM = smpdata[i].dM*0.001; 83 84 // the dophot type information gets pushed into the upper 2 bytes of photFlags 85 stars[i].measure.photFlags = (smpdata[i].dophot << 16); 86 87 stars[i].measure.FWx = ShortPixels (smpdata[i].fx); 88 stars[i].measure.FWy = ShortPixels (smpdata[i].fy); 89 stars[i].measure.theta = ShortDegree (smpdata[i].df); 86 90 } 87 91 *nstars = Nstars; … … 101 105 ALLOCATE (stars, Stars, Nstars); 102 106 for (i = 0; i < Nstars; i++) { 103 stars[i].X = ps1data[i].X; 104 stars[i].Y = ps1data[i].Y; 105 stars[i].dX = ps1data[i].dX; 106 stars[i].dY = ps1data[i].dY; 107 InitStar (&stars[i]); 108 stars[i].measure.Xccd = ps1data[i].X; 109 stars[i].measure.Yccd = ps1data[i].Y; 110 111 stars[i].measure.dXccd = ShortPixels(ps1data[i].dX); 112 stars[i].measure.dYccd = ShortPixels(ps1data[i].dY); 113 107 114 if ((ps1data[i].M >= 0.0) || isnan(ps1data[i].M)) { 108 stars[i].M = NAN; 109 } else { 110 stars[i].M = ps1data[i].M + ZeroPt; 111 } 112 stars[i].dM = ps1data[i].dM; 113 stars[i].Mpeak = ps1data[i].Mpeak; 114 115 stars[i].sky = ps1data[i].sky; 116 stars[i].dsky = ps1data[i].dSky; 117 118 stars[i].fx = ps1data[i].fx; 119 stars[i].fy = ps1data[i].fy; 120 stars[i].df = ps1data[i].df; 121 122 stars[i].psfChisq = ps1data[i].psfChisq; 123 stars[i].psfQual = ps1data[i].psfQual; 124 125 stars[i].detID = ps1data[i].detID; 126 127 /* these are set elsewhere */ 128 stars[i].R = 0.0; 129 stars[i].D = 0.0; 130 stars[i].dR = 0.0; 131 stars[i].dD = 0.0; 132 133 stars[i].uR = 0.0; 134 stars[i].uD = 0.0; 135 stars[i].duR = 0.0; 136 stars[i].duD = 0.0; 137 138 stars[i].P = 0.0; 139 stars[i].dP = 0.0; 140 141 stars[i].Mcal = 0; 142 stars[i].t = 0; 143 stars[i].dt = 0; 144 stars[i].airmass = 0; 145 stars[i].code = 0; 146 stars[i].found = 0; 147 148 /* these are not used */ 149 stars[i].Map = NAN; 150 stars[i].dophot = 0; 115 stars[i].measure.M = NAN; 116 } else { 117 stars[i].measure.M = ps1data[i].M + ZeroPt; 118 } 119 stars[i].measure.Map = NAN; 120 stars[i].measure.dM = ps1data[i].dM; 121 stars[i].measure.Sky = ps1data[i].sky; 122 stars[i].measure.dSky = ps1data[i].dSky; 123 124 stars[i].measure.FWx = ShortPixels(ps1data[i].fx); 125 stars[i].measure.FWy = ShortPixels(ps1data[i].fy); 126 stars[i].measure.theta = ShortDegree(ps1data[i].df); 127 128 stars[i].measure.psfChisq = ps1data[i].psfChisq; 129 stars[i].measure.psfQual = ps1data[i].psfQual; 130 131 stars[i].measure.detID = ps1data[i].detID; 151 132 } 152 133 *nstars = Nstars; … … 168 149 ALLOCATE (stars, Stars, Nstars); 169 150 for (i = 0; i < Nstars; i++) { 170 stars[i].X = ps1data[i].X; 171 stars[i].Y = ps1data[i].Y; 172 stars[i].dX = ps1data[i].dX; 173 stars[i].dY = ps1data[i].dY; 151 InitStar (&stars[i]); 152 stars[i].measure.Xccd = ps1data[i].X; 153 stars[i].measure.Yccd = ps1data[i].Y; 154 155 stars[i].measure.dXccd = ShortPixels(ps1data[i].dX); 156 stars[i].measure.dYccd = ShortPixels(ps1data[i].dY); 157 174 158 if ((ps1data[i].M >= 0.0) || isnan(ps1data[i].M)) { 175 stars[i].M = NAN; 176 } else { 177 stars[i].M = ps1data[i].M + ZeroPt; 178 } 179 stars[i].dM = ps1data[i].dM; 180 stars[i].Mpeak = ps1data[i].Mpeak; 181 182 stars[i].sky = ps1data[i].sky; 183 stars[i].dsky = ps1data[i].dSky; 184 185 stars[i].fx = ps1data[i].fx; 186 stars[i].fy = ps1data[i].fy; 187 stars[i].df = ps1data[i].df; 188 189 stars[i].psfChisq = ps1data[i].psfChisq; 190 stars[i].psfQual = ps1data[i].psfQual; 191 stars[i].crNsigma = ps1data[i].crNsigma; 192 stars[i].extNsigma = ps1data[i].extNsigma; 193 194 stars[i].detID = ps1data[i].detID; 195 stars[i].flags = ps1data[i].flags; 196 197 // XXX not defined anyway 198 // stars[i].stargal = ps1data[i].stargal; 199 200 /* these are set elsewhere */ 201 stars[i].R = 0.0; 202 stars[i].D = 0.0; 203 stars[i].dR = 0.0; 204 stars[i].dD = 0.0; 205 206 stars[i].uR = 0.0; 207 stars[i].uD = 0.0; 208 stars[i].duR = 0.0; 209 stars[i].duD = 0.0; 210 211 stars[i].P = 0.0; 212 stars[i].dP = 0.0; 213 214 stars[i].Mcal = 0; 215 stars[i].t = 0; 216 stars[i].dt = 0; 217 stars[i].airmass = 0; 218 stars[i].az = 0; 219 stars[i].code = 0; 220 stars[i].found = 0; 221 222 /* these are not used */ 223 stars[i].Map = NAN; 224 stars[i].dophot = 0; 225 } 226 *nstars = Nstars; 227 return (stars); 228 } 159 stars[i].measure.M = NAN; 160 } else { 161 stars[i].measure.M = ps1data[i].M + ZeroPt; 162 } 163 stars[i].measure.Map = NAN; 164 stars[i].measure.dM = ps1data[i].dM; 165 stars[i].measure.Sky = ps1data[i].sky; 166 stars[i].measure.dSky = ps1data[i].dSky; 167 168 stars[i].measure.FWx = ShortPixels(ps1data[i].fx); 169 stars[i].measure.FWy = ShortPixels(ps1data[i].fy); 170 stars[i].measure.theta = ShortDegree(ps1data[i].df); 171 172 stars[i].measure.psfChisq = ps1data[i].psfChisq; 173 stars[i].measure.psfQual = ps1data[i].psfQual; 174 stars[i].measure.crNsigma = ps1data[i].crNsigma; 175 stars[i].measure.extNsigma = ps1data[i].extNsigma; 176 177 stars[i].measure.detID = ps1data[i].detID; 178 stars[i].measure.photFlags = ps1data[i].flags; 179 } 180 *nstars = Nstars; 181 return (stars); 182 } 183 184 Stars *Convert_PS1_V1 (FTable *table, int *nstars) { 185 186 int i, Nstars; 187 double ZeroPt; 188 Stars *stars; 189 CMF_PS1_V1 *ps1data; 190 191 ps1data = gfits_table_get_CMF_PS1_V1 (table, &Nstars, NULL); 192 ZeroPt = GetZeroPoint(); 193 194 ALLOCATE (stars, Stars, Nstars); 195 for (i = 0; i < Nstars; i++) { 196 InitStar (&stars[i]); 197 stars[i].measure.Xccd = ps1data[i].X; 198 stars[i].measure.Yccd = ps1data[i].Y; 199 stars[i].measure.dXccd = ShortPixels(ps1data[i].dX); 200 stars[i].measure.dYccd = ShortPixels(ps1data[i].dY); 201 202 stars[i].measure.posangle = ShortDegree(ps1data[i].posangle); 203 stars[i].measure.pltscale = ps1data[i].pltscale; 204 205 if ((ps1data[i].M >= 0.0) || isnan(ps1data[i].M)) { 206 stars[i].measure.M = NAN; 207 } else { 208 stars[i].measure.M = ps1data[i].M + ZeroPt; 209 } 210 stars[i].measure.dM = ps1data[i].dM; 211 stars[i].measure.dMcal = ps1data[i].dMcal; 212 stars[i].measure.Map = ps1data[i].Map + ZeroPt; 213 214 stars[i].measure.Sky = ps1data[i].sky; 215 stars[i].measure.dSky = ps1data[i].dSky; 216 217 stars[i].measure.psfChisq = ps1data[i].psfChisq; 218 stars[i].measure.psfQual = ps1data[i].psfQual; 219 stars[i].measure.psfNdof = ps1data[i].psfNdof; 220 stars[i].measure.psfNpix = ps1data[i].psfNpix; 221 stars[i].measure.crNsigma = ps1data[i].crNsigma; 222 stars[i].measure.extNsigma = ps1data[i].extNsigma; 223 224 stars[i].measure.FWx = ShortPixels(ps1data[i].fx); 225 stars[i].measure.FWy = ShortPixels(ps1data[i].fy); 226 stars[i].measure.theta = ShortDegree(ps1data[i].df); 227 228 stars[i].measure.Mxx = ShortPixels(ps1data[i].Mxx); 229 stars[i].measure.Mxy = ShortPixels(ps1data[i].Mxy); 230 stars[i].measure.Myy = ShortPixels(ps1data[i].Myy); 231 232 stars[i].measure.photFlags = ps1data[i].flags; 233 234 // this is may optionally be replaced by the internal sequence (see FilterStars.c) 235 stars[i].measure.detID = ps1data[i].detID; 236 237 // the Average fields and the following Measure fields are set in FilterStars after 238 // the image metadata is in hand: dR, dD, Mcal, dt, airmass, az, t, imageID, extID, 239 // averef is set in find_matches, dbFlags is zero on ingest. 240 241 // the following fields are currently not being set anywhere: t_msec 242 } 243 *nstars = Nstars; 244 return (stars); 245 } -
trunk/Ohana/src/addstar/src/ReadStarsSDSS.c
r20688 r21508 140 140 for (j = 0; j < NFILTER; j++) { 141 141 N = NFILTER*i + j; 142 stars[N].X = colc[N]; 143 stars[N].Y = rowc[N]; 144 stars[N].dX = colcErr[N]; 145 stars[N].dY = rowcErr[N]; 146 stars[N].M = psfCounts[N] + ZeroPt - zeropt[j]; 147 stars[N].dM = psfCountsErr[N]; 148 stars[N].Map = fiberCounts[N] + ZeroPt - zeropt[j]; 149 stars[N].Mpeak = NAN; 150 stars[N].sky = sky[N]; // adjust this to counts? 151 stars[N].dsky = skyErr[N]; 152 stars[N].fx = seeing[j]; // reported in arcsec? 153 stars[N].fy = seeing[j]; 154 stars[N].df = 0.0; 155 stars[N].psfChisq = prob_psf[N]; // XXX not really the correct value... 156 stars[N].psfQual = 0.0; 157 stars[N].crNsigma = 0.0; 158 stars[N].extNsigma = 0.0; 159 stars[N].detID = N; 160 stars[N].R = ra[i] + dCOS(dec[i]) * offsetRa[N] / 3600.0; 161 stars[N].D = dec[i] + offsetDec[N] / 3600.0; 162 stars[N].dR = NAN; 163 stars[N].dD = NAN; 164 stars[N].uR = 0.0; // I don't trust the SDSS proper motions 165 stars[N].uD = 0.0; // I don't trust the SDSS proper motions 166 stars[N].duR = 0.0; 167 stars[N].duD = 0.0; 168 stars[N].P = 0.0; 169 stars[N].dP = 0.0; 170 stars[N].Mcal = 0.0; 171 stars[N].t = tzero[j] + clockRate*rowc[N]; // time since row 0 172 stars[N].dt = 53.907456; // is this 2048*clockRate ? 142 InitStar (&stars[N]); 143 144 // any values not explicitly set are left at 0.0 145 stars[N].average.R = ra[i] + dCOS(dec[i]) * offsetRa[N] / 3600.0; 146 stars[N].average.D = dec[i] + offsetDec[N] / 3600.0; 147 stars[N].average.dR = NAN; 148 stars[N].average.dD = NAN; 149 150 stars[N].measure.Xccd = colc[N]; 151 stars[N].measure.Yccd = rowc[N]; 152 stars[N].measure.dXccd = ShortPixels(colcErr[N]); 153 stars[N].measure.dYccd = ShortPixels(rowcErr[N]); 154 stars[N].measure.M = psfCounts[N] + ZeroPt - zeropt[j]; 155 stars[N].measure.dM = psfCountsErr[N]; 156 stars[N].measure.Map = fiberCounts[N] + ZeroPt - zeropt[j]; 157 stars[N].measure.Sky = sky[N]; // adjust this to counts? 158 stars[N].measure.dSky = skyErr[N]; 159 stars[N].measure.FWx = ShortPixels(seeing[j]); // reported in arcsec? 160 stars[N].measure.FWy = ShortPixels(seeing[j]); 161 stars[N].measure.psfChisq = prob_psf[N]; // XXX not really the correct value... 162 stars[N].measure.detID = N; 163 stars[N].measure.t = tzero[j] + clockRate*rowc[N]; // time since row 0 164 stars[N].measure.dt = 53.907456; // is this 2048*clockRate ? 173 165 174 166 SetSDSSFlags (&stars[N], flags[N], flags2[N]); … … 182 174 double Latitude = 32.7803611755; // degrees 183 175 184 jd = ohana_sec_to_jd (stars[N]. t);176 jd = ohana_sec_to_jd (stars[N].measure.t); 185 177 sidtime = 15.0*ohana_lst (jd, Longitude); // sidtime in degrees 186 altaz (&alt, &az, sidtime - stars[N].R, stars[N].D, Latitude); 187 188 stars[N].airmass = 1.0 / dCOS(90.0 - alt); 189 stars[N].az = az; 190 191 stars[N].code = photcode[j]; 192 stars[N].found = -1; 193 stars[N].dophot = 0; 178 altaz (&alt, &az, sidtime - stars[N].average.R, stars[N].average.D, Latitude); 179 180 stars[N].measure.airmass = 1.0 / dCOS(90.0 - alt); 181 stars[N].measure.az = az; 182 stars[N].measure.photcode = photcode[j]; 194 183 } 195 184 } … … 202 191 strcpy (images[N].coords.ctype, "RA---TAN"); 203 192 204 images[N].coords.crval1 = stars[0]. R;205 images[N].coords.crval2 = stars[0]. D;193 images[N].coords.crval1 = stars[0].average.R; 194 images[N].coords.crval2 = stars[0].average.D; 206 195 207 images[N].coords.crpix1 = stars[0]. X;208 images[N].coords.crpix2 = stars[0]. Y;196 images[N].coords.crpix1 = stars[0].measure.Xccd; 197 images[N].coords.crpix2 = stars[0].measure.Yccd; 209 198 images[N].coords.cdelt1 = images[N].coords.cdelt2 = 0.4 / 3600.0; 210 199 … … 251 240 252 241 images[N].trate = clockRate * 1e-4; 253 images[N].secz = stars[0]. airmass;242 images[N].secz = stars[0].measure.airmass; 254 243 images[N].ccdnum = camcol; 255 244 … … 257 246 images[N].Mcal = 0.0; 258 247 images[N].Xm = NAN_S_SHORT; 259 images[N]. code= 0;248 images[N].flags = 0; 260 249 261 250 images[N].nstar = Nstars; … … 297 286 298 287 // XXX this is wrong, need to roll left to set the correct bit 299 if (flags1 & 0x00000002) star[0]. flags |= 0x0001; // BRIGHT - 1 1300 if (flags1 & 0x00000004) star[0]. flags |= 0x0002; // EDGE - 1 2301 if (flags1 & 0x00000008) star[0]. flags |= 0x0004; // BLENDED - 1 3302 if (flags1 & 0x00000010) star[0]. flags |= 0x0008; // CHILD - 1 4303 if (flags1 & 0x00000020) star[0]. flags |= 0x0010; // PEAKCENTER - 1 5304 if (flags1 & 0x00000040) star[0]. flags |= 0x0020; // NODEBLEND - 1 6305 if (flags1 & 0x00040000) star[0]. flags |= 0x0040; // SATUR - 1 18306 if (flags1 & 0x00080000) star[0]. flags |= 0x0080; // NOTCHECKED - 1 19307 if (flags1 & 0x10000000) star[0]. flags |= 0x0100; // BINNED1 - 1 28308 if (flags1 & 0x20000000) star[0]. flags |= 0x0200; // BINNED2 - 1 29309 if (flags1 & 0x40000000) star[0]. flags |= 0x0400; // BINNED4 - 1 30310 if (flags2 & 0x00000040) star[0]. flags |= 0x0800; // LOCAL_EDGE - 2 7311 if (flags2 & 0x00000800) star[0]. flags |= 0x1000; // INTERP_CENTER - 2 12312 if (flags2 & 0x00002000) star[0]. flags |= 0x2000; // DEBLEND_NOPEAK - 2 14313 if (flags2 & 0x02000000) star[0]. flags |= 0x4000; // NOTCHECKED_CENTER - 2 26288 if (flags1 & 0x00000002) star[0].measure.photFlags |= 0x0001; // BRIGHT - 1 1 289 if (flags1 & 0x00000004) star[0].measure.photFlags |= 0x0002; // EDGE - 1 2 290 if (flags1 & 0x00000008) star[0].measure.photFlags |= 0x0004; // BLENDED - 1 3 291 if (flags1 & 0x00000010) star[0].measure.photFlags |= 0x0008; // CHILD - 1 4 292 if (flags1 & 0x00000020) star[0].measure.photFlags |= 0x0010; // PEAKCENTER - 1 5 293 if (flags1 & 0x00000040) star[0].measure.photFlags |= 0x0020; // NODEBLEND - 1 6 294 if (flags1 & 0x00040000) star[0].measure.photFlags |= 0x0040; // SATUR - 1 18 295 if (flags1 & 0x00080000) star[0].measure.photFlags |= 0x0080; // NOTCHECKED - 1 19 296 if (flags1 & 0x10000000) star[0].measure.photFlags |= 0x0100; // BINNED1 - 1 28 297 if (flags1 & 0x20000000) star[0].measure.photFlags |= 0x0200; // BINNED2 - 1 29 298 if (flags1 & 0x40000000) star[0].measure.photFlags |= 0x0400; // BINNED4 - 1 30 299 if (flags2 & 0x00000040) star[0].measure.photFlags |= 0x0800; // LOCAL_EDGE - 2 7 300 if (flags2 & 0x00000800) star[0].measure.photFlags |= 0x1000; // INTERP_CENTER - 2 12 301 if (flags2 & 0x00002000) star[0].measure.photFlags |= 0x2000; // DEBLEND_NOPEAK - 2 14 302 if (flags2 & 0x02000000) star[0].measure.photFlags |= 0x4000; // NOTCHECKED_CENTER - 2 26 314 303 return (TRUE); 315 304 -
trunk/Ohana/src/addstar/src/ReadStarsTEXT.c
r16810 r21508 7 7 8 8 int j, N, Nextra, Ninstar, Nskip, Nbytes, nbytes; 9 int done ;9 int done, itmp; 10 10 char *buffer, *c, *c2; 11 double tmp ;11 double tmp, fx, fy, df; 12 12 double ZeroPt; 13 13 Stars *stars; … … 66 66 Nextra = nbytes % BYTES_STAR; 67 67 for (j = 0; (j < Ninstar) && (N < *nstars); j++, N++) { 68 dparse (&stars[N].X, 1, &buffer[j*BYTES_STAR]); 69 dparse (&stars[N].Y, 2, &buffer[j*BYTES_STAR]); 70 dparse (&stars[N].M, 3, &buffer[j*BYTES_STAR]); 71 if ((stars[N].M > ZeroPt) || isnan(stars[N].M)) { 72 stars[N].M = NAN; 68 InitStar (&stars[N]); 69 fparse (&stars[N].measure.Xccd, 1, &buffer[j*BYTES_STAR]); 70 fparse (&stars[N].measure.Yccd, 2, &buffer[j*BYTES_STAR]); 71 fparse (&stars[N].measure.M, 3, &buffer[j*BYTES_STAR]); 72 if ((stars[N].measure.M > ZeroPt) || isnan(stars[N].measure.M)) { 73 stars[N].measure.M = NAN; 73 74 } 74 75 75 76 /* cmp files carry dM in millimags */ 76 77 dparse (&tmp, 4, &buffer[j*BYTES_STAR]); 77 stars[N]. dM = 0.001*tmp;78 stars[N].measure.dM = 0.001*tmp; 78 79 80 // the dophot type information get pushed into the upper 2 bytes of photFlags 79 81 dparse (&tmp, 5, &buffer[j*BYTES_STAR]); 80 stars[N].dophot = tmp; 82 itmp = tmp; 83 stars[N].measure.photFlags = (itmp << 16); 81 84 82 85 // XXX I've removed the Mgal field from the measure.d table, and am using Map … … 87 90 88 91 // dparse (&stars[N].Mgal, 7, &buffer[j*BYTES_STAR]); 89 dparse (&stars[N].Map, 8, &buffer[j*BYTES_STAR]); 90 dparse (&stars[N].fx, 9, &buffer[j*BYTES_STAR]); 91 dparse (&stars[N].fy, 10, &buffer[j*BYTES_STAR]); 92 dparse (&stars[N].df, 11, &buffer[j*BYTES_STAR]); 92 fparse (&stars[N].measure.Map, 8, &buffer[j*BYTES_STAR]); 93 dparse (&fx, 9, &buffer[j*BYTES_STAR]); 94 dparse (&fy, 10, &buffer[j*BYTES_STAR]); 95 dparse (&df, 11, &buffer[j*BYTES_STAR]); 96 97 stars[N].measure.FWx = ShortPixels (fx); 98 stars[N].measure.FWy = ShortPixels (fy); 99 stars[N].measure.theta = ShortDegree (df); 93 100 } 94 101 } -
trunk/Ohana/src/addstar/src/SEDfit.c
r16810 r21508 164 164 outcat[0].average[Nave].measureOffset = Nmeas; 165 165 outcat[0].average[Nave].missingOffset = -1; 166 outcat[0].average[Nave]. code= 0;166 outcat[0].average[Nave].flags = 0; 167 167 168 168 for (j = 0; j < Nsec; j++) { … … 181 181 for (j = 0; valid && (j < Nmodel); j++) { 182 182 n = modelRow[j]; 183 outcat[0].measure[Nmeas].dR = 0.0;184 outcat[0].measure[Nmeas].dD = 0.0;185 outcat[0].measure[Nmeas].M = table[0].row[minFit.row][0].mags[n] + minFit.Md;186 outcat[0].measure[Nmeas].dM = 0.0;187 outcat[0].measure[Nmeas].Mcal = 0;188 outcat[0].measure[Nmeas].t = TIMEREF;189 outcat[0].measure[Nmeas].averef = Nave;190 outcat[0].measure[Nmeas].photcode = table[0].code[n];191 outcat[0].measure[Nmeas]. dophot= 0;192 outcat[0].measure[Nmeas].dbFlags = 0;193 outcat[0].measure[Nmeas].dt = 0xffff;194 195 outcat[0].measure[Nmeas].airmass = 0;196 outcat[0].measure[Nmeas].FWx = NAN_S_SHORT;197 outcat[0].measure[Nmeas].FWy = NAN_S_SHORT;198 outcat[0].measure[Nmeas].theta = NAN_S_SHORT;183 outcat[0].measure[Nmeas].dR = 0.0; 184 outcat[0].measure[Nmeas].dD = 0.0; 185 outcat[0].measure[Nmeas].M = table[0].row[minFit.row][0].mags[n] + minFit.Md; 186 outcat[0].measure[Nmeas].dM = 0.0; 187 outcat[0].measure[Nmeas].Mcal = 0; 188 outcat[0].measure[Nmeas].t = TIMEREF; 189 outcat[0].measure[Nmeas].averef = Nave; 190 outcat[0].measure[Nmeas].photcode = table[0].code[n]; 191 outcat[0].measure[Nmeas].photFlags = 0; 192 outcat[0].measure[Nmeas].dbFlags = 0; 193 outcat[0].measure[Nmeas].dt = 0xffff; 194 195 outcat[0].measure[Nmeas].airmass = 0; 196 outcat[0].measure[Nmeas].FWx = NAN_S_SHORT; 197 outcat[0].measure[Nmeas].FWy = NAN_S_SHORT; 198 outcat[0].measure[Nmeas].theta = NAN_S_SHORT; 199 199 200 200 outcat[0].average[Nave].Nmeasure++; -
trunk/Ohana/src/addstar/src/SkyListForStars.c
r16040 r21508 1 1 # include "addstar.h" 2 3 void sort_stars_ra (Stars *stars, int N) { 4 5 # define SWAPFUNC(A,B){ Stars tmp; tmp = stars[A]; stars[A] = stars[B]; stars[B] = tmp; } 6 # define COMPARE(A,B)(stars[A].average.R < stars[B].average.R) 7 8 OHANA_SORT (N, COMPARE, SWAPFUNC); 9 10 # undef SWAPFUNC 11 # undef COMPARE 12 13 } 2 14 3 15 SkyList *SkyListForStars (SkyTable *table, int depth, Stars *stars, int Nstars) { … … 17 29 sort_stars_ra (stars, Nstars); /* sort by RA */ 18 30 for (i = 0; i < Nstars; i++) { 19 if (stars[i].found ) continue;20 here = SkyRegionByPoint (table, depth, stars[i]. R, stars[i].D);21 stars[i].found = TRUE;31 if (stars[i].found == -2) continue; 32 here = SkyRegionByPoint (table, depth, stars[i].average.R, stars[i].average.D); 33 stars[i].found = -2; 22 34 /* search forward for all contained stars */ 23 35 for (j = i; j < Nstars; j++) { 24 if (stars[j]. R >= here[0].regions[0][0].Rmax) break;25 if (stars[j]. R < here[0].regions[0][0].Rmin) break;26 if (stars[j]. D < here[0].regions[0][0].Dmin) continue;27 if (stars[j]. D >= here[0].regions[0][0].Dmax) continue;28 stars[j].found = TRUE;36 if (stars[j].average.R >= here[0].regions[0][0].Rmax) break; 37 if (stars[j].average.R < here[0].regions[0][0].Rmin) break; 38 if (stars[j].average.D < here[0].regions[0][0].Dmin) continue; 39 if (stars[j].average.D >= here[0].regions[0][0].Dmax) continue; 40 stars[j].found = -2; 29 41 } 30 42 list[0].regions[Nr] = here[0].regions[0]; -
trunk/Ohana/src/addstar/src/UpdateImageIDs.c
r20182 r21508 43 43 44 44 for (i = 0; i < Nstars; i++) { 45 stars[i]. imageID += imageID;45 stars[i].measure.imageID += imageID; 46 46 } 47 47 48 48 imageID += Nimages; 49 49 status = gfits_modify (&db.header, "IMAGEID", "%u", 1, imageID); 50 51 50 52 51 if (isEmpty) { -
trunk/Ohana/src/addstar/src/addstar.c
r18721 r21508 135 135 break; 136 136 case M_REFCAT: 137 stars = gref cat(argv[1], skylist[0].regions[i], options.photcode, &Nstars);137 stars = greference (argv[1], skylist[0].regions[i], options.photcode, &Nstars); 138 138 case M_REFLIST: 139 139 subset = find_subset (skylist[0].regions[i], stars, Nstars, &Nsubset); -
trunk/Ohana/src/addstar/src/airmass.c
r8642 r21508 1 1 # include "addstar.h" 2 2 3 static int AirmassQuality = FALSE;3 static int AirmassQuality = TRUE; 4 4 5 5 void SetAirmassQuality (int quality) { … … 25 25 return (secz); 26 26 } 27 28 // ha/dec -> az 29 float azimuth (double ha, double dec, double latitude) { 30 31 double rdec, rlat, rha; 32 double sinh, cosh; 33 float az; 34 35 rdec = RAD_DEG*dec; 36 rha = RAD_DEG*ha; 37 rlat = RAD_DEG*latitude; 38 39 sinh = - cos (rdec) * sin (rha); 40 cosh = sin (rdec) * cos (rlat) - cos (rdec) * cos (rha) * sin (rlat); 41 42 az = DEG_RAD * atan2 (sinh, cosh); 43 44 return az; 45 } -
trunk/Ohana/src/addstar/src/args.c
r20183 r21508 28 28 remove_argument (N, &argc, argv); 29 29 } 30 if ((N = get_argument (argc, argv, "-resort"))) { 31 options.mode = M_RESORT; 32 remove_argument (N, &argc, argv); 33 } 30 34 if ((N = get_argument (argc, argv, "-fakeimage"))) { 31 35 options.mode = M_FAKEIMAGE; … … 36 40 remove_argument (N, &argc, argv); 37 41 FAKE_THETA = atof (argv[N]); 38 remove_argument (N, &argc, argv);39 }40 if ((N = get_argument (argc, argv, "-resort"))) {41 options.mode = M_RESORT;42 42 remove_argument (N, &argc, argv); 43 43 } … … 221 221 /*** optional situations ***/ 222 222 /* choose high quality airmass vs low quality airmass (per-star vs per-image) */ 223 QUALITY_AIRMASS = FALSE;223 QUALITY_AIRMASS = TRUE; 224 224 if ((N = get_argument (argc, argv, "-quality-airmass"))) { 225 225 remove_argument (N, &argc, argv); 226 226 QUALITY_AIRMASS = TRUE; 227 } 228 if ((N = get_argument (argc, argv, "-quick-airmass"))) { 229 remove_argument (N, &argc, argv); 230 QUALITY_AIRMASS = FALSE; 227 231 } 228 232 /* choose high quality airmass vs low quality airmass (per-star vs per-image) */ … … 310 314 311 315 fprintf (stderr, "USAGE: addstar (filename)\n"); 316 fprintf (stderr, "USAGE: addstar -list (filename)\n"); 312 317 fprintf (stderr, "USAGE: addstar -cat (catalog)\n"); 313 318 fprintf (stderr, "USAGE: addstar -ref (filename)\n"); 314 319 fprintf (stderr, "USAGE: addstar -fakeimage (ra) (dec) (theta) (name)\n"); 315 320 fprintf (stderr, "USAGE: addstar -resort (SkyRegion)\n"); 321 fprintf (stderr, "USAGE: addstar -ppm (filename)\n"); 316 322 exit (2); 317 323 } … … 322 328 fprintf (stderr, " addstar (filename)\n"); 323 329 fprintf (stderr, " add specified image (cmp format) to database\n\n"); 330 fprintf (stderr, " addstar -list (filename)\n"); 331 fprintf (stderr, " add list of images (cmp format) to database\n\n"); 324 332 fprintf (stderr, " addstar -ref (filename)"); 325 333 fprintf (stderr, " add ASCII data (ra dec mag dmag) to database\n\n"); … … 328 336 fprintf (stderr, " addstar -resort (SkyRegion)"); 329 337 fprintf (stderr, " perform measure sorting for the specified catalog\n\n"); 338 fprintf (stderr, " addstar -fakeimage (ra) (dec) (theta) (name)"); 339 fprintf (stderr, " insert a fake image in the db\n\n"); 340 fprintf (stderr, " addstar -pmm (filename)"); 341 fprintf (stderr, " insert pmm table into database\n\n"); 330 342 331 343 fprintf (stderr, " optional flags:\n"); … … 340 352 fprintf (stderr, " -missed : skipped 'missed' entries\n"); 341 353 fprintf (stderr, " -replace : replace time/photcode measurements (no duplication)\n"); 342 fprintf (stderr, " -closest : use closest-star algorith\n"); 354 fprintf (stderr, " -closest : use closest-star algorith (default)\n"); 355 fprintf (stderr, " -all-matches : use all-matches algorith\n"); 343 356 fprintf (stderr, " -nosort : don't re-sort the measure entries (improves speed)\n"); 344 357 fprintf (stderr, " -update : only update the new rows (forces -nosort)\n"); 358 fprintf (stderr, " -force-sort : \n"); 345 359 fprintf (stderr, " -image : only insert image data\n"); 346 360 fprintf (stderr, " -cal : perform zero-point calibration\n"); 361 fprintf (stderr, " -excal : apply supplied zero-point calibration\n"); 362 fprintf (stderr, " -incal : perform zero-point calibration\n"); 363 fprintf (stderr, " -quality-airmass : use per-star airmass values (default)\n"); 364 fprintf (stderr, " -quick-airmass : use per-image airmass values\n"); 365 fprintf (stderr, " -subpix : apply subpixel corrections\n"); 347 366 fprintf (stderr, " -skyprobe : specify skyprobe mode\n"); 367 fprintf (stderr, " -2massquality : define 2MASS quality flags to keep\n"); 348 368 fprintf (stderr, " -accept : accept bad astrometry from header\n"); 349 369 fprintf (stderr, " -accept-astrom : accept bad astrometry from header\n"); 350 370 fprintf (stderr, " -accept-motion : accept proper-motion data from reference\n"); 371 fprintf (stderr, " -accept-time : use TZERO supplied in header\n"); 372 fprintf (stderr, " -no-stars : skip the stars\n"); 351 373 fprintf (stderr, " -force : force read of database with inconsistent info\n"); 374 fprintf (stderr, " -textmode : force textmode for file (ignore header clues)\n"); 352 375 fprintf (stderr, " -v : verbose mode\n"); 353 376 fprintf (stderr, " -dump (mode) : output test data. Currently supported values for mode are: 'rawdata', 'cal'.\n"); -
trunk/Ohana/src/addstar/src/dump.c
r3404 r21508 11 11 fprintf (f, "%4d %10.6f %10.6f %8.2f %8.2f %7.2f %7.2f\n", 12 12 i, 13 stars[i]. R, stars[i].D,14 stars[i]. X, stars[i].Y,15 stars[i]. M, stars[i].dM);13 stars[i].average.R, stars[i].average.D, 14 stars[i].measure.Xccd, stars[i].measure.Yccd, 15 stars[i].measure.M, stars[i].measure.dM); 16 16 } 17 17 -
trunk/Ohana/src/addstar/src/fakeimage.c
r16983 r21508 129 129 image[i+1].ccdnum = 0xff; 130 130 131 image[i+1].Mcal = 0.0;132 image[i+1].Xm = NAN_S_SHORT;133 image[i+1]. code= 0;131 image[i+1].Mcal = 0.0; 132 image[i+1].Xm = NAN_S_SHORT; 133 image[i+1].flags = 0; 134 134 135 135 image[i+1].nstar = 0; … … 189 189 image[0].Mcal = 0.0; 190 190 image[0].Xm = NAN_S_SHORT; 191 image[0]. code= 0;191 image[0].flags = 0; 192 192 image[0].nstar = 0; 193 193 image[0].Myyyy = 0; -
trunk/Ohana/src/addstar/src/find_matches.c
r20936 r21508 62 62 strcpy (tcoords.ctype, "RA---ARC"); 63 63 64 /* build spatial index (RA sort) */64 /* build spatial index (RA sort) referencing input array sequence */ 65 65 Nstars = 0; 66 66 for (i = 0; i < NstarsIn; i++) { 67 status = RD_to_XY (&X1[Nstars], &Y1[Nstars], stars[i]. R, stars[i].D, &tcoords);67 status = RD_to_XY (&X1[Nstars], &Y1[Nstars], stars[i].average.R, stars[i].average.D, &tcoords); 68 68 if (!status) continue; 69 69 N1[Nstars] = i; … … 104 104 /** find matched stars **/ 105 105 for (i = j = 0; (i < Nstars) && (j < Nave); ) { 106 if (!finite(X1[i]) || !finite(Y1[i])) {106 if (!finite(X1[i]) || !finite(Y1[i])) { 107 107 i++; 108 108 continue; … … 147 147 148 148 /** add measurements for this star **/ 149 /** dR,dD now represent arcsec **/ 150 catalog[0].measure[Nmeas].dR = 3600.0*(catalog[0].average[n].R - stars[N].R); 149 150 // set the new measurements 151 catalog[0].measure[Nmeas] = stars[N].measure; 152 153 // the following measure elements cannot be set until here: 154 catalog[0].measure[Nmeas].dR = 3600.0*(catalog[0].average[n].R - stars[N].average.R); 155 catalog[0].measure[Nmeas].dD = 3600.0*(catalog[0].average[n].D - stars[N].average.D); 156 catalog[0].measure[Nmeas].dbFlags = 0; 157 catalog[0].measure[Nmeas].averef = n; // this must be an absolute sequence number, if partial average is loaded 158 catalog[0].measure[Nmeas].objID = catalog[0].average[n].objID; 159 catalog[0].measure[Nmeas].catID = catalog[0].catID; 160 161 // rationalize dR: 151 162 if (catalog[0].measure[Nmeas].dR > +180.0*3600.0) { 152 163 // average on high end of boundary, move star up 153 stars[N]. R += 360.0;154 catalog[0].measure[Nmeas].dR = 3600.0*(catalog[0].average[n].R - stars[N]. R);164 stars[N].average.R += 360.0; 165 catalog[0].measure[Nmeas].dR = 3600.0*(catalog[0].average[n].R - stars[N].average.R); 155 166 } 156 167 if (catalog[0].measure[Nmeas].dR < -180.0*3600.0) { 157 168 // average on low end of boundary, move star down 158 stars[N]. R -= 360.0;159 catalog[0].measure[Nmeas].dR = 3600.0*(catalog[0].average[n].R - stars[N]. R);169 stars[N].average.R -= 360.0; 170 catalog[0].measure[Nmeas].dR = 3600.0*(catalog[0].average[n].R - stars[N].average.R); 160 171 } 161 172 if (fabs(catalog[0].measure[Nmeas].dR) > 10*RADIUS) { 162 173 fprintf (stderr, "error: %10.6f,%10.6f vs %10.6f,%10.6f (%f,%f vs %f,%f)\n", 163 174 catalog[0].average[n].R, catalog[0].average[n].D, 164 stars[N]. R, stars[N].D,175 stars[N].average.R, stars[N].average.D, 165 176 X1[i], X2[J], 166 177 Y1[i], Y2[J]); 167 178 } 168 catalog[0].measure[Nmeas].dD = 3600.0*(catalog[0].average[n].D - stars[N].D); 169 170 catalog[0].measure[Nmeas].Xccd = stars[N].X; 171 catalog[0].measure[Nmeas].Yccd = stars[N].Y; 172 173 catalog[0].measure[Nmeas].M = stars[N].M; 174 catalog[0].measure[Nmeas].dM = stars[N].dM; /* error in input files stored in thousandths of mag */ 175 catalog[0].measure[Nmeas].Mcal = stars[N].Mcal; 176 catalog[0].measure[Nmeas].t = stars[N].t; 177 catalog[0].measure[Nmeas].averef = n; /* this must be an absolute sequence number, if partial average is loaded */ 178 catalog[0].measure[Nmeas].photcode = stars[N].code; /* photcode */ 179 catalog[0].measure[Nmeas].dophot = stars[N].dophot; 180 catalog[0].measure[Nmeas].dbFlags = 0; 181 catalog[0].measure[Nmeas].dt = stars[N].dt; 182 catalog[0].measure[Nmeas].airmass = stars[N].airmass; 183 184 catalog[0].measure[Nmeas].photFlags = stars[N].flags; 185 catalog[0].measure[Nmeas].qPSF = stars[N].psfQual; 186 catalog[0].measure[Nmeas].psfChisq = stars[N].psfChisq; 187 catalog[0].measure[Nmeas].crNsigma = stars[N].crNsigma; 188 catalog[0].measure[Nmeas].extNsigma = stars[N].extNsigma; 189 catalog[0].measure[Nmeas].Sky = stars[N].sky; 190 catalog[0].measure[Nmeas].dSky = stars[N].dsky; 191 192 catalog[0].measure[Nmeas].stargal = 0; // XXX not yet set 193 194 catalog[0].measure[Nmeas].detID = stars[N].detID; 195 catalog[0].measure[Nmeas].imageID = stars[N].imageID; 196 197 catalog[0].measure[Nmeas].dXccd = stars[N].dX; 198 catalog[0].measure[Nmeas].dYccd = stars[N].dY; 199 200 catalog[0].measure[Nmeas].Map = stars[N].Map; 201 catalog[0].measure[Nmeas].FWx = 100*stars[N].fx; 202 catalog[0].measure[Nmeas].FWy = 100*stars[N].fy; 203 catalog[0].measure[Nmeas].theta = (0xffff/360.0)*stars[N].df; 204 179 205 180 /* adds the measurement to the calibration if appropriate color terms are found */ 206 181 /* we call this before (optionally) setting the average magnitude to avoid auto-correlations */ … … 266 241 N = N1[i]; 267 242 if (stars[N].found >= 0) continue; 268 if (!IN_REGION (stars[N].R, stars[N].D)) continue; 269 270 catalog[0].average[Nave].R = stars[N].R; 271 catalog[0].average[Nave].D = stars[N].D; 272 catalog[0].average[Nave].Xp = 0; 243 if (!IN_REGION (stars[N].average.R, stars[N].average.D)) continue; 244 245 catalog[0].average[Nave].R = stars[N].average.R; 246 catalog[0].average[Nave].D = stars[N].average.D; 247 catalog[0].average[Nave].dR = 0; 248 catalog[0].average[Nave].dD = 0; 249 273 250 catalog[0].average[Nave].Nmeasure = 1; 274 251 catalog[0].average[Nave].Nmissing = 0; 252 catalog[0].average[Nave].Nextend = 0; 253 275 254 catalog[0].average[Nave].measureOffset = Nmeas; 276 255 catalog[0].average[Nave].missingOffset = -1; 277 catalog[0].average[Nave].code = 0; 278 279 catalog[0].average[Nave].dR = 0; 280 catalog[0].average[Nave].dD = 0; 281 catalog[0].average[Nave].uR = 0; 282 catalog[0].average[Nave].uD = 0; 283 catalog[0].average[Nave].duR = 0; 284 catalog[0].average[Nave].duD = 0; 285 catalog[0].average[Nave].P = 0; 286 catalog[0].average[Nave].dP = 0; 287 288 catalog[0].average[Nave].objID = objID; 289 catalog[0].average[Nave].catID = catID; 256 catalog[0].average[Nave].extendOffset = -1; 257 258 catalog[0].average[Nave].uR = 0; 259 catalog[0].average[Nave].uD = 0; 260 catalog[0].average[Nave].duR = 0; 261 catalog[0].average[Nave].duD = 0; 262 catalog[0].average[Nave].P = 0; 263 catalog[0].average[Nave].dP = 0; 264 265 catalog[0].average[Nave].Xp = 0; 266 catalog[0].average[Nave].ChiSq = 0.0; 267 catalog[0].average[Nave].Npos = 0; 268 269 catalog[0].average[Nave].objID = objID; 270 catalog[0].average[Nave].catID = catID; 271 catalog[0].average[Nave].flags = 0; 272 290 273 objID ++; 291 274 292 275 for (j = 0; j < Nsecfilt; j++) { 293 catalog[0].secfilt[Nave*Nsecfilt+j].M = NAN; 294 catalog[0].secfilt[Nave*Nsecfilt+j].dM = NAN; 295 catalog[0].secfilt[Nave*Nsecfilt+j].Xm = NAN_S_SHORT; 296 } 297 298 catalog[0].measure[Nmeas].Xccd = stars[N].X; 299 catalog[0].measure[Nmeas].Yccd = stars[N].Y; 300 276 catalog[0].secfilt[Nave*Nsecfilt+j].M = NAN; 277 catalog[0].secfilt[Nave*Nsecfilt+j].dM = NAN; 278 catalog[0].secfilt[Nave*Nsecfilt+j].Xm = NAN_S_SHORT; 279 catalog[0].secfilt[Nave*Nsecfilt+j].M_20 = NAN_S_SHORT; 280 catalog[0].secfilt[Nave*Nsecfilt+j].M_80 = NAN_S_SHORT; 281 catalog[0].secfilt[Nave*Nsecfilt+j].Ncode = 0; 282 catalog[0].secfilt[Nave*Nsecfilt+j].Nused = 0; 283 } 284 285 // supply the measurments from this detection 286 catalog[0].measure[Nmeas] = stars[N].measure; 287 288 // the following measure elements cannot be set until here: 301 289 catalog[0].measure[Nmeas].dR = 0.0; 302 290 catalog[0].measure[Nmeas].dD = 0.0; 303 catalog[0].measure[Nmeas].M = stars[N].M;304 catalog[0].measure[Nmeas].dM = stars[N].dM;305 catalog[0].measure[Nmeas].Mcal = stars[N].Mcal;306 catalog[0].measure[Nmeas].t = stars[N].t;307 catalog[0].measure[Nmeas].averef = Nave; /* XXX EAM : must be absolute Nave if partial read */308 catalog[0].measure[Nmeas].photcode = stars[N].code; /* photcode */309 catalog[0].measure[Nmeas].dophot = stars[N].dophot;310 291 catalog[0].measure[Nmeas].dbFlags = 0; 311 catalog[0].measure[Nmeas].dt = stars[N].dt; 312 catalog[0].measure[Nmeas].airmass = stars[N].airmass; 313 314 catalog[0].measure[Nmeas].photFlags = stars[N].flags; 315 catalog[0].measure[Nmeas].qPSF = stars[N].psfQual; 316 catalog[0].measure[Nmeas].psfChisq = stars[N].psfChisq; 317 catalog[0].measure[Nmeas].crNsigma = stars[N].crNsigma; 318 catalog[0].measure[Nmeas].extNsigma = stars[N].extNsigma; 319 catalog[0].measure[Nmeas].Sky = stars[N].sky; 320 catalog[0].measure[Nmeas].dSky = stars[N].dsky; 321 322 catalog[0].measure[Nmeas].stargal = 0; // XXX not yet set 323 324 catalog[0].measure[Nmeas].detID = stars[N].detID; 325 catalog[0].measure[Nmeas].imageID = stars[N].imageID; 326 327 catalog[0].measure[Nmeas].dXccd = stars[N].dX; 328 catalog[0].measure[Nmeas].dYccd = stars[N].dY; 329 330 catalog[0].measure[Nmeas].Map = stars[N].Map; 331 catalog[0].measure[Nmeas].FWx = 100*stars[N].fx; 332 catalog[0].measure[Nmeas].FWy = 100*stars[N].fy; 333 catalog[0].measure[Nmeas].theta = (0xffff/360.0)*stars[N].df; 334 /* XXX replace df here with theta, right? */ 292 catalog[0].measure[Nmeas].averef = Nave; // XXX EAM : must be absolute Nave if partial read 293 catalog[0].measure[Nmeas].objID = catalog[0].average[Nave].objID; 294 catalog[0].measure[Nmeas].catID = catalog[0].catID; 335 295 336 296 /* set the average magnitude if not already set and the photcode.equiv is not 0 */ -
trunk/Ohana/src/addstar/src/find_matches_closest.c
r20936 r21508 7 7 double *X1, *Y1, *X2, *Y2; 8 8 double dX, dY, dR; 9 int *N1, *N2, *next_meas , *next_miss;10 int Nave, NAVE, Nmeas, NMEAS, Nm iss, NMISS, Nmatch;9 int *N1, *N2, *next_meas; 10 int Nave, NAVE, Nmeas, NMEAS, Nmatch; 11 11 int Nsecfilt, Nsec; 12 12 unsigned int objID, catID; … … 37 37 Nmatch = 0; 38 38 NMEAS = Nmeas = catalog[0].Nmeasure; 39 NMISS = Nmiss = catalog[0].Nmissing;40 39 41 40 // current max obj ID for this catalog … … 66 65 Nstars = 0; 67 66 for (i = 0; i < NstarsIn; i++) { 68 status = RD_to_XY (&X1[Nstars], &Y1[Nstars], stars[i]. R, stars[i].D, &tcoords);67 status = RD_to_XY (&X1[Nstars], &Y1[Nstars], stars[i].average.R, stars[i].average.D, &tcoords); 69 68 if (!status) continue; 70 69 N1[Nstars] = i; … … 92 91 if (Nave > 1) sort_coords_index (X2, Y2, N2, Nave); 93 92 94 /* set up pointers for linked list of measure , missing*/93 /* set up pointers for linked list of measure */ 95 94 if (catalog[0].sorted && (catalog[0].Nmeasure == catalog[0].Nmeas_disk)) { 96 95 // this version is only valid if we have done a full catalog load, and if the catalog … … 100 99 next_meas = build_measure_links (catalog[0].average, Nave, catalog[0].measure, Nmeas); 101 100 } 102 next_miss = init_missing_links (catalog[0].average, Nave, catalog[0].missing, Nmiss);103 /* missing MUST be written 'sorted', or not at all */104 101 105 102 /* choose a radius for matches */ … … 167 164 168 165 /** add measurements for this star **/ 166 167 // set the new measurements 168 catalog[0].measure[Nmeas] = stars[N].measure; 169 169 170 /** dR,dD now represent arcsec **/ 170 catalog[0].measure[Nmeas].dR = 3600.0*(catalog[0].average[n].R - stars[N].R); 171 catalog[0].measure[Nmeas].dR = 3600.0*(catalog[0].average[n].R - stars[N].average.R); 172 catalog[0].measure[Nmeas].dD = 3600.0*(catalog[0].average[n].D - stars[N].average.D); 173 catalog[0].measure[Nmeas].dbFlags = 0; 174 catalog[0].measure[Nmeas].averef = n; 175 catalog[0].measure[Nmeas].objID = catalog[0].average[n].objID; 176 catalog[0].measure[Nmeas].catID = catalog[0].catID; 177 178 // rationalize dR 171 179 if (catalog[0].measure[Nmeas].dR > +180.0*3600.0) { 172 180 // average on high end of boundary, move star up 173 stars[N]. R += 360.0;174 catalog[0].measure[Nmeas].dR = 3600.0*(catalog[0].average[n].R - stars[N]. R);181 stars[N].average.R += 360.0; 182 catalog[0].measure[Nmeas].dR = 3600.0*(catalog[0].average[n].R - stars[N].average.R); 175 183 } 176 184 if (catalog[0].measure[Nmeas].dR < -180.0*3600.0) { 177 185 // average on low end of boundary, move star down 178 stars[N]. R -= 360.0;179 catalog[0].measure[Nmeas].dR = 3600.0*(catalog[0].average[n].R - stars[N]. R);186 stars[N].average.R -= 360.0; 187 catalog[0].measure[Nmeas].dR = 3600.0*(catalog[0].average[n].R - stars[N].average.R); 180 188 } 181 189 if (fabs(catalog[0].measure[Nmeas].dR) > 10*RADIUS) { 182 190 fprintf (stderr, "error: %10.6f,%10.6f vs %10.6f,%10.6f (%f,%f vs %f,%f)\n", 183 191 catalog[0].average[n].R, catalog[0].average[n].D, 184 stars[N]. R, stars[N].D,192 stars[N].average.R, stars[N].average.D, 185 193 X1[i], X2[Jmin], 186 194 Y1[i], Y2[Jmin]); 187 195 } 188 catalog[0].measure[Nmeas].dD = 3600.0*(catalog[0].average[n].D - stars[N].D); 189 190 /* XXX need to add dX, dY : need to load into stars[N].dX,dY */ 191 /* XXX need to add stargal, Sky, dSky, qPSF, detID, imageID */ 192 catalog[0].measure[Nmeas].Xccd = stars[N].X; 193 catalog[0].measure[Nmeas].Yccd = stars[N].Y; 194 195 catalog[0].measure[Nmeas].M = stars[N].M; 196 catalog[0].measure[Nmeas].dM = stars[N].dM; /* error in input files stored in thousandths of mag */ 197 catalog[0].measure[Nmeas].Mcal = stars[N].Mcal; 198 catalog[0].measure[Nmeas].t = stars[N].t; 199 catalog[0].measure[Nmeas].averef = n; 200 catalog[0].measure[Nmeas].photcode = stars[N].code; /* photcode */ 201 catalog[0].measure[Nmeas].dophot = stars[N].dophot; 202 catalog[0].measure[Nmeas].dbFlags = 0; 203 catalog[0].measure[Nmeas].dt = stars[N].dt; 204 catalog[0].measure[Nmeas].airmass = stars[N].airmass; 205 206 catalog[0].measure[Nmeas].photFlags = stars[N].flags; 207 catalog[0].measure[Nmeas].qPSF = stars[N].psfQual; 208 catalog[0].measure[Nmeas].psfChisq = stars[N].psfChisq; 209 catalog[0].measure[Nmeas].crNsigma = stars[N].crNsigma; 210 catalog[0].measure[Nmeas].extNsigma = stars[N].extNsigma; 211 catalog[0].measure[Nmeas].Sky = stars[N].sky; 212 catalog[0].measure[Nmeas].dSky = stars[N].dsky; 213 214 catalog[0].measure[Nmeas].stargal = 0; 215 216 catalog[0].measure[Nmeas].detID = stars[N].detID; 217 catalog[0].measure[Nmeas].imageID = stars[N].imageID; 218 219 catalog[0].measure[Nmeas].dXccd = stars[N].dX; 220 catalog[0].measure[Nmeas].dYccd = stars[N].dY; 221 222 catalog[0].measure[Nmeas].Map = stars[N].Map; 223 224 // XXX saturate range for FWx, FWy, theta 225 // XXX convert to unsigned int for these... 226 catalog[0].measure[Nmeas].FWx = 100*stars[N].fx; 227 catalog[0].measure[Nmeas].FWy = 100*stars[N].fy; 228 catalog[0].measure[Nmeas].theta = (0xffff/360.0)*stars[N].df; 229 196 197 198 /* adds the measurement to the calibration if appropriate color terms are found */ 199 /* we call this before (optionally) setting the average magnitude to avoid auto-correlations */ 200 if (options.calibrate) { 201 AddToCalibration (&catalog[0].average[n], &catalog[0].secfilt[n*Nsecfilt], catalog[0].measure, &catalog[0].measure[Nmeas], next_meas, N); 202 } 203 230 204 /* set the average magnitude if not already set and the photcode.equiv is not 0 */ 231 205 /* in UPDATE mode, this value is not saved; use relphot to recalculate */ … … 234 208 catalog[0].secfilt[n*Nsecfilt+Nsec].M = PhotCat (&catalog[0].measure[Nmeas]); 235 209 } 236 }237 238 /* adds the measurement to the calibration if appropriate color terms are found */239 if (options.calibrate) {240 AddToCalibration (&catalog[0].average[n], &catalog[0].secfilt[n*Nsecfilt], catalog[0].measure, &catalog[0].measure[Nmeas], next_meas, N);241 210 } 242 211 … … 270 239 N = N1[i]; 271 240 if (stars[N].found >= 0) continue; 272 if (!IN_REGION (stars[N].R, stars[N].D)) continue; 273 274 catalog[0].average[Nave].R = stars[N].R; 275 catalog[0].average[Nave].D = stars[N].D; 276 catalog[0].average[Nave].Xp = 0; 241 if (!IN_REGION (stars[N].average.R, stars[N].average.D)) continue; 242 243 catalog[0].average[Nave].R = stars[N].average.R; 244 catalog[0].average[Nave].D = stars[N].average.D; 245 catalog[0].average[Nave].dR = 0; 246 catalog[0].average[Nave].dD = 0; 247 277 248 catalog[0].average[Nave].Nmeasure = 1; 278 249 catalog[0].average[Nave].Nmissing = 0; 250 catalog[0].average[Nave].Nextend = 0; 251 279 252 catalog[0].average[Nave].measureOffset = Nmeas; 280 253 catalog[0].average[Nave].missingOffset = -1; 281 catalog[0].average[Nave].code = 0; 282 283 catalog[0].average[Nave].dR = 0; 284 catalog[0].average[Nave].dD = 0; 285 catalog[0].average[Nave].uR = 0; 286 catalog[0].average[Nave].uD = 0; 287 catalog[0].average[Nave].duR = 0; 288 catalog[0].average[Nave].duD = 0; 289 catalog[0].average[Nave].P = 0; 290 catalog[0].average[Nave].dP = 0; 291 292 catalog[0].average[Nave].objID = objID; 293 catalog[0].average[Nave].catID = catID; 254 catalog[0].average[Nave].extendOffset = -1; 255 256 catalog[0].average[Nave].uR = 0; 257 catalog[0].average[Nave].uD = 0; 258 catalog[0].average[Nave].duR = 0; 259 catalog[0].average[Nave].duD = 0; 260 catalog[0].average[Nave].P = 0; 261 catalog[0].average[Nave].dP = 0; 262 263 catalog[0].average[Nave].Xp = 0; 264 catalog[0].average[Nave].ChiSq = 0.0; 265 catalog[0].average[Nave].Npos = 0; 266 267 catalog[0].average[Nave].objID = objID; 268 catalog[0].average[Nave].catID = catID; 269 catalog[0].average[Nave].flags = 0; 270 294 271 objID ++; 295 272 … … 298 275 catalog[0].secfilt[Nave*Nsecfilt+j].dM = NAN; 299 276 catalog[0].secfilt[Nave*Nsecfilt+j].Xm = NAN_S_SHORT; 300 } 301 302 catalog[0].measure[Nmeas].Xccd = stars[N].X; 303 catalog[0].measure[Nmeas].Yccd = stars[N].Y; 304 277 catalog[0].secfilt[Nave*Nsecfilt+j].M_20 = NAN_S_SHORT; 278 catalog[0].secfilt[Nave*Nsecfilt+j].M_80 = NAN_S_SHORT; 279 catalog[0].secfilt[Nave*Nsecfilt+j].Ncode = 0; 280 catalog[0].secfilt[Nave*Nsecfilt+j].Nused = 0; 281 } 282 283 // supply the measurments from this detection 284 catalog[0].measure[Nmeas] = stars[N].measure; 285 286 // the following measure elements cannot be set until here: 305 287 catalog[0].measure[Nmeas].dR = 0.0; 306 288 catalog[0].measure[Nmeas].dD = 0.0; 307 catalog[0].measure[Nmeas].M = stars[N].M; 308 catalog[0].measure[Nmeas].dM = stars[N].dM; 309 catalog[0].measure[Nmeas].Mcal = stars[N].Mcal; 310 catalog[0].measure[Nmeas].t = stars[N].t; 289 catalog[0].measure[Nmeas].dbFlags = 0; 311 290 catalog[0].measure[Nmeas].averef = Nave; 312 catalog[0].measure[Nmeas].photcode = stars[N].code; /* photcode */ 313 catalog[0].measure[Nmeas].dophot = stars[N].dophot; 314 catalog[0].measure[Nmeas].dbFlags = 0; 315 catalog[0].measure[Nmeas].dt = stars[N].dt; 316 catalog[0].measure[Nmeas].airmass = stars[N].airmass; 317 318 catalog[0].measure[Nmeas].photFlags = stars[N].flags; 319 catalog[0].measure[Nmeas].qPSF = stars[N].psfQual; 320 catalog[0].measure[Nmeas].psfChisq = stars[N].psfChisq; 321 catalog[0].measure[Nmeas].crNsigma = stars[N].crNsigma; 322 catalog[0].measure[Nmeas].extNsigma = stars[N].extNsigma; 323 catalog[0].measure[Nmeas].Sky = stars[N].sky; 324 catalog[0].measure[Nmeas].dSky = stars[N].dsky; 325 326 catalog[0].measure[Nmeas].stargal = 0; 327 328 catalog[0].measure[Nmeas].detID = stars[N].detID; 329 catalog[0].measure[Nmeas].imageID = stars[N].imageID; 330 331 catalog[0].measure[Nmeas].dXccd = stars[N].dX; 332 catalog[0].measure[Nmeas].dYccd = stars[N].dY; 333 334 catalog[0].measure[Nmeas].Map = stars[N].Map; 335 catalog[0].measure[Nmeas].FWx = 100*stars[N].fx; 336 catalog[0].measure[Nmeas].FWy = 100*stars[N].fy; 337 catalog[0].measure[Nmeas].theta = (0xffff/360.0)*stars[N].df; 291 catalog[0].measure[Nmeas].objID = catalog[0].average[Nave].objID; 292 catalog[0].measure[Nmeas].catID = catalog[0].catID; 338 293 339 294 /* set the average magnitude if not already set and the photcode.equiv is not 0 */ -
trunk/Ohana/src/addstar/src/find_matches_refstars.c
r18374 r21508 69 69 70 70 for (i = 0; i < Nstars; i++) { 71 RD_to_XY (&X1[i], &Y1[i], stars[i][0]. R, stars[i][0].D, &tcoords);71 RD_to_XY (&X1[i], &Y1[i], stars[i][0].average.R, stars[i][0].average.D, &tcoords); 72 72 N1[i] = i; 73 73 } … … 134 134 /* find last measurement of this star */ 135 135 for (k = 0; k < catalog[0].average[n].Nmeasure - 1; k++) m = next[m]; 136 136 137 /* set up references */ 137 138 next[Nmeas] = next[m]; 138 139 next[m] = Nmeas; 140 139 141 /* last just was moved */ 140 142 if (next[Nmeas] == -1) last = Nmeas; 141 143 142 144 /** add measurements for this star **/ 145 146 // set the new measurements 147 catalog[0].measure[Nmeas] = stars[N][0].measure; 148 143 149 /** *** dR,dD now in arcsec *** **/ 144 catalog[0].measure[Nmeas].dR = 3600.0*(catalog[0].average[n].R - stars[N][0].R); 145 catalog[0].measure[Nmeas].dD = 3600.0*(catalog[0].average[n].D - stars[N][0].D); 146 catalog[0].measure[Nmeas].M = stars[N][0].M; 147 catalog[0].measure[Nmeas].dM = stars[N][0].dM; 148 catalog[0].measure[Nmeas].Mcal = 0; 149 catalog[0].measure[Nmeas].t = (TIMEREF == 0) ? stars[N][0].t : TIMEREF; /** careful : time_t vs e_time **/ 150 catalog[0].measure[Nmeas].dR = 3600.0*(catalog[0].average[n].R - stars[N][0].average.R); 151 catalog[0].measure[Nmeas].dD = 3600.0*(catalog[0].average[n].D - stars[N][0].average.D); 152 153 // rationalize dR: 154 if (catalog[0].measure[Nmeas].dR > +180.0*3600.0) { 155 // average on high end of boundary, move star up 156 stars[N][0].average.R += 360.0; 157 catalog[0].measure[Nmeas].dR = 3600.0*(catalog[0].average[n].R - stars[N][0].average.R); 158 } 159 if (catalog[0].measure[Nmeas].dR < -180.0*3600.0) { 160 // average on low end of boundary, move star down 161 stars[N][0].average.R -= 360.0; 162 catalog[0].measure[Nmeas].dR = 3600.0*(catalog[0].average[n].R - stars[N][0].average.R); 163 } 164 150 165 catalog[0].measure[Nmeas].averef = n; 151 catalog[0].measure[Nmeas].photcode = stars[N][0].code;152 catalog[0].measure[Nmeas].dophot = 0;153 166 catalog[0].measure[Nmeas].dbFlags = 0; 154 catalog[0].measure[Nmeas].dt = 0xffff; 155 156 catalog[0].measure[Nmeas].Map = NAN; 157 catalog[0].measure[Nmeas].airmass = 0; 158 catalog[0].measure[Nmeas].FWx = stars[N][0].fx; // XXX make sure these are zero'ed as needed 159 catalog[0].measure[Nmeas].FWy = stars[N][0].fy; // XXX make sure these are zero'ed as needed 160 catalog[0].measure[Nmeas].theta = stars[N][0].df; // XXX make sure these are zero'ed as needed 161 162 catalog[0].measure[Nmeas].photFlags = stars[N][0].flags; // XXX make sure these are zero'ed as needed 163 catalog[0].measure[Nmeas].qPSF = 0; 164 catalog[0].measure[Nmeas].psfChisq = 0; 165 catalog[0].measure[Nmeas].crNsigma = 0; 166 catalog[0].measure[Nmeas].extNsigma = 0; 167 catalog[0].measure[Nmeas].Sky = 0; 168 catalog[0].measure[Nmeas].dSky = 0; 169 170 catalog[0].measure[Nmeas].stargal = 0; // XXX not yet set 171 172 catalog[0].measure[Nmeas].detID = 0; 173 catalog[0].measure[Nmeas].imageID = 0; 174 175 catalog[0].measure[Nmeas].dXccd = 0; 176 catalog[0].measure[Nmeas].dYccd = 0; 177 178 catalog[0].measure[Nmeas].Xccd = stars[N][0].X; // XXX make sure these are zero'ed as needed 179 catalog[0].measure[Nmeas].Yccd = stars[N][0].Y; // XXX make sure these are zero'ed as needed 167 catalog[0].measure[Nmeas].objID = catalog[0].average[n].objID; 168 catalog[0].measure[Nmeas].catID = catalog[0].catID; 169 170 catalog[0].measure[Nmeas].t = (TIMEREF == 0) ? stars[N][0].measure.t : TIMEREF; /** careful : time_t vs e_time **/ 171 catalog[0].measure[Nmeas].t_msec = (TIMEREF == 0) ? stars[N][0].measure.t_msec : TIMEREF; /** careful : time_t vs e_time **/ 180 172 181 173 if (ACCEPT_MOTION) { 182 catalog[0].average[n].uR = stars[N][0]. uR;183 catalog[0].average[n].uD = stars[N][0]. uD;184 catalog[0].average[n].duR = stars[N][0]. duR;185 catalog[0].average[n].duD = stars[N][0]. duD;186 catalog[0].average[n].P = stars[N][0]. P;187 catalog[0].average[n].dP = stars[N][0]. dP;174 catalog[0].average[n].uR = stars[N][0].average.uR; 175 catalog[0].average[n].uD = stars[N][0].average.uD; 176 catalog[0].average[n].duR = stars[N][0].average.duR; 177 catalog[0].average[n].duD = stars[N][0].average.duD; 178 catalog[0].average[n].P = stars[N][0].average.P; 179 catalog[0].average[n].dP = stars[N][0].average.dP; 188 180 } 189 181 … … 233 225 for (i = 0; (i < Nstars) && !options.only_match; i+=NREFSTAR_GROUP) { 234 226 N = N1[i]; 235 if (stars[N][0].found > = 0) continue;236 237 catalog[0].average[Nave].R = stars[N][0]. R;238 catalog[0].average[Nave].D = stars[N][0]. D;239 catalog[0].average[Nave].Xp = 0; 227 if (stars[N][0].found > -1) continue; 228 229 catalog[0].average[Nave].R = stars[N][0].average.R; 230 catalog[0].average[Nave].D = stars[N][0].average.D; 231 240 232 catalog[0].average[Nave].Nmeasure = NREFSTAR_GROUP; 241 233 catalog[0].average[Nave].Nmissing = 0; 234 catalog[0].average[Nave].Nextend = 0; 235 242 236 catalog[0].average[Nave].measureOffset = Nmeas; 243 237 catalog[0].average[Nave].missingOffset = -1; 244 catalog[0].average[Nave]. code = 0;238 catalog[0].average[Nave].extendOffset = -1; 245 239 246 240 if (ACCEPT_MOTION) { 247 catalog[0].average[Nave].dR = stars[N][0].dR;248 catalog[0].average[Nave].dD = stars[N][0].dD;249 catalog[0].average[Nave].uR = stars[N][0].uR;250 catalog[0].average[Nave].uD = stars[N][0].uD;251 catalog[0].average[Nave].duR = stars[N][0].duR;252 catalog[0].average[Nave].duD = stars[N][0].duD;253 catalog[0].average[Nave].P = stars[N][0].P;254 catalog[0].average[Nave].dP = stars[N][0].dP;241 catalog[0].average[Nave].dR = stars[N][0].average.dR; 242 catalog[0].average[Nave].dD = stars[N][0].average.dD; 243 catalog[0].average[Nave].uR = stars[N][0].average.uR; 244 catalog[0].average[Nave].uD = stars[N][0].average.uD; 245 catalog[0].average[Nave].duR = stars[N][0].average.duR; 246 catalog[0].average[Nave].duD = stars[N][0].average.duD; 247 catalog[0].average[Nave].P = stars[N][0].average.P; 248 catalog[0].average[Nave].dP = stars[N][0].average.dP; 255 249 } else { 256 catalog[0].average[Nave].dR = 0; 257 catalog[0].average[Nave].dD = 0; 258 catalog[0].average[Nave].uR = 0; 259 catalog[0].average[Nave].uD = 0; 260 catalog[0].average[Nave].duR = 0; 261 catalog[0].average[Nave].duD = 0; 262 catalog[0].average[Nave].P = 0; 263 catalog[0].average[Nave].dP = 0; 264 } 265 266 catalog[0].average[Nave].objID = objID; 267 catalog[0].average[Nave].catID = catID; 250 catalog[0].average[Nave].dR = 0; 251 catalog[0].average[Nave].dD = 0; 252 catalog[0].average[Nave].uR = 0; 253 catalog[0].average[Nave].uD = 0; 254 catalog[0].average[Nave].duR = 0; 255 catalog[0].average[Nave].duD = 0; 256 catalog[0].average[Nave].P = 0; 257 catalog[0].average[Nave].dP = 0; 258 catalog[0].average[Nave].Xp = 0; 259 } 260 261 catalog[0].average[Nave].Xp = 0; 262 catalog[0].average[Nave].ChiSq = 0.0; 263 catalog[0].average[Nave].Npos = 0; 264 265 catalog[0].average[Nave].objID = objID; 266 catalog[0].average[Nave].catID = catID; 267 catalog[0].average[Nave].flags = 0; 268 268 269 objID ++; 269 270 270 271 for (j = 0; j < Nsecfilt; j++) { 271 catalog[0].secfilt[Nave*Nsecfilt+j].M = NAN; 272 catalog[0].secfilt[Nave*Nsecfilt+j].dM = NAN; 273 catalog[0].secfilt[Nave*Nsecfilt+j].Xm = NAN_S_SHORT; 272 catalog[0].secfilt[Nave*Nsecfilt+j].M = NAN; 273 catalog[0].secfilt[Nave*Nsecfilt+j].dM = NAN; 274 catalog[0].secfilt[Nave*Nsecfilt+j].Xm = NAN_S_SHORT; 275 catalog[0].secfilt[Nave*Nsecfilt+j].M_20 = NAN_S_SHORT; 276 catalog[0].secfilt[Nave*Nsecfilt+j].M_80 = NAN_S_SHORT; 277 catalog[0].secfilt[Nave*Nsecfilt+j].Ncode = 0; 278 catalog[0].secfilt[Nave*Nsecfilt+j].Nused = 0; 274 279 } 275 280 276 281 for (j = 0; j < NREFSTAR_GROUP; j++) { 277 282 N = N1[i + j]; 283 284 catalog[0].measure[Nmeas] = stars[N][0].measure; 285 278 286 catalog[0].measure[Nmeas].dR = 0.0; 279 287 catalog[0].measure[Nmeas].dD = 0.0; 280 catalog[0].measure[Nmeas].M = stars[N][0].M; 281 catalog[0].measure[Nmeas]. dM = stars[N][0].dM;282 catalog[0].measure[Nmeas]. Mcal = 0;283 catalog[0].measure[Nmeas]. t = (stars[N][0].t == 0) ? TIMEREF : stars[N][0].t; /** careful : time_t vs e_time **/288 289 catalog[0].measure[Nmeas].t = (stars[N][0].measure.t == 0) ? TIMEREF : stars[N][0].measure.t; /** careful : time_t vs e_time **/ 290 catalog[0].measure[Nmeas].t_msec = (stars[N][0].measure.t == 0) ? 0 : stars[N][0].measure.t_msec; /** careful : time_t vs e_time **/ 291 catalog[0].measure[Nmeas].dbFlags = 0; 284 292 catalog[0].measure[Nmeas].averef = Nave; 285 catalog[0].measure[Nmeas].photcode = stars[N][0].code; 286 catalog[0].measure[Nmeas].dophot = 0; 287 catalog[0].measure[Nmeas].dbFlags = 0; 288 catalog[0].measure[Nmeas].dt = 0xffff; 289 290 catalog[0].measure[Nmeas].photFlags = stars[N][0].flags; // XXX make sure these are zero'ed as needed 291 catalog[0].measure[Nmeas].qPSF = 0; 292 catalog[0].measure[Nmeas].psfChisq = 0; 293 catalog[0].measure[Nmeas].crNsigma = 0; 294 catalog[0].measure[Nmeas].extNsigma = 0; 295 catalog[0].measure[Nmeas].Sky = 0; 296 catalog[0].measure[Nmeas].dSky = 0; 297 298 catalog[0].measure[Nmeas].stargal = 0; // XXX not yet set 299 300 catalog[0].measure[Nmeas].detID = 0; 301 catalog[0].measure[Nmeas].imageID = 0; 302 303 catalog[0].measure[Nmeas].dXccd = 0; 304 catalog[0].measure[Nmeas].dYccd = 0; 305 306 catalog[0].measure[Nmeas].Xccd = stars[N][0].X; // XXX make sure these are zero'ed as needed 307 catalog[0].measure[Nmeas].Yccd = stars[N][0].Y; // XXX make sure these are zero'ed as needed 308 309 catalog[0].measure[Nmeas].airmass = 0; 310 catalog[0].measure[Nmeas].Map = NAN; 311 catalog[0].measure[Nmeas].FWx = stars[N][0].fx; // XXX make sure these are zero'ed as needed 312 catalog[0].measure[Nmeas].FWy = stars[N][0].fy; // XXX make sure these are zero'ed as needed 313 catalog[0].measure[Nmeas].theta = stars[N][0].df; // XXX make sure these are zero'ed as needed 314 315 catalog[0].measure[Nmeas].Xccd = 0.0; 316 catalog[0].measure[Nmeas].Yccd = 0.0; 293 catalog[0].measure[Nmeas].objID = catalog[0].average[Nave].objID; 294 catalog[0].measure[Nmeas].catID = catalog[0].catID; 317 295 318 296 stars[N][0].found = Nmeas; -
trunk/Ohana/src/addstar/src/find_subset.c
r5443 r21508 20 20 /* find stars within ra,dec region */ 21 21 for (i = N = 0; i < Nstars; i++) { 22 if (stars[i]. R < RA0) continue;23 if (stars[i]. R >= RA1) continue;24 if (stars[i]. D < DEC0) continue;25 if (stars[i]. D >= DEC1) continue;22 if (stars[i].average.R < RA0) continue; 23 if (stars[i].average.R >= RA1) continue; 24 if (stars[i].average.D < DEC0) continue; 25 if (stars[i].average.D >= DEC1) continue; 26 26 27 27 subset[N] = &stars[i]; -
trunk/Ohana/src/addstar/src/get2mass_dr2.c
r16810 r21508 68 68 dparse (&J, 1, &buffer[NBYTE*i + 53]); 69 69 dparse (&dJ, 2, &buffer[NBYTE*i + 53]); 70 stars[Nstars].M = J;71 stars[Nstars].dM = dJ;72 stars[Nstars]. code = TM_J;70 stars[Nstars].M = J; 71 stars[Nstars].dM = dJ; 72 stars[Nstars].photcode = TM_J; 73 73 } 74 74 if (photcode == TM_H) { 75 75 dparse (&H, 1, &buffer[NBYTE*i + 72]); 76 76 dparse (&dH, 2, &buffer[NBYTE*i + 72]); 77 stars[Nstars].M = H;78 stars[Nstars].dM = dH;79 stars[Nstars]. code = TM_H;77 stars[Nstars].M = H; 78 stars[Nstars].dM = dH; 79 stars[Nstars].photcode = TM_H; 80 80 } 81 81 if (photcode == TM_K) { 82 82 dparse (&K, 1, &buffer[NBYTE*i + 91]); 83 83 dparse (&dK, 2, &buffer[NBYTE*i + 91]); 84 stars[Nstars].M = K;85 stars[Nstars].dM = dK;86 stars[Nstars]. code = TM_K;84 stars[Nstars].M = K; 85 stars[Nstars].dM = dK; 86 stars[Nstars].photcode = TM_K; 87 87 } 88 88 Nstars ++; -
trunk/Ohana/src/addstar/src/get2mass_full.c
r17439 r21508 15 15 ptr = next2MASSfield (ptr); // dec (assumed to be already set) 16 16 ptr = next2MASSfield (ptr); // err_maj 17 star[0][0]. fx = strtod (ptr, NULL);17 star[0][0].measure.FWx = ShortPixels(strtod (ptr, NULL)); 18 18 ptr = next2MASSfield (ptr); // err_min 19 star[0][0]. fy = strtod (ptr, NULL);19 star[0][0].measure.FWy = ShortPixels(strtod (ptr, NULL)); 20 20 ptr = next2MASSfield (ptr); // err_ang 21 star[0][0]. df = strtod (ptr, NULL);22 23 star[2][0]. fx = star[2][0].fx = star[0][0].fx;24 star[2][0]. fy = star[2][0].fy = star[0][0].fy;25 star[2][0]. df = star[2][0].df = star[0][0].df;21 star[0][0].measure.theta = ShortPixels(strtod (ptr, NULL)); 22 23 star[2][0].measure.FWx = star[2][0].measure.FWx = star[0][0].measure.FWx; 24 star[2][0].measure.FWy = star[2][0].measure.FWy = star[0][0].measure.FWy; 25 star[2][0].measure.theta = star[2][0].measure.theta = star[0][0].measure.theta; 26 26 27 27 ptr = next2MASSfield (ptr); // designation (skip) 28 28 29 29 ptr = next2MASSfield (ptr); // j_m 30 star[0][0]. M = strtod (ptr, NULL);30 star[0][0].measure.M = strtod (ptr, NULL); 31 31 ptr = next2MASSfield (ptr); // j_cmsig 32 star[0][0]. dM = strtod (ptr, NULL);32 star[0][0].measure.dM = strtod (ptr, NULL); 33 33 ptr = next2MASSfield (ptr); // j_msigcom 34 34 dMfull = strtod (ptr, NULL); 35 star[0][0]. dMcal = sqrt (SQ(dMfull) - SQ(star[0][0].dM));35 star[0][0].measure.dMcal = sqrt (SQ(dMfull) - SQ(star[0][0].measure.dM)); 36 36 ptr = next2MASSfield (ptr); // j_snr (skip) 37 37 38 38 ptr = next2MASSfield (ptr); // h_m 39 star[1][0]. M = strtod (ptr, NULL);39 star[1][0].measure.M = strtod (ptr, NULL); 40 40 ptr = next2MASSfield (ptr); // h_cmsig 41 star[1][0]. dM = strtod (ptr, NULL);41 star[1][0].measure.dM = strtod (ptr, NULL); 42 42 ptr = next2MASSfield (ptr); // h_msigcom 43 43 dMfull = strtod (ptr, NULL); 44 star[1][0]. dMcal = sqrt (SQ(dMfull) - SQ(star[1][0].dM));44 star[1][0].measure.dMcal = sqrt (SQ(dMfull) - SQ(star[1][0].measure.dM)); 45 45 ptr = next2MASSfield (ptr); // h_snr (skip) 46 46 47 47 ptr = next2MASSfield (ptr); // k_m 48 star[2][0]. M = strtod (ptr, NULL);48 star[2][0].measure.M = strtod (ptr, NULL); 49 49 ptr = next2MASSfield (ptr); // k_cmsig 50 star[2][0]. dM = strtod (ptr, NULL);50 star[2][0].measure.dM = strtod (ptr, NULL); 51 51 ptr = next2MASSfield (ptr); // k_msigcom 52 52 dMfull = strtod (ptr, NULL); 53 star[2][0]. dMcal = sqrt (SQ(dMfull) - SQ(star[2][0].dM));53 star[2][0].measure.dMcal = sqrt (SQ(dMfull) - SQ(star[2][0].measure.dM)); 54 54 ptr = next2MASSfield (ptr); // k_snr (skip) 55 55 56 star[2][0]. flags = star[1][0].flags = star[0][0].flags = 0;56 star[2][0].measure.photFlags = star[1][0].measure.photFlags = star[0][0].measure.photFlags = 0; 57 57 58 58 ptr = next2MASSfield (ptr); // ph_qual … … 99 99 100 100 ptr = next2MASSfield (ptr); // x_scan 101 star[0][0]. X= strtod (ptr, NULL);102 star[2][0]. X = star[1][0].X = star[0][0].X;101 star[0][0].measure.Xccd = strtod (ptr, NULL); 102 star[2][0].measure.Xccd = star[1][0].measure.Xccd = star[0][0].measure.Xccd; 103 103 104 104 ptr = next2MASSfield (ptr); // jdate (julian date) 105 105 jd = strtod (ptr, NULL); 106 star[0][0]. t = ohana_jd_to_sec (jd);107 star[2][0]. t = star[1][0].t = star[0][0].t;106 star[0][0].measure.t = ohana_jd_to_sec (jd); 107 star[2][0].measure.t = star[1][0].measure.t = star[0][0].measure.t; 108 108 109 109 ptr = next2MASSfield (ptr); // j_psfchi 110 star[0][0]. psfChisq = strtod (ptr, NULL);110 star[0][0].measure.psfChisq = strtod (ptr, NULL); 111 111 ptr = next2MASSfield (ptr); // h_psfchi 112 star[1][0]. psfChisq = strtod (ptr, NULL);112 star[1][0].measure.psfChisq = strtod (ptr, NULL); 113 113 ptr = next2MASSfield (ptr); // k_psfchi 114 star[2][0]. psfChisq = strtod (ptr, NULL);114 star[2][0].measure.psfChisq = strtod (ptr, NULL); 115 115 116 116 ptr = next2MASSfield (ptr); // j_m_stdap 117 star[0][0]. Map = strtod (ptr, NULL);117 star[0][0].measure.Map = strtod (ptr, NULL); 118 118 ptr = next2MASSfield (ptr); // j_msig_stdap (skip?) 119 119 120 120 ptr = next2MASSfield (ptr); // h_m_stdap 121 star[1][0]. Map = strtod (ptr, NULL);121 star[1][0].measure.Map = strtod (ptr, NULL); 122 122 ptr = next2MASSfield (ptr); // h_msig_stdap (skip?) 123 123 124 124 ptr = next2MASSfield (ptr); // k_m_stdap 125 star[2][0]. Map = strtod (ptr, NULL);125 star[2][0].measure.Map = strtod (ptr, NULL); 126 126 ptr = next2MASSfield (ptr); // k_msig_stdap (skip?) 127 127 … … 140 140 set2MASS_use_flag (star[2], ptr[0]); 141 141 142 star[0][0].code = TM_J; 143 star[0][0].found = -1; 144 star[0][0].detID = 0; 145 star[0][0].imageID = 0; 146 147 star[1][0].code = TM_H; 148 star[1][0].found = -1; 149 star[1][0].detID = 0; 150 star[1][0].imageID = 0; 151 152 star[2][0].code = TM_K; 153 star[2][0].found = -1; 154 star[2][0].detID = 0; 155 star[2][0].imageID = 0; 142 star[0][0].measure.photcode = TM_J; 143 star[0][0].measure.detID = 0; 144 star[0][0].measure.imageID = 0; 145 146 star[1][0].measure.photcode = TM_H; 147 star[1][0].measure.detID = 0; 148 star[1][0].measure.imageID = 0; 149 150 star[2][0].measure.photcode = TM_K; 151 star[2][0].measure.detID = 0; 152 star[2][0].measure.imageID = 0; 156 153 157 154 return TRUE; … … 174 171 175 172 switch (qual) { 176 case 'X': star[0]. flags |= 0x0000; break;177 case 'U': star[0]. flags |= 0x0001; break;178 case 'F': star[0]. flags |= 0x0002; break;179 case 'E': star[0]. flags |= 0x0003; break;180 case 'A': star[0]. flags |= 0x0004; break;181 case 'B': star[0]. flags |= 0x0005; break;182 case 'C': star[0]. flags |= 0x0006; break;183 case 'D': star[0]. flags |= 0x0007; break;173 case 'X': star[0].measure.photFlags |= 0x0000; break; 174 case 'U': star[0].measure.photFlags |= 0x0001; break; 175 case 'F': star[0].measure.photFlags |= 0x0002; break; 176 case 'E': star[0].measure.photFlags |= 0x0003; break; 177 case 'A': star[0].measure.photFlags |= 0x0004; break; 178 case 'B': star[0].measure.photFlags |= 0x0005; break; 179 case 'C': star[0].measure.photFlags |= 0x0006; break; 180 case 'D': star[0].measure.photFlags |= 0x0007; break; 184 181 default: 185 182 fprintf (stderr, "error!\n"); … … 192 189 193 190 switch (qual) { 194 case '0': star[0]. flags |= 0x0000; break;195 case '1': star[0]. flags |= 0x0010; break;196 case '2': star[0]. flags |= 0x0020; break;197 case '3': star[0]. flags |= 0x0030; break;198 case '4': star[0]. flags |= 0x0040; break;199 case '6': star[0]. flags |= 0x0050; break;200 case '9': star[0]. flags |= 0x0060; break;191 case '0': star[0].measure.photFlags |= 0x0000; break; 192 case '1': star[0].measure.photFlags |= 0x0010; break; 193 case '2': star[0].measure.photFlags |= 0x0020; break; 194 case '3': star[0].measure.photFlags |= 0x0030; break; 195 case '4': star[0].measure.photFlags |= 0x0040; break; 196 case '6': star[0].measure.photFlags |= 0x0050; break; 197 case '9': star[0].measure.photFlags |= 0x0060; break; 201 198 default: 202 199 fprintf (stderr, "error!\n"); … … 209 206 210 207 switch (qual) { 211 case 'p': star[0]. flags |= 0x0000; break;212 case 'c': star[0]. flags |= 0x0100; break;213 case 'd': star[0]. flags |= 0x0200; break;214 case 's': star[0]. flags |= 0x0300; break;215 case 'b': star[0]. flags |= 0x0400; break;216 case '0': star[0]. flags |= 0x0500; break;208 case 'p': star[0].measure.photFlags |= 0x0000; break; 209 case 'c': star[0].measure.photFlags |= 0x0100; break; 210 case 'd': star[0].measure.photFlags |= 0x0200; break; 211 case 's': star[0].measure.photFlags |= 0x0300; break; 212 case 'b': star[0].measure.photFlags |= 0x0400; break; 213 case '0': star[0].measure.photFlags |= 0x0500; break; 217 214 default: 218 215 fprintf (stderr, "error!\n"); … … 225 222 226 223 switch (qual) { 227 case '0': star[0]. flags &= ~0x0008; break;228 case '1': star[0]. flags &= ~0x0008; break;229 default: star[0]. flags |= 0x0008; break;224 case '0': star[0].measure.photFlags &= ~0x0008; break; 225 case '1': star[0].measure.photFlags &= ~0x0008; break; 226 default: star[0].measure.photFlags |= 0x0008; break; 230 227 } 231 228 return (TRUE); … … 235 232 236 233 switch (qual) { 237 case '0': star[0]. flags &= ~0x0080; break;238 case '1': star[0]. flags &= ~0x0080; break;234 case '0': star[0].measure.photFlags &= ~0x0080; break; 235 case '1': star[0].measure.photFlags &= ~0x0080; break; 239 236 default: 240 star[0]. flags |= 0x0080;241 star[0]. extNsigma = 100.0;237 star[0].measure.photFlags |= 0x0080; 238 star[0].measure.extNsigma = 100.0; 242 239 break; 243 240 } … … 248 245 249 246 switch (qual) { 250 case '0': star[0]. flags &= ~0x0800; break;251 case '1': star[0]. flags &= ~0x0800; break;252 default: star[0]. flags |= 0x0800; break;247 case '0': star[0].measure.photFlags &= ~0x0800; break; 248 case '1': star[0].measure.photFlags &= ~0x0800; break; 249 default: star[0].measure.photFlags |= 0x0800; break; 253 250 } 254 251 return (TRUE); … … 258 255 259 256 switch (qual) { 260 case '0': star[0]. flags &= ~0x1000; break;261 case '1': star[0]. flags &= ~0x1000; break;262 default: star[0]. flags |= 0x1000; break;257 case '0': star[0].measure.photFlags &= ~0x1000; break; 258 case '1': star[0].measure.photFlags &= ~0x1000; break; 259 default: star[0].measure.photFlags |= 0x1000; break; 263 260 } 264 261 return (TRUE); … … 268 265 269 266 switch (qual) { 270 case '0': star[0]. flags &= ~0x2000; break;271 case '1': star[0]. flags |= 0x2000; break;267 case '0': star[0].measure.photFlags &= ~0x2000; break; 268 case '1': star[0].measure.photFlags |= 0x2000; break; 272 269 default: abort(); 273 270 } -
trunk/Ohana/src/addstar/src/get2mass_ops.c
r17196 r21508 42 42 double M, dM; 43 43 e_time time; 44 45 InitStar (star); 44 46 45 47 ptr = skipNbounds (line, '|', FilterSkip, Nmax); … … 57 59 } 58 60 59 star[0].M = M; 60 star[0].dM = dM; 61 star[0].code = Photcode; 62 star[0].t = time; 63 star[0].found = -1; 64 star[0].detID = 0; 65 star[0].imageID = 0; 61 star[0].measure.M = M; 62 star[0].measure.dM = dM; 63 star[0].measure.photcode = Photcode; 64 star[0].measure.t = time; 65 star[0].measure.detID = 0; 66 star[0].measure.imageID = 0; 66 67 67 68 return TRUE; … … 107 108 // how many bits are being used for the 2mass flags; can we just set photFlags based on them? 108 109 109 star[0].M = J; 110 star[0].dM = dJ; 111 star[0].code = TM_J; 112 star[0].t = time; 113 star[0].found = -1; 114 star[0].detID = 0; 115 star[0].imageID = 0; 116 117 star[1].M = H; 118 star[1].dM = dH; 119 star[1].code = TM_H; 120 star[1].t = time; 121 star[1].found = -1; 122 star[1].detID = 0; 123 star[1].imageID = 0; 124 125 star[2].M = K; 126 star[2].dM = dK; 127 star[2].code = TM_K; 128 star[2].t = time; 129 star[2].found = -1; 130 star[2].detID = 0; 131 star[2].imageID = 0; 110 star[0].measure.M = J; 111 star[0].measure.dM = dJ; 112 star[0].measure.photcode = TM_J; 113 star[0].measure.t = time; 114 star[0].measure.detID = 0; 115 star[0].measure.imageID = 0; 116 117 star[1].measure.M = H; 118 star[1].measure.dM = dH; 119 star[1].measure.photcode = TM_H; 120 star[1].measure.t = time; 121 star[1].measure.detID = 0; 122 star[1].measure.imageID = 0; 123 124 star[2].measure.M = K; 125 star[2].measure.dM = dK; 126 star[2].measure.photcode = TM_K; 127 star[2].measure.t = time; 128 star[2].measure.detID = 0; 129 star[2].measure.imageID = 0; 132 130 133 131 return TRUE; -
trunk/Ohana/src/addstar/src/getgsc.c
r17439 r21508 67 67 Nline = nbytes / BYTES_STAR; 68 68 for (i = 0; i < Nline; i++) { 69 70 InitStar (&stars[Nstars]); 71 69 72 Nbyte = i*BYTES_STAR; 70 dparse (&stars[Nstars].R, 1, &buffer[Nbyte]); 71 dparse (&stars[Nstars].D, 2, &buffer[Nbyte]); 72 if (stars[Nstars].R < UserPatch.Rmin) continue; 73 if (stars[Nstars].R > UserPatch.Rmax) continue; 74 if (stars[Nstars].D < UserPatch.Dmin) continue; 75 if (stars[Nstars].D > UserPatch.Dmax) continue; 73 dparse (&stars[Nstars].average.R, 1, &buffer[Nbyte]); 74 dparse (&stars[Nstars].average.D, 2, &buffer[Nbyte]); 76 75 77 dparse (&stars[Nstars].M, 3, &buffer[Nbyte]); 78 stars[Nstars].dM = NAN; 79 stars[Nstars].t = 0; 80 stars[Nstars].code = GSC_M; 81 stars[Nstars].found = -1; 76 if (stars[Nstars].average.R < UserPatch.Rmin) continue; 77 if (stars[Nstars].average.R > UserPatch.Rmax) continue; 78 if (stars[Nstars].average.D < UserPatch.Dmin) continue; 79 if (stars[Nstars].average.D > UserPatch.Dmax) continue; 82 80 83 stars[Nstars].detID = 0; 84 stars[Nstars].imageID = 0; 85 86 stars[Nstars].X = 0; 87 stars[Nstars].Y = 0; 88 stars[Nstars].fx = 0; 89 stars[Nstars].fy = 0; 90 stars[Nstars].df = 0; 81 fparse (&stars[Nstars].measure.M, 3, &buffer[Nbyte]); 82 stars[Nstars].measure.dM = NAN; 83 stars[Nstars].measure.photcode = GSC_M; 84 stars[Nstars].measure.t = 0; 91 85 92 86 Nstars ++; -
trunk/Ohana/src/addstar/src/gettycho.c
r17439 r21508 69 69 70 70 for (j = 0; j < nitems; j++) { 71 71 72 line = &buffer[j*NBYTE]; 72 stars[Ntycho].R = atof (&line[15]);73 stars[Ntycho].D = atof (&line[28]);74 73 75 if (stars[Ntycho].R < region[0].Rmin) goto next_section; 76 if (stars[Ntycho].R > region[0].Rmax) goto next_section; 77 if (stars[Ntycho].D < region[0].Dmin) goto next_section; 78 if (stars[Ntycho].D > region[0].Dmax) goto next_section; 74 InitStar (&stars[Ntycho]); 79 75 80 if (stars[Ntycho].R < UserPatch.Rmin) continue; 81 if (stars[Ntycho].R > UserPatch.Rmax) continue; 82 if (stars[Ntycho].D < UserPatch.Dmin) continue; 83 if (stars[Ntycho].D > UserPatch.Dmax) continue; 76 stars[Ntycho].average.R = atof (&line[15]); 77 stars[Ntycho].average.D = atof (&line[28]); 84 78 85 stars[Ntycho].dR = 1000 * atof (&line[57]); 86 stars[Ntycho].dD = 1000 * atof (&line[64]); 79 if (stars[Ntycho].average.R < region[0].Rmin) goto next_section; 80 if (stars[Ntycho].average.R > region[0].Rmax) goto next_section; 81 if (stars[Ntycho].average.D < region[0].Dmin) goto next_section; 82 if (stars[Ntycho].average.D > region[0].Dmax) goto next_section; 83 84 if (stars[Ntycho].average.R < UserPatch.Rmin) continue; 85 if (stars[Ntycho].average.R > UserPatch.Rmax) continue; 86 if (stars[Ntycho].average.D < UserPatch.Dmin) continue; 87 if (stars[Ntycho].average.D > UserPatch.Dmax) continue; 88 89 stars[Ntycho].average.dR = 1000 * atof (&line[57]); 90 stars[Ntycho].average.dD = 1000 * atof (&line[64]); 87 91 88 92 /* XXX : we need to apply uR,uD to R,D to advance to 2000.0 */ 89 stars[Ntycho]. uR = atof (&line[41]);90 stars[Ntycho]. uD = atof (&line[49]);93 stars[Ntycho].average.uR = atof (&line[41]); 94 stars[Ntycho].average.uD = atof (&line[49]); 91 95 92 stars[Ntycho].duR = atof (&line[69]); 93 stars[Ntycho].duD = atof (&line[75]); 94 95 stars[Ntycho].P = 0; 96 stars[Ntycho].dP = 0; 97 98 stars[Ntycho].detID = 0; 99 stars[Ntycho].imageID = 0; 96 stars[Ntycho].average.duR = atof (&line[69]); 97 stars[Ntycho].average.duD = atof (&line[75]); 100 98 101 99 /* Tycho uses J2000 equinox and 1991.25 epoch for coordinates */ 102 100 /* the magnitudes have no temporal information */ 103 stars[Ntycho].t = TychoEpoch; 104 stars[Ntycho].found = -1; 105 106 stars[Ntycho].X = 0; 107 stars[Ntycho].Y = 0; 108 stars[Ntycho].fx = 0; 109 stars[Ntycho].fy = 0; 110 stars[Ntycho].df = 0; 101 stars[Ntycho].measure.t = TychoEpoch; 111 102 112 103 /* one pass of addstar does either r or b */ 113 104 if (photcode == TYCHO_B) { 114 stars[Ntycho]. M= atof (&line[110]);115 stars[Ntycho]. dM= atof (&line[117]);116 stars[Ntycho]. code= TYCHO_B;105 stars[Ntycho].measure.M = atof (&line[110]); 106 stars[Ntycho].measure.dM = atof (&line[117]); 107 stars[Ntycho].measure.photcode = TYCHO_B; 117 108 } else { 118 stars[Ntycho]. M= atof (&line[123]);119 stars[Ntycho]. dM= atof (&line[130]);120 stars[Ntycho]. code= TYCHO_V;109 stars[Ntycho].measure.M = atof (&line[123]); 110 stars[Ntycho].measure.dM = atof (&line[130]); 111 stars[Ntycho].measure.photcode = TYCHO_V; 121 112 } 122 113 -
trunk/Ohana/src/addstar/src/getusno.c
r17439 r21508 110 110 if (buf[1] > iDEC1) continue; 111 111 112 memset (&stars[Nusno], 0, sizeof(Stars)); 113 stars[Nusno].R = buf[0]/360000.0; 114 stars[Nusno].D = buf[1]/360000.0 - 90.0; 115 stars[Nusno].dM = NAN; 116 stars[Nusno].t = 0; 117 stars[Nusno].found = -1; 112 InitStar (&stars[Nusno]); 118 113 119 stars[Nusno].detID = 0; 120 stars[Nusno].imageID = 0; 121 122 stars[Nusno].X = 0; 123 stars[Nusno].Y = 0; 124 stars[Nusno].fx = 0; 125 stars[Nusno].fy = 0; 126 stars[Nusno].df = 0; 114 stars[Nusno].average.R = buf[0]/360000.0; 115 stars[Nusno].average.D = buf[1]/360000.0 - 90.0; 116 stars[Nusno].measure.dM = NAN; 127 117 128 118 /* one pass of addstar does either r or b */ 129 119 if (photcode == USNO_RED) { 130 stars[Nusno]. code= USNO_RED;131 stars[Nusno]. M= fabs (0.1*(buf[2] - 1000*((int)(buf[2]/1000))));120 stars[Nusno].measure.photcode = USNO_RED; 121 stars[Nusno].measure.M = fabs (0.1*(buf[2] - 1000*((int)(buf[2]/1000)))); 132 122 } 133 123 if (photcode == USNO_BLUE) { 134 stars[Nusno]. code= USNO_BLUE;135 stars[Nusno]. M= fabs (0.1*((int)(buf[2] - 1000000*((int)(buf[2]/1000000))) / 1000));124 stars[Nusno].measure.photcode = USNO_BLUE; 125 stars[Nusno].measure.M = fabs (0.1*((int)(buf[2] - 1000000*((int)(buf[2]/1000000))) / 1000)); 136 126 } 137 127 Nusno ++; -
trunk/Ohana/src/addstar/src/getusnob.c
r17439 r21508 125 125 /* USNO coords are reported for J2000 / epoch 2000.0 */ 126 126 /* extract the basic stellar data */ 127 memset (&stars[Nusno], 0, sizeof(Stars)); 128 stars[Nusno].R = buf[0]/360000.0; 129 stars[Nusno].D = buf[1]/360000.0 - 90.0; 127 InitStar (&stars[Nusno]); 128 129 stars[Nusno].average.R = buf[0]/360000.0; 130 stars[Nusno].average.D = buf[1]/360000.0 - 90.0; 130 131 131 132 /* XXX uR cos(D) or just uR ??? */ 132 stars[Nusno]. uR = 2.0 * ((buf[2] % 10000) - 5000);133 stars[Nusno]. uD = 2.0 * ((buf[2]/10000 % 10000) - 5000);133 stars[Nusno].average.uR = 2.0 * ((buf[2] % 10000) - 5000); 134 stars[Nusno].average.uD = 2.0 * ((buf[2]/10000 % 10000) - 5000); 134 135 135 stars[Nusno]. duR = (buf[3] % 1000);136 stars[Nusno]. duD = (buf[3]/1000 % 1000);136 stars[Nusno].average.duR = (buf[3] % 1000); 137 stars[Nusno].average.duD = (buf[3]/1000 % 1000); 137 138 138 stars[Nusno]. dR = 0.001 * (buf[4] % 1000);139 stars[Nusno]. dD = 0.001 * (buf[4]/1000 % 1000);139 stars[Nusno].average.dR = 0.001 * (buf[4] % 1000); 140 stars[Nusno].average.dD = 0.001 * (buf[4]/1000 % 1000); 140 141 141 stars[Nusno]. P = 0;142 stars[Nusno]. dP = 0;142 stars[Nusno].average.P = 0; 143 stars[Nusno].average.dP = 0; 143 144 144 145 /* USNO magnitude errors are reported as a fixed 0.3 mag */ 145 stars[Nusno].dM = 0.3; 146 stars[Nusno].found = -1; 147 148 stars[Nusno].detID = 0; 149 stars[Nusno].imageID = 0; 150 151 stars[Nusno].X = 0; 152 stars[Nusno].Y = 0; 153 stars[Nusno].fx = 0; 154 stars[Nusno].fy = 0; 155 stars[Nusno].df = 0; 146 stars[Nusno].measure.dM = 0.3; 156 147 157 148 /* USNO-B uses J2000 equinox and 2000.0 epoch for coordinates */ 158 149 /* the magnitudes have no temporal information */ 159 stars[Nusno]. t= USNOepoch;150 stars[Nusno].measure.t = USNOepoch; 160 151 161 152 /* one pass of addstar does r, b, or n */ … … 172 163 m2 = 0; 173 164 } 174 stars[Nusno]. code = photcode;165 stars[Nusno].measure.photcode = photcode; 175 166 176 167 /* if two mags are available, get an average */ … … 180 171 mag = (m1) ? m1 : m2; 181 172 } 182 stars[Nusno]. M = (mag == 0.0) ? 32.0 : mag;173 stars[Nusno].measure.M = (mag == 0.0) ? 32.0 : mag; 183 174 184 175 Nusno ++; -
trunk/Ohana/src/addstar/src/greference.c
r6683 r21508 3 3 # define LOAD_DR2 1 4 4 5 Stars *gref cat(char *Refcat, SkyRegion *region, int photcode, int *nstars) {5 Stars *greference (char *Refcat, SkyRegion *region, int photcode, int *nstars) { 6 6 7 7 int Nstars; … … 36 36 /* get stars from 2MASS for the given region */ 37 37 if (!strcasecmp (Refcat, "2MASS")) { 38 stars = get2mass (region, photcode, LOAD_ALLSKY, &Nstars); 38 // stars = get2mass (region, photcode, LOAD_ALLSKY, &Nstars); 39 fprintf (stderr, "2MASS load via addstar is deprecated: use load2mass\n"); 40 exit (2); 39 41 } 40 42 41 43 /* get stars from 2MASS for the given region */ 42 44 if (!strcasecmp (Refcat, "2MASS-ALLSKY")) { 43 stars = get2mass (region, photcode, LOAD_ALLSKY, &Nstars); 45 // stars = get2mass (region, photcode, LOAD_ALLSKY, &Nstars); 46 fprintf (stderr, "2MASS load via addstar is deprecated: use load2mass\n"); 47 exit (2); 44 48 } 45 49 46 50 /* get stars from 2MASS for the given region */ 47 51 if (!strcasecmp (Refcat, "2MASS-DR2")) { 48 stars = get2mass (region, photcode, LOAD_DR2, &Nstars); 52 // stars = get2mass (region, photcode, LOAD_DR2, &Nstars); 53 fprintf (stderr, "2MASS load via addstar is deprecated: use load2mass\n"); 54 exit (2); 49 55 } 50 56 -
trunk/Ohana/src/addstar/src/grefstars.c
r19823 r21508 21 21 if (line[0] == 0) continue; 22 22 if (line[0] == '#') continue; 23 dparse (&stars[N].R, 1, line);24 dparse (&stars[N].D, 2, line);25 dparse (&stars[N].M, 3, line);26 dparse (&stars[N].dM, 4, line);27 stars[N].R = ohana_normalize_angle (stars[N].R);28 stars[N].t = 0;29 stars[N].code = photcode;30 stars[N].found = FALSE;31 stars[N].detID = 0;32 stars[N].imageID = 0;33 23 34 stars[N].X = 0; 35 stars[N].Y = 0; 36 stars[N].fx = 0; 37 stars[N].fy = 0; 38 stars[N].df = 0; 24 InitStar (&stars[N]); 25 26 dparse (&stars[N].average.R, 1, line); 27 dparse (&stars[N].average.D, 2, line); 28 stars[N].average.R = ohana_normalize_angle (stars[N].average.R); 29 30 fparse (&stars[N].measure.M, 3, line); 31 fparse (&stars[N].measure.dM, 4, line); 32 33 stars[N].measure.photcode = photcode; 39 34 40 35 CHECK_REALLOCATE (stars, Stars, NSTARS, N+1, 100); … … 43 38 return (stars); 44 39 } 45 46 /* stars.found is set here to FALSE.47 find_match_refstars uses stars.found to identify the seq number of the48 star which is found. it requires an initial value of -1 XXX49 */ -
trunk/Ohana/src/addstar/src/load2mass_as_rawdata.c
r17439 r21508 140 140 ALLOCATE (stars[Nstars+2], Stars, 1); 141 141 142 stars[Nstars+0][0].R = tstars[j].R; 143 stars[Nstars+0][0].D = tstars[j].D; 144 stars[Nstars+1][0].R = tstars[j].R; 145 stars[Nstars+1][0].D = tstars[j].D; 146 stars[Nstars+2][0].R = tstars[j].R; 147 stars[Nstars+2][0].D = tstars[j].D; 142 InitStar (stars[Nstars+0]); 143 InitStar (stars[Nstars+1]); 144 InitStar (stars[Nstars+2]); 145 146 stars[Nstars+0][0].average.R = tstars[j].R; 147 stars[Nstars+0][0].average.D = tstars[j].D; 148 stars[Nstars+1][0].average.R = tstars[j].R; 149 stars[Nstars+1][0].average.D = tstars[j].D; 150 stars[Nstars+2][0].average.R = tstars[j].R; 151 stars[Nstars+2][0].average.D = tstars[j].D; 148 152 get2mass_3star_full (&stars[Nstars], &buffer[offset], Nbyte - offset); 149 // get2mass_star (&stars[Nstars], &buffer[offset], Nbyte - offset);150 153 151 154 tstars[j].flag = TRUE; -
trunk/Ohana/src/addstar/src/load2mass_catalog.c
r16810 r21508 20 20 // XXX for now, the output objects will have limited astrometric interpretation... 21 21 // XXX every 3 stars represents 3 measurements and 1 average 22 catalog[0].average[Nave].R = stars[i]. R;23 catalog[0].average[Nave].D = stars[i]. D;22 catalog[0].average[Nave].R = stars[i].average.R; 23 catalog[0].average[Nave].D = stars[i].average.D; 24 24 catalog[0].average[Nave].dR = 0; 25 25 catalog[0].average[Nave].dD = 0; … … 37 37 catalog[0].average[Nave].measureOffset = Nmeas; 38 38 catalog[0].average[Nave].missingOffset = -1; 39 catalog[0].average[Nave]. code= 0;39 catalog[0].average[Nave].flags = 0; 40 40 41 41 for (j = 0; j < Nsec; j++) { 42 catalog[0].secfilt[Nave*Nsec+j].M = NAN; 43 catalog[0].secfilt[Nave*Nsec+j].dM = NAN; 44 catalog[0].secfilt[Nave*Nsec+j].Xm = NAN_S_SHORT; 42 catalog[0].secfilt[Nave*Nsec+j].M = NAN; 43 catalog[0].secfilt[Nave*Nsec+j].dM = NAN; 44 catalog[0].secfilt[Nave*Nsec+j].Xm = NAN_S_SHORT; 45 catalog[0].secfilt[Nave*Nsec+j].M_20 = NAN_S_SHORT; 46 catalog[0].secfilt[Nave*Nsec+j].M_80 = NAN_S_SHORT; 47 catalog[0].secfilt[Nave*Nsec+j].Ncode = 0; 48 catalog[0].secfilt[Nave*Nsec+j].Nused = 0; 45 49 } 46 50 47 51 // we now have the min chisq row. use this to supply the other filter values.... 48 52 for (j = 0; j < 3; j++) { 53 catalog[0].measure[Nmeas] = stars[i+j].measure; 54 49 55 catalog[0].measure[Nmeas].dR = 0.0; 50 56 catalog[0].measure[Nmeas].dD = 0.0; 51 catalog[0].measure[Nmeas].Xccd = stars[i+j].X; 52 catalog[0].measure[Nmeas].Yccd = stars[i+j].Y; 53 catalog[0].measure[Nmeas].dXccd = 0.0; 54 catalog[0].measure[Nmeas].dYccd = 0.0; 55 catalog[0].measure[Nmeas].M = stars[i+j].M; 56 catalog[0].measure[Nmeas].dM = stars[i+j].dM; 57 catalog[0].measure[Nmeas].Mcal = 0; 58 catalog[0].measure[Nmeas].dMcal = stars[i+j].dMcal; 59 catalog[0].measure[Nmeas].t = stars[i+j].t; 60 catalog[0].measure[Nmeas].averef = Nave; 61 catalog[0].measure[Nmeas].photcode = stars[i+j].code; 62 catalog[0].measure[Nmeas].dophot = 0; 63 catalog[0].measure[Nmeas].photFlags = stars[i+j].flags; 64 catalog[0].measure[Nmeas].dbFlags = 0; 65 catalog[0].measure[Nmeas].dt = 0xffff; 66 67 catalog[0].measure[Nmeas].airmass = 0; 68 catalog[0].measure[Nmeas].FWx = stars[i+j].fx; 69 catalog[0].measure[Nmeas].FWy = stars[i+j].fy; 70 catalog[0].measure[Nmeas].theta = stars[i+j].df; 57 catalog[0].measure[Nmeas].dt = NAN_S_SHORT; 58 59 // XXX what about averef? 71 60 72 61 catalog[0].average[Nave].Nmeasure++; -
trunk/Ohana/src/addstar/src/replace_match.c
r16810 r21508 7 7 /* search for entry and replace values M, dM, R, D */ 8 8 for (i = 0; i < average[0].Nmeasure; i++) { 9 if (measure[i].photcode != star[0]. code) continue;10 measure[i].dR = 3600.0*(average[0].R - star[0]. R);11 measure[i].dD = 3600.0*(average[0].D - star[0]. D);12 measure[i].M = star[0]. M;13 measure[i].dM = star[0]. dM;9 if (measure[i].photcode != star[0].measure.photcode) continue; 10 measure[i].dR = 3600.0*(average[0].R - star[0].average.R); 11 measure[i].dD = 3600.0*(average[0].D - star[0].average.D); 12 measure[i].M = star[0].measure.M; 13 measure[i].dM = star[0].measure.dM; 14 14 star[0].found = average[0].measureOffset + i; 15 15 return (TRUE); -
trunk/Ohana/src/addstar/src/sky_tessalation.c
r21055 r21508 281 281 image[0].NY = NY; 282 282 283 image[0]. code = 1; // this needs to be set more sensibly283 image[0].photcode = 1; // this needs to be set more sensibly 284 284 285 285 image[0].Mx = xv[0]; image[0].My = yv[0]; … … 433 433 rectangle[0].NX = NX; 434 434 rectangle[0].NY = NY; 435 rectangle[0]. code = 1; // this needs to be set more sensibly435 rectangle[0].photcode = 1; // this needs to be set more sensibly 436 436 437 437 return (TRUE); … … 477 477 rectangle[0].NX = NX; 478 478 rectangle[0].NY = NY; 479 rectangle[0]. code = 1; // this needs to be set more sensibly479 rectangle[0].photcode = 1; // this needs to be set more sensibly 480 480 481 481 return (TRUE); … … 511 511 output[N].NX = NX; 512 512 output[N].NY = NY; 513 output[N]. code = input[0].code;513 output[N].photcode = input[0].photcode; 514 514 515 515 output[N].coords.crpix1 = input[0].coords.crpix1 - i*NX; -
trunk/Ohana/src/getstar/src/ReadImageFiles.c
r19259 r21508 64 64 /* find image rootname */ 65 65 name = filebasename (file[i]); 66 snprintf (image[N].name, DVO_IMAGE_NAME_LEN, name);66 snprintf (image[N].name, DVO_IMAGE_NAME_LEN, "%s", name); 67 67 free (name); 68 68 -
trunk/Ohana/src/getstar/src/ReadImageHeader.c
r20184 r21508 112 112 image[0].Mcal = 0.0; 113 113 image[0].Xm = NAN_S_SHORT; 114 image[0]. code= 0;114 image[0].flags = 0; 115 115 116 116 return (TRUE); -
trunk/Ohana/src/getstar/src/write_getstar_ps1_dev_0.c
r16810 r21508 46 46 output[i].D = average[i].D; 47 47 48 output[i].code = average[i]. code;48 output[i].code = average[i].flags; 49 49 output[i].photcode = code_c0; 50 50 -
trunk/Ohana/src/getstar/src/write_getstar_ps1_dev_1.c
r16810 r21508 49 49 output[i].P = average[i].P; 50 50 51 output[i].code = average[i]. code;51 output[i].code = average[i].flags; 52 52 output[i].photcode = code_c0; 53 53 -
trunk/Ohana/src/getstar/src/write_getstar_ps1_dev_2.c
r16810 r21508 55 55 output[i].dP = average[i].dP; 56 56 57 output[i].code = average[i]. code;57 output[i].code = average[i].flags; 58 58 output[i].photcode = code_c0; 59 59 -
trunk/Ohana/src/imregister/imphot/modify.c
r7080 r21508 13 13 if (options.modify) { 14 14 if (!strcasecmp (options.ModifyEntry, "and")) { 15 image[i]. code&= atoi (options.ModifyValue);15 image[i].flags &= atoi (options.ModifyValue); 16 16 } 17 17 if (!strcasecmp (options.ModifyEntry, "or")) { 18 image[i]. code|= atoi (options.ModifyValue);18 image[i].flags |= atoi (options.ModifyValue); 19 19 } 20 20 if (!strcasecmp (options.ModifyEntry, "xor")) { 21 image[i]. code^= atoi (options.ModifyValue);21 image[i].flags ^= atoi (options.ModifyValue); 22 22 } 23 23 if (!strcasecmp (options.ModifyEntry, "=")) { 24 image[i]. code= atoi (options.ModifyValue);24 image[i].flags = atoi (options.ModifyValue); 25 25 } 26 26 } -
trunk/Ohana/src/imregister/imphot/output.c
r14590 r21508 39 39 40 40 fprintf (stdout, "%s %s %s %7.4f %7.4f %7.4f %5d %02x\n", image[i].name, photstr, timestr, 41 image[i].Mcal, image[i].dMcal, image[i].secz, image[i].nstar, image[i]. code);41 image[i].Mcal, image[i].dMcal, image[i].secz, image[i].nstar, image[i].flags); 42 42 free (timestr); 43 43 } -
trunk/Ohana/src/imregister/imphot/subset.c
r12332 r21508 24 24 if (!status && criteria.Ntimes) continue; 25 25 if (criteria.PhotcodeSelect && (image[i].photcode != criteria.photcode)) continue; 26 if (criteria.CodeSelect && (image[i]. code!= criteria.Code)) continue;26 if (criteria.CodeSelect && (image[i].flags != criteria.Code)) continue; 27 27 if (criteria.NameSelect && strncasecmp (image[i].name, criteria.Name, NameSelectLength)) continue; 28 28 -
trunk/Ohana/src/libautocode/Makefile.Targets
r19185 r21508 1 2 1 AOBJS = \ 3 2 $(ASRC)/coords.$(ARCH).o \ … … 9 8 $(ASRC)/average-ps1-dev-1.$(ARCH).o \ 10 9 $(ASRC)/average-ps1-dev-2.$(ARCH).o \ 10 $(ASRC)/average-ps1-v1.$(ARCH).o \ 11 11 $(ASRC)/secfilt.$(ARCH).o \ 12 12 $(ASRC)/secfilt-loneos.$(ARCH).o \ … … 16 16 $(ASRC)/secfilt-ps1-dev-1.$(ARCH).o \ 17 17 $(ASRC)/secfilt-ps1-dev-2.$(ARCH).o \ 18 $(ASRC)/secfilt-ps1-v1.$(ARCH).o \ 18 19 $(ASRC)/measure.$(ARCH).o \ 19 20 $(ASRC)/measure-loneos.$(ARCH).o \ … … 23 24 $(ASRC)/measure-ps1-dev-1.$(ARCH).o \ 24 25 $(ASRC)/measure-ps1-dev-2.$(ARCH).o \ 26 $(ASRC)/measure-ps1-v1.$(ARCH).o \ 25 27 $(ASRC)/missing.$(ARCH).o \ 26 28 $(ASRC)/photcode.$(ARCH).o \ … … 29 31 $(ASRC)/photcode-ps1-dev-2.$(ARCH).o \ 30 32 $(ASRC)/photcode-ps1-dev-3.$(ARCH).o \ 33 $(ASRC)/photcode-ps1-v1.$(ARCH).o \ 31 34 $(ASRC)/image.$(ARCH).o \ 32 35 $(ASRC)/image-loneos.$(ARCH).o \ … … 37 40 $(ASRC)/image-ps1-dev-2.$(ARCH).o \ 38 41 $(ASRC)/image-ps1-dev-3.$(ARCH).o \ 42 $(ASRC)/image-ps1-v1.$(ARCH).o \ 39 43 $(ASRC)/regimage.$(ARCH).o \ 40 44 $(ASRC)/detreg.$(ARCH).o \ 41 45 $(ASRC)/photreg.$(ARCH).o \ 42 46 $(ASRC)/photreg-old.$(ARCH).o \ 43 $(ASRC)/ps1_dev_0.$(ARCH).o \ 44 $(ASRC)/ps1_dev_1.$(ARCH).o \ 45 $(ASRC)/smpdata.$(ARCH).o \ 47 $(ASRC)/cmf-ps1-dev-0.$(ARCH).o \ 48 $(ASRC)/cmf-ps1-dev-1.$(ARCH).o \ 49 $(ASRC)/cmf-ps1-v1.$(ARCH).o \ 50 $(ASRC)/cmf-smpdata.$(ARCH).o \ 46 51 $(ASRC)/getstar-ps1-dev-0.$(ARCH).o \ 47 52 $(ASRC)/getstar-ps1-dev-1.$(ARCH).o \ … … 49 54 $(ASRC)/spectrum.$(ARCH).o \ 50 55 $(ASRC)/spectrum-ascii.$(ARCH).o \ 51 $(ASRC)/Stars.$(ARCH).o \52 56 $(ASRC)/GSCRegion.$(ARCH).o \ 53 57 $(ASRC)/AddstarClientOptions.$(ARCH).o \ … … 63 67 $(AINC)/average-ps1-dev-1.h \ 64 68 $(AINC)/average-ps1-dev-2.h \ 69 $(AINC)/average-ps1-v1.h \ 65 70 $(AINC)/secfilt.h \ 66 71 $(AINC)/secfilt-loneos.h \ … … 70 75 $(AINC)/secfilt-ps1-dev-1.h \ 71 76 $(AINC)/secfilt-ps1-dev-2.h \ 77 $(AINC)/secfilt-ps1-v1.h \ 72 78 $(AINC)/measure.h \ 73 79 $(AINC)/measure-loneos.h \ … … 77 83 $(AINC)/measure-ps1-dev-1.h \ 78 84 $(AINC)/measure-ps1-dev-2.h \ 85 $(AINC)/measure-ps1-v1.h \ 79 86 $(AINC)/missing.h \ 80 87 $(AINC)/photcode.h \ … … 83 90 $(AINC)/photcode-ps1-dev-2.h \ 84 91 $(AINC)/photcode-ps1-dev-3.h \ 92 $(AINC)/photcode-ps1-v1.h \ 85 93 $(AINC)/image.h \ 86 94 $(AINC)/image-loneos.h \ … … 91 99 $(AINC)/image-ps1-dev-2.h \ 92 100 $(AINC)/image-ps1-dev-3.h \ 101 $(AINC)/image-ps1-v1.h \ 93 102 $(AINC)/regimage.h \ 94 103 $(AINC)/detreg.h \ 95 104 $(AINC)/photreg.h \ 96 105 $(AINC)/photreg-old.h \ 97 $(AINC)/ps1_dev_0.h \ 98 $(AINC)/ps1_dev_1.h \ 106 $(AINC)/cmf-ps1-dev-0.h \ 107 $(AINC)/cmf-ps1-dev-1.h \ 108 $(AINC)/cmf-ps1-v1.h \ 109 $(AINC)/cmf-smpdata.h \ 99 110 $(AINC)/getstar-ps1-dev-0.h \ 100 111 $(AINC)/getstar-ps1-dev-1.h \ 101 112 $(AINC)/getstar-ps1-dev-2.h \ 102 $(AINC)/smpdata.h \103 113 $(AINC)/spectrum.h \ 104 114 $(AINC)/spectrum-ascii.h \ 105 $(AINC)/Stars.h \106 115 $(AINC)/GSCRegion.h \ 107 116 $(AINC)/AddstarClientOptions.h \ 108 117 $(AINC)/SkyRegion.h 118 119 # $(ASRC)/Stars.$(ARCH).o 120 # $(AINC)/Stars.h 121 -
trunk/Ohana/src/libautocode/def/Stars.d
r16810 r21508 2 2 EXTNAME STARS 3 3 TYPE BINTABLE 4 SIZE 2 484 SIZE 278 5 5 6 FIELD X, X, double, x coordinate on image, pixels 7 FIELD Y, Y, double, y coordinate on image, pixels 8 FIELD dX, dX, double, x coordinate error, pixels 9 FIELD dY, dY, double, y coordinate error, pixels 6 * FIELD Xccd, X, double, x coordinate on image, pixels 7 * FIELD Yccd, Y, double, y coordinate on image, pixels 8 * FIELD dXccd, dX, double, x coordinate error, pixels 9 * FIELD dYccd, dY, double, y coordinate error, pixels 10 * FIELD posangle, POSANGLE, float 11 * FIELD pltscale, PLTSCALE, float 10 12 FIELD R, R, double, ra coordinate on sky, decimal degrees 11 13 FIELD D, D, double, dec coordinate on sky, decimal degrees … … 18 20 FIELD P, PAR, double, parallax, milliarcsec 19 21 FIELD dP, PAR_ERR, double, parallax error, milliarcsec 20 FIELD M, M, double, instrumental mag 21 FIELD dM, DM, double, error on mag 22 FIELD dMcal, DMCAL, double, systematic error on mag 23 FIELD sky, SKY, double, local sky counts 24 FIELD dsky, dSKY, double, local sky error counts 25 FIELD fx, FX, double, object FWHM x-dir, pixels? 26 FIELD fy, FY, double, object FWHM y-dir, pixels? 27 FIELD df, DF, double, object position angle, degrees 28 # FIELD Mgal, MGAL, double, alternative (galaxy) magnitude 29 FIELD Map, MAP, double, alternative (aperture) magnitude 22 23 * FIELD M, M, double, instrumental mag 24 * FIELD dM, DM, double, error on mag 25 * FIELD dMcal, DMCAL, double, systematic error on mag 26 * FIELD Sky, SKY, double, local sky counts 27 * FIELD dSky, dSKY, double, local sky error counts 28 * FIELD fx, FX, double, object FWHM x-dir, pixels? 29 * FIELD fy, FY, double, object FWHM y-dir, pixels? 30 * FIELD df, DF, double, object position angle, degrees 31 * FIELD Mcal, MCAL, float, image cal magnitude 32 * FIELD Map, MAP, double, alternative (aperture) magnitude 30 33 FIELD Mpeak, MPEAK, double, alternative (peak) magnitude 31 FIELD detID, ID, int, detection identifier32 FIELD imageID, IMAGE_ID, int, image identifier34 * FIELD detID, ID, int, detection identifier 35 * FIELD imageID, IMAGE_ID, int, image identifier 33 36 FIELD found, FOUND, int, found in database catalog? 34 FIELD t, T, e_time, date/time of exposure (UNIX) 35 FIELD dt, EXPTIME, float, exposure time, 2.5*log(exptime) 36 FIELD psfChisq, PSF_CHISQ, float 37 FIELD crNsigma, CR_NSIGMA, float 38 FIELD extNsigma, EXT_NSIGMA, float 39 FIELD psfQual, PSF_QUAL, float 40 FIELD Mcal, MCAL, float, image cal mag, mag 41 FIELD airmass, AIRMASS, float, (airmass - 1), airmass 42 FIELD az, AZ, float, azimuth 43 FIELD code, CODE, short 44 FIELD nFrames, N_FRAMES, short 45 FIELD flags, FLAGS, short 46 FIELD dophot, DOPHOT, char, dophot type code 47 FIELD dummy, DUMMY, char 48 49 # XXX I'm going to need azimuth (or load from image header?) 37 * FIELD t, T, e_time, date/time of exposure (UNIX) 38 * FIELD t_msec, T_MSEC, short, milliseconds of exposure 39 * FIELD dt, EXPTIME, float, exposure time, 2.5*log(exptime) 40 * FIELD psfQual, PSF_QUAL, float 41 * FIELD psfChisq, PSF_CHISQ, float 42 * FIELD psfNdof, PSF_NDOF, int 43 * FIELD psfNpix, PSF_NPIX, int 44 * FIELD crNsigma, CR_NSIGMA, float 45 * FIELD extNsigma, EXT_NSIGMA, float 46 * FIELD Mxx, MOMENTS_XX, float, second moment 47 * FIELD Mxy, MOMENTS_XY, float, second moment 48 * FIELD Myy, MOMENTS_YY, float, second moment 49 * FIELD airmass, AIRMASS, float, (airmass - 1), airmass 50 * FIELD az, AZ, float, azimuth 51 * FIELD photcode, CODE, short 52 * FIELD nFrames, N_FRAMES, short 53 * FIELD photFlags, FLAGS, short 54 FIELD dummy, DUMMY, char[2] 50 55 51 56 # double: 24 * 8 : 192 … … 58 63 # define down the types to floats where reasonable (all but R,D)? 59 64 # R,D should be in ICRS, J2000, epoch 2000 : precess as needed, apply p-m as needed 65 66 # XXX I'd like to merge this with Measure, but need to be careful about addstarClient -> addstarServer 67 # XXX extend photFlags to match actual psphot output -
trunk/Ohana/src/libautocode/def/average.d
r16810 r21508 2 2 EXTNAME DVO_AVERAGE 3 3 TYPE BINTABLE 4 SIZE 804 SIZE 94 5 5 DESCRIPTION DVO Average Object Table 6 6 7 7 # elements of data structure / FITS table 8 8 9 FIELD R, RA, double, RA, decimal degrees 10 FIELD D, DEC, double, DEC, decimal degrees 11 FIELD dR, RA_ERR, float, RA error arcsec 12 FIELD dD, DEC_ERR, float, DEC error arcsec 9 FIELD R, RA, double, RA, decimal degrees 10 FIELD D, DEC, double, DEC, decimal degrees 11 FIELD dR, RA_ERR, float, RA error arcsec 12 FIELD dD, DEC_ERR, float, DEC error arcsec 13 14 FIELD uR, U_RA, float, RA*cos(D) proper-motion, arcsec/year 15 FIELD uD, U_DEC, float, DEC proper-motion, arcsec/year 16 FIELD duR, V_RA_ERR, float, RA*cos(D) p-m error, arcsec/year 17 FIELD duD, V_DEC_ERR, float, DEC p-m error, arcsec/year 18 FIELD P, PAR, float, parallax, arcsec 19 FIELD dP, PAR_ERR, float, parallax error, arcsec 13 20 14 FIELD uR, U_RA, float, RA*cos(D) proper-motion, arcsec/year 15 FIELD uD, U_DEC, float, DEC proper-motion, arcsec/year 16 FIELD duR, V_RA_ERR, float, RA*cos(D) p-m error, arcsec/year 17 FIELD duD, V_DEC_ERR, float, DEC p-m error, arcsec/year 18 FIELD P, PAR, float, parallax, arcsec 19 FIELD dP, PAR_ERR, float, parallax error, arcsec 21 FIELD Xp, SIGMA_POS, short, position scatter, 1/100 arcsec 22 FIELD ChiSq, CHISQ_POS, float, astrometry analysis chisq 23 FIELD Npos, NUMBER_POS, unsigned short, number of detections used for astrometry 20 24 21 FIELD Xp, SIGMA_POS, short, position scatter, 1/100 arcsec 25 # this limits us to a max of 64k measurements per object 22 26 FIELD Nmeasure, NMEASURE, unsigned short, number of psf measurements 23 27 FIELD Nmissing, NMISSING, unsigned short, number of missings 24 28 FIELD Nextend, NEXTEND, unsigned short, number of extended measurements 25 FIELD measureOffset, OFF_MEASURE, int, offset to first psf measurement26 FIELD missingOffset, OFF_MISSING, int, offset to first missing obs27 FIELD extendOffset, OFF_EXTEND, int, offset to first extended measurement28 29 29 FIELD code, code, unsigned short, ID code (star; ghost; etc) 30 FIELD dummy, DUMMY, char[2], padding 30 FIELD measureOffset, OFF_MEASURE, int, offset to first psf measurement 31 FIELD missingOffset, OFF_MISSING, int, offset to first missing obs 32 FIELD extendOffset, OFF_EXTEND, int, offset to first extended measurement 31 33 32 # Pan-STARRS uses a 64-bit detection ID. keep this in two 32 bit ints 33 # for C89 compatibility. The objID is constructed based on the 34 # position of first instatiation. this is actually quite expensive 35 # because we need to include the uniqueness test to construct this, 36 # which requires a select for each new object. Therefore, I will use 37 # a table based ID (table ID + object ID), and we will have to 38 # re-number the object IDs if we change the table density, OR treat 39 # all subdivisions as entries which are from a foreign table. 34 # 'flags' was called 'code' prior to 2009.02.07 35 FIELD flags, FLAGS, uint32_t, average object flags (star; ghost; etc) 40 36 41 FIELD objID, OBJ_ID, unsigned int, unique ID for object in table 42 FIELD catID, CAT_ID, unsigned int, unique ID for table in which object was first realized 37 # objID + catID gives a unique ID for all objects in the database 38 FIELD objID, OBJ_ID, unsigned int, unique ID for object in table 39 FIELD catID, CAT_ID, unsigned int, unique ID for table in which object was first realized 40 FIELD extID, EXT_ID, uint64_t, external ID for object (eg PSPS objID) 43 41 44 42 # this structure should only be used for internal representations … … 47 45 # the index for the secfilt table is just Nsecfilt times the index for the average table. 48 46 49 # the DVO object IDs are generated internally and are not equivalent to the PSPS object IDs 50 # probably need to add position chisq 51 52 # XXX include the number of measurements used to determine the positional information? 47 # *** 20090206 : new fields : ChiSq, Npos, flags (was code, uint16_t), extID -
trunk/Ohana/src/libautocode/def/image.d
r20936 r21508 40 40 # 40 bytes 41 41 42 FIELD name, NAME, char[12 8], name of original image42 FIELD name, NAME, char[121], name of original image 43 43 FIELD detection_limit, DETECTION_LIMIT, unsigned char, detection limit, 10*mag 44 44 FIELD saturation_limit, SATURATION_LIMIT, unsigned char, saturation limit, 10*mag … … 47 47 FIELD fwhm_y, FWHM_Y, unsigned char, PSF y width, 25*arcsec 48 48 FIELD trate, TRATE, unsigned char, scan rate, 100 usec/pixel 49 FIELD code, CODE, char, image quality flag50 49 FIELD ccdnum, CCDNUM, unsigned char, CCD ID number 50 FIELD flags, FLAGS, unsigned int, image quality flags 51 51 FIELD imageID, IMAGE_ID, unsigned int, internal image ID 52 53 # XXX do we want to use this to handle mosaics? 54 # FIELD parentID, PARENT_ID, unsigned int, associated ref image 52 FIELD parentID, PARENT_ID, unsigned int, associated ref image 55 53 FIELD externID, EXTERN_ID, unsigned int, external image ID 56 54 FIELD sourceID, SOURCE_ID, unsigned short, analysis source ID … … 73 71 FIELD Myyyy, MYYYY, short, Mrel polyterm 74 72 # 40 bytes 73 74 # *** 20090206 : new fields : parentID, flags (was code char), changed name to 121 bytes. -
trunk/Ohana/src/libautocode/def/measure-panstarrs-dev-0.d
r15511 r21508 46 46 47 47 # do we need more resolution than a short? should this be a log? 48 FIELD qPSF,PSF_QF, short, psf coverage/quality factor48 FIELD psfQual, PSF_QF, short, psf coverage/quality factor 49 49 50 50 FIELD dophot, DOPHOT, char, dophot type -
trunk/Ohana/src/libautocode/def/measure-panstarrs-dev-1.d
r15511 r21508 46 46 47 47 # do we need more resolution than a short? should this be a log? 48 FIELD qPSF,PSF_QF, short, psf coverage/quality factor48 FIELD psfQual, PSF_QF, short, psf coverage/quality factor 49 49 50 50 FIELD dophot, DOPHOT, char, dophot type -
trunk/Ohana/src/libautocode/def/measure-ps1-dev-1.d
r16810 r21508 33 33 34 34 # do we need more resolution than a short? should this be a log? 35 FIELD qPSF,PSF_QF, float, psf coverage/quality factor35 FIELD psfQual, PSF_QF, float, psf coverage/quality factor 36 36 FIELD psfChisq, PSF_CHISQ, float, psf coverage/quality factor 37 37 FIELD crNsigma, CR_NSIGMA, float, psf coverage/quality factor -
trunk/Ohana/src/libautocode/def/measure-ps1-dev-2.d
r16810 r21508 34 34 35 35 # do we need more resolution than a short? should this be a log? 36 FIELD qPSF,PSF_QF, float, psf coverage/quality factor36 FIELD psfQual, PSF_QF, float, psf coverage/quality factor 37 37 FIELD psfChisq, PSF_CHISQ, float, psf fit chisq 38 38 FIELD crNsigma, CR_NSIGMA, float, Nsigma deviation towards CR -
trunk/Ohana/src/libautocode/def/measure.d
r16810 r21508 2 2 EXTNAME DVO_MEASURE 3 3 TYPE BINTABLE 4 SIZE 1 124 SIZE 146 5 5 DESCRIPTION DVO Detection Measurement Table 6 6 7 FIELD dR, D_RA, float, RA offset, arcsec8 FIELD dD, D_DEC, float, DEC offset, arcsec9 FIELD M, MAG, float, catalog mag, mag10 FIELD Mcal, M_CAL, float, image cal mag, mag11 FIELD Map, M_APER, float, aperture mag, mag12 FIELD dM, MAG_ERR, float, mag error, mag13 FIELD dMcal, MAG_CAL_ERR, float, systematic calibration error, mag14 FIELD dt, M_TIME, float, exposure time, 2.5*log(exptime)7 FIELD dR, D_RA, float, RA offset, arcsec 8 FIELD dD, D_DEC, float, DEC offset, arcsec 9 FIELD M, MAG, float, catalog mag, mag 10 FIELD Mcal, M_CAL, float, image cal mag, mag 11 FIELD Map, M_APER, float, aperture mag, mag 12 FIELD dM, MAG_ERR, float, mag error, mag 13 FIELD dMcal, MAG_CAL_ERR, float, systematic calibration error, mag 14 FIELD dt, M_TIME, float, exposure time, 2.5*log(exptime) 15 15 16 16 # note that with airmass = 1.0 / cos(90 - alt), we have full alt/az representation 17 FIELD airmass, AIRMASS, float, (airmass - 1), airmass17 FIELD airmass, AIRMASS, float, (airmass - 1), airmass 18 18 FIELD az, AZ, float, telescope azimuth 19 19 20 20 # new field elements needed for Pan-STARRS: 21 FIELD Xccd, X_CCD, float, X coord on chip, pixels22 FIELD Yccd, Y_CCD, float, Y coord on chip, pixels21 FIELD Xccd, X_CCD, float, X coord on chip, pixels 22 FIELD Yccd, Y_CCD, float, Y coord on chip, pixels 23 23 24 24 # could these be packed into fewer bits? 25 FIELD Sky, SKY_FLUX, float, local estimate of sky flux, counts/sec26 FIELD dSky, SKY_FLUX_ERR, float, local estimate of sky flux, counts/sec25 FIELD Sky, SKY_FLUX, float, local estimate of sky flux, counts/sec 26 FIELD dSky, SKY_FLUX_ERR, float, local estimate of sky flux, counts/sec 27 27 28 FIELD t, TIME, unsigned int, time in seconds (UNIX) 28 FIELD t, TIME, int, time in seconds (UNIX) 29 FIELD t_msec, TIME_MSEC, unsigned short, time fraction of second, milliseconds 29 30 FIELD averef, AVE_REF, unsigned int, reference to average entry 30 31 31 # Pan-STARRS uses a 64-bit detection ID. keep this in two 32 bit ints for backwards compatibility?32 32 FIELD detID, DET_ID, unsigned int, detection ID 33 33 FIELD imageID, IMAGE_ID, unsigned int, reference to DVO image ID 34 FIELD objID, OBJ_ID, unsigned int, unique ID for object in table 35 FIELD catID, CAT_ID, unsigned int, unique ID for table in which object was first realized 36 37 # PSPS uses a 64-bit detection ID 38 FIELD extID, EXT_ID, uint64_t, external ID (eg PSPS detID) 34 39 35 40 # do we need more resolution than a short? should this be a log? 36 FIELD qPSF,PSF_QF, float, psf coverage/quality factor41 FIELD psfQual, PSF_QF, float, psf coverage/quality factor 37 42 FIELD psfChisq, PSF_CHISQ, float, psf fit chisq 43 FIELD psfNdof, PSF_NDOF, int, psf degrees of freedom 44 FIELD psfNpix, PSF_NPIX, int, psf number of pixels 38 45 FIELD crNsigma, CR_NSIGMA, float, Nsigma deviation towards CR 39 46 FIELD extNsigma, EXT_NSIGMA, float, Nsigma deviation towards EXT 40 47 41 FIELD FWx, FWHM_MAJOR, short, object fwhm major axis, 1/100 of arcsec 42 FIELD FWy, FWHM_MINOR, short, object fwhm minor axis, 1/100 of arcsec 43 FIELD theta, PSF_THETA, short, angle wrt ccd X dir, (0xffff/360) deg 48 # model shape parameters 49 FIELD FWx, FWHM_MAJOR, short, object fwhm major axis, 1/100 of pixels 50 FIELD FWy, FWHM_MINOR, short, object fwhm minor axis, 1/100 of pixels 51 FIELD theta, PSF_THETA, short, angle wrt ccd X dir, (0xffff/360) deg 52 53 # moments 54 FIELD Mxx, MXX, short, second moments in pixel coords, 1/100 of pixels^2 55 FIELD Mxy, MXY, short, second moments in pixel coords, 1/100 of pixels^2 56 FIELD Myy, MYY, short, second moments in pixel coords, 1/100 of pixels^2 57 58 # convert this to error in pixels on load? 59 FIELD dXccd, X_CCD_ERR, short, X coord error on chip, 1/100 of pixels 60 FIELD dYccd, Y_CCD_ERR, short, Y coord error on chip, 1/100 of pixels 61 62 FIELD posangle, POSANGLE, short, position angle sky to chip, (0xffff/360) deg 63 FIELD pltscale, PLTSCALE, float, plate scale, arcsec/pixel 64 44 65 FIELD photcode, PHOTCODE, unsigned short, photcode 66 FIELD dbFlags, DB_FLAGS, unsigned int, flags supplied by analysis in database 67 FIELD photFlags, PHOT_FLAGS, unsigned int, flags supplied by photometry program 45 68 46 # convert this to error in arcsec on load?47 FIELD dXccd, X_CCD_ERR, short, X coord error on chip, pixels 48 FIELD dYccd, Y_CCD_ERR, short, Y coord error on chip, pixels 69 # *** 20090206 : new fields : t_msec, extID, Mxx, Mxy, Myy, posangle, 70 # psfNdof, psfNpix, Map_small; deprecated dophot. 71 # Changed dbFlags, photFlags : uint16_t to uint64_t 49 72 50 FIELD dbFlags, DB_FLAGS, unsigned short, flags for various uses 51 FIELD photFlags, PHOT_FLAGS, unsigned short, flags supplied by photometry program 52 53 FIELD stargal, STAR_GAL, char, star-galaxy separator 54 55 # absorb these into photFlags? 56 FIELD dophot, DOPHOT, char, dophot type 57 58 FIELD dummy, DUMMY, char[6], padding 73 # XXX unsigned int values are probably not being saved in the FITS file correctly: no BZERO, BSCALE -
trunk/Ohana/src/libautocode/def/secfilt.d
r12332 r21508 2 2 EXTNAME DVO_SECFILT 3 3 TYPE BINTABLE 4 SIZE 1 64 SIZE 18 5 5 DESCRIPTION DVO SecFilt : Secondary Filter Data 6 6 … … 11 11 FIELD Ncode, NCODE, short, number of detections in band 12 12 FIELD Nused, NUSED, short, number of detections used in average 13 FIELD dummy, JUNK, short, place holder 13 FIELD M_20, MAG_20, short, lower 20percent mag, millimags 14 FIELD M_80, MAG_80, short, upper 20percent mag, millimags 15 16 # *** 20090206 : new fields : M_20, M_80; dropped dummy -
trunk/Ohana/src/libautocode/doc/autocode.txt
r3515 r21508 1 2 2009.02.07 3 4 The autocode tables currently use type names which are ambiguous in 5 terms of their actual sizes in bits. I've added the intNN_t and 6 uintNN_t types -- this requires --use-gnu99 with configure 7 8 see libdvo/doc/notes.txt for instructions on adding new dvo catalog formats 9 10 2007.00.00 1 11 2 12 This directory contains a collection of autocoded FITS I/O routines -
trunk/Ohana/src/libautocode/generate
r7080 r21508 114 114 115 115 # rawshort is a short without byteswapping 116 # rawshort is a patch for old photreg tables 116 117 117 118 $pt1 = 0; … … 124 125 if ($type eq "int") { $pt1 = "J"; } 125 126 if ($type eq "unsigned int") { $pt1 = "J"; } 126 if ($type eq "e_time") { $pt1 = "J"; } 127 128 if ($type eq "int8_t") { $pt1 = "B"; } 129 if ($type eq "uint8_t") { $pt1 = "B"; } 130 if ($type eq "int16_t") { $pt1 = "I"; } 131 if ($type eq "uint16_t") { $pt1 = "I"; } 132 if ($type eq "int32_t") { $pt1 = "J"; } 133 if ($type eq "uint32_t") { $pt1 = "J"; } 134 135 # FITS tables do not allow for 64bit integers. we need to 136 # write these by splitting the value into high and low 32 bit values 137 if ($type eq "int64_t") { $pt1 = "J"; $Np = 2*$Np; } 138 if ($type eq "uint64_t") { $pt1 = "J"; $Np = 2*$Np; } 139 127 140 if ($type eq "float") { $pt1 = "E"; } 128 141 if ($type eq "double") { $pt1 = "D"; } 129 142 143 # special 'elixir' types: 144 if ($type eq "e_time") { $pt1 = "J"; } 130 145 if ($type eq "e_void") { $pt1 = "B"; $Np = 8*$Np; } 131 146 # e_void is a 64 bit pointer, cast to size_t. its value is not loaded … … 146 161 printf FILE "%-20s 1.0, 0.0);\n", "\"$unit[$i]\", "; 147 162 } 148 149 163 } 150 164 … … 217 231 if ($type eq "int") { $pt1 = sprintf "I%s", $length; } 218 232 if ($type eq "unsigned int") { $pt1 = sprintf "I%s", $length; } 219 if ($type eq "e_time") { $pt1 = sprintf "I%s", $length; } 233 234 if ($type eq "int8_t") { $pt1 = sprintf "I%s", $length; } 235 if ($type eq "uint8_t") { $pt1 = sprintf "I%s", $length; } 236 if ($type eq "int16_t") { $pt1 = sprintf "I%s", $length; } 237 if ($type eq "uint16_t") { $pt1 = sprintf "I%s", $length; } 238 if ($type eq "int32_t") { $pt1 = sprintf "I%s", $length; } 239 if ($type eq "uint32_t") { $pt1 = sprintf "I%s", $length; } 240 241 # FITS tables do not allow for 64bit integers. we need to 242 # write these by splitting the value into high and low 32 bit values 243 if ($type eq "int64_t") { $pt1 = sprintf "I%s", $length; } 244 if ($type eq "uint64_t") { $pt1 = sprintf "I%s", $length; } 245 220 246 if ($type eq "float") { $pt1 = sprintf "F%s", $length; } 221 247 if ($type eq "double") { $pt1 = sprintf "F%s", $length; } 222 248 249 # special 'elixir' types: 250 if ($type eq "e_time") { $pt1 = sprintf "I%s", $length; } 223 251 if ($type eq "e_void") { $pt1 = sprintf "I%s", $length; } 224 252 … … 283 311 if ($type eq "unsigned char") { $N += $Np; next; } 284 312 if ($type eq "rawshort") { $N += 2*$Np; next; } 313 285 314 if ($type eq "short") { $T = "BYTE"; $n = 2; } 286 315 if ($type eq "unsigned short"){ $T = "BYTE"; $n = 2; } 287 316 if ($type eq "int") { $T = "WORD"; $n = 4; } 288 317 if ($type eq "unsigned int") { $T = "WORD"; $n = 4; } 318 319 if ($type eq "int8_t") { $N += $Np; next; } 320 if ($type eq "uint8_t") { $N += $Np; next; } 321 if ($type eq "int16_t") { $T = "BYTE"; $n = 2; } 322 if ($type eq "uint16_t") { $T = "BYTE"; $n = 2; } 323 if ($type eq "int32_t") { $T = "WORD"; $n = 4; } 324 if ($type eq "uint32_t") { $T = "WORD"; $n = 4; } 325 326 # FITS tables do not allow for 64bit integers. we need to 327 # write these by splitting the value into high and low 32 bit values 328 if ($type eq "int64_t") { $T = "WORD"; $n = 4; $Np = 2*$Np; } 329 if ($type eq "uint64_t") { $T = "WORD"; $n = 4; $Np = 2*$Np; } 330 331 if ($type eq "float") { $T = "WORD"; $n = 4; } 332 if ($type eq "double") { $T = "DBLE"; $n = 8; } 333 334 # special 'elixir' types: 289 335 if ($type eq "e_time") { $T = "WORD"; $n = 4; } 290 336 if ($type eq "e_void") { $T = "DBLE"; $n = 8; } 291 if ($type eq "float") { $T = "WORD"; $n = 4; } 292 if ($type eq "double") { $T = "DBLE"; $n = 8; } 337 293 338 if (!$n) { die "unknown type $type"; } 294 339 for ($j = 0; $j < $Np; $j++) { … … 318 363 if ($type eq "int") { $Nbytes += 4*$Np; $valid = 1; } 319 364 if ($type eq "unsigned int") { $Nbytes += 4*$Np; $valid = 1; } 365 366 if ($type eq "int8_t") { $Nbytes += 1*$Np; $valid = 1; } 367 if ($type eq "uint8_t") { $Nbytes += 1*$Np; $valid = 1; } 368 if ($type eq "int16_t") { $Nbytes += 2*$Np; $valid = 1; } 369 if ($type eq "uint16_t") { $Nbytes += 2*$Np; $valid = 1; } 370 if ($type eq "int32_t") { $Nbytes += 4*$Np; $valid = 1; } 371 if ($type eq "uint32_t") { $Nbytes += 4*$Np; $valid = 1; } 372 373 # FITS tables do not allow for 64bit integers. we need to 374 # write these by splitting the value into high and low 32 bit values 375 if ($type eq "int64_t") { $Nbytes += 8*$Np; $valid = 1; } 376 if ($type eq "uint64_t") { $Nbytes += 8*$Np; $valid = 1; } 377 378 if ($type eq "float") { $Nbytes += 4*$Np; $valid = 1; } 379 if ($type eq "double") { $Nbytes += 8*$Np; $valid = 1; } 380 381 # special 'elixir' types: 320 382 if ($type eq "e_time") { $Nbytes += 4*$Np; $valid = 1; } 321 383 if ($type eq "e_void") { $Nbytes += 8*$Np; $valid = 1; } 322 if ($type eq "float") { $Nbytes += 4*$Np; $valid = 1; }323 if ($type eq "double") { $Nbytes += 8*$Np; $valid = 1; }324 384 if (!$valid) { die "unknown type $type"; } 325 385 } -
trunk/Ohana/src/libdvo/Makefile
r17419 r21508 31 31 $(DESTINC)/ps1_dev_1_defs.h \ 32 32 $(DESTINC)/ps1_dev_2_defs.h \ 33 $(DESTINC)/ps1_dev_3_defs.h 33 $(DESTINC)/ps1_dev_3_defs.h \ 34 $(DESTINC)/ps1_v1_defs.h 34 35 35 36 INCS = $(DEFS) $(DESTINC)/dvo.h $(DESTINC)/autocode.h … … 65 66 $(SRC)/dvo_convert_PS1_DEV_2.$(ARCH).o \ 66 67 $(SRC)/dvo_convert_PS1_DEV_3.$(ARCH).o \ 68 $(SRC)/dvo_convert_PS1_V1.$(ARCH).o \ 67 69 $(SRC)/skyregion_io.$(ARCH).o \ 68 70 $(SRC)/skyregion_gsc.$(ARCH).o \ -
trunk/Ohana/src/libdvo/doc/notes.txt
r12332 r21508 2 2 Adding a new dvo catalog format. Assume the new format name is 'foo'. 3 3 4 1) create the autocode definition files for average, measure, secfilt, image5 these files must be a subset of the internal versions of these same6 tables. if you intend to add fields which don't exist in the7 internal tables, you must update the internal tables as well. the8 naming convention is: average-foo.d, etc.4 1) create the autocode definition files for average, measure, secfilt, 5 image, and photcode. these files must be a subset of the internal 6 versions of these same tables. if you intend to add fields which 7 don't exist in the internal tables, you must update the internal 8 tables as well. the naming convention is: average-foo.d, etc. 9 9 10 10 2) add the new definition files to libautocode/Makefile.Targets (both … … 22 22 (libdvo/src/dvo_catalog.c). The name should be "FOO". 23 23 24 6) add entry for structure size in dvo_catalog_load_raw 25 (libdvo/src/dvo_catalog_raw.c), since this is not available from 26 the header. 24 6) in libdvo/src/dvo_catalog_raw.c, update the FORMAT_CASE lists to 25 include the new STRUCT name. 27 26 28 7) add entries in ReadRawAverage, WriteRawAverage, ReadRawMeasure, 29 WriteRawMeasure, ReadRawSecFilt, WriteRawSecFilt. Make sure to use 30 the new STRUCT names. the conversion function gfit_convert_Foo will 31 be automatically generated. 27 7) create a new conversion file dvo_convert_foo.c and define the 28 internal to Foo conversions. 32 29 33 8) add entry in WriteRawAverage, making sure to use the new STRUCT 34 name. the conversion function gfit_convert_Foo will be 35 automatically generated. 30 8) add the new format to the list of FORMAT conversion in dvo_convert.c. 36 31 37 9) create a new conversion file dvo_convert_foo.c and define the 38 internal to Foo conversions. 32 9) any changes to the internal format need to be reflected in the 33 functions in the dvo_convert_*.c files. These files are defined so 34 that changed fields are sequential in the functions. This should 35 make is easy to identify the new changes needed. 36 37 10) add the new format to the section at the end of dvo_image.c 38 39 11) add the new format to the dvo_image_raw.c 40 41 12) add the photcode format conversions to libdvo/src/LoadPhotcodesFITS.c 42 43 12) switch the output photcode format conversion ina libdvo/src/SavePhotcodesFITS.c 44 45 13) Add the conversion functions to the header file libdvo/include/foo_defs.h 39 46 40 47 * Note some esoteric format issues: … … 54 61 keywords. 55 62 63 ---- 64 65 20090207 : adding PS1_V1 66 67 measure: 68 new fields : t_msec, extID, Mxx, Mxy, Myy, dTccd; deprecated dophot 69 dbFlags, photFlags : uint16_t to uint64_t 70 71 average: 72 new fields : ChiSq, Npos, flags (was code, uint16_t), extID 73 74 secfilt: 75 new fields : M_20, M_80; dropped dummy 76 77 image: 78 new fields : parentID, flags (was code char), changed name to 121 bytes. 79 80 photcode: 81 new fields : NONE 82 83 ** parentID was added to enable easy lookups from chip->fpa for mosaic 84 astrometry. In old databases, this conversion was done by making 85 the match via the time and photcode. This conversion needs to be 86 done on load... -
trunk/Ohana/src/libdvo/include/dvo.h
r21153 r21508 18 18 DVO_FORMAT_PS1_DEV_1, 19 19 DVO_FORMAT_PS1_DEV_2, 20 DVO_FORMAT_PS1_DEV_3 20 DVO_FORMAT_PS1_DEV_3, 21 DVO_FORMAT_PS1_V1 21 22 } DVOTableFormat; 22 23 … … 407 408 # include "ps1_dev_2_defs.h" 408 409 # include "ps1_dev_3_defs.h" 410 # include "ps1_v1_defs.h" 409 411 410 412 /*** DVO image db I/O Functions ***/ … … 444 446 void sort_image_subset (Image *image, int *subset, int N); 445 447 void sort_coords_index (double *X, double *Y, int *S, int N); 446 void sort_stars_ra (Stars *stars, int N);447 448 void sort_regions (SkyRegion *region, int N); 448 449 -
trunk/Ohana/src/libdvo/src/LoadPhotcodesFITS.c
r17190 r21508 40 40 gfits_scan (&db.theader, "EXTNAME", "%s", 1, extname); 41 41 42 if (!strcmp (extname, "DVO_PHOTCODE") || !strcmp (extname, "DVO_PHOTCODE_ELIXIR")) { 42 if (!strcmp (extname, "DVO_PHOTCODE")) { 43 PhotCode_Elixir *photcode_elixir = gfits_table_get_PhotCode_Elixir (&db.ftable, &Ncode, &db.swapped); 44 photcode = PhotCode_Elixir_To_Internal (photcode_elixir, Ncode); 45 free (photcode_elixir); 46 } 47 48 if (!strcmp (extname, "DVO_PHOTCODE_ELIXIR")) { 43 49 PhotCode_Elixir *photcode_elixir = gfits_table_get_PhotCode_Elixir (&db.ftable, &Ncode, &db.swapped); 44 50 photcode = PhotCode_Elixir_To_Internal (photcode_elixir, Ncode); … … 62 68 photcode = PhotCode_PS1_DEV_3_To_Internal (photcode_ps1_dev_3, Ncode); 63 69 free (photcode_ps1_dev_3); 70 } 71 72 if (!strcmp (extname, "DVO_PHOTCODE_PS1_V1")) { 73 PhotCode_PS1_V1 *photcode_ps1_v1 = gfits_table_get_PhotCode_PS1_V1 (&db.ftable, &Ncode, &db.swapped); 74 photcode = PhotCode_PS1_V1_To_Internal (photcode_ps1_v1, Ncode); 75 free (photcode_ps1_v1); 64 76 } 65 77 -
trunk/Ohana/src/libdvo/src/SavePhotcodesFITS.c
r17190 r21508 29 29 // for the moment, we simply support the latest photcode format for output 30 30 // XXX update this as needed as new formats are defined 31 PhotCode_PS1_ DEV_3 *photcode_output = PhotCode_Internal_To_PS1_DEV_3(table[0].code, table[0].Ncode);31 PhotCode_PS1_V1 *photcode_output = PhotCode_Internal_To_PS1_V1 (table[0].code, table[0].Ncode); 32 32 33 33 /* convert FITS format data to internal format (byteswaps & EXTNAME) */ 34 34 gfits_db_create (&db); 35 gfits_table_set_PhotCode_PS1_ DEV_3(&db.ftable, photcode_output, table[0].Ncode);35 gfits_table_set_PhotCode_PS1_V1 (&db.ftable, photcode_output, table[0].Ncode); 36 36 gfits_db_save (&db); 37 37 gfits_db_close (&db); -
trunk/Ohana/src/libdvo/src/dvo_catalog.c
r20981 r21508 52 52 if (!strcasecmp (catformat, "PS1_DEV_1")) return (DVO_FORMAT_PS1_DEV_1); 53 53 if (!strcasecmp (catformat, "PS1_DEV_2")) return (DVO_FORMAT_PS1_DEV_2); 54 if (!strcasecmp (catformat, "PS1_V1")) return (DVO_FORMAT_PS1_V1); 54 55 return (DVO_FORMAT_UNDEF); 55 56 } -
trunk/Ohana/src/libdvo/src/dvo_catalog_raw.c
r20982 r21508 86 86 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 87 87 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 88 FORMAT_CASE (PS1_V1, PS1_V1); 88 89 89 90 default: … … 271 272 if (catalog[0].catformat == DVO_FORMAT_PS1_DEV_1) gfits_modify (&catalog[0].header, "FORMAT", "%s", 1, "PS1_DEV_1"); 272 273 if (catalog[0].catformat == DVO_FORMAT_PS1_DEV_2) gfits_modify (&catalog[0].header, "FORMAT", "%s", 1, "PS1_DEV_2"); 274 if (catalog[0].catformat == DVO_FORMAT_PS1_V1) gfits_modify (&catalog[0].header, "FORMAT", "%s", 1, "PS1_V1"); 273 275 274 276 /* rewind file pointers and truncate file */ … … 366 368 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 367 369 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 370 FORMAT_CASE (PS1_V1, PS1_V1); 368 371 369 372 default: … … 412 415 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 413 416 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 417 FORMAT_CASE (PS1_V1, PS1_V1); 414 418 415 419 default: … … 462 466 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 463 467 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 468 FORMAT_CASE (PS1_V1, PS1_V1); 464 469 465 470 default: … … 508 513 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 509 514 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 515 FORMAT_CASE (PS1_V1, PS1_V1); 510 516 511 517 default: … … 558 564 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 559 565 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 566 FORMAT_CASE (PS1_V1, PS1_V1); 560 567 561 568 default: … … 604 611 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 605 612 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 613 FORMAT_CASE (PS1_V1, PS1_V1); 606 614 607 615 default: -
trunk/Ohana/src/libdvo/src/dvo_convert.c
r19185 r21508 49 49 CONVERT_FORMAT ("DVO_AVERAGE_PS1_DEV_1", PS1_DEV_1, PS1_DEV_1); 50 50 CONVERT_FORMAT ("DVO_AVERAGE_PS1_DEV_2", PS1_DEV_2, PS1_DEV_2); 51 CONVERT_FORMAT ("DVO_AVERAGE_PS1_V1", PS1_V1, PS1_V1); 51 52 # undef CONVERT_FORMAT 52 53 … … 79 80 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 80 81 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 82 FORMAT_CASE (PS1_V1, PS1_V1); 81 83 # undef FORMAT_CASE 82 84 … … 122 124 CONVERT_FORMAT ("DVO_MEASURE_PS1_DEV_1", PS1_DEV_1, PS1_DEV_1); 123 125 CONVERT_FORMAT ("DVO_MEASURE_PS1_DEV_2", PS1_DEV_2, PS1_DEV_2); 126 CONVERT_FORMAT ("DVO_MEASURE_PS1_V1", PS1_V1, PS1_V1); 124 127 # undef CONVERT_FORMAT 125 128 … … 152 155 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 153 156 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 157 FORMAT_CASE (PS1_V1, PS1_V1); 154 158 # undef FORMAT_CASE 155 159 … … 195 199 CONVERT_FORMAT ("DVO_SECFILT_PS1_DEV_1", PS1_DEV_1, PS1_DEV_1); 196 200 CONVERT_FORMAT ("DVO_SECFILT_PS1_DEV_2", PS1_DEV_2, PS1_DEV_2); 201 CONVERT_FORMAT ("DVO_SECFILT_PS1_V1", PS1_V1, PS1_V1); 197 202 # undef CONVERT_FORMAT 198 203 … … 225 230 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 226 231 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 232 FORMAT_CASE (PS1_V1, PS1_V1); 227 233 # undef FORMAT_CASE 228 234 … … 288 294 CONVERT_FORMAT ("DVO_IMAGE_PS1_DEV_1", PS1_DEV_1, PS1_DEV_1); 289 295 CONVERT_FORMAT ("DVO_IMAGE_PS1_DEV_2", PS1_DEV_2, PS1_DEV_2); 290 CONVERT_FORMAT ("DVO_IMAGE_PS1_DEV_3", PS1_DEV_3, PS1_DEV_3); 296 CONVERT_FORMAT ("DVO_IMAGE_PS1_V1", PS1_V1, PS1_V1); 297 298 // XXX Not sure this was ever actually used -- it was not complete... 299 // CONVERT_FORMAT ("DVO_IMAGE_PS1_DEV_3", PS1_DEV_3, PS1_DEV_3); 300 291 301 # undef CONVERT_FORMAT 292 302 … … 322 332 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 323 333 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 324 FORMAT_CASE (PS1_DEV_3, PS1_DEV_3); 334 FORMAT_CASE (PS1_V1, PS1_V1); 335 336 // XXX not sure this was actually used: it was incomplete 337 // FORMAT_CASE (PS1_DEV_3, PS1_DEV_3); 325 338 # undef FORMAT_CASE 326 339 … … 372 385 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 373 386 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 374 FORMAT_CASE (PS1_DEV_3, PS1_DEV_3); 387 FORMAT_CASE (PS1_V1, PS1_V1); 388 389 // XXX not sure this was used, it was incomplete 390 // FORMAT_CASE (PS1_DEV_3, PS1_DEV_3); 391 375 392 # undef FORMAT_CASE 376 393 -
trunk/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_1.c
r19185 r21508 15 15 out[i].M = in[i].M; 16 16 out[i].Mcal = in[i].Mcal; 17 out[i].Map = in[i].Mgal;18 17 out[i].dM = in[i].dM; 19 18 out[i].dt = in[i].dt; … … 28 27 out[i].detID = in[i].detID; 29 28 out[i].imageID = in[i].imageID; 30 out[i]. qPSF = in[i].qPSF;29 out[i].psfQual = in[i].psfQual; 31 30 out[i].psfChisq = in[i].psfChisq; 32 31 out[i].crNsigma = in[i].crNsigma; … … 40 39 out[i].dbFlags = in[i].dbFlags; 41 40 out[i].photFlags = in[i].photFlags; 42 out[i].stargal = in[i].stargal; 43 out[i].dophot = in[i].dophot; 41 42 // changed or added for PS1_DEV_2 43 out[i].Map = in[i].Mgal; 44 out[i].dMcal = 0; 45 46 // changed or added for PS1_V1 47 out[i].photFlags = in[i].photFlags | (in[i].dophot << 16); 48 out[i].t_msec = 0; 49 out[i].extID = 0; 50 out[i].objID = 0; 51 out[i].catID = 0; 52 out[i].Mxx = 0.0; 53 out[i].Mxy = 0.0; 54 out[i].Myy = 0.0; 55 out[i].posangle = 0; 56 out[i].pltscale = 0; 57 out[i].psfNdof = 0; 58 out[i].psfNpix = 0; 44 59 } 45 60 return (out); … … 58 73 out[i].M = in[i].M; 59 74 out[i].Mcal = in[i].Mcal; 60 out[i].Mgal = in[i].Map;61 75 out[i].dM = in[i].dM; 62 76 out[i].dt = in[i].dt; … … 71 85 out[i].detID = in[i].detID; 72 86 out[i].imageID = in[i].imageID; 73 out[i]. qPSF = in[i].qPSF;87 out[i].psfQual = in[i].psfQual; 74 88 out[i].psfChisq = in[i].psfChisq; 75 89 out[i].crNsigma = in[i].crNsigma; … … 82 96 out[i].dYccd = in[i].dYccd; 83 97 out[i].dbFlags = in[i].dbFlags; 84 out[i].photFlags = in[i].photFlags; 85 out[i].stargal = in[i].stargal; 86 out[i].dophot = in[i].dophot; 98 99 // changed or added for PS1_DEV_2 100 out[i].Mgal = in[i].Map; 101 102 // changed or added for PS1_V1 103 out[i].photFlags = in[i].photFlags & 0x0000ffff; 104 out[i].dophot = in[i].photFlags >> 16; 87 105 } 88 106 return (out); … … 101 119 out[i].D = in[i].D; 102 120 out[i].Xp = in[i].Xp; 103 out[i].Nmeasure = in[i].Nm;104 out[i].Nmissing = in[i].Nn;105 out[i].code = in[i].code;106 out[i].measureOffset = in[i].offset;107 out[i].missingOffset = in[i].missing;108 121 out[i].dR = in[i].dR; 109 122 out[i].dD = in[i].dD; … … 116 129 out[i].objID = in[i].objID; 117 130 out[i].catID = in[i].catID; 131 132 // changed or added for PS1_DEV_2 133 out[i].Nmeasure = in[i].Nm; 134 out[i].Nmissing = in[i].Nn; 135 out[i].measureOffset = in[i].offset; 136 out[i].missingOffset = in[i].missing; 137 out[i].Nextend = 0; 138 out[i].extendOffset = 0; 139 140 // changed or added for PS1_V1 141 out[i].flags = in[i].code; 142 out[i].ChiSq = 0.0; 143 out[i].Npos = 0.0; 144 out[i].extID = 0; 118 145 } 119 146 return (out); … … 129 156 130 157 for (i = 0; i < Nvalues; i++) { 131 out[i].R = in[i].R; 132 out[i].D = in[i].D; 133 out[i].Xp = in[i].Xp; 134 out[i].Nm = in[i].Nmeasure; 135 out[i].Nn = in[i].Nmissing; 136 out[i].code = in[i].code; 137 out[i].offset = in[i].measureOffset; 138 out[i].missing = in[i].missingOffset; 139 out[i].dR = in[i].dR; 140 out[i].dD = in[i].dD; 141 out[i].uR = in[i].uR; 142 out[i].uD = in[i].uD; 143 out[i].duR = in[i].duR; 144 out[i].duD = in[i].duD; 145 out[i].P = in[i].P; 146 out[i].dP = in[i].dP; 147 out[i].objID = in[i].objID; 148 out[i].catID = in[i].catID; 158 out[i].R = in[i].R; 159 out[i].D = in[i].D; 160 out[i].Xp = in[i].Xp; 161 out[i].dR = in[i].dR; 162 out[i].dD = in[i].dD; 163 out[i].uR = in[i].uR; 164 out[i].uD = in[i].uD; 165 out[i].duR = in[i].duR; 166 out[i].duD = in[i].duD; 167 out[i].P = in[i].P; 168 out[i].dP = in[i].dP; 169 out[i].objID = in[i].objID; 170 out[i].catID = in[i].catID; 171 172 // changed or added for PS1_DEV_2 173 out[i].Nm = in[i].Nmeasure; 174 out[i].Nn = in[i].Nmissing; 175 out[i].offset = in[i].measureOffset; 176 out[i].missing = in[i].missingOffset; 177 178 // changed or added for PS1_V1 179 out[i].code = in[i].flags; 149 180 } 150 181 return (out); … … 164 195 out[i].Ncode = in[i].Ncode; 165 196 out[i].Nused = in[i].Nused; 197 198 // changed or added for PS1_V1 199 out[i].M_20 = 0; 200 out[i].M_80 = 0; 166 201 } 167 202 return (out); … … 218 253 out[i].fwhm_y = in[i].fwhm_y; 219 254 out[i].trate = in[i].trate; 220 out[i].code = in[i].code;221 255 out[i].ccdnum = in[i].ccdnum; 222 256 out[i].imageID = in[i].imageID; … … 237 271 out[i].Mxyyy = in[i].Mxyyy; 238 272 out[i].Myyyy = in[i].Myyyy; 273 274 // changed or added for PS1_DEV_2 275 out[i].externID = 0; 276 out[i].sourceID = 0; 277 278 // changed or added for PS1_V1 279 out[i].flags = in[i].code; 280 out[i].parentID = 0; 239 281 } 240 282 return (out); … … 275 317 out[i].fwhm_y = in[i].fwhm_y; 276 318 out[i].trate = in[i].trate; 277 out[i].code = in[i].code;278 319 out[i].ccdnum = in[i].ccdnum; 279 320 out[i].imageID = in[i].imageID; … … 294 335 out[i].Mxyyy = in[i].Mxyyy; 295 336 out[i].Myyyy = in[i].Myyyy; 337 338 // changed or added for PS1_V1 339 out[i].code = in[i].flags; 340 } 341 return (out); 342 } 343 344 PhotCode *PhotCode_PS1_DEV_1_To_Internal (PhotCode_PS1_DEV_1 *in, int Nvalues) { 345 346 int i; 347 PhotCode *out; 348 349 ALLOCATE (out, PhotCode, Nvalues); 350 351 for (i = 0; i < Nvalues; i++) { 352 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 353 out[i].name[31] = 0; // force termination 354 355 out[i].code = in[i].code; 356 out[i].type = in[i].type; 357 out[i].C = in[i].C; 358 out[i].dC = in[i].dC; 359 out[i].dX = in[i].dX; 360 out[i].K = in[i].K; 361 out[i].c1 = in[i].c1; 362 out[i].c2 = in[i].c2; 363 out[i].equiv = in[i].equiv; 364 out[i].Nc = in[i].Nc; 365 memcpy (out[i].X, in[i].X, 4*sizeof(float)); 366 367 out[i].astromErrMagScale = in[i].astromErrMagScale; 368 out[i].photomErrSys = in[i].photomErrSys; 369 370 // changed or added for PS1_DEV_2 371 out[i].astromErrSys = 0.0; 372 out[i].astromErrScale = 0.0; 373 374 // changed or added for PS1_V1 (also PS1_DEV_3, deprecated) 375 out[i].photomPoorMask = 0; 376 out[i].photomBadMask = 0; 377 out[i].astromPoorMask = 0; 378 out[i].astromBadMask = 0; 296 379 } 297 380 return (out); … … 323 406 out[i].astromErrMagScale = out[i].astromErrMagScale; 324 407 out[i].photomErrSys = out[i].photomErrSys; 325 326 } 327 return (out); 328 } 329 330 PhotCode *PhotCode_PS1_DEV_1_To_Internal (PhotCode_PS1_DEV_1 *in, int Nvalues) { 331 332 int i; 333 PhotCode *out; 334 335 ALLOCATE (out, PhotCode, Nvalues); 336 337 for (i = 0; i < Nvalues; i++) { 338 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 339 out[i].name[31] = 0; // force termination 340 341 out[i].code = in[i].code; 342 out[i].type = in[i].type; 343 out[i].C = in[i].C; 344 out[i].dC = in[i].dC; 345 out[i].dX = in[i].dX; 346 out[i].K = in[i].K; 347 out[i].c1 = in[i].c1; 348 out[i].c2 = in[i].c2; 349 out[i].equiv = in[i].equiv; 350 out[i].Nc = in[i].Nc; 351 352 // not defined in PS1_DEV_1 353 out[i].astromErrSys = 0.0; 354 out[i].astromErrScale = 0.0; 355 out[i].astromErrMagScale = in[i].astromErrMagScale; 356 out[i].photomErrSys = in[i].photomErrSys; 357 358 memcpy (out[i].X, in[i].X, 4*sizeof(float)); 359 360 out[i].photomPoorMask = 0; 361 out[i].photomBadMask = 0; 362 out[i].astromPoorMask = 0; 363 out[i].astromBadMask = 0; 364 } 365 return (out); 366 } 408 } 409 return (out); 410 } -
trunk/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_2.c
r19185 r21508 29 29 out[i].detID = in[i].detID; 30 30 out[i].imageID = in[i].imageID; 31 out[i]. qPSF = in[i].qPSF;31 out[i].psfQual = in[i].psfQual; 32 32 out[i].psfChisq = in[i].psfChisq; 33 33 out[i].crNsigma = in[i].crNsigma; … … 40 40 out[i].dYccd = in[i].dYccd; 41 41 out[i].dbFlags = in[i].dbFlags; 42 out[i].photFlags = in[i].photFlags; 43 out[i].stargal = in[i].stargal; 44 out[i].dophot = in[i].dophot; 42 43 // changed or added for PS1_V1 44 out[i].photFlags = in[i].photFlags | (in[i].dophot << 16); 45 out[i].t_msec = 0; 46 out[i].extID = 0; 47 out[i].objID = 0; 48 out[i].catID = 0; 49 out[i].Mxx = 0.0; 50 out[i].Mxy = 0.0; 51 out[i].Myy = 0.0; 52 out[i].posangle = 0; 53 out[i].pltscale = 0; 54 out[i].psfNdof = 0; 55 out[i].psfNpix = 0; 45 56 } 46 57 return (out); … … 73 84 out[i].detID = in[i].detID; 74 85 out[i].imageID = in[i].imageID; 75 out[i]. qPSF = in[i].qPSF;86 out[i].psfQual = in[i].psfQual; 76 87 out[i].psfChisq = in[i].psfChisq; 77 88 out[i].crNsigma = in[i].crNsigma; … … 84 95 out[i].dYccd = in[i].dYccd; 85 96 out[i].dbFlags = in[i].dbFlags; 86 out[i].photFlags = in[i].photFlags; 87 out[i].stargal = in[i].stargal; 88 out[i].dophot = in[i].dophot; 97 98 // changed or added for PS1_V1 99 out[i].photFlags = in[i].photFlags & 0x0000ffff; 100 out[i].dophot = in[i].photFlags >> 16; 89 101 } 90 102 return (out); … … 114 126 out[i].Nmissing = in[i].Nmissing; 115 127 out[i].Nextend = in[i].Nextend; 116 out[i].code = in[i].code;117 128 out[i].measureOffset = in[i].measureOffset; 118 129 out[i].missingOffset = in[i].missingOffset; … … 120 131 out[i].objID = in[i].objID; 121 132 out[i].catID = in[i].catID; 133 134 // changed or added for PS1_V1 135 out[i].flags = in[i].code; 136 out[i].ChiSq = 0.0; 137 out[i].Npos = 0.0; 138 out[i].extID = 0; 122 139 } 123 140 return (out); … … 147 164 out[i].Nmissing = in[i].Nmissing; 148 165 out[i].Nextend = in[i].Nextend; 149 out[i].code = in[i].code;150 166 out[i].measureOffset = in[i].measureOffset; 151 167 out[i].missingOffset = in[i].missingOffset; … … 153 169 out[i].objID = in[i].objID; 154 170 out[i].catID = in[i].catID; 171 172 // changed or added for PS1_V1 173 out[i].code = in[i].flags; 155 174 } 156 175 return (out); … … 170 189 out[i].Ncode = in[i].Ncode; 171 190 out[i].Nused = in[i].Nused; 191 192 // changed or added for PS1_V1 193 out[i].M_20 = 0; 194 out[i].M_80 = 0; 172 195 } 173 196 return (out); … … 201 224 memcpy (&out[i].coords, &in[i].coords, sizeof(Coords)); 202 225 203 strncpy (out[i].name, in[i].name, 63); // out[12 8], int[64]226 strncpy (out[i].name, in[i].name, 63); // out[121], int[64] 204 227 out[i].name[63] = 0; // force termination 205 228 … … 224 247 out[i].fwhm_y = in[i].fwhm_y; 225 248 out[i].trate = in[i].trate; 226 out[i].code = in[i].code;227 249 out[i].ccdnum = in[i].ccdnum; 228 250 out[i].imageID = in[i].imageID; … … 245 267 out[i].Mxyyy = in[i].Mxyyy; 246 268 out[i].Myyyy = in[i].Myyyy; 269 270 // changed or added for PS1_V1 271 out[i].flags = in[i].code; 272 out[i].parentID = 0; 247 273 } 248 274 return (out); … … 259 285 memcpy (&out[i].coords, &in[i].coords, sizeof(Coords)); 260 286 261 strncpy (out[i].name, in[i].name, 63); // in[12 8], out[64]287 strncpy (out[i].name, in[i].name, 63); // in[121], out[64] 262 288 out[i].name[63] = 0; // force termination 263 289 … … 282 308 out[i].fwhm_y = in[i].fwhm_y; 283 309 out[i].trate = in[i].trate; 284 out[i].code = in[i].code;285 310 out[i].ccdnum = in[i].ccdnum; 286 311 out[i].imageID = in[i].imageID; … … 303 328 out[i].Mxyyy = in[i].Mxyyy; 304 329 out[i].Myyyy = in[i].Myyyy; 305 } 306 return (out); 307 } 308 309 PhotCode_PS1_DEV_2 *PhotCode_Internal_To_PS1_DEV_2 (PhotCode *in, int Nvalues) { 310 311 int i; 312 PhotCode_PS1_DEV_2 *out; 313 314 ALLOCATE (out, PhotCode_PS1_DEV_2, Nvalues); 330 331 // changed or added for PS1_V1 332 out[i].code = in[i].flags; 333 } 334 return (out); 335 } 336 337 PhotCode *PhotCode_PS1_DEV_2_To_Internal (PhotCode_PS1_DEV_2 *in, int Nvalues) { 338 339 int i; 340 PhotCode *out; 341 342 ALLOCATE (out, PhotCode, Nvalues); 315 343 316 344 for (i = 0; i < Nvalues; i++) { … … 334 362 out[i].astromErrMagScale = in[i].astromErrMagScale; 335 363 out[i].photomErrSys = in[i].photomErrSys; 336 } 337 return (out); 338 } 339 340 PhotCode *PhotCode_PS1_DEV_2_To_Internal (PhotCode_PS1_DEV_2 *in, int Nvalues) { 341 342 int i; 343 PhotCode *out; 344 345 ALLOCATE (out, PhotCode, Nvalues); 364 365 // changed or added for PS1_V1 (also PS1_DEV_3, deprecated) 366 out[i].photomPoorMask = 0; 367 out[i].photomBadMask = 0; 368 out[i].astromPoorMask = 0; 369 out[i].astromBadMask = 0; 370 } 371 return (out); 372 } 373 374 PhotCode_PS1_DEV_2 *PhotCode_Internal_To_PS1_DEV_2 (PhotCode *in, int Nvalues) { 375 376 int i; 377 PhotCode_PS1_DEV_2 *out; 378 379 ALLOCATE (out, PhotCode_PS1_DEV_2, Nvalues); 346 380 347 381 for (i = 0; i < Nvalues; i++) { … … 365 399 out[i].astromErrMagScale = in[i].astromErrMagScale; 366 400 out[i].photomErrSys = in[i].photomErrSys; 367 368 out[i].photomPoorMask = 0; 369 out[i].photomBadMask = 0; 370 out[i].astromPoorMask = 0; 371 out[i].astromBadMask = 0; 372 } 373 return (out); 374 } 401 } 402 return (out); 403 } -
trunk/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_3.c
r19185 r21508 3 3 /* convert PS1_DEV_3 formats to internal formats */ 4 4 5 // XXX EAM I am not yet ready to commit to a full PS1_DEV_3 release, but I am providingimage and photcode conversion5 // We only provide image and photcode conversion 6 6 7 7 Image *Image_PS1_DEV_3_ToInternal (Image_PS1_DEV_3 *in, int Nvalues) { … … 38 38 out[i].fwhm_y = in[i].fwhm_y; 39 39 out[i].trate = in[i].trate; 40 out[i].code = in[i].code;41 40 out[i].ccdnum = in[i].ccdnum; 42 41 out[i].imageID = in[i].imageID; … … 59 58 out[i].Mxyyy = in[i].Mxyyy; 60 59 out[i].Myyyy = in[i].Myyyy; 60 61 // changed or added for PS1_V1 62 out[i].flags = in[i].code; 63 out[i].parentID = 0; 61 64 } 62 65 return (out); … … 96 99 out[i].fwhm_y = in[i].fwhm_y; 97 100 out[i].trate = in[i].trate; 98 out[i].code = in[i].code;99 101 out[i].ccdnum = in[i].ccdnum; 100 102 out[i].imageID = in[i].imageID; … … 117 119 out[i].Mxyyy = in[i].Mxyyy; 118 120 out[i].Myyyy = in[i].Myyyy; 121 122 // changed or added for PS1_V1 123 out[i].code = in[i].flags; 124 } 125 return (out); 126 } 127 128 PhotCode *PhotCode_PS1_DEV_3_To_Internal (PhotCode_PS1_DEV_3 *in, int Nvalues) { 129 130 int i; 131 PhotCode *out; 132 133 ALLOCATE (out, PhotCode, Nvalues); 134 135 for (i = 0; i < Nvalues; i++) { 136 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 137 out[i].name[31] = 0; // force termination 138 139 out[i].code = in[i].code; 140 out[i].type = in[i].type; 141 out[i].C = in[i].C; 142 out[i].dC = in[i].dC; 143 out[i].dX = in[i].dX; 144 out[i].K = in[i].K; 145 out[i].c1 = in[i].c1; 146 out[i].c2 = in[i].c2; 147 out[i].equiv = in[i].equiv; 148 out[i].Nc = in[i].Nc; 149 memcpy (out[i].X, in[i].X, 4*sizeof(float)); 150 151 out[i].astromErrSys = in[i].astromErrSys; 152 out[i].astromErrScale = in[i].astromErrScale; 153 out[i].astromErrMagScale = in[i].astromErrMagScale; 154 out[i].photomErrSys = in[i].photomErrSys; 155 156 out[i].photomPoorMask = in[i].photomPoorMask; 157 out[i].photomBadMask = in[i].photomBadMask; 158 out[i].astromPoorMask = in[i].astromPoorMask; 159 out[i].astromBadMask = in[i].astromBadMask; 119 160 } 120 161 return (out); … … 157 198 } 158 199 159 PhotCode *PhotCode_PS1_DEV_3_To_Internal (PhotCode_PS1_DEV_3 *in, int Nvalues) {160 161 int i;162 PhotCode *out;163 164 ALLOCATE (out, PhotCode, Nvalues);165 166 for (i = 0; i < Nvalues; i++) {167 strncpy (out[i].name, in[i].name, 31); // out[32], in[32]168 out[i].name[31] = 0; // force termination169 170 out[i].code = in[i].code;171 out[i].type = in[i].type;172 out[i].C = in[i].C;173 out[i].dC = in[i].dC;174 out[i].dX = in[i].dX;175 out[i].K = in[i].K;176 out[i].c1 = in[i].c1;177 out[i].c2 = in[i].c2;178 out[i].equiv = in[i].equiv;179 out[i].Nc = in[i].Nc;180 memcpy (out[i].X, in[i].X, 4*sizeof(float));181 182 out[i].astromErrSys = in[i].astromErrSys;183 out[i].astromErrScale = in[i].astromErrScale;184 out[i].astromErrMagScale = in[i].astromErrMagScale;185 out[i].photomErrSys = in[i].photomErrSys;186 187 out[i].photomPoorMask = in[i].photomPoorMask;188 out[i].photomBadMask = in[i].photomBadMask;189 out[i].astromPoorMask = in[i].astromPoorMask;190 out[i].astromBadMask = in[i].astromBadMask;191 }192 return (out);193 } -
trunk/Ohana/src/libdvo/src/dvo_convert_elixir.c
r19185 r21508 10 10 11 11 for (i = 0; i < Nvalues; i++) { 12 out[i].FWx = in[i].FWx; 13 out[i].t = in[i].t; 14 out[i].averef = in[i].averef; 15 16 // changed for PANSTARRS_DEV_0 12 17 out[i].dR = (in[i].dR == NAN_S_SHORT) ? NAN : in[i].dR * 0.01; 13 18 out[i].dD = (in[i].dD == NAN_S_SHORT) ? NAN : in[i].dD * 0.01; … … 16 21 out[i].dt = (in[i].dt == NAN_S_SHORT) ? NAN : in[i].dt * 0.001; 17 22 out[i].Mcal = (in[i].Mcal == NAN_S_SHORT) ? NAN : in[i].Mcal * 0.001; 18 19 // 2008.02.26 : I've renamed Mgal to Map, and intend it to be used per aperture20 // magnitudes. Most uses of Mgal in the past were actually aperture (isophotal) mags21 23 out[i].Map = (in[i].Mgal == NAN_S_SHORT) ? NAN : in[i].Mgal * 0.001; 22 24 out[i].airmass = (in[i].airmass == NAN_S_SHORT) ? NAN : in[i].airmass* 0.001; 23 out[i].FWx = in[i].FWx;24 25 out[i].FWy = in[i].fwy * in[i].FWx * 0.01; 25 26 out[i].theta = in[i].theta*(0x10000 / 0x100); 26 out[i].dophot = in[i].dophot;27 27 out[i].photcode = in[i].source; 28 out[i].t = in[i].t;29 out[i].averef = in[i].averef;30 out[i].dbFlags = in[i].flags;31 28 32 /* these can be determined if needed / desired */ 33 out[i].Xccd = 0; 34 out[i].Yccd = 0; 35 out[i].dXccd = 0; 36 out[i].dYccd = 0; 37 38 /* these do not have a corresponding value */ 29 // added for PANSTARRS_DEV_0 30 out[i].Xccd = 0; // determine on-the-fly 31 out[i].Yccd = 0; // determine on-the-fly 32 out[i].dXccd = 0; 33 out[i].dYccd = 0; 39 34 out[i].az = 0; 40 out[i].stargal = 0;41 35 out[i].Sky = 0; 42 36 out[i].dSky = 0; 43 out[i]. qPSF= 0;37 out[i].psfQual = 0; 44 38 out[i].psfChisq = 0; 45 39 out[i].crNsigma = 0; 46 40 out[i].extNsigma = 0; 47 out[i].photFlags = 0; 48 49 /* XXX add these later */ 50 out[i].detID = 0; 51 out[i].imageID = 0; 41 out[i].detID = 0; // determine on-the-fly 42 out[i].imageID = 0; // determine on-the-fly 43 44 // changed or added for PS1_DEV_1 (2008.02.26) 45 out[i].dbFlags = in[i].flags; 46 out[i].detID = 0; 47 out[i].imageID = 0; 48 49 // changed or added for PS1_DEV_2 50 out[i].Map = in[i].Mgal; 51 out[i].dMcal = 0; 52 53 // changed or added for PS1_V1 54 out[i].photFlags = in[i].dophot << 16; 55 out[i].t_msec = 0; 56 out[i].extID = 0; 57 out[i].objID = 0; 58 out[i].catID = 0; 59 out[i].Mxx = 0.0; 60 out[i].Mxy = 0.0; 61 out[i].Myy = 0.0; 62 out[i].posangle = 0; 63 out[i].pltscale = 0; 64 out[i].psfNdof = 0; 65 out[i].psfNpix = 0; 52 66 } 53 67 return (out); … … 63 77 64 78 for (i = 0; i < Nvalues; i++) { 79 out[i].FWx = in[i].FWx; 80 out[i].t = in[i].t; 81 out[i].averef = in[i].averef; 82 83 // changed for PANSTARRS_DEV_0 65 84 out[i].dR = isnan(in[i].dR ) ? NAN_S_SHORT : in[i].dR * 100.0; 66 85 out[i].dD = isnan(in[i].dD ) ? NAN_S_SHORT : in[i].dD * 100.0; … … 71 90 out[i].Mgal = isnan(in[i].Map ) ? NAN_S_SHORT : in[i].Map * 1000.0; 72 91 out[i].airmass = isnan(in[i].airmass) ? NAN_S_SHORT : in[i].airmass * 1000.0; 92 out[i].fwy = in[i].FWy * 100.0 / in[i].FWx; 93 out[i].theta = in[i].theta*(0x100/ 0x10000); 94 out[i].source = in[i].photcode; 73 95 74 96 if (out[i].M < 0) { … … 76 98 } 77 99 78 out[i].FWx = in[i].FWx; 79 out[i].fwy = in[i].FWy * 100.0 / in[i].FWx; 80 out[i].theta = in[i].theta*(0x100/ 0x10000); 81 out[i].dophot = in[i].dophot; 82 out[i].source = in[i].photcode; 83 out[i].t = in[i].t; 84 out[i].averef = in[i].averef; 100 // changed or added for PS1_DEV_1 (2008.02.26) 85 101 out[i].flags = in[i].dbFlags; 102 103 // changed or added for PS1_V1 104 out[i].dophot = in[i].photFlags >> 16; 86 105 } 87 106 return (out); … … 101 120 out[i].D = in[i].D; 102 121 out[i].Xp = in[i].Xp; 103 out[i].Nmeasure = in[i].Nm; 104 out[i].Nmissing = in[i].Nn; 105 out[i].code = in[i].code; 106 out[i].measureOffset = in[i].offset; 107 out[i].missingOffset = in[i].missing; 108 109 /* these don't exist in Elixir */ 122 123 // changed for PANSTARRS_DEV_0 (moved from Average to Measure) 124 primary[0][i].M = (in[i].M == NAN_S_SHORT) ? NAN : in[i].M * 0.001; 125 primary[0][i].dM = (in[i].dM == NAN_S_SHORT) ? NAN : in[i].dM * 0.001; 126 primary[0][i].Xm = in[i].Xm; 127 128 primary[0][i].Ncode = 0; 129 primary[0][i].Nused = 0; 130 131 // added for PANSTARRS_DEV_0 110 132 out[i].dR = 0; 111 133 out[i].dD = 0; … … 116 138 out[i].P = 0; 117 139 out[i].dP = 0; 118 119 /* XXX add these later */ 120 out[i].objID = 0; 121 out[i].catID = 0; 122 123 primary[0][i].M = (in[i].M == NAN_S_SHORT) ? NAN : in[i].M * 0.001; 124 primary[0][i].dM = (in[i].dM == NAN_S_SHORT) ? NAN : in[i].dM * 0.001; 125 primary[0][i].Xm = in[i].Xm; 126 primary[0][i].Ncode = 0; 127 primary[0][i].Nused = 0; 140 out[i].objID = 0; // determine on-the-fly 141 out[i].catID = 0; // determine on-the-fly 142 143 // changed or added for PS1_DEV_2 144 out[i].Nmeasure = in[i].Nm; 145 out[i].Nmissing = in[i].Nn; 146 out[i].measureOffset = in[i].offset; 147 out[i].missingOffset = in[i].missing; 148 out[i].Nextend = 0; 149 out[i].extendOffset = 0; 150 151 // changed or added for PS1_V1 152 out[i].flags = in[i].code; 153 out[i].ChiSq = 0.0; 154 out[i].Npos = 0.0; 155 out[i].extID = 0; 128 156 } 129 157 return (out); … … 142 170 out[i].D = in[i].D; 143 171 out[i].Xp = in[i].Xp; 144 out[i].Nm = in[i].Nmeasure; 145 out[i].Nn = in[i].Nmissing; 146 out[i].code = in[i].code; 147 out[i].offset = in[i].measureOffset; 148 out[i].missing = in[i].missingOffset; 149 172 173 // changed for PANSTARRS_DEV_0 (moved from Average to Measure) 150 174 out[i].M = isnan(primary[i].M) ? NAN_S_SHORT : primary[i].M * 1000.0; 151 175 out[i].dM = isnan(primary[i].dM) ? NAN_S_SHORT : primary[i].dM * 1000.0; 152 176 out[i].Xm = primary[i].Xm; 177 178 // changed or added for PS1_DEV_2 179 out[i].Nm = in[i].Nmeasure; 180 out[i].Nn = in[i].Nmissing; 181 out[i].offset = in[i].measureOffset; 182 out[i].missing = in[i].missingOffset; 183 184 // changed or added for PS1_V1 185 out[i].code = in[i].flags; 153 186 } 154 187 return (out); … … 164 197 165 198 for (i = 0; i < Nvalues; i++) { 199 out[i].Xm = in[i].Xm; 200 201 // added or changed for PANSTARRS_DEV_0 166 202 out[i].M = (in[i].M == NAN_S_SHORT) ? NAN : in[i].M * 0.001; 167 203 out[i].dM = (in[i].dM == NAN_S_SHORT) ? NAN : in[i].dM * 0.001; 168 out[i].Xm = in[i].Xm;169 204 out[i].Ncode = 0; 170 205 out[i].Nused = 0; 206 207 // changed or added for PS1_V1 208 out[i].M_20 = 0; 209 out[i].M_80 = 0; 171 210 } 172 211 return (out); … … 182 221 183 222 for (i = 0; i < Nvalues; i++) { 223 out[i].Xm = in[i].Xm; 224 225 // added or changed for PANSTARRS_DEV_0 184 226 out[i].M = isnan(in[i].M) ? NAN_S_SHORT : in[i].M * 1000.0; 185 227 out[i].dM = isnan(in[i].dM) ? NAN_S_SHORT : in[i].dM * 1000.0; 186 out[i].Xm = in[i].Xm;187 228 } 188 229 return (out); … … 207 248 out[i].NX = in[i].NX; 208 249 out[i].NY = in[i].NY; 209 out[i].secz = (in[i].secz == NAN_S_SHORT) ? NAN : in[i].secz * 0.001;210 out[i].apmifit = (in[i].apmifit == NAN_S_SHORT) ? NAN : in[i].apmifit * 0.001;211 out[i].dapmifit = (in[i].dapmifit == NAN_S_SHORT) ? NAN : in[i].dapmifit * 0.001;212 out[i].Mcal = (in[i].Mcal == NAN_S_SHORT) ? NAN : in[i].Mcal * 0.001;213 out[i].dMcal = (in[i].dMcal == NAN_S_SHORT) ? NAN : in[i].dMcal * 0.001;214 250 out[i].Xm = in[i].Xm; 215 251 out[i].photcode = in[i].source; … … 221 257 out[i].fwhm_y = in[i].fwhm_y; 222 258 out[i].trate = in[i].trate; 223 out[i].code = in[i].code;224 259 out[i].ccdnum = in[i].ccdnum; 225 260 … … 240 275 out[i].Myyyy = in[i].Myyyy; 241 276 242 /* XXX add these later */ 243 out[i].imageID = 0; 244 245 // not available in ELIXIR 277 // added or changed for PANSTARRS_DEV_0 278 out[i].secz = (in[i].secz == NAN_S_SHORT) ? NAN : in[i].secz * 0.001; 279 out[i].apmifit = (in[i].apmifit == NAN_S_SHORT) ? NAN : in[i].apmifit * 0.001; 280 out[i].dapmifit = (in[i].dapmifit == NAN_S_SHORT) ? NAN : in[i].dapmifit * 0.001; 281 out[i].Mcal = (in[i].Mcal == NAN_S_SHORT) ? NAN : in[i].Mcal * 0.001; 282 out[i].dMcal = (in[i].dMcal == NAN_S_SHORT) ? NAN : in[i].dMcal * 0.001; 246 283 out[i].sidtime = NAN; 247 284 out[i].latitude = NAN; 285 out[i].imageID = 0; // determine on-the-fly 286 287 // changed or added for PS1_DEV_2 288 out[i].externID = 0; 289 out[i].sourceID = 0; 290 291 // changed or added for PS1_V1 292 out[i].flags = in[i].code; 293 out[i].parentID = 0; 248 294 } 249 295 return (out); … … 268 314 out[i].NX = in[i].NX; 269 315 out[i].NY = in[i].NY; 270 out[i].secz = isnan(in[i].secz ) ? NAN_S_SHORT : in[i].secz * 1000.0; 271 out[i].apmifit = isnan(in[i].apmifit ) ? NAN_S_SHORT : in[i].apmifit * 1000.0; 272 out[i].dapmifit = isnan(in[i].dapmifit) ? NAN_S_SHORT : in[i].dapmifit * 1000.0; 273 out[i].Mcal = isnan(in[i].Mcal ) ? NAN_S_SHORT : in[i].Mcal * 1000.0; 274 out[i].dMcal = isnan(in[i].dMcal ) ? NAN_S_SHORT : in[i].dMcal * 1000.0; 316 275 317 out[i].Xm = in[i].Xm; 276 318 out[i].source = in[i].photcode; … … 282 324 out[i].fwhm_y = in[i].fwhm_y; 283 325 out[i].trate = in[i].trate; 284 out[i].code = in[i].code;285 326 out[i].ccdnum = in[i].ccdnum; 286 327 … … 300 341 out[i].Mxyyy = in[i].Mxyyy; 301 342 out[i].Myyyy = in[i].Myyyy; 302 } 303 return (out); 304 } 305 306 PhotCode_Elixir *PhotCode_Internal_To_Elixir (PhotCode *in, int Nvalues) { 307 308 int i; 309 PhotCode_Elixir *out; 310 311 ALLOCATE (out, PhotCode_Elixir, Nvalues); 343 344 // added or changed for PANSTARRS_DEV_0 345 out[i].secz = isnan(in[i].secz ) ? NAN_S_SHORT : in[i].secz * 1000.0; 346 out[i].apmifit = isnan(in[i].apmifit ) ? NAN_S_SHORT : in[i].apmifit * 1000.0; 347 out[i].dapmifit = isnan(in[i].dapmifit) ? NAN_S_SHORT : in[i].dapmifit * 1000.0; 348 out[i].Mcal = isnan(in[i].Mcal ) ? NAN_S_SHORT : in[i].Mcal * 1000.0; 349 out[i].dMcal = isnan(in[i].dMcal ) ? NAN_S_SHORT : in[i].dMcal * 1000.0; 350 351 // changed or added for PS1_V1 352 out[i].code = in[i].flags; 353 } 354 return (out); 355 } 356 357 PhotCode *PhotCode_Elixir_To_Internal (PhotCode_Elixir *in, int Nvalues) { 358 359 int i; 360 PhotCode *out; 361 362 ALLOCATE (out, PhotCode, Nvalues); 312 363 313 364 for (i = 0; i < Nvalues; i++) { … … 326 377 out[i].Nc = in[i].Nc; 327 378 memcpy (out[i].X, in[i].X, 4*sizeof(float)); 328 } 329 return (out); 330 } 331 332 PhotCode *PhotCode_Elixir_To_Internal (PhotCode_Elixir *in, int Nvalues) { 333 334 int i; 335 PhotCode *out; 336 337 ALLOCATE (out, PhotCode, Nvalues); 379 380 // changed or added for PS1_DEV_1 381 out[i].astromErrMagScale = 0.0; 382 out[i].photomErrSys = 0.0; 383 384 // changed or added for PS1_DEV_2 385 out[i].astromErrSys = 0.0; 386 out[i].astromErrScale = 0.0; 387 388 // changed or added for PS1_V1 (also PS1_DEV_3, deprecated) 389 out[i].photomPoorMask = 0; 390 out[i].photomBadMask = 0; 391 out[i].astromPoorMask = 0; 392 out[i].astromBadMask = 0; 393 } 394 return (out); 395 } 396 397 PhotCode_Elixir *PhotCode_Internal_To_Elixir (PhotCode *in, int Nvalues) { 398 399 int i; 400 PhotCode_Elixir *out; 401 402 ALLOCATE (out, PhotCode_Elixir, Nvalues); 338 403 339 404 for (i = 0; i < Nvalues; i++) { … … 352 417 out[i].Nc = in[i].Nc; 353 418 memcpy (out[i].X, in[i].X, 4*sizeof(float)); 354 355 // not defined in Elixir: 356 out[i].astromErrSys = 0.0; 357 out[i].astromErrScale = 0.0; 358 out[i].astromErrMagScale = 0.0; 359 out[i].photomErrSys = 0.0; 360 361 out[i].photomPoorMask = 0; 362 out[i].photomBadMask = 0; 363 out[i].astromPoorMask = 0; 364 out[i].astromBadMask = 0; 365 } 366 return (out); 367 } 419 } 420 return (out); 421 } -
trunk/Ohana/src/libdvo/src/dvo_convert_loneos.c
r19185 r21508 10 10 11 11 for (i = 0; i < Nvalues; i++) { 12 out[i].dR = (in[i].dR == NAN_S_SHORT) ? NAN : in[i].dR * 0.01; 13 out[i].dD = (in[i].dD == NAN_S_SHORT) ? NAN : in[i].dD * 0.01; 14 out[i].M = (in[i].M == NAN_S_SHORT) ? NAN : in[i].M * 0.001; 15 out[i].dM = (in[i].dM == NAN_U_CHAR) ? NAN : in[i].dM * 0.001; 16 out[i].Mcal = (in[i].Mcal == NAN_S_SHORT) ? NAN : in[i].Mcal * 0.001; 17 out[i].dophot = in[i].dophot; 18 out[i].photcode = in[i].source; 19 out[i].t = in[i].t; 20 21 /* flags and averef are now split */ 12 out[i].t = in[i].t; 13 14 // added or changed for ELIXIR 22 15 out[i].averef = in[i].averef & 0x00ffffff; 23 16 out[i].dbFlags = (in[i].averef & 0xff000000) >> 24; 24 25 /* these values don't exist in the Loneos format */ 26 27 // 2008.02.26 : I've renamed Mgal to Map, and intend it to be used per aperture 28 // magnitudes. Most uses of Mgal in the past were actually aperture (isophotal) mags 29 out[i].Map = out[i].M; 17 out[i].t = in[i].t; 30 18 out[i].dt = 0; 31 19 out[i].airmass = 0; 20 out[i].FWy = 0; 21 out[i].FWx = 0; 22 out[i].theta = 0; 23 24 // changed for PANSTARRS_DEV_0 25 out[i].dR = (in[i].dR == NAN_S_SHORT) ? NAN : in[i].dR * 0.01; 26 out[i].dD = (in[i].dD == NAN_S_SHORT) ? NAN : in[i].dD * 0.01; 27 out[i].M = (in[i].M == NAN_S_SHORT) ? NAN : in[i].M * 0.001; 28 out[i].dM = (in[i].dM == NAN_U_CHAR) ? NAN : in[i].dM * 0.001; 29 out[i].Mcal = (in[i].Mcal == NAN_S_SHORT) ? NAN : in[i].Mcal * 0.001; 30 out[i].Map = (in[i].M == NAN_S_SHORT) ? NAN : in[i].M * 0.001; 31 out[i].photcode = in[i].source; 32 33 // added for PANSTARRS_DEV_0 34 out[i].Xccd = 0; // determine on-the-fly 35 out[i].Yccd = 0; // determine on-the-fly 36 out[i].dXccd = 0; 37 out[i].dYccd = 0; 32 38 out[i].az = 0; 33 out[i].FWx = 0;34 out[i].FWy = 0;35 out[i].theta = 0;36 out[i].stargal = 0;37 39 out[i].Sky = 0; 38 40 out[i].dSky = 0; 39 out[i]. qPSF= 0;41 out[i].psfQual = 0; 40 42 out[i].psfChisq = 0; 41 43 out[i].crNsigma = 0; 42 44 out[i].extNsigma = 0; 43 out[i].photFlags = 0; 44 45 /* these can be determined if needed / desired */ 46 out[i].Xccd = 0; 47 out[i].Yccd = 0; 48 out[i].dXccd = 0; 49 out[i].dYccd = 0; 50 51 /* XXX add these later */ 52 out[i].detID = 0; 53 out[i].imageID = 0; 45 out[i].detID = 0; // determine on-the-fly 46 out[i].imageID = 0; // determine on-the-fly 47 48 // changed or added for PS1_DEV_1 (2008.02.26) 49 out[i].detID = 0; 50 out[i].imageID = 0; 51 52 // changed or added for PS1_DEV_2 53 out[i].dMcal = 0; 54 55 // changed or added for PS1_V1 56 out[i].photFlags = in[i].dophot << 16; 57 out[i].t_msec = 0; 58 out[i].extID = 0; 59 out[i].objID = 0; 60 out[i].catID = 0; 61 out[i].Mxx = 0.0; 62 out[i].Mxy = 0.0; 63 out[i].Myy = 0.0; 64 out[i].posangle = 0; 65 out[i].pltscale = 0; 66 out[i].psfNdof = 0; 67 out[i].psfNpix = 0; 54 68 } 55 69 return (out); … … 65 79 66 80 for (i = 0; i < Nvalues; i++) { 81 82 // changed for PANSTARRS_DEV_0 67 83 out[i].dR = isnan(in[i].dR ) ? NAN_S_SHORT : in[i].dR * 100.0; 68 84 out[i].dD = isnan(in[i].dD ) ? NAN_S_SHORT : in[i].dD * 100.0; … … 70 86 out[i].dM = isnan(in[i].dM ) ? NAN_U_CHAR : in[i].dM * 1000.0; 71 87 out[i].Mcal = isnan(in[i].Mcal ) ? NAN_S_SHORT : in[i].Mcal * 1000.0; 72 out[i].dophot = in[i].dophot;73 88 out[i].source = in[i].photcode; 74 89 out[i].t = in[i].t; … … 76 91 /* flags and averef are merged in Loneos */ 77 92 out[i].averef = (in[i].averef & 0x00ffffff) | (in[i].dbFlags << 24); 93 94 // changed or added for PS1_V1 95 out[i].dophot = in[i].photFlags >> 16; 78 96 } 79 97 return (out); … … 93 111 out[i].D = in[i].D; 94 112 out[i].Xp = in[i].Xp; 95 out[i].Nmeasure = in[i].Nm; 96 out[i].Nmissing = in[i].Nn; 97 out[i].code = in[i].code; 98 out[i].measureOffset = in[i].offset; 99 out[i].missingOffset = in[i].missing; 100 101 /* these don't exist in Loneos */ 113 114 // added for ELIXIR 115 primary[0][i].dM = NAN; 116 117 // changed for PANSTARRS_DEV_0 (moved from Average to Measure) 118 primary[0][i].M = (in[i].M == NAN_S_SHORT) ? NAN : in[i].M * 0.001; 119 primary[0][i].Xm = in[i].Xm; 120 primary[0][i].Ncode = 0; 121 primary[0][i].Nused = 0; 122 123 // added for PANSTARRS_DEV_0 102 124 out[i].dR = 0; 103 125 out[i].dD = 0; … … 108 130 out[i].P = 0; 109 131 out[i].dP = 0; 110 111 /* XXX add these later */ 112 out[i].objID = 0; 113 out[i].catID = 0; 114 115 primary[0][i].M = (in[i].M == NAN_S_SHORT) ? NAN : in[i].M * 0.001; 116 primary[0][i].Xm = in[i].Xm; 117 primary[0][i].dM = NAN; 118 primary[0][i].Ncode = 0; 119 primary[0][i].Nused = 0; 132 out[i].objID = 0; // determine on-the-fly 133 out[i].catID = 0; // determine on-the-fly 134 135 // changed or added for PS1_DEV_2 136 out[i].Nmeasure = in[i].Nm; 137 out[i].Nmissing = in[i].Nn; 138 out[i].measureOffset = in[i].offset; 139 out[i].missingOffset = in[i].missing; 140 out[i].Nextend = 0; 141 out[i].extendOffset = 0; 142 143 // changed or added for PS1_V1 144 out[i].flags = in[i].code; 145 out[i].ChiSq = 0.0; 146 out[i].Npos = 0.0; 147 out[i].extID = 0; 120 148 } 121 149 return (out); … … 134 162 out[i].D = in[i].D; 135 163 out[i].Xp = in[i].Xp; 164 165 // changed for PANSTARRS_DEV_0 (moved from Average to Measure) 166 out[i].M = isnan(primary[i].M) ? NAN_S_SHORT : primary[i].M * 1000.0; 167 out[i].Xm = primary[i].Xm; 168 169 // changed or added for PS1_DEV_2 136 170 out[i].Nm = in[i].Nmeasure; 137 171 out[i].Nn = in[i].Nmissing; 138 out[i].code = in[i].code;139 172 out[i].offset = in[i].measureOffset; 140 173 out[i].missing = in[i].missingOffset; 141 174 142 out[i].M = isnan(primary[i].M) ? NAN_S_SHORT : primary[i].M * 1000.0;143 out[i]. Xm = primary[i].Xm;175 // changed or added for PS1_V1 176 out[i].code = in[i].flags; 144 177 } 145 178 return (out); … … 155 188 156 189 for (i = 0; i < Nvalues; i++) { 190 out[i].Xm = in[i].Xm; 191 192 // added for ELIXIR 193 out[i].dM = NAN; 194 195 // added or changed for PANSTARRS_DEV_0 157 196 out[i].M = (in[i].M == NAN_S_SHORT) ? NAN : in[i].M * 0.001; 158 out[i].Xm = in[i].Xm;159 out[i].dM = NAN;160 197 out[i].Ncode = 0; 161 198 out[i].Nused = 0; 199 200 // changed or added for PS1_V1 201 out[i].M_20 = 0; 202 out[i].M_80 = 0; 162 203 } 163 204 return (out); … … 173 214 174 215 for (i = 0; i < Nvalues; i++) { 216 out[i].Xm = in[i].Xm; 217 218 // added or changed for PANSTARRS_DEV_0 175 219 out[i].M = isnan(in[i].M) ? NAN_S_SHORT : in[i].M * 1000.0; 176 out[i].Xm = in[i].Xm;177 220 } 178 221 return (out); … … 197 240 out[i].NX = in[i].NX; 198 241 out[i].NY = in[i].NY; 199 200 out[i].secz = (in[i].secz == NAN_S_SHORT) ? NAN : in[i].secz * 0.001;201 out[i].apmifit = (in[i].apmifit == NAN_S_SHORT) ? NAN : in[i].apmifit * 0.001;202 out[i].dapmifit = (in[i].dapmifit == NAN_S_SHORT) ? NAN : in[i].dapmifit * 0.001;203 out[i].Mcal = (in[i].Mcal == NAN_S_SHORT) ? NAN : in[i].Mcal * 0.001;204 out[i].dMcal = (in[i].dMcal == NAN_S_SHORT) ? NAN : in[i].dMcal * 0.001;205 242 206 243 out[i].Xm = in[i].Xm; … … 213 250 out[i].fwhm_y = in[i].fwhm_y; 214 251 out[i].trate = in[i].trate; 215 out[i].code = in[i].code;216 252 out[i].ccdnum = in[i].ccdnum; 253 217 254 out[i].order = in[i].order; 218 255 out[i].Mx = in[i].Mx; … … 231 268 out[i].Myyyy = in[i].Myyyy; 232 269 233 /* XXX add these later */ 234 out[i].imageID = 0; 270 // added or changed for PANSTARRS_DEV_0 271 out[i].secz = (in[i].secz == NAN_S_SHORT) ? NAN : in[i].secz * 0.001; 272 out[i].apmifit = (in[i].apmifit == NAN_S_SHORT) ? NAN : in[i].apmifit * 0.001; 273 out[i].dapmifit = (in[i].dapmifit == NAN_S_SHORT) ? NAN : in[i].dapmifit * 0.001; 274 out[i].Mcal = (in[i].Mcal == NAN_S_SHORT) ? NAN : in[i].Mcal * 0.001; 275 out[i].dMcal = (in[i].dMcal == NAN_S_SHORT) ? NAN : in[i].dMcal * 0.001; 276 out[i].sidtime = NAN; 277 out[i].latitude = NAN; 278 out[i].imageID = 0; // determine on-the-fly 279 280 // changed or added for PS1_DEV_2 281 out[i].externID = 0; 282 out[i].sourceID = 0; 283 284 // changed or added for PS1_V1 285 out[i].flags = in[i].code; 286 out[i].parentID = 0; 235 287 } 236 288 return (out); … … 255 307 out[i].NX = in[i].NX; 256 308 out[i].NY = in[i].NY; 257 258 out[i].secz = isnan(in[i].secz ) ? NAN_S_SHORT : in[i].secz * 1000.0;259 out[i].apmifit = isnan(in[i].apmifit ) ? NAN_S_SHORT : in[i].apmifit * 1000.0;260 out[i].dapmifit = isnan(in[i].dapmifit) ? NAN_S_SHORT : in[i].dapmifit * 1000.0;261 out[i].Mcal = isnan(in[i].Mcal ) ? NAN_S_SHORT : in[i].Mcal * 1000.0;262 out[i].dMcal = isnan(in[i].dMcal ) ? NAN_S_SHORT : in[i].dMcal * 1000.0;263 309 264 310 out[i].Xm = in[i].Xm; … … 271 317 out[i].fwhm_y = in[i].fwhm_y; 272 318 out[i].trate = in[i].trate; 273 out[i].code = in[i].code;274 319 out[i].ccdnum = in[i].ccdnum; 320 275 321 out[i].order = in[i].order; 276 322 out[i].Mx = in[i].Mx; … … 288 334 out[i].Mxyyy = in[i].Mxyyy; 289 335 out[i].Myyyy = in[i].Myyyy; 290 } 291 return (out); 292 } 336 337 // added or changed for PANSTARRS_DEV_0 338 out[i].secz = isnan(in[i].secz ) ? NAN_S_SHORT : in[i].secz * 1000.0; 339 out[i].apmifit = isnan(in[i].apmifit ) ? NAN_S_SHORT : in[i].apmifit * 1000.0; 340 out[i].dapmifit = isnan(in[i].dapmifit) ? NAN_S_SHORT : in[i].dapmifit * 1000.0; 341 out[i].Mcal = isnan(in[i].Mcal ) ? NAN_S_SHORT : in[i].Mcal * 1000.0; 342 out[i].dMcal = isnan(in[i].dMcal ) ? NAN_S_SHORT : in[i].dMcal * 1000.0; 343 344 // changed or added for PS1_V1 345 out[i].code = in[i].flags; 346 } 347 return (out); 348 } -
trunk/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_0.c
r19185 r21508 16 16 out[i].Mcal = in[i].Mcal; 17 17 18 // 2008.02.26 : I've renamed Mgal to Map, and intend it to be used per aperture19 // magnitudes. Most uses of Mgal in the past were actually aperture (isophotal) mags20 out[i].Map = in[i].Mgal;21 18 out[i].airmass = in[i].airmass; 22 19 out[i].az = in[i].az; … … 25 22 out[i].FWy = in[i].FWy; 26 23 out[i].theta = in[i].theta; 27 out[i].dophot = in[i].dophot;28 24 out[i].photcode = in[i].photcode; 29 25 out[i].t = in[i].t; 30 26 out[i].averef = in[i].averef; 31 out[i].dbFlags = in[i].flags;32 27 out[i].Xccd = in[i].Xccd; 33 28 out[i].Yccd = in[i].Yccd; 34 29 out[i].dXccd = in[i].dXccd; 35 30 out[i].dYccd = in[i].dYccd; 36 out[i].stargal = in[i].stargal;37 31 out[i].Sky = in[i].Sky; 38 32 out[i].dSky = in[i].dSky; 39 out[i].qPSF = (in[i].qPSF == NAN_S_SHORT) ? NAN : in[i].qPSF; 33 34 // 2008.02.26 : I've renamed Mgal to Map, and intend it to be used per aperture 35 // magnitudes. Most uses of Mgal in the past were actually aperture (isophotal) mags 36 37 // changed or added for PS1_DEV_1 (2008.02.26) 38 out[i].psfQual = (in[i].psfQual == NAN_S_SHORT) ? NAN : in[i].psfQual; 39 out[i].dbFlags = in[i].flags; 40 40 out[i].detID = in[i].detID_lo; 41 41 out[i].imageID = in[i].imageID_lo; 42 43 // these don't have a correspondence 44 out[i].psfChisq = 0; 45 out[i].crNsigma = 0; 46 out[i].extNsigma = 0; 47 out[i].photFlags = 0; 42 out[i].psfChisq = 0; 43 out[i].crNsigma = 0; 44 out[i].extNsigma = 0; 45 46 // changed or added for PS1_DEV_2 47 out[i].Map = in[i].Mgal; 48 out[i].dMcal = 0; 49 50 // changed or added for PS1_V1 51 out[i].photFlags = in[i].dophot << 16; 52 out[i].t_msec = 0; 53 out[i].extID = 0; 54 out[i].objID = 0; 55 out[i].catID = 0; 56 out[i].Mxx = 0.0; 57 out[i].Mxy = 0.0; 58 out[i].Myy = 0.0; 59 out[i].posangle = 0; 60 out[i].pltscale = 0; 61 out[i].psfNdof = 0; 62 out[i].psfNpix = 0; 48 63 } 49 64 return (out); … … 64 79 out[i].dM = in[i].dM; 65 80 out[i].Mcal = in[i].Mcal; 66 out[i].Mgal = in[i].Map;67 81 out[i].airmass = in[i].airmass; 68 82 out[i].az = in[i].az; … … 71 85 out[i].FWy = in[i].FWy; 72 86 out[i].theta = in[i].theta; 73 out[i].dophot = in[i].dophot;74 87 out[i].photcode = in[i].photcode; 75 88 out[i].t = in[i].t; 76 89 out[i].averef = in[i].averef; 77 out[i].flags = in[i].dbFlags;78 90 out[i].Xccd = in[i].Xccd; 79 91 out[i].Yccd = in[i].Yccd; 80 92 out[i].dXccd = in[i].dXccd; 81 93 out[i].dYccd = in[i].dYccd; 82 out[i].stargal = in[i].stargal;83 94 out[i].Sky = in[i].Sky; 84 95 out[i].dSky = in[i].dSky; 85 out[i].qPSF = isnan(in[i].qPSF) ? NAN_S_SHORT : in[i].qPSF; 96 97 // changed or added for PS1_DEV_1 (2008.02.26) 98 out[i].flags = in[i].dbFlags; 99 out[i].psfQual = isnan(in[i].psfQual) ? NAN_S_SHORT : in[i].psfQual; 86 100 out[i].detID_hi = 0; 87 101 out[i].detID_lo = in[i].detID; 88 102 out[i].imageID_hi = 0; 89 103 out[i].imageID_lo = in[i].imageID; 104 105 // changed or added for PS1_DEV_2 106 out[i].Mgal = in[i].Map; 107 108 // changed or added for PS1_V1 109 // out[i].photFlags = in[i].photFlags & 0x0000ffff; (only dophot pre PS1_DEV_1) 110 out[i].dophot = in[i].photFlags >> 16; 90 111 } 91 112 return (out); … … 105 126 out[i].D = in[i].D; 106 127 out[i].Xp = in[i].Xp; 107 out[i].Nmeasure = in[i].Nm;108 out[i].Nmissing = in[i].Nn;109 out[i].code = in[i].code;110 out[i].measureOffset = in[i].offset;111 out[i].missingOffset = in[i].missing;112 128 out[i].dR = in[i].dR; 113 129 out[i].dD = in[i].dD; … … 120 136 out[i].objID = in[i].objID; 121 137 out[i].catID = in[i].catID; 138 139 // changed or added for PS1_DEV_2 140 out[i].Nmeasure = in[i].Nm; 141 out[i].Nmissing = in[i].Nn; 142 out[i].measureOffset = in[i].offset; 143 out[i].missingOffset = in[i].missing; 144 out[i].Nextend = 0; 145 out[i].extendOffset = 0; 146 147 // changed or added for PS1_V1 148 out[i].flags = in[i].code; 149 out[i].ChiSq = 0.0; 150 out[i].Npos = 0.0; 151 out[i].extID = 0; 122 152 } 123 153 return (out); … … 137 167 out[i].D = in[i].D; 138 168 out[i].Xp = in[i].Xp; 139 out[i].Nm = in[i].Nmeasure;140 out[i].Nn = in[i].Nmissing;141 out[i].code = in[i].code;142 out[i].offset = in[i].measureOffset;143 out[i].missing = in[i].missingOffset;144 169 out[i].dR = in[i].dR; 145 170 out[i].dD = in[i].dD; … … 152 177 out[i].objID = in[i].objID; 153 178 out[i].catID = in[i].catID; 179 180 // changed or added for PS1_DEV_2 181 out[i].Nm = in[i].Nmeasure; 182 out[i].Nn = in[i].Nmissing; 183 out[i].offset = in[i].measureOffset; 184 out[i].missing = in[i].missingOffset; 185 186 // changed or added for PS1_V1 187 out[i].code = in[i].flags; 154 188 } 155 189 return (out); … … 170 204 out[i].Ncode = in[i].Ncode; 171 205 out[i].Nused = in[i].Nused; 206 207 // changed or added for PS1_V1 208 out[i].M_20 = 0; 209 out[i].M_80 = 0; 172 210 } 173 211 return (out); … … 226 264 out[i].fwhm_y = in[i].fwhm_y; 227 265 out[i].trate = in[i].trate; 228 out[i].code = in[i].code;229 266 out[i].ccdnum = in[i].ccdnum; 230 out[i].imageID = in[i].imageID_lo;231 267 232 268 out[i].order = in[i].order; … … 245 281 out[i].Mxyyy = in[i].Mxyyy; 246 282 out[i].Myyyy = in[i].Myyyy; 283 284 // changed or added for PS1_DEV_1 285 out[i].imageID = in[i].imageID_lo; 286 287 // changed or added for PS1_DEV_2 288 out[i].externID = 0; 289 out[i].sourceID = 0; 290 291 // changed or added for PS1_V1 292 out[i].flags = in[i].code; 293 out[i].parentID = 0; 247 294 } 248 295 return (out); … … 283 330 out[i].fwhm_y = in[i].fwhm_y; 284 331 out[i].trate = in[i].trate; 285 out[i].code = in[i].code;286 332 out[i].ccdnum = in[i].ccdnum; 287 out[i].imageID_hi = 0;288 out[i].imageID_lo = in[i].imageID;289 333 290 334 out[i].order = in[i].order; … … 303 347 out[i].Mxyyy = in[i].Mxyyy; 304 348 out[i].Myyyy = in[i].Myyyy; 305 } 306 return (out); 307 } 349 350 // changed or added for PS1_DEV_1 351 out[i].imageID_hi = 0; 352 out[i].imageID_lo = in[i].imageID; 353 354 // changed or added for PS1_V1 355 out[i].code = in[i].flags; 356 } 357 return (out); 358 } -
trunk/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_1.c
r19185 r21508 16 16 out[i].Mcal = in[i].Mcal; 17 17 18 // 2008.02.26 : I've renamed Mgal to Map, and intend it to be used per aperture19 // magnitudes. Most uses of Mgal in the past were actually aperture (isophotal) mags20 out[i].Map = in[i].Mgal;21 18 out[i].airmass = in[i].airmass; 22 19 out[i].az = in[i].az; … … 25 22 out[i].FWy = in[i].FWy; 26 23 out[i].theta = in[i].theta; 27 out[i].dophot = in[i].dophot;28 24 out[i].photcode = in[i].photcode; 29 25 out[i].t = in[i].t; 30 26 out[i].averef = in[i].averef; 31 out[i].dbFlags = in[i].flags;32 27 out[i].Xccd = in[i].Xccd; 33 28 out[i].Yccd = in[i].Yccd; 34 29 out[i].dXccd = in[i].dXccd; 35 30 out[i].dYccd = in[i].dYccd; 36 out[i].stargal = in[i].stargal;37 31 out[i].Sky = in[i].Sky; 38 32 out[i].dSky = in[i].dSky; 39 out[i].qPSF = (in[i].qPSF == NAN_S_SHORT) ? NAN : in[i].qPSF; 33 34 // 2008.02.26 : I've renamed Mgal to Map, and intend it to be used per aperture 35 // magnitudes. Most uses of Mgal in the past were actually aperture (isophotal) mags 36 37 // changed or added for PS1_DEV_1 (2008.02.26) 38 out[i].psfQual = (in[i].psfQual == NAN_S_SHORT) ? NAN : in[i].psfQual; 39 out[i].dbFlags = in[i].flags; 40 40 out[i].detID = in[i].detID_lo; 41 41 out[i].imageID = in[i].imageID_lo; 42 43 // these don't have a correspondence 44 out[i].psfChisq = 0; 45 out[i].crNsigma = 0; 46 out[i].extNsigma = 0; 47 out[i].photFlags = 0; 42 out[i].psfChisq = 0; 43 out[i].crNsigma = 0; 44 out[i].extNsigma = 0; 45 46 // changed or added for PS1_DEV_2 47 out[i].Map = in[i].Mgal; 48 out[i].dMcal = 0; 49 50 // changed or added for PS1_V1 51 out[i].photFlags = in[i].dophot << 16; 52 out[i].t_msec = 0; 53 out[i].extID = 0; 54 out[i].objID = 0; 55 out[i].catID = 0; 56 out[i].Mxx = 0.0; 57 out[i].Mxy = 0.0; 58 out[i].Myy = 0.0; 59 out[i].posangle = 0; 60 out[i].pltscale = 0; 61 out[i].psfNdof = 0; 62 out[i].psfNpix = 0; 48 63 } 49 64 return (out); … … 64 79 out[i].dM = in[i].dM; 65 80 out[i].Mcal = in[i].Mcal; 66 out[i].Mgal = in[i].Map;67 81 out[i].airmass = in[i].airmass; 68 82 out[i].az = in[i].az; … … 71 85 out[i].FWy = in[i].FWy; 72 86 out[i].theta = in[i].theta; 73 out[i].dophot = in[i].dophot;74 87 out[i].photcode = in[i].photcode; 75 88 out[i].t = in[i].t; 76 89 out[i].averef = in[i].averef; 77 out[i].flags = in[i].dbFlags;78 90 out[i].Xccd = in[i].Xccd; 79 91 out[i].Yccd = in[i].Yccd; 80 92 out[i].dXccd = in[i].dXccd; 81 93 out[i].dYccd = in[i].dYccd; 82 out[i].stargal = in[i].stargal;83 94 out[i].Sky = in[i].Sky; 84 95 out[i].dSky = in[i].dSky; 85 out[i].qPSF = isnan(in[i].qPSF) ? NAN_S_SHORT : in[i].qPSF; 96 97 // changed or added for PS1_DEV_1 (2008.02.26) 98 out[i].flags = in[i].dbFlags; 99 out[i].psfQual = isnan(in[i].psfQual) ? NAN_S_SHORT : in[i].psfQual; 86 100 out[i].detID_hi = 0; 87 101 out[i].detID_lo = in[i].detID; 88 102 out[i].imageID_hi = 0; 89 103 out[i].imageID_lo = in[i].imageID; 104 105 // changed or added for PS1_DEV_2 106 out[i].Mgal = in[i].Map; 107 108 // changed or added for PS1_V1 109 // out[i].photFlags = in[i].photFlags & 0x0000ffff; (only dophot pre PS1_DEV_1) 110 out[i].dophot = in[i].photFlags >> 16; 90 111 } 91 112 return (out); … … 105 126 out[i].D = in[i].D; 106 127 out[i].Xp = in[i].Xp; 107 out[i].Nmeasure = in[i].Nm;108 out[i].Nmissing = in[i].Nn;109 out[i].code = in[i].code;110 out[i].measureOffset = in[i].offset;111 out[i].missingOffset = in[i].missing;112 128 out[i].dR = in[i].dR; 113 129 out[i].dD = in[i].dD; … … 120 136 out[i].objID = in[i].objID; 121 137 out[i].catID = in[i].catID; 138 139 // changed or added for PS1_DEV_2 140 out[i].Nmeasure = in[i].Nm; 141 out[i].Nmissing = in[i].Nn; 142 out[i].measureOffset = in[i].offset; 143 out[i].missingOffset = in[i].missing; 144 out[i].Nextend = 0; 145 out[i].extendOffset = 0; 146 147 // changed or added for PS1_V1 148 out[i].flags = in[i].code; 149 out[i].ChiSq = 0.0; 150 out[i].Npos = 0.0; 151 out[i].extID = 0; 122 152 } 123 153 return (out); … … 137 167 out[i].D = in[i].D; 138 168 out[i].Xp = in[i].Xp; 139 out[i].Nm = in[i].Nmeasure;140 out[i].Nn = in[i].Nmissing;141 out[i].code = in[i].code;142 out[i].offset = in[i].measureOffset;143 out[i].missing = in[i].missingOffset;144 169 out[i].dR = in[i].dR; 145 170 out[i].dD = in[i].dD; … … 152 177 out[i].objID = in[i].objID; 153 178 out[i].catID = in[i].catID; 179 180 // changed or added for PS1_DEV_2 181 out[i].Nm = in[i].Nmeasure; 182 out[i].Nn = in[i].Nmissing; 183 out[i].offset = in[i].measureOffset; 184 out[i].missing = in[i].missingOffset; 185 186 // changed or added for PS1_V1 187 out[i].code = in[i].flags; 154 188 } 155 189 return (out); … … 170 204 out[i].Ncode = in[i].Ncode; 171 205 out[i].Nused = in[i].Nused; 206 207 // changed or added for PS1_V1 208 out[i].M_20 = 0; 209 out[i].M_80 = 0; 172 210 } 173 211 return (out); … … 226 264 out[i].fwhm_y = in[i].fwhm_y; 227 265 out[i].trate = in[i].trate; 228 out[i].code = in[i].code;229 266 out[i].ccdnum = in[i].ccdnum; 230 out[i].imageID = in[i].imageID_lo;231 267 232 268 out[i].order = in[i].order; … … 245 281 out[i].Mxyyy = in[i].Mxyyy; 246 282 out[i].Myyyy = in[i].Myyyy; 283 284 // changed or added for PS1_DEV_1 285 out[i].imageID = in[i].imageID_lo; 286 287 // changed or added for PS1_DEV_2 288 out[i].externID = 0; 289 out[i].sourceID = 0; 290 291 // changed or added for PS1_V1 292 out[i].flags = in[i].code; 293 out[i].parentID = 0; 247 294 } 248 295 return (out); … … 283 330 out[i].fwhm_y = in[i].fwhm_y; 284 331 out[i].trate = in[i].trate; 285 out[i].code = in[i].code;286 332 out[i].ccdnum = in[i].ccdnum; 287 out[i].imageID_hi = 0;288 out[i].imageID_lo = in[i].imageID;289 333 290 334 out[i].order = in[i].order; … … 303 347 out[i].Mxyyy = in[i].Mxyyy; 304 348 out[i].Myyyy = in[i].Myyyy; 305 } 306 return (out); 307 } 349 350 // changed or added for PS1_DEV_1 351 out[i].imageID_hi = 0; 352 out[i].imageID_lo = in[i].imageID; 353 354 // changed or added for PS1_V1 355 out[i].code = in[i].flags; 356 } 357 return (out); 358 } 359 360 // XXX no photcode conversions? this may be from before we had a photcode FITS table... 361 -
trunk/Ohana/src/libdvo/src/dvo_image.c
r19185 r21508 196 196 if (db[0].format == DVO_FORMAT_PS1_DEV_2) gfits_modify (&db[0].header, "FORMAT", "%s", 1, "PS1_DEV_2"); 197 197 if (db[0].format == DVO_FORMAT_PS1_DEV_3) gfits_modify (&db[0].header, "FORMAT", "%s", 1, "PS1_DEV_3"); 198 if (db[0].format == DVO_FORMAT_PS1_V1) gfits_modify (&db[0].header, "FORMAT", "%s", 1, "PS1_V1"); 198 199 199 200 return; -
trunk/Ohana/src/libdvo/src/dvo_image_raw.c
r16810 r21508 54 54 if (db[0].format == DVO_FORMAT_PS1_DEV_1) ImageSize = sizeof(Image_PS1_DEV_1); 55 55 if (db[0].format == DVO_FORMAT_PS1_DEV_2) ImageSize = sizeof(Image_PS1_DEV_2); 56 if (db[0].format == DVO_FORMAT_PS1_DEV_3) ImageSize = sizeof(Image_PS1_DEV_3); 57 if (db[0].format == DVO_FORMAT_PS1_V1) ImageSize = sizeof(Image_PS1_V1); 56 58 57 59 /* check that filesize makes sense */ … … 78 80 if (db[0].format == DVO_FORMAT_PS1_DEV_1) gfits_table_mkheader_Image_PS1_DEV_1 (&db[0].theader); 79 81 if (db[0].format == DVO_FORMAT_PS1_DEV_2) gfits_table_mkheader_Image_PS1_DEV_2 (&db[0].theader); 82 if (db[0].format == DVO_FORMAT_PS1_DEV_3) gfits_table_mkheader_Image_PS1_DEV_3 (&db[0].theader); 83 if (db[0].format == DVO_FORMAT_PS1_V1) gfits_table_mkheader_Image_PS1_V1 (&db[0].theader); 80 84 81 85 /* read data from file */ -
trunk/Ohana/src/libdvo/src/dvosorts.c
r16040 r21508 46 46 } 47 47 48 void sort_stars_ra (Stars *stars, int N) {49 50 # define SWAPFUNC(A,B){ Stars tmp; tmp = stars[A]; stars[A] = stars[B]; stars[B] = tmp; }51 # define COMPARE(A,B)(stars[A].R < stars[B].R)52 53 OHANA_SORT (N, COMPARE, SWAPFUNC);54 55 # undef SWAPFUNC56 # undef COMPARE57 58 }59 60 48 void sort_regions (SkyRegion *region, int N) { 61 49 … … 70 58 } 71 59 60 # if (0) 61 // deprecated along with Stars as an autocode type 62 void sort_stars_ra (Stars *stars, int N) { 63 64 # define SWAPFUNC(A,B){ Stars tmp; tmp = stars[A]; stars[A] = stars[B]; stars[B] = tmp; } 65 # define COMPARE(A,B)(stars[A].R < stars[B].R) 66 67 OHANA_SORT (N, COMPARE, SWAPFUNC); 68 69 # undef SWAPFUNC 70 # undef COMPARE 71 72 } 73 # endif -
trunk/Ohana/src/libohana/include/ohana.h
r21153 r21508 6 6 # include <time.h> 7 7 # include <stdlib.h> 8 # include <stdint.h> 8 9 # include <string.h> 9 10 # include <sys/socket.h> -
trunk/Ohana/src/opihi/cmd.data/Makefile
r17579 r21508 20 20 $(SRC)/accum.$(ARCH).o \ 21 21 $(SRC)/applyfit2d.$(ARCH).o \ 22 $(SRC)/applyfit .$(ARCH).o \22 $(SRC)/applyfit1d.$(ARCH).o \ 23 23 $(SRC)/box.$(ARCH).o \ 24 24 $(SRC)/book.$(ARCH).o \ … … 26 26 $(SRC)/center.$(ARCH).o \ 27 27 $(SRC)/clear.$(ARCH).o \ 28 $(SRC)/ clip.$(ARCH).o \28 $(SRC)/imclip.$(ARCH).o \ 29 29 $(SRC)/close.$(ARCH).o \ 30 30 $(SRC)/concat.$(ARCH).o \ … … 44 44 $(SRC)/fft1d.$(ARCH).o \ 45 45 $(SRC)/fft2d.$(ARCH).o \ 46 $(SRC)/fit1d.$(ARCH).o \ 46 47 $(SRC)/fit2d.$(ARCH).o \ 47 $(SRC)/fit.$(ARCH).o \48 48 $(SRC)/gaussj.$(ARCH).o \ 49 49 $(SRC)/gaussdeviate.$(ARCH).o \ … … 107 107 $(SRC)/spline_apply.$(ARCH).o \ 108 108 $(SRC)/spline_construct.$(ARCH).o \ 109 $(SRC)/ stats.$(ARCH).o\109 $(SRC)/imstats.$(ARCH).o \ 110 110 $(SRC)/style.$(ARCH).o \ 111 111 $(SRC)/subraster.$(ARCH).o \ … … 131 131 $(SRC)/vroll.$(ARCH).o \ 132 132 $(SRC)/vsmooth.$(ARCH).o \ 133 $(SRC)/vstat .$(ARCH).o \133 $(SRC)/vstats.$(ARCH).o \ 134 134 $(SRC)/wd.$(ARCH).o \ 135 135 $(SRC)/write_vectors.$(ARCH).o \ -
trunk/Ohana/src/opihi/cmd.data/init.c
r21064 r21508 3 3 int accum PROTO((int, char **)); 4 4 int applyfit PROTO((int, char **)); 5 int applyfit1d PROTO((int, char **)); 5 6 int applyfit2d PROTO((int, char **)); 6 7 int box PROTO((int, char **)); … … 11 12 int clear PROTO((int, char **)); 12 13 int clip PROTO((int, char **)); 14 int imclip PROTO((int, char **)); 13 15 int close_device PROTO((int, char **)); 14 16 int concat PROTO((int, char **)); … … 29 31 int fft1d PROTO((int, char **)); 30 32 int fft2d PROTO((int, char **)); 33 int fit PROTO((int, char **)); 34 int fit1d PROTO((int, char **)); 31 35 int fit2d PROTO((int, char **)); 32 int fit PROTO((int, char **));33 36 int gaussjordan PROTO((int, char **)); 34 37 int gaussdeviate PROTO((int, char **)); … … 92 95 int spline_construct_cmd PROTO((int, char **)); 93 96 int stats PROTO((int, char **)); 97 int imstats PROTO((int, char **)); 94 98 int style PROTO((int, char **)); 95 99 int subraster PROTO((int, char **)); … … 113 117 int vload PROTO((int, char **)); 114 118 int vzload PROTO((int, char **)); 115 int vstat PROTO((int, char **));119 int vstats PROTO((int, char **)); 116 120 int vroll PROTO((int, char **)); 117 121 int vpop PROTO((int, char **)); … … 124 128 static Command cmds[] = { 125 129 {1, "accum", accum, "accumulate vector values in another vector"}, 126 {1, "applyfit", applyfit, "apply fit to new vector"}, 130 {1, "applyfit", applyfit1d, "apply 1-d fit to new vector"}, 131 {1, "applyfit1d", applyfit1d, "apply 1-d fit to new vector"}, 127 132 {1, "applyfit2d", applyfit2d, "apply 2-d fit to new vector"}, 133 {1, "book", book_command, "commands to manipulate book/page/word data"}, 128 134 {1, "box", box, "draw a box on the plot"}, 129 {1, "book", book_command, "commands to manipulate book/page/word data"}, 135 {1, "buffers", list_buffers, "list the currently allocated buffers (images)"}, 136 {1, "images", list_buffers, "list the currently allocated images"}, 130 137 {1, "center", center, "center image on coords"}, 131 {1, "parity", parity, "set image parity"},132 138 {1, "circstats", circstats, "circular statistics"}, 133 139 {1, "clear", clear, "erase plot"}, 134 {1, "clip", clip, "clip values in a bufferto be within a range"},140 {1, "clip", imclip, "clip values in an image to be within a range"}, 135 141 {1, "close", close_device, "close the current display device"}, 136 {1, "concat", concat, " reduce vector dimension"},142 {1, "concat", concat, "append values to the end of a vector"}, 137 143 {1, "contour", contour, "create contour from image"}, 138 144 {1, "create", create, "create a new vector"}, 145 {1, "vcreate", create, "create a new vector"}, 139 146 {1, "cumulative", cumulative, "build a cumulative histogram from a specific histogram"}, 140 147 {1, "cursor", cursor, "get coords from cursor"}, … … 143 150 {1, "dbconnect", dbconnect, "setup mysql db connection"}, 144 151 {1, "dbselect", dbselect, "extract vectors from mysql database table"}, 145 {1, "delete", delete, "delete vectors or matrices"},152 {1, "delete", delete, "delete vectors or images"}, 146 153 {1, "device", device, "set / get current graphics device"}, 147 {1, "dimendown", dimendown, "convert matrix to vector"}, 148 {1, "dimenup", dimenup, "convert vector to matrix"}, 149 {1, "erase", erase, "erase objects on an overlay"}, 150 {1, "extract", extract, "extract a portion of a buffer into another buffer"}, 151 {1, "fft1d", fft1d, "fft on the pixel-stream in an image"}, 154 {1, "dimendown", dimendown, "convert image to vector"}, 155 {1, "dimenup", dimenup, "convert vector to image"}, 156 {1, "dot", dot, "plot a single point"}, 157 {1, "erase", erase, "erase objects on an image overlay"}, 158 {1, "extract", extract, "extract a portion of a image into another image"}, 159 {1, "fft1d", fft1d, "fft on a vector"}, 152 160 {1, "fft2d", fft2d, "fft on an image"}, 153 {1, "fit", fit, "fit polynomial to vector pair"}, 161 {1, "fit", fit1d, "fit polynomial to vector pair"}, 162 {1, "fit1d", fit1d, "fit polynomial to vector pair"}, 154 163 {1, "fit2d", fit2d, "fit 2-d polynomial to vector triplet"}, 155 {1, "gaussj", gaussjordan, "solve Ax = B (N-D)"},156 164 {1, "gaussdev", gaussdeviate, "generate a gaussian deviate vector"}, 157 165 {1, "gaussint", gaussintegral, "return the integrated gaussian vector"}, 158 {1, "grid", grid, "plot cartesian grid"}, 159 {1, "gridify", gridify, "convert vector triplet to buffer"}, 166 {1, "gaussj", gaussjordan, "solve Ax = B (N-Dimensional)"}, 167 {1, "grid", grid, "plot cartesian grid on graph"}, 168 {1, "gridify", gridify, "convert vector triplet to image (same as vgrid?)"}, 160 169 {1, "grow", grow, "grow a mask"}, 161 {1, "ungridify", ungridify, "convert buffer region to vector triplet"}, 162 {1, "header", header, "print buffer header"}, 170 {1, "header", header, "print image header"}, 163 171 {1, "histogram", histogram, "generate histogram from vector"}, 172 {1, "imbin", rebin, "rebin image data by factor of N"}, 173 {1, "imclip", imclip, "clip values in an image to be within a range"}, 164 174 {1, "imcut", imcut, "linear image cut between arbitrary coords"}, 165 {1, "imhist ",imhist, "histogram of an image region"},175 {1, "imhistogram", imhist, "histogram of an image region"}, 166 176 {1, "imsmooth", imsmooth, "circular gaussian smoothing"}, 177 {1, "imstats", imstats, "statistics on a portion of an image"}, 167 178 {1, "integrate", integrate, "integrate a vector"}, 168 179 {1, "interpolate", interpolate, "interpolate between vector pairs"}, 169 {1, "jpeg", jpeg, "write text line on graph"}, 170 {1, "png", jpeg, "write text line on graph"}, 171 {1, "ppm", jpeg, "write text line on graph"}, 180 {1, "jpeg", jpeg, "convert display image to JPEG"}, 172 181 {1, "kern", kern, "convolve with 3x3 kernel"}, 173 {1, "keyword", keyword, "extract a FITS keyword from bufferheader"},182 {1, "keyword", keyword, "extract a FITS keyword from image header"}, 174 183 {1, "labels", labels, "define labels for plot"}, 175 184 {1, "limits", limits, "define plot limits"}, 176 {1, "line", line, "plot line"}, 177 {1, "buffers", list_buffers, "list the currently allocated buffers"}, 178 {1, "vectors", list_vectors, "list vectors"}, 179 {1, "load", load, "load an SAOimage style overlay"}, 185 {1, "line", line, "plot a line"}, 186 {1, "load", load, "load an SAOimage/DS9 style overlay"}, 180 187 {1, "lookup", lookup, "convert vector via lookup table (vector pair)"}, 181 {1, "m krgb", mkrgb, "convert 3 images to rgb jpeg"},182 {1, " mcreate", mcreate, "create a matrix"},188 {1, "mcreate", mcreate, "create an image"}, 189 {1, "imcreate", mcreate, "create an image"}, 183 190 {1, "medacc", medacc, "accumulate vector values in another vector"}, 184 {1, "mget", mget, "extract a vector from a matrix"}, 191 {1, "mget", mget, "extract a vector from an image"}, 192 {1, "imget", mget, "extract a vector from an image"}, 185 193 {1, "minterp", minterp, "interpolate image pixels"}, 186 {1, "mset", mset, "insert a vector in a matrix"}, 194 {1, "iminterp", minterp, "interpolate image pixels"}, 195 {1, "mkrgb", mkrgb, "convert 3 images to rgb jpeg (use Kapa for better control)"}, 196 {1, "imset", mset, "insert a vector in an image"}, 197 {1, "parity", parity, "set image parity"}, 187 198 {1, "peak", peak, "find vector peak in range"}, 188 199 {1, "periodogram", periodogram, "measure periods in unevenly sampled data"}, 189 200 {1, "plot", plot, "plot a pair of vectors"}, 190 {1, "dot", dot, "plot a single point"}, 191 {1, "point", point, "load overlay with single point"}, 192 {1, "ps", ps, "define labels for plot"}, 201 {1, "png", jpeg, "convert display graphic to PNG"}, 202 {1, "point", point, "load image overlay with a single point"}, 203 {1, "ppm", jpeg, "convert display graphic to PPM"}, 204 {1, "ps", ps, "convert display to PostScript"}, 205 {1, "queuedelete", queuedelete, "delete a queue"}, 206 {1, "queuedrop", queuedrop, "drop values from queue matching a key"}, 207 {1, "queueinit", queueinit, "create an empty queue"}, 208 {1, "queuelist", queuelist, "list defined queues"}, 209 {1, "queueload", queueload, "load queue from command"}, 193 210 {1, "queuepop", queuepop, "pop value from queue to variable"}, 194 {1, "queuedrop", queuedrop, "drop values from queue matching a key"},195 211 {1, "queueprint", queueprint, "print the contents of a queue"}, 196 212 {1, "queuepush", queuepush, "push value onto queue"}, 197 {1, "queueinit", queueinit, "create an empty queue"}, 198 {1, "queuedelete", queuedelete, "delete a queue"}, 199 {1, "queuelist", queuelist, "list defined queues"}, 200 {1, "queueload", queueload, "load queue from command"}, 213 {1, "queuesize", queuesize, "show queue size"}, 201 214 {1, "queuesubstr", queuesubstr, "bulk replace strings in queue"}, 202 {1, "queuesize", queuesize, "show queue size"},203 215 {1, "rd", rd, "load fits image"}, 204 216 {1, "rdseg", rdseg, "read a segment of an image from a file"}, 205 217 {1, "read", read_vectors, "read vectors from datafile"}, 206 {1, "rebin", rebin, "rebin data by factor of N"},218 {1, "rebin", rebin, "rebin image data by factor of N"}, 207 219 {1, "resize", resize, "set graphics/image window size"}, 208 220 {1, "roll", roll, "roll image to new start point"}, 209 221 {1, "rotate", rotate, "rotate image"}, 210 {1, "save", save, "save an SAOimage style overlay"},222 {1, "save", save, "save an SAOimage style image overlay"}, 211 223 {1, "section", section, "define section of graph"}, 212 {1, "set", set, "vector math"}, 224 {1, "select", vect_select, "selective vector assignment"}, 225 {1, "set", set, "image and vector math"}, 213 226 {1, "shift", shift, "shift data in an image"}, 214 227 {1, "sort", sort_vectors, "sort list of vectors"}, 215 228 {1, "spline.apply", spline_apply_cmd, "apply spline fit to generate an image"}, 216 229 {1, "spline.const", spline_construct_cmd, "create spline 2nd deriv. terms"}, 217 {1, "stats", stats, "give statistics on a portion of a buffer"},230 {1, "stats", imstats, "statistics on a portion of an image"}, 218 231 {1, "style", style, "set the style for graph plots"}, 219 232 {1, "subraster", subraster, "subraster of fits image"}, 220 {1, "subset", subset, " expand vector dimension"},221 {1, "svd", svd, "singular value decomposition of a matrix "},233 {1, "subset", subset, "generate a vector from a portion of another vector"}, 234 {1, "svd", svd, "singular value decomposition of a matrix (image)"}, 222 235 {1, "swapbytes", swapbytes, "byte swap thing"}, 223 236 {1, "textline", textline, "write text line on graph"}, … … 225 238 {1, "tvchannel", tvchannel, "set the current tv channel"}, 226 239 {1, "tvcolors", tvcolors, "set the tv colormap"}, 227 {1, "tvcontour", tvcontour, "send contour to overlay"}, 228 {1, "tvgrid", tvgrid, "wait until return is typed"}, 240 {1, "tvcontour", tvcontour, "send contour to image overlay"}, 241 {1, "tvgrid", tvgrid, "RA/DEC grid on an image"}, 242 {1, "ungridify", ungridify, "convert image region to vector triplet"}, 229 243 {1, "uniq", uniq, "create a uniq vector subset from a vector"}, 230 244 {1, "unsign", unsign, "toggle the UNSIGN status"}, 231 {1, "vbin", vbin, " bin values in a vector to be within a range"},245 {1, "vbin", vbin, "rebin vector data by a fector of N"}, 232 246 {1, "vclip", vclip, "clip values in a vector to be within a range"}, 233 {1, "select", vect_select, "selective vector assignment"}, 234 {1, "vgauss", vgauss, ""}, 235 {1, "vmaxwell", vmaxwell, ""}, 236 {1, "vgrid", vgrid, ""}, 237 {1, "vload", vload, "load vectors on Kii"}, 238 {1, "vzload", vzload, "load vectors on Kii"}, 239 {1, "vstat", vstat, "get info from imreg database"}, 240 {1, "vsmooth", vsmooth, "gaussian smooth of a vector"}, 247 {1, "vectors", list_vectors, "list vectors"}, 248 {1, "vgauss", vgauss, "fit a Gaussian to a vector"}, 249 {1, "vgrid", vgrid, "generate an image from a triplet of vectors"}, 250 {1, "vhistogram", histogram, "generate histogram from vector"}, 251 {1, "vload", vload, "load vectors as overlay on image display"}, 252 {1, "vmaxwell", vmaxwell, "fit a Maxwellian to a vector"}, 253 {1, "vpop", vpop, "remove first element of a vector"}, 241 254 {1, "vroll", vroll, "roll vector elements"}, 242 {1, "vpop", vpop, "remove first element"}, 255 {1, "vsmooth", vsmooth, "Gaussian smooth of a vector"}, 256 {1, "vstats", vstats, "statistics on a vector"}, 257 {1, "vzload", vzload, "load vectors as overlay on image display (scaled points)"}, 243 258 {1, "wd", wd, "write an image to a file"}, 244 259 {1, "write", write_vectors, "write vectors to datafile"}, 245 {1, "zap", zap, " delete pixels"},260 {1, "zap", zap, "assign values to pixel regions"}, 246 261 {1, "zplot", zplot, "plot x y with size scaled by z"}, 247 262 }; -
trunk/Ohana/src/opihi/dvo/dbExtractAverages.c
r21153 r21508 121 121 break; 122 122 case AVE_FLAG: 123 value.Int = average[0]. code;123 value.Int = average[0].flags; 124 124 break; 125 125 case AVE_OBJID: -
trunk/Ohana/src/opihi/dvo/dbExtractImages.c
r20936 r21508 247 247 break; 248 248 case IMAGE_FLAG: 249 value.Int = image[N]. code;249 value.Int = image[N].flags; 250 250 break; 251 251 case IMAGE_CCDNUM: -
trunk/Ohana/src/opihi/dvo/dbExtractMeasures.c
r21153 r21508 146 146 case MAG_NPHOT: 147 147 if (equiv == NULL) { 148 value.Int = NAN;148 value.Int = 0; 149 149 break; 150 150 } … … 260 260 break; 261 261 case MEAS_OBJFLAGS: /* OK */ 262 value.Int = average[0]. code;262 value.Int = average[0].flags; 263 263 break; 264 264 // note that these represent the ra displacement relative to the average, not … … 312 312 break; 313 313 case MEAS_DOPHOT: /* OK */ 314 value. Flt = measure[0].dophot;314 value.Int = (measure[0].photFlags >> 16); 315 315 break; 316 316 case MEAS_DB_FLAGS: /* ? */ … … 394 394 break; 395 395 case MEAS_PSF_QF: /* OK */ 396 value.Flt = measure[0]. qPSF;396 value.Flt = measure[0].psfQual; 397 397 break; 398 398 case MEAS_PSF_CHISQ: /* OK */ … … 404 404 case MEAS_EXT_NSIGMA: /* OK */ 405 405 value.Flt = measure[0].extNsigma; 406 break;407 case MEAS_STARGAL: /* OK */408 value.Flt = measure[0].stargal;409 406 break; 410 407 -
trunk/Ohana/src/opihi/dvo/dbFields.c
r21153 r21508 170 170 if (!strcasecmp (fieldName, "FWHM_MIN")) ESCAPE (MEAS_FWHM_MIN, MAG_NONE, OPIHI_FLT); 171 171 if (!strcasecmp (fieldName, "THETA")) ESCAPE (MEAS_THETA, MAG_NONE, OPIHI_FLT); 172 if (!strcasecmp (fieldName, "DOPHOT")) ESCAPE (MEAS_DOPHOT, MAG_NONE, OPIHI_ FLT);172 if (!strcasecmp (fieldName, "DOPHOT")) ESCAPE (MEAS_DOPHOT, MAG_NONE, OPIHI_INT); 173 173 if (!strcasecmp (fieldName, "DB_FLAGS")) ESCAPE (MEAS_DB_FLAGS, MAG_NONE, OPIHI_INT); 174 174 if (!strcasecmp (fieldName, "PHOT_FLAGS")) ESCAPE (MEAS_PHOT_FLAGS, MAG_NONE, OPIHI_INT); … … 193 193 if (!strcasecmp (fieldName, "SKY")) ESCAPE (MEAS_SKY, MAG_NONE, OPIHI_FLT); 194 194 if (!strcasecmp (fieldName, "SKY_ERR")) ESCAPE (MEAS_dSKY, MAG_NONE, OPIHI_FLT); 195 if (!strcasecmp (fieldName, "STARGAL")) ESCAPE (MEAS_STARGAL, MAG_NONE, OPIHI_FLT);196 195 197 196 // for words that don't parse, try a photcode -
trunk/Ohana/src/opihi/dvo/gimages.c
r21153 r21508 220 220 if (PixelCoords) { 221 221 gprint (GP_LOG, "%3d %s %6.1f %6.1f %20s %5d %2d %4.2f %6.3f %5.3f %5.3f %4x\n", 222 Nfound, image[i].name, X, Y, date, image[i].nstar, image[i].photcode, image[i].secz, image[i].Mcal, image[i].dMcal, image[i].exptime, image[i]. code);222 Nfound, image[i].name, X, Y, date, image[i].nstar, image[i].photcode, image[i].secz, image[i].Mcal, image[i].dMcal, image[i].exptime, image[i].flags); 223 223 } else { 224 224 XY_to_RD (&ra, &dec, 0.5*image[i].NX, 0.5*image[i].NY, &image[i].coords); 225 225 gprint (GP_LOG, "%3d %s %8.4f %8.4f %20s %5d %2d %4.2f %6.3f %5.3f %5.3f %4x\n", 226 Nfound, image[i].name, ra, dec, date, image[i].nstar, image[i].photcode, image[i].secz, image[i].Mcal, image[i].dMcal, image[i].exptime, image[i]. code);226 Nfound, image[i].name, ra, dec, date, image[i].nstar, image[i].photcode, image[i].secz, image[i].Mcal, image[i].dMcal, image[i].exptime, image[i].flags); 227 227 } 228 228 sprintf (name, "IMAGEx:%d", Nfound); -
trunk/Ohana/src/opihi/dvo/gstar.c
r20936 r21508 158 158 gprint (GP_LOG, "%3d ", catalog.average[k].Nmeasure); 159 159 gprint (GP_LOG, "%4.1f ", 0.01*catalog.average[k].Xp); 160 gprint (GP_LOG, "%5d", catalog.average[k]. code);160 gprint (GP_LOG, "%5d", catalog.average[k].flags); 161 161 162 162 if (FULL_OUTPUT) { … … 211 211 gprint (GP_LOG, "%7.4f ", catalog.measure[m].dR); 212 212 gprint (GP_LOG, "%7.4f", catalog.measure[m].dD); 213 gprint (GP_LOG, "% 2d ", catalog.measure[m].dophot);213 gprint (GP_LOG, "%4x ", catalog.measure[m].photFlags); 214 214 gprint (GP_LOG, "%3x ", catalog.measure[m].dbFlags); 215 215 gprint (GP_LOG, "%5d ", catalog.measure[m].photcode); … … 233 233 gprint (GP_LOG, "%d", catalog.measure[m].detID); 234 234 gprint (GP_LOG, "%d", catalog.measure[m].imageID); 235 gprint (GP_LOG, "%f", catalog.measure[m]. qPSF);235 gprint (GP_LOG, "%f", catalog.measure[m].psfQual); 236 236 gprint (GP_LOG, "%f", catalog.measure[m].psfChisq); 237 237 gprint (GP_LOG, "%f", catalog.measure[m].crNsigma); … … 240 240 gprint (GP_LOG, "%f", 0.01*catalog.measure[m].FWy); 241 241 gprint (GP_LOG, "%f", (360.0/(float)0xffff)*catalog.measure[m].theta); 242 243 gprint (GP_LOG, "%x", catalog.measure[m].photFlags);244 gprint (GP_LOG, "%d", catalog.measure[m].stargal);245 242 } 246 243 gprint (GP_LOG, "\n"); -
trunk/Ohana/src/opihi/dvo/paverage.c
r20936 r21508 122 122 /* project stars to screen display coords */ 123 123 for (i = 0; (i < catalog.Naverage) && !interrupt; i++) { 124 if (IDclip && (average[i]. code!= IDchoice)) continue;124 if (IDclip && (average[i].flags != IDchoice)) continue; 125 125 average[i].R = ohana_normalize_angle (average[i].R); 126 126 while (average[i].R < Rmin) average[i].R += 360.0; -
trunk/Ohana/src/opihi/dvo/photometry.c
r17200 r21508 2 2 3 3 /* match code to measure */ 4 # define TESTCODE(C,M) \5 if (C != NULL) { \6 switch (C[0].type) { \7 case PHOT_DEP:\8 case PHOT_REF:\9 if (C[0].code != M.photcode) continue;\10 break;\11 case PHOT_SEC:\12 if (C[0].code != GetPhotcodeEquivCodebyCode (M.photcode)) continue; \13 break;\14 default:\15 break;\16 } }4 # define TESTCODE(C,M) \ 5 if (C != NULL) { \ 6 switch (C[0].type) { \ 7 case PHOT_DEP: \ 8 case PHOT_REF: \ 9 if (C[0].code != M.photcode) continue; \ 10 break; \ 11 case PHOT_SEC: \ 12 if (C[0].code != GetPhotcodeEquivCodebyCode (M.photcode)) continue; \ 13 break; \ 14 default: \ 15 break; \ 16 } } 17 17 18 18 /* exclusions based on measure.params */ 19 # define TESTMEASURE(M) \ 20 if (ApplySelections[SelectionParam]) { \ 21 if (TimeSelect && (M.t < tzero)) continue; \ 22 if (TimeSelect && (M.t > tend)) continue; \ 23 if (ErrSelect && (M.dM > ErrValue)) continue; \ 19 # define TESTMEASURE(M) \ 20 if (ApplySelections[SelectionParam]) { \ 21 if (TimeSelect && (M.t < tzero)) continue; \ 22 if (TimeSelect && (M.t > tend)) continue; \ 23 if (ErrSelect && (M.dM > ErrValue)) continue; \ 24 if (iMagSelect && (PhotInst (&M) < iMagMin)) continue; \ 25 if (FlagSelect && (M.dbFlags != FlagValue)) continue; \ 24 26 if (TypeSelect && (TypeValue != GetMeasureTypeCode (&M))) continue; \ 25 if (iMagSelect && (PhotInst (&M) < iMagMin)) continue; \ 26 if (FlagSelect && (M.dbFlags != FlagValue)) continue; \ 27 } 28 29 # define SETMAG(MOUT,MEAS,MODE) \ 30 MOUT = NAN; \ 31 if (MODE == MAG_INST) MOUT = PhotInst (&MEAS); \ 32 if (MODE == MAG_CAT) MOUT = PhotCat (&MEAS); \ 33 if (MODE == MAG_SYS) MOUT = PhotSys (&MEAS, average, secfilt); \ 34 if (MODE == MAG_REL) MOUT = PhotRel (&MEAS, average, secfilt); \ 27 } 28 29 # define SETMAG(MOUT,MEAS,MODE) \ 30 MOUT = NAN; \ 31 if (MODE == MAG_INST) MOUT = PhotInst (&MEAS); \ 32 if (MODE == MAG_CAT) MOUT = PhotCat (&MEAS); \ 33 if (MODE == MAG_SYS) MOUT = PhotSys (&MEAS, average, secfilt); \ 34 if (MODE == MAG_REL) MOUT = PhotRel (&MEAS, average, secfilt); \ 35 35 if (MODE == MAG_CAL) MOUT = PhotCal (&MEAS, average, secfilt, measure, GetPhotcodeEquivbyCode (MEAS.photcode)); \ 36 36 if (MODE == MAG_AVE) MOUT = PhotAve (GetPhotcodeEquivbyCode (MEAS.photcode), average, secfilt); \ 37 37 if (MODE == MAG_REF) MOUT = PhotRef (GetPhotcodeEquivbyCode (MEAS.photcode), average, secfilt, measure); \ 38 if (ApplySelections[SelectionParam]) { \39 if (MagSelect && (MOUT > MagMax)) continue; \40 if (MagSelect && (MOUT < MagMin)) continue; \38 if (ApplySelections[SelectionParam]) { \ 39 if (MagSelect && (MOUT > MagMax)) continue; \ 40 if (MagSelect && (MOUT < MagMin)) continue; \ 41 41 } 42 42 … … 182 182 if (!strcasecmp (parname, "dec")) param = MEAS_DEC; 183 183 if (!strcasecmp (parname, "mag")) param = MEAS_MAG; 184 // if (!strcasecmp (parname, "dmag")) param = MEAS_dMAG;185 184 if (!strcasecmp (parname, "airmass")) param = MEAS_AIRMASS; 186 185 if (!strcasecmp (parname, "exptime")) param = MEAS_EXPTIME; … … 190 189 if (!strcasecmp (parname, "dD")) param = MEAS_DEC_OFFSET; 191 190 if (!strcasecmp (parname, "fwhm")) param = MEAS_FWHM; 192 // if (!strcasecmp (parname, "dophot")) param = MEAS_DOPHOT;193 191 if (!strcasecmp (parname, "FLAGS")) param = MEAS_DB_FLAGS; 194 192 if (!strcasecmp (parname, "XCCD")) param = MEAS_XCCD; … … 198 196 if (!strcasecmp (parname, "help")) { 199 197 gprint (GP_ERR, "value may be one of the following:\n"); 200 gprint (GP_ERR, " ra dR dec dD mag dmag Mrel Mcal photcode time fwhm dophotxccd yccd xmosaic ymosaic flags\n");198 gprint (GP_ERR, " ra dR dec dD mag dmag Mrel Mcal photcode time fwhm xccd yccd xmosaic ymosaic flags\n"); 201 199 gprint (GP_ERR, "value may also be a valid photcode\n"); 202 200 gprint (GP_ERR, "photcodes or 'mag' may have optional magnitude type: mag,[Minst, Mcat, Msys, Mrel, Mcal]\n"); … … 311 309 312 310 if (VarConfig ("ZERO_PT", "%lf", &ZERO_POINT) == (char *) NULL) { 313 gprint (GP_ERR, "ZERO_PT undefined in config\n");314 return (FALSE);311 gprint (GP_ERR, "ZERO_PT undefined in config\n"); 312 return (FALSE); 315 313 } 316 314 SetZeroPoint (ZERO_POINT); … … 324 322 325 323 if (VarConfig ("PHOTCODE_FILE", "%s", MasterPhotcodeFile) == (char *) NULL) { 326 gprint (GP_ERR, "PHOTCODE_FILE undefined in config\n");327 return (FALSE);324 gprint (GP_ERR, "PHOTCODE_FILE undefined in config\n"); 325 return (FALSE); 328 326 } 329 327 if (!LoadPhotcodes (CatdirPhotcodeFile, MasterPhotcodeFile)) { … … 642 640 break; 643 641 case AVE_FLAG: 644 value = average[0]. code;642 value = average[0].flags; 645 643 break; 646 644 case AVE_MAG: … … 659 657 value = NAN; 660 658 for (i = 0; i < average[0].Nmeasure; i++) { 661 if (code[0].code != measure[i].photcode) continue;662 value = measure[i].M;659 if (code[0].code != measure[i].photcode) continue; 660 value = measure[i].M; 663 661 } 664 662 break; … … 675 673 break; 676 674 case AVE_TYPEFRAC: 677 value = DetermineTypefrac (average, measure, code); 675 // value = DetermineTypefrac (average, measure, code); 676 value = NAN; 678 677 break; 679 678 case AVE_NCODE: … … 719 718 if ((code != NULL) && (code[0].code != GetPhotcodeEquivCodebyCode (measure[k].photcode))) continue; 720 719 Nc ++; 721 if ( measure[k].dophot!= TypefracType) continue;720 if ((measure[k].photFlags >> 16) != TypefracType) continue; 722 721 Nt ++; 723 722 } … … 744 743 745 744 int GetMeasureTypeCode (Measure *measure) { 746 switch ( measure[0].dophot) {745 switch ((measure[0].photFlags >> 16)) { 747 746 case 0: 748 747 case 1: … … 770 769 if (IsDophot) { 771 770 772 if ( measure[0].dophot== 4) return (FALSE);771 if ((measure[0].photFlags >> 16) == 4) return (FALSE); 773 772 return (TRUE); 774 773 … … 866 865 if (ErrSelect) { 867 866 dM = PhotdM (code, average, secfilt); 868 if (dM > ErrValue) return ( NAN);867 if (dM > ErrValue) return (FALSE); 869 868 } 870 869 … … 1137 1136 value = average[0].D - measure[0].dD / 3600.0; 1138 1137 break; 1139 # if (0)1140 case MEAS_dMAG: /* OK */1141 value = measure[0].dM;1142 break;1143 1138 case MEAS_DOPHOT: /* OK */ 1144 value = measure[0].dophot; 1145 break; 1146 # endif 1139 value = (measure[0].photFlags >> 16); 1140 break; 1147 1141 case MEAS_AIRMASS: /* OK */ 1148 1142 value = measure[0].airmass; -
trunk/Ohana/src/opihi/dvo/pmeasure.c
r20936 r21508 192 192 /* project stars to screen display coords */ 193 193 for (i = 0; (i < catalog.Naverage) && !interrupt; i++) { 194 if (IDclip && (catalog.average[i]. code!= IDchoice)) continue;194 if (IDclip && (catalog.average[i].flags != IDchoice)) continue; 195 195 catalog.average[i].R = ohana_normalize_angle (catalog.average[i].R); 196 196 while (catalog.average[i].R < Rmin) catalog.average[i].R += 360.0; -
trunk/Ohana/src/opihi/include/dvoshell.h
r21153 r21508 106 106 MEAS_CR_NSIGMA, 107 107 MEAS_EXT_NSIGMA, 108 MEAS_STARGAL,109 108 }; 110 109 -
trunk/Ohana/src/relastro/include/relastro.h
r21153 r21508 61 61 short Xm; 62 62 float secz; 63 char code;63 char flags; 64 64 Coords coords; 65 65 } Mosaic; -
trunk/Ohana/src/relastro/src/MosaicOps.c
r16810 r21508 47 47 mosaic[Nmosaic].dMcal = 0.0; 48 48 mosaic[Nmosaic].Xm = 0.0; 49 mosaic[Nmosaic]. code = image[i].code;49 mosaic[Nmosaic].flags = image[i].flags; 50 50 mosaic[Nmosaic].secz = image[i].secz; 51 51 mosaic[Nmosaic].coords = image[i].coords; -
trunk/Ohana/src/relastro/src/UpdateObjects.c
r17419 r21508 169 169 // position, consider including the lower-quality detections 170 170 171 catalog[i].average[j]. code&= ~ID_STAR_FEW;171 catalog[i].average[j].flags &= ~ID_STAR_FEW; 172 172 173 173 // XXX add the parallax factor range as a criterion as well -
trunk/Ohana/src/relastro/src/bcatalog.c
r17212 r21508 36 36 // XXX define astrometry vs photometry average.dbFlags 37 37 // XXX put photometry flags in secfilt (ie, per average mag?) 38 subcatalog[0].average[Naverage]. code&= ~ID_STAR_FEW;39 subcatalog[0].average[Naverage]. code&= ~ID_STAR_POOR;38 subcatalog[0].average[Naverage].flags &= ~ID_STAR_FEW; 39 subcatalog[0].average[Naverage].flags &= ~ID_STAR_POOR; 40 40 } 41 41 … … 70 70 71 71 /* select measurements by quality */ 72 if (DophotSelect && (catalog[0].measure[offset].dophot != DophotValue)) continue; 72 // XXX FIX THIS!! 73 // if (DophotSelect && (catalog[0].measure[offset].dophot != DophotValue)) continue; 73 74 74 75 /* select measurements by quality */ -
trunk/Ohana/src/relastro/src/load_catalogs.c
r16810 r21508 38 38 if (RESET) { 39 39 for (j = 0; j < catalog[i].Naverage; j++) { 40 catalog[i].average[j]. code= 0;40 catalog[i].average[j].flags = 0; 41 41 m = catalog[i].average[j].measureOffset; 42 42 for (k = 0; k < catalog[i].average[j].Nmeasure; k++) { -
trunk/Ohana/src/relastro/src/relastro_objects.c
r17243 r21508 40 40 if (RESET) { 41 41 for (j = 0; j < catalog.Naverage; j++) { 42 catalog.average[j]. code= 0;42 catalog.average[j].flags = 0; 43 43 m = catalog.average[j].measureOffset; 44 44 for (k = 0; k < catalog.average[j].Nmeasure; k++) { -
trunk/Ohana/src/relastro/src/select_images.c
r17205 r21508 147 147 image[nimage] = timage[i]; 148 148 /* always allow 'few' images to succeed, if possible */ 149 if (image[nimage]. code& ID_IMAGE_FEW) {150 image[nimage]. code&= ~(ID_IMAGE_FEW | ID_IMAGE_POOR);149 if (image[nimage].flags & ID_IMAGE_FEW) { 150 image[nimage].flags &= ~(ID_IMAGE_FEW | ID_IMAGE_POOR); 151 151 } 152 152 if (RESET) { … … 154 154 assignMcal (&image[nimage], (double *) NULL, -1); 155 155 image[nimage].dMcal = NAN; 156 image[nimage]. code&= ~ID_IMAGE_POOR;156 image[nimage].flags &= ~ID_IMAGE_POOR; 157 157 } 158 158 line_number[nimage] = i; -
trunk/Ohana/src/relphot/include/relphot.h
r21153 r21508 23 23 short Xm; 24 24 float secz; 25 char code;25 char flags; 26 26 Coords coords; 27 27 } Mosaic; -
trunk/Ohana/src/relphot/src/GridOps.c
r20936 r21508 369 369 370 370 // skip stars marked as BAD 371 if (catalog[c].average[n]. code& STAR_BAD) {371 if (catalog[c].average[n].flags & STAR_BAD) { 372 372 Nrel ++; 373 373 continue; -
trunk/Ohana/src/relphot/src/ImageOps.c
r20936 r21508 244 244 if (i == -1) return (NAN); 245 245 246 if (image[i]. code& IMAGE_BAD) return (NAN);246 if (image[i].flags & IMAGE_BAD) return (NAN); 247 247 value = image[i].Mcal; 248 248 return (value); … … 285 285 /* on PoorImages run, skip good images */ 286 286 if (PoorImages) { 287 bad = image[i]. code& (ID_IMAGE_FEW | ID_IMAGE_POOR | ID_IMAGE_SKIP);287 bad = image[i].flags & (ID_IMAGE_FEW | ID_IMAGE_POOR | ID_IMAGE_SKIP); 288 288 if (!bad) continue; 289 289 } … … 331 331 mark = (N < IMAGE_TOOFEW) || (N < IMAGE_GOOD_FRACTION*Nlist[i]); 332 332 if (mark) { 333 image[i]. code|= ID_IMAGE_FEW;333 image[i].flags |= ID_IMAGE_FEW; 334 334 Nfew ++; 335 335 } else { 336 image[i]. code&= ~ID_IMAGE_FEW;336 image[i].flags &= ~ID_IMAGE_FEW; 337 337 } 338 338 } … … 373 373 374 374 for (i = N = 0; i < Nimage; i++) { 375 if (image[i]. code& IMAGE_BAD) continue;375 if (image[i].flags & IMAGE_BAD) continue; 376 376 mlist[N] = fabs (image[i].Mcal); 377 377 slist[N] = image[i].dMcal; … … 390 390 for (i = 0; i < Nimage; i++) { 391 391 mark = FALSE; 392 image[i]. code&= ~ID_IMAGE_POOR;392 image[i].flags &= ~ID_IMAGE_POOR; 393 393 mark = (image[i].dMcal > MaxScatter) || (fabs(image[i].Mcal - MedOffset) > MaxOffset); 394 394 if (mark) { 395 395 Nmark ++; 396 image[i]. code|= ID_IMAGE_POOR;396 image[i].flags |= ID_IMAGE_POOR; 397 397 } else { 398 image[i]. code&= ~ID_IMAGE_POOR;398 image[i].flags &= ~ID_IMAGE_POOR; 399 399 } 400 400 } … … 470 470 n = 0; 471 471 for (i = 0; i < Nimage; i++) { 472 if (image[i]. code& IMAGE_BAD) continue;472 if (image[i].flags & IMAGE_BAD) continue; 473 473 474 474 N = 0; … … 512 512 for (i = 0; i < Nimage; i++) { 513 513 514 if (image[i]. code& IMAGE_BAD) continue;514 if (image[i].flags & IMAGE_BAD) continue; 515 515 516 516 list[n] = pow (10.0, 0.01*image[i].Xm); … … 540 540 for (i = 0; i < Nimage; i++) { 541 541 542 if (image[i]. code& IMAGE_BAD) continue;542 if (image[i].flags & IMAGE_BAD) continue; 543 543 544 544 list[n] = image[i].Mcal; … … 568 568 for (i = 0; i < Nimage; i++) { 569 569 570 if (image[i]. code& IMAGE_BAD) continue;570 if (image[i].flags & IMAGE_BAD) continue; 571 571 572 572 list[n] = image[i].dMcal; -
trunk/Ohana/src/relphot/src/MosaicOps.c
r20323 r21508 68 68 mosaic[Nmosaic].dMcal = 0.0; 69 69 mosaic[Nmosaic].Xm = 0.0; 70 mosaic[Nmosaic]. code = image[i].code;70 mosaic[Nmosaic].flags = image[i].flags; 71 71 mosaic[Nmosaic].secz = image[i].secz; 72 72 … … 183 183 image[im].dMcal = mosaic[i].dMcal; 184 184 image[im].Xm = mosaic[i].Xm; 185 image[im]. code |= (mosaic[i].code& ID_IMAGE_FEW);186 image[im]. code |= (mosaic[i].code& ID_IMAGE_POOR);185 image[im].flags |= (mosaic[i].flags & ID_IMAGE_FEW); 186 image[im].flags |= (mosaic[i].flags & ID_IMAGE_POOR); 187 187 } 188 188 } … … 306 306 if (i == -1) return (NAN); 307 307 308 if (mosaic[i]. code& IMAGE_BAD) return (NAN);308 if (mosaic[i].flags & IMAGE_BAD) return (NAN); 309 309 value = mosaic[i].Mcal; 310 310 return (value); … … 343 343 /* on PoorImages run, skip good images */ 344 344 if (PoorImages) { 345 bad = mosaic[i]. code& (ID_IMAGE_FEW | ID_IMAGE_POOR | ID_IMAGE_SKIP);345 bad = mosaic[i].flags & (ID_IMAGE_FEW | ID_IMAGE_POOR | ID_IMAGE_SKIP); 346 346 if (!bad) continue; 347 347 } … … 393 393 if (mark) { 394 394 fprintf (stderr, "marked image %s (%d), (%d < %d) || (%d < %f*%d)\n", image[imlist[i][0]].name, i, N, IMAGE_TOOFEW, N, IMAGE_GOOD_FRACTION, Nlist[i]); 395 mosaic[i]. code|= ID_IMAGE_FEW;395 mosaic[i].flags |= ID_IMAGE_FEW; 396 396 Nfew ++; 397 397 } else { 398 mosaic[i]. code&= ~ID_IMAGE_FEW;398 mosaic[i].flags &= ~ID_IMAGE_FEW; 399 399 } 400 400 } … … 434 434 n = 0; 435 435 for (i = 0; i < Nmosaic; i++) { 436 if (mosaic[i]. code& IMAGE_BAD) continue;436 if (mosaic[i].flags & IMAGE_BAD) continue; 437 437 list[n] = mosaic[i].Mcal; 438 438 dlist[n] = 1; … … 462 462 for (i = 0; i < Nmosaic; i++) { 463 463 464 if (mosaic[i]. code& IMAGE_BAD) continue;464 if (mosaic[i].flags & IMAGE_BAD) continue; 465 465 list[n] = mosaic[i].dMcal; 466 466 dlist[n] = 1; … … 490 490 n = 0; 491 491 for (i = 0; i < Nmosaic; i++) { 492 if (mosaic[i]. code& IMAGE_BAD) continue;492 if (mosaic[i].flags & IMAGE_BAD) continue; 493 493 494 494 N = 0; … … 534 534 for (i = 0; i < Nmosaic; i++) { 535 535 536 if (mosaic[i]. code& IMAGE_BAD) continue;536 if (mosaic[i].flags & IMAGE_BAD) continue; 537 537 list[n] = pow(10.0, 0.01*mosaic[i].Xm); 538 538 dlist[n] = 1; … … 564 564 565 565 for (i = N = 0; i < Nmosaic; i++) { 566 if (mosaic[i]. code& IMAGE_BAD) continue;566 if (mosaic[i].flags & IMAGE_BAD) continue; 567 567 mlist[N] = mosaic[i].Mcal; 568 568 slist[N] = mosaic[i].dMcal; … … 584 584 if (mark) { 585 585 Nmark ++; 586 mosaic[i]. code|= ID_IMAGE_POOR;586 mosaic[i].flags |= ID_IMAGE_POOR; 587 587 } else { 588 mosaic[i]. code&= ~ID_IMAGE_POOR;588 mosaic[i].flags &= ~ID_IMAGE_POOR; 589 589 } 590 590 } -
trunk/Ohana/src/relphot/src/StarOps.c
r21153 r21508 26 26 27 27 ave = catalog[cat].measure[meas].averef; 28 if (catalog[cat].average[ave]. code& STAR_BAD) return (NAN);28 if (catalog[cat].average[ave].flags & STAR_BAD) return (NAN); 29 29 30 30 value = catalog[cat].secfilt[PhotNsec*ave+PhotSec].M; … … 44 44 45 45 /* calculate the average value for a single star */ 46 if (catalog[i].average[j]. code& STAR_BAD) continue;46 if (catalog[i].average[j].flags & STAR_BAD) continue; 47 47 m = catalog[i].average[j].measureOffset; 48 48 … … 89 89 90 90 if (N <= STAR_TOOFEW) { /* too few measurements */ 91 catalog[i].average[j]. code|= ID_STAR_FEW;91 catalog[i].average[j].flags |= ID_STAR_FEW; 92 92 Nfew ++; 93 93 } else { 94 catalog[i].average[j]. code&= ~ID_STAR_FEW;94 catalog[i].average[j].flags &= ~ID_STAR_FEW; 95 95 } 96 96 … … 208 208 209 209 // XXX this is a hack for the 2MASS search; better to save an average value? 210 if (catalog[i].measure[m]. qPSF< 0.85) continue;210 if (catalog[i].measure[m].psfQual < 0.85) continue; 211 211 212 212 list[N] = Msys - catalog[i].measure[m].Mcal; … … 280 280 for (i = Ntot = 0; i < Ncatalog; i++) { 281 281 for (j = 0; j < catalog[i].Naverage; j++) { 282 if (catalog[i].average[j]. code& STAR_BAD) continue;282 if (catalog[i].average[j].flags & STAR_BAD) continue; 283 283 Xm = catalog[i].secfilt[PhotNsec*j+PhotSec].Xm; 284 284 if (Xm == -1) continue; … … 306 306 mark = (dM > MaxScatter) || (Xm == NAN_S_SHORT) || (Chisq > MaxChisq); 307 307 if (mark) { 308 catalog[i].average[j]. code|= ID_STAR_POOR;308 catalog[i].average[j].flags |= ID_STAR_POOR; 309 309 Ndel ++; 310 310 } else { 311 catalog[i].average[j]. code&= ~ID_STAR_POOR;311 catalog[i].average[j].flags &= ~ID_STAR_POOR; 312 312 } 313 313 Nave ++; … … 351 351 352 352 /* skip bad stars to prevent them from becoming good (on inner sample) */ 353 if (catalog[i].average[j]. code& STAR_BAD) continue;353 if (catalog[i].average[j].flags & STAR_BAD) continue; 354 354 355 355 /* on final processing, skip stars already measured */ … … 448 448 449 449 /* calculate the average value for a single star */ 450 if (catalog[i].average[j]. code& STAR_BAD) continue;450 if (catalog[i].average[j].flags & STAR_BAD) continue; 451 451 m = catalog[i].average[j].measureOffset; 452 452 … … 493 493 494 494 /* calculate the average value for a single star */ 495 if (catalog[i].average[j]. code& STAR_BAD) continue;495 if (catalog[i].average[j].flags & STAR_BAD) continue; 496 496 497 497 Xm = catalog[i].secfilt[PhotNsec*j+PhotSec].Xm; … … 529 529 530 530 /* calculate the average value for a single star */ 531 if (catalog[i].average[j]. code& STAR_BAD) continue;531 if (catalog[i].average[j].flags & STAR_BAD) continue; 532 532 533 533 dM = catalog[i].secfilt[PhotNsec*j+PhotSec].dM; … … 559 559 for (i = 0; i < Ncatalog; i++) { 560 560 for (j = 0; j < catalog[i].Naverage; j++) { 561 if (catalog[i].average[j]. code& STAR_BAD) continue;561 if (catalog[i].average[j].flags & STAR_BAD) continue; 562 562 dMrel = catalog[i].secfilt[PhotNsec*j+PhotSec].dM; 563 563 bin = dMrel / 0.00025; … … 590 590 for (i = 0; i < Ncatalog; i++) { 591 591 for (j = 0; j < catalog[i].Naverage; j++) { 592 if (catalog[i].average[j]. code& STAR_BAD) continue;592 if (catalog[i].average[j].flags & STAR_BAD) continue; 593 593 xlist[N] = catalog[i].secfilt[PhotNsec*j+PhotSec].M; 594 594 value = catalog[i].secfilt[PhotNsec*j+PhotSec].Xm; -
trunk/Ohana/src/relphot/src/bcatalog.c
r20323 r21508 34 34 subcatalog[0].secfilt[PhotNsec*Naverage+PhotSec].M = NAN; 35 35 subcatalog[0].secfilt[PhotNsec*Naverage+PhotSec].dM = NAN; 36 subcatalog[0].average[Naverage]. code&= ~ID_STAR_FEW;37 subcatalog[0].average[Naverage]. code&= ~ID_STAR_POOR;36 subcatalog[0].average[Naverage].flags &= ~ID_STAR_FEW; 37 subcatalog[0].average[Naverage].flags &= ~ID_STAR_POOR; 38 38 } 39 39 … … 55 55 /* select measurements by quality */ 56 56 // XXX ignore this criterion for REF measurements? 57 if (DophotSelect && (catalog[0].measure[offset].dophot != DophotValue)) continue; 57 // XXX chnage this to select by bitflags 58 if (DophotSelect && ((catalog[0].measure[offset].photFlags >> 16) != DophotValue)) continue; 58 59 59 60 /* select measurements by mag limit */ -
trunk/Ohana/src/relphot/src/plot_scatter.c
r20193 r21508 23 23 24 24 /* calculate the average value for a single star */ 25 if (catalog[i].average[j]. code& STAR_BAD) continue;25 if (catalog[i].average[j].flags & STAR_BAD) continue; 26 26 m = catalog[i].average[j].measureOffset; 27 27 -
trunk/Ohana/src/relphot/src/relphot_objects.c
r21153 r21508 42 42 Nsecfilt = catalog.Nsecfilt; 43 43 for (j = 0; j < catalog.Naverage; j++) { 44 catalog.average[j]. code= 0;44 catalog.average[j].flags = 0; 45 45 for (k = 0; k < Nsecfilt; k++) { 46 catalog.secfilt[j*Nsecfilt + k].M = NAN; 47 catalog.secfilt[j*Nsecfilt + k].dM = NAN; 48 catalog.secfilt[j*Nsecfilt + k].Xm = NAN_S_SHORT; 46 catalog.secfilt[j*Nsecfilt + k].M = NAN; 47 catalog.secfilt[j*Nsecfilt + k].M_20 = NAN_S_SHORT; 48 catalog.secfilt[j*Nsecfilt + k].M_80 = NAN_S_SHORT; 49 catalog.secfilt[j*Nsecfilt + k].dM = NAN; 50 catalog.secfilt[j*Nsecfilt + k].Xm = NAN_S_SHORT; 49 51 catalog.secfilt[j*Nsecfilt + k].Ncode = 0; 50 52 catalog.secfilt[j*Nsecfilt + k].Nused = 0; 51 catalog.secfilt[j*Nsecfilt + k].dummy = 0;52 53 } 53 54 m = catalog.average[j].measureOffset; -
trunk/Ohana/src/relphot/src/select_images.c
r15509 r21508 133 133 image[nimage] = timage[i]; 134 134 /* always allow 'few' images to succeed, if possible */ 135 if (image[nimage]. code& ID_IMAGE_FEW) {136 image[nimage]. code&= ~(ID_IMAGE_FEW | ID_IMAGE_POOR);135 if (image[nimage].flags & ID_IMAGE_FEW) { 136 image[nimage].flags &= ~(ID_IMAGE_FEW | ID_IMAGE_POOR); 137 137 } 138 138 if (RESET) { 139 139 assignMcal (&image[nimage], (double *) NULL, -1); 140 140 image[nimage].dMcal = NAN; 141 image[nimage]. code&= ~ID_IMAGE_POOR;141 image[nimage].flags &= ~ID_IMAGE_POOR; 142 142 } 143 143 line_number[nimage] = i; -
trunk/Ohana/src/relphot/src/setMrelFinal.c
r17201 r21508 54 54 /* clear ID_STAR_POOR, ID_STAR_FEW, ID_MEAS_NOCAL values before writing ??? */ 55 55 for (i = 0; i < catalog[0].Naverage; i++) { 56 catalog[0].average[i]. code&= ~ID_STAR_FEW;57 catalog[0].average[i]. code&= ~ID_STAR_POOR;56 catalog[0].average[i].flags &= ~ID_STAR_FEW; 57 catalog[0].average[i].flags &= ~ID_STAR_POOR; 58 58 m = catalog[0].average[i].measureOffset; 59 59 for (j = 0; j < catalog[0].average[i].Nmeasure; j++, m++) { … … 102 102 103 103 /* skip measurements with sat. dophot values */ 104 if ((pass < 4) && (catalog[0].measure[m].dophot == 10)) goto skip; 104 // XXX we need to fix this: use the photFlags to ID saturation... 105 // if ((pass < 4) && (catalog[0].measure[m].dophot == 10)) goto skip; 105 106 106 107 /* skip measurements from BAD images and mosaics */ … … 116 117 } 117 118 118 d1 = (catalog[0].measure[m].dophot == 1); 119 d2 = (catalog[0].measure[m].dophot == 2); 119 // d1 = (catalog[0].measure[m].dophot == 1); 120 // d2 = (catalog[0].measure[m].dophot == 2); 121 fprintf (stderr, "fix the dophot / type selections!"); 122 abort (); 120 123 121 124 /* skip measurements by measurement error */ -
trunk/Ohana/src/uniphot/src/find_image_sgroups.c
r7080 r21508 27 27 for (i = 0; i < Nimage; i++) { 28 28 if (imlink[i].sgroup != NULL) continue; 29 if (image[i]. code& ID_IMAGE_NOCAL) continue;29 if (image[i].flags & ID_IMAGE_NOCAL) continue; 30 30 31 31 /* new sgroup, set ref coords */ … … 52 52 53 53 for (j = 0; j < Nimage; j++) { 54 if (image[j]. code& ID_IMAGE_NOCAL) continue;54 if (image[j].flags & ID_IMAGE_NOCAL) continue; 55 55 if (imlink[j].sgroup != NULL) continue; 56 56 -
trunk/Ohana/src/uniphot/src/find_image_tgroups.c
r16040 r21508 63 63 if (image[j].tzero < tmin[i]) continue; 64 64 if (image[j].tzero > tmax[i]) continue; 65 if (image[j]. code& ID_IMAGE_NOCAL) continue;65 if (image[j].flags & ID_IMAGE_NOCAL) continue; 66 66 67 67 group[i].image[Nentry] = &image[j]; -
trunk/Ohana/src/uniphot/src/fit_groups.c
r12332 r21508 16 16 for (i = 0; i < Ntgroup; i++) { 17 17 for (j = Nlist = 0; j < tgroup[i].Nimage; j++) { 18 if (tgroup[i].image[j][0]. code& IMAGE_BAD) continue;18 if (tgroup[i].image[j][0].flags & IMAGE_BAD) continue; 19 19 sgroup = (Group *) tgroup[i].imlink[j][0].sgroup; 20 20 Mcal = tgroup[i].image[j][0].Mcal; … … 54 54 for (i = 0; i < Nsgroup; i++) { 55 55 for (j = Nlist = 0; j < sgroup[i].Nimage; j++) { 56 if (sgroup[i].image[j][0]. code& IMAGE_BAD) continue;56 if (sgroup[i].image[j][0].flags & IMAGE_BAD) continue; 57 57 tgroup = (Group *) sgroup[i].imlink[j][0].tgroup; 58 58 Mcal = sgroup[i].image[j][0].Mcal; -
trunk/Ohana/src/uniphot/src/subset_images.c
r12332 r21508 16 16 for (i = 0; i < Nimage; i++) { 17 17 18 image[i]. code|= ID_IMAGE_NOCAL;18 image[i].flags |= ID_IMAGE_NOCAL; 19 19 20 20 /* select images by photcode */ … … 27 27 if (image[i].tzero > TSTOP) continue; 28 28 } 29 image[i]. code&= ~ID_IMAGE_NOCAL;29 image[i].flags &= ~ID_IMAGE_NOCAL; 30 30 keep[Nkeep] = i; 31 31 Nkeep ++; -
trunk/Ohana/src/uniphot/src/update.c
r19823 r21508 16 16 /* clear the NOCAL flags */ 17 17 for (i = 0; i < Nimage; i++) { 18 image[i]. code&= ~ID_IMAGE_NOCAL;18 image[i].flags &= ~ID_IMAGE_NOCAL; 19 19 } 20 20
Note:
See TracChangeset
for help on using the changeset viewer.
