Changeset 15426
- Timestamp:
- Oct 31, 2007, 3:02:19 PM (19 years ago)
- Location:
- branches/eam_branch_20071015/Ohana/src/absphot
- Files:
-
- 1 added
- 9 edited
-
Makefile (modified) (1 diff)
-
include/absphot.h (modified) (3 diffs)
-
src/ConfigInit.c (modified) (3 diffs)
-
src/absphot.c (modified) (1 diff)
-
src/args.c (modified) (7 diffs)
-
src/find_regions.c (added)
-
src/fit_trend.c (modified) (4 diffs)
-
src/initialize.c (modified) (2 diffs)
-
src/plotstuff.c (modified) (1 diff)
-
src/subset_catalog.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20071015/Ohana/src/absphot/Makefile
r15354 r15426 21 21 22 22 ABSPHOT = \ 23 $(SRC)/absphot.$(ARCH).o \ 24 $(SRC)/initialize.$(ARCH).o \ 23 25 $(SRC)/ConfigInit.$(ARCH).o \ 24 $(SRC)/GridOps.$(ARCH).o \25 $(SRC)/ImageOps.$(ARCH).o \26 $(SRC)/MosaicOps.$(ARCH).o \27 $(SRC)/SetSignals.$(ARCH).o \28 $(SRC)/Shutdown.$(ARCH).o \29 $(SRC)/StarOps.$(ARCH).o \30 26 $(SRC)/args.$(ARCH).o \ 31 $(SRC)/bcatalog.$(ARCH).o \ 32 $(SRC)/global_stats.$(ARCH).o \ 33 $(SRC)/initialize.$(ARCH).o \ 27 $(SRC)/find_regions.$(ARCH).o \ 28 $(SRC)/load_catalogs.$(ARCH).o \ 29 $(SRC)/subset_catalog.$(ARCH).o \ 30 $(SRC)/fit_trend.$(ARCH).o \ 34 31 $(SRC)/liststats.$(ARCH).o \ 35 $(SRC)/load_catalogs.$(ARCH).o \ 36 $(SRC)/load_images.$(ARCH).o \ 37 $(SRC)/plot_scatter.$(ARCH).o \ 38 $(SRC)/plotstuff.$(ARCH).o \ 39 $(SRC)/reload_catalogs.$(ARCH).o \ 40 $(SRC)/absphot.$(ARCH).o \ 41 $(SRC)/select_images.$(ARCH).o \ 42 $(SRC)/setExclusions.$(ARCH).o \ 43 $(SRC)/setMrelFinal.$(ARCH).o \ 44 $(SRC)/sort.$(ARCH).o \ 45 $(SRC)/write_coords.$(ARCH).o 32 $(SRC)/sort.$(ARCH).o \ 33 $(SRC)/plotstuff.$(ARCH).o 34 35 # $(SRC)/plot_residuals.$(ARCH).o \ 46 36 47 37 $(ABSPHOT): $(INC)/absphot.h -
branches/eam_branch_20071015/Ohana/src/absphot/include/absphot.h
r15354 r15426 3 3 # include <kapa.h> 4 4 # include <signal.h> 5 6 /* # define GRID_V1 */7 # define GRID_V28 # define NO_IMAGE -1009 10 # if (0)11 typedef struct {12 double xmin, xmax, ymin, ymax;13 int style, ptype, ltype, etype, color;14 double lweight, size;15 } Graphdata;16 # endif17 18 typedef struct {19 unsigned int start;20 unsigned int stop;21 float Mcal;22 float dMcal;23 short Xm;24 float secz;25 char code;26 Coords coords;27 } Mosaic;28 5 29 6 typedef struct { … … 41 18 /* global variables set in parameter file */ 42 19 char ImageCat[256]; 43 char ImageTemplate[256];44 char CatTemplate[256];45 20 char GSCFILE[256]; 46 21 char CATDIR[256]; 47 22 char CATMODE[16]; /* raw, mef, split, mysql */ 48 23 char CATFORMAT[16]; /* internal, elixir, loneos, panstarrs */ 49 char CameraConfig[256]; 24 50 25 char SKY_TABLE[256]; 51 26 int SKY_DEPTH; /** XXX EAM : depth of catalog tables, fix usage */ 52 27 53 double MAG_LIM;54 double SIGMA_LIM;55 double IMAGE_SCATTER;56 double IMAGE_OFFSET;57 double STAR_SCATTER;58 double STAR_CHISQ;59 double MIN_ERROR;60 61 28 int VERBOSE; 62 29 63 int NLOOP;64 int RESET;65 30 int UPDATE; 66 31 int PLOTSTUFF; 67 32 int SAVEPLOT; 68 int SHOW_PARAMS;69 char MOSAICNAME[256];70 char STATMODE[32];71 int STAR_BAD;72 int MEAS_BAD;73 int STAR_TOOFEW;74 int IMAGE_TOOFEW;75 double IMAGE_GOOD_FRACTION;76 int IMAGE_BAD;77 int FREEZE_IMAGES;78 int USE_GRID;79 33 int PLOTDELAY; 80 34 81 int RELPHOT_GRID_X; 82 int RELPHOT_GRID_Y; 83 int RELPHOT_GRID_BINNING; 35 int SHOW_PARAMS; 36 char STATMODE[32]; 84 37 85 38 PhotCode *photcode; … … 87 40 int PhotSec; 88 41 89 int AreaSelect;90 double AreaXmin, AreaXmax, AreaYmin, AreaYmax;91 92 int ImagSelect, ImagMin, ImagMax;93 94 int DophotSelect, DophotValue;95 96 42 double PlotMmin, PlotMmax, PlotdMmin, PlotdMmax; 97 enum {black, white, red, orange, yellow, green, blue, indigo, violet};98 99 int TimeSelect;100 time_t TSTART, TSTOP;101 43 102 44 SkyRegion UserPatch; 103 int UserPatchSelect;104 45 105 # ifdef GRID_V1 106 int setGridMeasure (int meas, int cat, double X, double Y); 107 # endif 108 109 # ifdef GRID_V2 110 int setGridMeasure (int meas, int cat, double X, double Y, int ccdnum); 111 # endif 112 113 /*** relphot prototypes ***/ 46 /*** absphot prototypes ***/ 47 int main PROTO((int argc, char **argv)); 48 void initialize PROTO((int argc, char **argv)); 49 int args PROTO((int argc, char **argv)); 114 50 void ConfigInit PROTO((int *argc, char **argv)); 115 51 void GetConfig PROTO((char *config, char *field, char *format, int N, void *ptr)); 116 char *GetPhotnamebyCode PROTO((PhotCodeData *photcodes, int code)); 117 void InterpolateGrid PROTO((float *buffer, int Nx, int Ny, Coords *ccd, Coords *gcoords)); 118 int *SelectRefMosaic PROTO((Mosaic **refmosaic, int *Nimage)); 119 int args PROTO((int argc, char **argv)); 120 int bcatalog PROTO((Catalog *subcatalog, Catalog *catalog)); 121 void clean_images PROTO(()); 122 void clean_measures PROTO((Catalog *catalog, int Ncatalog, int final)); 123 void clean_mosaics PROTO(()); 124 void clean_stars PROTO((Catalog *catalog, int Ncatalog)); 125 int corner_check PROTO((double *x1, double *y1, double *x2, double *y2)); 126 void dumpGrid PROTO(()); 127 void dump_grid PROTO(()); 128 int edge_check PROTO((double *x1, double *y1, double *x2, double *y2)); 129 void findImages PROTO((Catalog *catalog, int Ncatalog)); 130 int findMosaics PROTO((Catalog *catalog, int Ncatalog)); 52 Catalog *load_catalogs PROTO((SkyList *skylist)); 53 int subset_catalog PROTO((Catalog *subcatalog, Catalog *catalog)); 54 void free_catalogs PROTO((Catalog *catalog, int Ncatalog)); 131 55 132 void set_db (FITS_DB *in);133 int Shutdown (char *format, ...);134 void TrapSignal (int sig);135 void SetProtect (int mode);136 int SetSignals ();137 138 void freeGridBins PROTO((int Ncatalog));139 void freeImageBins PROTO((int Ncatalog));140 void freeMosaicBins PROTO((int Ncatalog));141 void free_catalogs PROTO((Catalog *catalog, int Ncatalog));142 int gcatalog PROTO((Catalog *catalog, int FINAL));143 Coords *getCoords PROTO((int meas, int cat));144 float getMcal PROTO((int meas, int cat));145 float getMgrid PROTO((int meas, int cat));146 float getMmos PROTO((int meas, int cat));147 float getMrel PROTO((Catalog *catalog, int meas, int cat));148 Image *getimage PROTO((int N));149 Image *getimages PROTO((int *N));150 void global_stats PROTO((Catalog *catalog, int Ncatalog));151 void initGrid PROTO((int dX, int dY));152 void initGridBins PROTO((Catalog *catalog, int Ncatalog));153 void initImageBins PROTO((Catalog *catalog, int Ncatalog));154 void initImages PROTO((Image *input, int N));155 void initMosaicBins PROTO((Catalog *catalog, int Ncatalog));156 void initMosaicGrid PROTO((Image *image, int Nimage));157 void initMosaics PROTO((Image *image, int Nimage));158 void initMrel PROTO((Catalog *catalog, int Ncatalog));159 void initialize PROTO((int argc, char **argv));160 56 void initstats PROTO((char *mode)); 161 57 int liststats PROTO((double *value, double *dvalue, int N, StatType *stats)); 162 Catalog *load_catalogs PROTO((SkyList *skylist, int *Ncatalog));163 SkyList *load_images PROTO((FITS_DB *db, char *regionName, SkyRegion *region, int RegionSelect));164 Image *select_images PROTO((SkyList *skylist, Image *timage, int Ntimage, int **LineNumber, int *Nimage));165 58 166 int main PROTO((int argc, char **argv)); 167 void mark_images PROTO((Image *image, int Nimage, Image *timage, int Ntimage)); 168 void matchImage PROTO((Catalog *catalog, int meas, int cat)); 169 void matchMosaics PROTO((Catalog *catalog, int meas, int cat)); 170 double opening_angle PROTO((double x1, double y1, double x2, double y2, double x3, double y3)); 171 void plot_chisq PROTO((Catalog *catalog, int Ncatalog)); 172 void plot_defaults PROTO((Graphdata *graphdata)); 173 void plot_grid PROTO((Catalog *catalog)); 174 void plot_images PROTO(()); 175 void plot_list PROTO((Graphdata *graphdata, double *xlist, double *ylist, int N, char *label, char *file)); 176 void plot_mosaic_fields PROTO((Catalog *catalog)); 177 void plot_mosaics PROTO(()); 178 void plot_scatter PROTO((Catalog *catalog, int Ncatalog)); 179 void plot_star_coords PROTO((Catalog *catalog, int Ncatalog)); 180 void plot_stars PROTO((Catalog *catalog, int Ncatalog)); 181 void reload_catalogs PROTO((SkyList *skylist)); 182 int reload_images PROTO((FITS_DB *db)); 183 int setExclusions PROTO((Catalog *catalog, int Ncatalog)); 184 void setMcal PROTO((Catalog *catalog, int Poor)); 185 void setMcalFinal PROTO(()); 186 int setMcalOutput PROTO((Catalog *catalog, int Ncatalog)); 187 void setMgrid PROTO((Catalog *catalog)); 188 int setMmos PROTO((Catalog *catalog, int Poor)); 189 int setMrel PROTO((Catalog *catalog, int Ncatalog)); 190 void setMrelFinal PROTO((Catalog *catalog)); 191 int setMrelOutput PROTO((Catalog *catalog, int Ncatalog, int mark)); 192 void set_ZP PROTO((double ZERO)); 193 int setrefcode PROTO((Image *image, int Nimage)); 194 void skip_measurements PROTO((Catalog *catalog, int pass)); 195 void sortA PROTO((double *X, int N)); 196 void sortB PROTO((double *X, double *Y, int N)); 197 void sortC PROTO((double *X, double *Y, double *F1, double *F2, int N)); 198 void sortD PROTO((double *X, double *Y, double *Z, int N)); 199 StatType statsImageM PROTO((Catalog *catalog)); 200 StatType statsImageN PROTO((Catalog *catalog)); 201 StatType statsImageX PROTO((Catalog *catalog)); 202 StatType statsImagedM PROTO((Catalog *catalog)); 203 StatType statsMosaicM PROTO((Catalog *catalog)); 204 StatType statsMosaicN PROTO((Catalog *catalog)); 205 StatType statsMosaicX PROTO((Catalog *catalog)); 206 StatType statsMosaicdM PROTO((Catalog *catalog)); 207 StatType statsStarN PROTO((Catalog *catalog, int Ncatalog)); 208 StatType statsStarS PROTO((Catalog *catalog, int Ncatalog)); 209 StatType statsStarX PROTO((Catalog *catalog, int Ncatalog)); 210 void wcatalog PROTO((Catalog *catalog)); 211 void wimages PROTO(()); 212 void write_coords PROTO((Header *header, Coords *coords)); 59 SkyList *find_regions PROTO((FITS_DB *db, SkyRegion *region)); -
branches/eam_branch_20071015/Ohana/src/absphot/src/ConfigInit.c
r15354 r15426 1 1 # include "absphot.h" 2 3 2 void ConfigInit (int *argc, char **argv) { 4 3 … … 18 17 if (VERBOSE) fprintf (stderr, "loaded config file: %s\n", file); 19 18 20 GetConfig (config, "MAG_LIM", "%lf", 0, &MAG_LIM); 21 GetConfig (config, "SIGMA_LIM", "%lf", 0, &SIGMA_LIM); 22 GetConfig (config, "STAR_SCATTER", "%lf", 0, &STAR_SCATTER); 23 GetConfig (config, "IMAGE_SCATTER", "%lf", 0, &IMAGE_SCATTER); 24 GetConfig (config, "IMAGE_OFFSET", "%lf", 0, &IMAGE_OFFSET); 25 26 GetConfig (config, "STAR_CHISQ", "%lf", 0, &STAR_CHISQ); 27 GetConfig (config, "STAR_TOOFEW", "%d", 0, &STAR_TOOFEW); 28 GetConfig (config, "IMAGE_TOOFEW", "%d", 0, &IMAGE_TOOFEW); 29 GetConfig (config, "IMAGE_GOOD_FRACTION", "%lf", 0, &IMAGE_GOOD_FRACTION); 30 31 GetConfig (config, "GSCFILE", "%s", 0, GSCFILE); 32 GetConfig (config, "CATDIR", "%s", 0, CATDIR); 19 GetConfig (config, "GSCFILE", "%s", 0, GSCFILE); 20 GetConfig (config, "CATDIR", "%s", 0, CATDIR); 33 21 ScanConfig (config, "CATMODE", "%s", 0, CATMODE); 34 22 ScanConfig (config, "CATFORMAT", "%s", 0, CATFORMAT); … … 46 34 GetConfig (config, "ZERO_PT", "%lf", 0, &ZERO_POINT); 47 35 48 GetConfig (config, "RELPHOT_GRID_X", "%d", 0, &RELPHOT_GRID_X); 49 GetConfig (config, "RELPHOT_GRID_Y", "%d", 0, &RELPHOT_GRID_Y); 50 GetConfig (config, "RELPHOT_GRID_BINNING", "%d", 0, &RELPHOT_GRID_BINNING); 51 GetConfig (config, "CAMERA_CONFIG", "%s", 0, CameraConfig); 52 36 // XXX these are used to set the default values if we are opening a new catalog, 37 // but this program requires the existence of a catalog (with observations and references) 53 38 if (*CATMODE == 0) strcpy (CATMODE, "RAW"); 54 39 if (*CATFORMAT == 0) strcpy (CATFORMAT, "ELIXIR"); 55 40 56 / * XXX this does not yet write out the master photcode table */41 // XXX this does not yet write out the master photcode table 57 42 sprintf (CatdirPhotcodeFile, "%s/Photcodes.dat", CATDIR); 58 43 if (!LoadPhotcodes (CatdirPhotcodeFile, MasterPhotcodeFile)) { -
branches/eam_branch_20071015/Ohana/src/absphot/src/absphot.c
r15354 r15426 9 9 SkyList *skylist = NULL; 10 10 11 / * get configuration info, args */11 // get configuration info, interpret args 12 12 initialize (argc, argv); 13 13 14 /* lock and load the photcode table */ 15 if (UPDATE) dvo_photcode_lock (); 14 // lock and load the photcode table 15 // XXX need to define this 16 // if (UPDATE) dvo_photcode_lock (); 16 17 17 /* load catalog data from region files */ 18 // restrict to user-specified region 19 skylist = find_regions (&db, &UserPatch); 20 21 // load catalog data from selected regions 18 22 catalog = load_catalogs (skylist); 19 23 20 /* add in a loop over the catalogs calling dvo_catalog_chipcoords */ 21 fit_trend (catalog); 24 // fit the trend of the obs - ref vs color... 25 // XXX define this 26 // fit_trend (catalog); 22 27 23 28 if (PLOTSTUFF) { 24 plot_residuals (catalog); 29 // XXX define this 30 // plot_residuals (catalog); 25 31 } 26 32 27 33 if (!UPDATE) exit (0); 28 34 29 /* load catalog data from region files, update Mrel include all data */ 30 dvo_photcode_update (); 31 dvo_photcode_unlock (); 35 // write out modifications to the photcode table (how do we record historical values?) 36 // XXX define these 37 // dvo_photcode_update (); 38 // dvo_photcode_unlock (); 32 39 33 40 exit (0); -
branches/eam_branch_20071015/Ohana/src/absphot/src/args.c
r15354 r15426 7 7 double trange; 8 8 9 /* define time */10 TimeSelect = FALSE;11 if ((N = get_argument (argc, argv, "-time"))) {12 remove_argument (N, &argc, argv);13 if (!ohana_str_to_time (argv[N], &TSTART)) {14 fprintf (stderr, "ERROR: syntax error\n");15 return (FALSE);16 }17 remove_argument (N, &argc, argv);18 if (!ohana_str_to_dtime (argv[N], &trange)) {19 if (!ohana_str_to_time (argv[N], &TSTOP)) {20 fprintf (stderr, "ERROR: syntax error\n");21 return (FALSE);22 }23 } else {24 if (trange < 0) {25 trange = fabs (trange);26 TSTOP = TSTART;27 TSTART -= trange;28 } else {29 TSTOP = TSTART + trange;30 }31 }32 remove_argument (N, &argc, argv);33 TimeSelect = TRUE;34 }35 36 9 /* specify portion of the sky */ 37 10 UserPatch.Rmin = 0; … … 39 12 UserPatch.Dmin = -90; 40 13 UserPatch.Dmax = +90; 41 UserPatchSelect = FALSE;42 14 if ((N = get_argument (argc, argv, "-region"))) { 43 15 remove_argument (N, &argc, argv); … … 50 22 UserPatch.Dmax = atof (argv[N]); 51 23 remove_argument (N, &argc, argv); 52 UserPatchSelect = TRUE;53 24 } 54 25 … … 79 50 } 80 51 81 NLOOP = 8;82 if ((N = get_argument (argc, argv, "-n"))) {83 remove_argument (N, &argc, argv);84 NLOOP = atof (argv[N]);85 remove_argument (N, &argc, argv);86 }87 88 RESET = FALSE;89 if ((N = get_argument (argc, argv, "-reset"))) {90 remove_argument (N, &argc, argv);91 RESET = TRUE;92 }93 94 UPDATE = FALSE;95 if ((N = get_argument (argc, argv, "-update"))) {96 remove_argument (N, &argc, argv);97 UPDATE = TRUE;98 }99 100 52 SHOW_PARAMS = FALSE; 101 53 if ((N = get_argument (argc, argv, "-params"))) { … … 105 57 106 58 PlotMmin = 10.0; PlotMmax = 20.0; PlotdMmin = -1.0; PlotdMmax = 1.0; 107 if ((N = get_argument (argc, argv, "-pl range"))) {59 if ((N = get_argument (argc, argv, "-plotrange"))) { 108 60 remove_argument (N, &argc, argv); 109 61 PlotMmin = atof (argv[N]); … … 117 69 } 118 70 119 /* group images by mosaic, find Mmos */ 120 MOSAICNAME[0] = 0; 121 if ((N = get_argument (argc, argv, "-mosaic"))) { 122 remove_argument (N, &argc, argv); 123 strcpy (MOSAICNAME, argv[N]); 124 remove_argument (N, &argc, argv); 125 } 126 127 FREEZE_IMAGES = FALSE; 128 if ((N = get_argument (argc, argv, "-imfreeze"))) { 129 remove_argument (N, &argc, argv); 130 FREEZE_IMAGES = TRUE; 131 } 132 133 USE_GRID = FALSE; 134 if ((N = get_argument (argc, argv, "-grid"))) { 135 remove_argument (N, &argc, argv); 136 USE_GRID = TRUE; 137 if (!MOSAICNAME[0]) { 138 fprintf (stderr, "-grid is only valid with -mosaic\n"); 139 exit (2); 140 } 141 } 142 143 MIN_ERROR = 0.001; 144 if ((N = get_argument (argc, argv, "-minerror"))) { 145 remove_argument (N, &argc, argv); 146 MIN_ERROR = atof (argv[N]); 147 remove_argument (N, &argc, argv); 148 /* require MIN_ERROR > 0 */ 149 } 150 151 AreaSelect = FALSE; 152 if ((N = get_argument (argc, argv, "-area"))) { 153 remove_argument (N, &argc, argv); 154 AreaXmin = atof (argv[N]); 155 remove_argument (N, &argc, argv); 156 AreaXmax = atof (argv[N]); 157 remove_argument (N, &argc, argv); 158 AreaYmin = atof (argv[N]); 159 remove_argument (N, &argc, argv); 160 AreaYmax = atof (argv[N]); 161 remove_argument (N, &argc, argv); 162 AreaSelect = TRUE; 163 } 164 165 ImagSelect = FALSE; 166 if ((N = get_argument (argc, argv, "-instmag"))) { 167 remove_argument (N, &argc, argv); 168 ImagMin = atof (argv[N]); 169 remove_argument (N, &argc, argv); 170 ImagMax = atof (argv[N]); 171 remove_argument (N, &argc, argv); 172 ImagSelect = TRUE; 173 } 174 175 DophotSelect = FALSE; 176 if ((N = get_argument (argc, argv, "-dophot"))) { 177 remove_argument (N, &argc, argv); 178 DophotValue = atof (argv[N]); 179 remove_argument (N, &argc, argv); 180 DophotSelect = TRUE; 181 } 182 183 if ( UserPatchSelect && (argc != 2)) usage (); 184 if (!UserPatchSelect && (argc != 3)) usage (); 71 if (argc != 2) usage (); 185 72 186 73 return TRUE; … … 188 75 189 76 void usage () { 190 fprintf (stderr, "ERROR: USAGE: absphot (region) (photcode)\n"); 191 fprintf (stderr, " or: absphot (photcode) -region RA RA DEC DEC\n"); 77 fprintf (stderr, "ERROR: USAGE: absphot (photcode) -region RA RA DEC DEC\n"); 192 78 fprintf (stderr, " options: \n"); 193 fprintf (stderr, " -time (start) (stop)\n");194 79 fprintf (stderr, " -v\n"); 195 80 fprintf (stderr, " -plot\n"); 196 81 fprintf (stderr, " -plotdelay (seconds)\n"); 197 82 fprintf (stderr, " -statmode (mode)\n"); 198 fprintf (stderr, " -n (nloop)\n");199 fprintf (stderr, " -reset\n");200 fprintf (stderr, " -update\n");201 83 fprintf (stderr, " -params\n"); 202 fprintf (stderr, " -mosaic (mosaic)\n"); 203 fprintf (stderr, " -imfreeze\n"); 204 fprintf (stderr, " -grid\n"); 205 fprintf (stderr, " -area Xmin Xmax Ymin Ymax\n"); 206 fprintf (stderr, " -instmag min max\n"); 84 fprintf (stderr, " -plotrange Mmin Mmax dMmin dMmax\n"); 207 85 fprintf (stderr, " \n"); 208 86 exit (2); -
branches/eam_branch_20071015/Ohana/src/absphot/src/fit_trend.c
r15354 r15426 1 # include "absphot. c"1 # include "absphot.h" 2 2 3 3 int fit_trend (Catalog *catalog) { 4 5 // XXX define this : obs - ref vs color(obs) 6 // target is the ref photcode (derived from obs photcode table entry) 7 PhotCode *target; 8 9 int i, Nc0, Nc1, Nc2; 10 float *x, *y, *dy; 11 float c0, m0, dc0, dm0, c1, c2; 4 12 5 13 ALLOCATE (x, float, catalog[0].Naverage); … … 9 17 // XXX I must have code that does this in another program 10 18 // XXX perhaps relphot for the grid colors? 11 Nc0 = getNsecphot (target.c0);12 Nc1 = getNsecphot (target.c1);13 Nc2 = getNsecphot (target.c2);19 Nc0 = GetPhotcodeNsec (target->code); 20 Nc1 = GetPhotcodeNsec (target->c1); 21 Nc2 = GetPhotcodeNsec (target->c2); 14 22 15 23 if (catalog[0].Naverage != catalog[0].Nmeasure) abort(); … … 18 26 19 27 // XXX I probably need to apply some corrections? 20 c0 = catalog[0].secfilt[i* Nsecfilt + Nc0].mag;21 m0 = catalog[0].measure[i]. mag;28 c0 = catalog[0].secfilt[i*PhotNsec + Nc0].M; 29 m0 = catalog[0].measure[i].M; 22 30 23 dc0 = catalog[0].secfilt[i* Nsecfilt + Nc0].dmag;24 dm0 = catalog[0].measure[i].d mag;31 dc0 = catalog[0].secfilt[i*PhotNsec + Nc0].dM; 32 dm0 = catalog[0].measure[i].dM; 25 33 26 c1 = catalog[0].secfilt[i* Nsecfilt + Nc1].mag;27 c2 = catalog[0].secfilt[i* Nsecfilt + Nc2].mag;34 c1 = catalog[0].secfilt[i*PhotNsec + Nc1].M; 35 c2 = catalog[0].secfilt[i*PhotNsec + Nc2].M; 28 36 29 37 x[i] = c1 - c2; … … 33 41 } 34 42 35 fit_vectors (x, y, dy); 43 // XXX define this 44 // fit_vectors (x, y, dy); 45 // do something with the result! 46 47 free (x); 48 free (y); 49 free (dy); 36 50 37 51 } -
branches/eam_branch_20071015/Ohana/src/absphot/src/initialize.c
r15354 r15426 8 8 args (argc, argv); 9 9 10 N = UserPatchSelect ? 1 : 2;11 if ((photcode = GetPhotcodebyName (argv[ N])) == NULL) {12 fprintf (stderr, "ERROR: photcode %s not found in photcode table\n", argv[ N]);10 // XXX what type of photcodes are allowed / required? 11 if ((photcode = GetPhotcodebyName (argv[1])) == NULL) { 12 fprintf (stderr, "ERROR: photcode %s not found in photcode table\n", argv[1]); 13 13 exit (1); 14 14 } 15 15 if (photcode[0].type != PHOT_SEC) { 16 fprintf (stderr, "photcode %s is not a primary or secondary filter\n", argv[ N]);16 fprintf (stderr, "photcode %s is not a primary or secondary filter\n", argv[1]); 17 17 exit (1); 18 18 } … … 23 23 initstats (STATMODE); 24 24 25 IMAGE_BAD = ID_IMAGE_POOR | ID_IMAGE_FEW | ID_IMAGE_SKIP;26 STAR_BAD = ID_STAR_POOR | ID_STAR_FEW;27 MEAS_BAD = ID_MEAS_NOCAL | ID_MEAS_POOR | ID_MEAS_SKIP | ID_MEAS_AREA;28 29 25 if (SHOW_PARAMS) { 30 26 fprintf (stderr, "current parameter settings:\n"); 31 if (TimeSelect) {32 fprintf (stderr, "TimeSelect: TRUE (%s - %s)\n", ohana_sec_to_date (TSTART), ohana_sec_to_date (TSTOP));33 } else {34 fprintf (stderr, "TimeSelect: FALSE\n");35 }36 27 fprintf (stderr, "VERBOSE: %d, PLOTSTUFF: %d\n", VERBOSE, PLOTSTUFF); 37 fprintf (stderr, "GRID_X: %d, GRID_Y: %d, BINNING: %d == Nmx: %d, Nmy: %d\n",38 RELPHOT_GRID_X,39 RELPHOT_GRID_Y,40 RELPHOT_GRID_BINNING,41 (int)(RELPHOT_GRID_X/RELPHOT_GRID_BINNING), (int)(RELPHOT_GRID_Y/RELPHOT_GRID_BINNING));42 28 43 fprintf (stderr, "MAG_LIM %lf\n", MAG_LIM);44 fprintf (stderr, "STAR_SCATTER %lf\n", STAR_SCATTER);45 fprintf (stderr, "IMAGE_SCATTER %lf\n", IMAGE_SCATTER);46 fprintf (stderr, "IMAGE_OFFSET %lf\n", IMAGE_OFFSET);47 29 fprintf (stderr, "IMAGE_CATALOG %s\n", ImageCat); 48 30 fprintf (stderr, "GSCFILE %s\n", GSCFILE); -
branches/eam_branch_20071015/Ohana/src/absphot/src/plotstuff.c
r15354 r15426 138 138 graphdata[0].ltype = 0; 139 139 graphdata[0].etype = 0; 140 graphdata[0].color = black;140 graphdata[0].color = 0; 141 141 graphdata[0].lweight = 0; 142 142 graphdata[0].size = 0.5; -
branches/eam_branch_20071015/Ohana/src/absphot/src/subset_catalog.c
r15354 r15426 3 3 int subset_catalog (Catalog *subcatalog, Catalog *catalog) { 4 4 5 int i, j, offset, ecode; 5 // XXX define this : obs - ref vs color(obs) 6 // target is the ref photcode (derived from obs photcode table entry) 7 PhotCode *target; 8 9 int i, j, offset, averef, ecode; 6 10 int NAVERAGE, NMEASURE, Naverage, Nmeasure, Nm; 7 11 float mag; … … 30 34 31 35 // find desired target photcode measurements 32 if (catalog[0].measure[i].photcode != target .photcode) continue;36 if (catalog[0].measure[i].photcode != target[0].code) continue; 33 37 34 38 // some possible exclusions based on the target measurements 35 mag = PhotCat (&catalog[0].measure[i]);36 if (mag > MAG_LIM) continue;39 // mag = PhotCat (&catalog[0].measure[i]); 40 // if (mag > MAG_LIM) continue; 37 41 38 42 /* select measurements by measurement error */ 39 if ((SIGMA_LIM > 0) && (catalog[0].measure[i].dM > SIGMA_LIM)) continue;43 // if ((SIGMA_LIM > 0) && (catalog[0].measure[i].dM > SIGMA_LIM)) continue; 40 44 41 ave = catalog[0].measure[i].averef;45 averef = catalog[0].measure[i].averef; 42 46 43 47 // copy the average and secfilt data for this average object 44 48 // XXX potentially skip this source on some basis here 45 subcatalog[0].average[Naverage] = catalog[0].average[ave ];49 subcatalog[0].average[Naverage] = catalog[0].average[averef]; 46 50 subcatalog[0].average[Naverage].offset = Nmeasure; 47 51 for (j = 0; j < PhotNsec; j++) { 48 subcatalog[0].secfilt[PhotNsec*Naverage+j] = catalog[0].secfilt[PhotNsec*ave +j];52 subcatalog[0].secfilt[PhotNsec*Naverage+j] = catalog[0].secfilt[PhotNsec*averef+j]; 49 53 } 50 54
Note:
See TracChangeset
for help on using the changeset viewer.
