Changeset 4796
- Timestamp:
- Aug 16, 2005, 3:00:56 PM (21 years ago)
- Location:
- trunk/Ohana/src/relphot
- Files:
-
- 22 edited
-
include/relphot.h (modified) (4 diffs)
-
src/ConfigInit.c (modified) (2 diffs)
-
src/GridOps.v2.c (modified) (3 diffs)
-
src/ImageOps.c (modified) (8 diffs)
-
src/MosaicOps.c (modified) (13 diffs)
-
src/StarOps.c (modified) (7 diffs)
-
src/args.c (modified) (2 diffs)
-
src/bcatalog.c (modified) (2 diffs)
-
src/find_images.c (modified) (1 diff)
-
src/find_regions.c (modified) (1 diff)
-
src/gcatalog.c (modified) (1 diff)
-
src/get_regions.c (modified) (3 diffs)
-
src/global_stats.c (modified) (1 diff)
-
src/initialize.c (modified) (1 diff)
-
src/liststats.c (modified) (1 diff)
-
src/misc.c (modified) (4 diffs)
-
src/plot_scatter.c (modified) (1 diff)
-
src/plotstuff.c (modified) (12 diffs)
-
src/relphot.c (modified) (2 diffs)
-
src/setExclusions.c (modified) (3 diffs)
-
src/setMrelFinal.c (modified) (2 diffs)
-
src/time.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/relphot/include/relphot.h
r3466 r4796 4 4 /* # define GRID_V1 */ 5 5 # define GRID_V2 6 7 static union { unsigned char c[4]; float f; } f_undef = { 0xff, 0xff, 0xff, 0xfe };8 # define fUNDEF (f_undef.f)9 10 static union { unsigned char c[8]; float d; } d_undef = { 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00 };11 # define dUNDEF (d_undef.d)12 6 13 7 typedef struct { … … 95 89 int TimeSelect; 96 90 unsigned int TSTART, TSTOP; 91 92 # ifdef GRID_V1 93 int setGridMeasure (int meas, int cat, double X, double Y); 94 # endif 95 96 # ifdef GRID_V2 97 int setGridMeasure (int meas, int cat, double X, double Y, int ccdnum); 98 # endif 97 99 98 100 /***** prototypes ****/ … … 139 141 void reload_catalogs (GSCRegion *region, int Nregion, GSCRegion *fullregion); 140 142 void free_catalogs (Catalog *catalog, int Ncatalog); 141 142 # ifdef GRID_V1143 int setGridMeasure (int meas, int cat, double X, double Y);144 # endif145 146 # ifdef GRID_V2147 int setGridMeasure (int meas, int cat, double X, double Y, int ccdnum);148 # endif149 150 143 void set_ZP (double ZERO); 151 152 144 char *GetPhotnamebyCode (PhotCodeData *photcodes, int code); 153 145 StatType statsStarS (Catalog *catalog, int Ncatalog); … … 157 149 StatType statsImageX (Catalog *catalog); 158 150 StatType statsImageM (Catalog *catalog); 151 void plot_scatter (Catalog *catalog, int Ncatalog); 152 void plot_defaults (Graphdata *graphdata); 153 void plot_list (Graphdata *graphdata, double *xlist, double *ylist, int N, char *label, char *file); 154 void plot_stars (Catalog *catalog, int Ncatalog); 155 void plot_chisq (Catalog *catalog, int Ncatalog); 156 void plot_star_coords (Catalog *catalog, int Ncatalog); 157 void plot_grid (Catalog *catalog); 158 void dump_grid (); 159 int *SelectRefMosaic (Mosaic **refmosaic, int *Nimage); 160 Image *getimage (int N); 161 void InterpolateGrid (float *buffer, int Nx, int Ny, Coords *ccd, Coords *gcoords); 162 void plot_mosaic_fields (Catalog *catalog); 163 void plot_mosaics (); 164 void plot_images (); 165 void wimages (); 166 void clean_mosaics (); 167 void freeMosaicBins (int Ncatalog); 168 void freeGridBins (int Ncatalog); 169 void clean_measures (Catalog *catalog, int Ncatalog, int final); 170 void global_stats (Catalog *catalog, int Ncatalog); 171 StatType statsImagedM (Catalog *catalog); 172 StatType statsMosaicdM (Catalog *catalog); 173 StatType statsMosaicM (Catalog *catalog); 174 StatType statsMosaicN (Catalog *catalog); 175 StatType statsMosaicX (Catalog *catalog); 176 Coords *getCoords (int meas, int cat); 177 int setExclusions (Catalog *catalog, int Ncatalog); 178 void freeImageBins (int Ncatalog); 179 void sortA (double *X, int N); 180 void sortB (double *X, double *Y, int N); 181 void sortC (double *X, double *Y, double *F1, double *F2, int N); 182 void sortD (double *X, double *Y, double *Z, int N); 183 void initstats (char *mode); 184 int liststats (double *value, double *dvalue, int N, StatType *stats); 185 186 int dms_to_ddd (double *Value, char *string); 187 int str_to_radec (double *ra, double *dec, char *str1, char *str2); 188 int chk_time (char *line); 189 double sec_to_jd (unsigned long second); 190 unsigned long int jd_to_sec (double jd); 191 char *sec_to_date (unsigned long second); 192 unsigned long date_to_sec (char *date); 193 194 int str_to_time (char *line, unsigned int *second); 195 int str_to_dtime (char *line, double *second); 196 int Fseek (FILE *f, long offset, int whence); 197 void GetConfig (char *config, char *field, char *format, int N, void *ptr); 198 void skip_measurements (Catalog *catalog, int pass); 199 Image *getimages (int *N); 200 201 void setMrelFinal (Catalog *catalog); 202 void skip_measurements (Catalog *catalog, int pass); 203 GSCRegion *get_regions (double minRa, double maxRa, double minDec, double maxDec, int *Nregions); 204 int hms_to_deg (double *h0, double *h1, double *d0, double *d1, char *string); 205 GSCRegion *find_regions (Image *image, int Nimage, int *Nregions, GSCRegion *fullregion); 206 void getfullregion (Image *image, int Nimage, GSCRegion *fullregion); 207 void setMcalFinal (Image *image, int Nimage); 208 int gcatalog (Catalog *catalog, int FINAL); 209 void write_coords (Header *header, Coords *coords); 210 void wcatalog (Catalog *catalog); 211 int setMrelOutput (Catalog *catalog, int Ncatalog, int mark); 212 int setMcalOutput (Catalog *catalog, int Ncatalog); -
trunk/Ohana/src/relphot/src/ConfigInit.c
r2486 r4796 1 1 # include "relphot.h" 2 void GetConfig (char *config, char *field, char *format, int N, void *ptr);3 2 4 3 void ConfigInit (int *argc, char **argv) { … … 60 59 void GetConfig (char *config, char *field, char *format, int N, void *ptr) { 61 60 62 intstatus;61 char *status; 63 62 64 63 status = ScanConfig (config, field, format, N, ptr); 65 if ( !status) {64 if (status == NULL) { 66 65 fprintf (stderr, "error in config, cannot find %s\n", field); 67 66 exit (1); -
trunk/Ohana/src/relphot/src/GridOps.v2.c
r2486 r4796 227 227 return (TRUE); 228 228 229 escape:230 229 fprintf (stderr, "error: star out of grid\n"); 231 230 exit (1); … … 352 351 } 353 352 354 int *SelectRefMosaic (Mosaic **refmosaic, int *Nimage);355 Image *getimage (int N);356 357 353 void dump_grid () { 358 354 359 int i, j, N x, Ny, Nimage;355 int i, j, Nimage; 360 356 int *imlist; 361 char *p, *pname, ccdname[80];362 357 FILE *f; 363 358 Header header, theader; 364 359 Matrix matrix; 365 360 Mosaic *refmosaic; 366 Image *image;367 361 368 362 /* select reference mosaic image */ … … 517 511 } 518 512 519 InterpolateGrid (float *buffer, int Nx, int Ny, Coords *ccd, Coords *gcoords) {513 void InterpolateGrid (float *buffer, int Nx, int Ny, Coords *ccd, Coords *gcoords) { 520 514 521 515 int i, j; 522 double x, y, r, d, X, Y, dx, dy , dVx, dVy, dVxy;516 double x, y, r, d, X, Y, dx, dy; 523 517 double V00, V01, V10, V11; 524 518 double wV00, wV01, wV10, wV11; -
trunk/Ohana/src/relphot/src/ImageOps.c
r2486 r4796 15 15 void initImages (Image *input, int N) { 16 16 17 int i , j;17 int i; 18 18 19 19 image = input; … … 111 111 /* add this measurement to the grid cell for this chip */ 112 112 ave = measure[0].averef; 113 ra = catalog[cat].average[ave].R - measure[0].dR / 360000.0;114 dec = catalog[cat].average[ave].D - measure[0].dD / 360000.0;113 ra = catalog[cat].average[ave].R_PS - measure[0].dR_PS / 3600.0; 114 dec = catalog[cat].average[ave].D_PS - measure[0].dD_PS / 3600.0; 115 115 116 116 /* X,Y always positive-definite in range 0,0 - dX, dY */ … … 152 152 153 153 int i; 154 short value;155 154 156 155 i = bin[cat][meas]; … … 285 284 void plot_images () { 286 285 287 int i, j, m, c, N, Nmax, bin; 288 short Mrel, Mcal, Mmos; 286 int i, bin; 289 287 double *xlist, *Mlist, *dlist; 290 288 Graphdata graphdata; … … 334 332 StatType statsImageN (Catalog *catalog) { 335 333 336 int i, j, k, m, c, n, N, Nmax;334 int i, j, m, c, n, N; 337 335 double *list, *dlist; 338 336 StatType stats; … … 372 370 StatType statsImageX (Catalog *catalog) { 373 371 374 int i, j, k, m, n, N, Nmax;372 int i, n; 375 373 double *list, *dlist; 376 374 StatType stats; … … 400 398 StatType statsImageM (Catalog *catalog) { 401 399 402 int i, j, k, m, n, N, Nmax;400 int i, n; 403 401 double *list, *dlist; 404 402 StatType stats; … … 428 426 StatType statsImagedM (Catalog *catalog) { 429 427 430 int i, j, k, m, n, N, Nmax;428 int i, n; 431 429 double *list, *dlist; 432 430 StatType stats; -
trunk/Ohana/src/relphot/src/MosaicOps.c
r3417 r4796 99 99 int i, j, m, NX, NY; 100 100 int dXmax, dYmax; 101 double d R, dD, dS, dX, dY;101 double dS, dX, dY; 102 102 double R, D, Rmin, Rmax, Dmin, Dmax; 103 103 double Mcal, dMcal, Xm; … … 211 211 } 212 212 213 void freeMosaicBins ( Ncatalog) {213 void freeMosaicBins (int Ncatalog) { 214 214 215 215 int i; … … 249 249 } 250 250 } 251 251 return (TRUE); 252 252 } 253 253 254 254 void matchMosaics (Catalog *catalog, int meas, int cat) { 255 255 256 int i, ave; 257 double ra, dec, X, Y; 256 int i; 258 257 259 258 for (i = 0; i < Nmosaic; i++) { … … 264 263 if (USE_GRID) { 265 264 ave = catalog[cat].measure[meas].averef; 266 ra = catalog[cat].average[ave].R - catalog[cat].measure[meas].dR / 360000.0;267 dec = catalog[cat].average[ave].D - catalog[cat].measure[meas].dD / 360000.0;265 ra = catalog[cat].average[ave].R_PS - catalog[cat].measure[meas].dR_PS / 3600.0; 266 dec = catalog[cat].average[ave].D_PS - catalog[cat].measure[meas].dD_PS / 3600.0; 268 267 269 268 /* X,Y always positive-definite in range 0,0 - dX, dY */ … … 311 310 StatType stats; 312 311 Image *image; 313 Graphdata graphdata;314 312 315 313 if (!MOSAICNAME[0]) return (FALSE); … … 391 389 StatType statsMosaicM (Catalog *catalog) { 392 390 393 int i, n , N, Nmax;391 int i, n; 394 392 double *list, *dlist; 395 393 StatType stats; … … 417 415 StatType statsMosaicdM (Catalog *catalog) { 418 416 419 int i, n , N, Nmax;417 int i, n; 420 418 double *list, *dlist; 421 419 StatType stats; … … 444 442 StatType statsMosaicN (Catalog *catalog) { 445 443 446 int i, j, k, m, c, n, N, Nmax;444 int i, j, m, c, n, N; 447 445 double *list, *dlist; 448 446 StatType stats; … … 483 481 StatType statsMosaicX (Catalog *catalog) { 484 482 485 int i, n , N, Nmax;483 int i, n; 486 484 double *list, *dlist; 487 485 StatType stats; … … 511 509 void clean_mosaics () { 512 510 513 int i, j,N, mark, Nmark;511 int i, N, mark, Nmark; 514 512 double *mlist, *slist, *dlist; 515 513 double MaxOffset, MedOffset, MaxScatter; 516 514 StatType stats; 517 Image *image;518 515 519 516 if (!MOSAICNAME[0]) return; … … 562 559 563 560 int i, j, m, c, N, ave, Nimage; 564 short Mrel, Mcal, Mmos;565 561 double *xlist, *ylist; 566 562 double Xmin, Xmax, Ymin, Ymax; … … 592 588 593 589 ave = catalog[c].measure[m].averef; 594 xlist[N] = catalog[c].average[ave].R - catalog[c].measure[m].dR / 360000.0;595 ylist[N] = catalog[c].average[ave].D - catalog[c].measure[m].dD / 360000.0;590 xlist[N] = catalog[c].average[ave].R_PS - catalog[c].measure[m].dR_PS / 3600.0; 591 ylist[N] = catalog[c].average[ave].D_PS - catalog[c].measure[m].dD_PS / 3600.0; 596 592 N++; 597 593 } … … 608 604 void plot_mosaics () { 609 605 610 int i, j, m, c, N, Nmax, bin; 611 short Mrel, Mcal, Mmos; 606 int i, bin; 612 607 double *xlist, *Mlist, *dlist; 613 608 Graphdata graphdata; -
trunk/Ohana/src/relphot/src/StarOps.c
r2486 r4796 76 76 } 77 77 } 78 return (TRUE); 78 79 } 79 80 … … 134 135 free (list); 135 136 free (dlist); 137 return (TRUE); 136 138 } 137 139 … … 366 368 StatType statsStarX (Catalog *catalog, int Ncatalog) { 367 369 368 int i, j, k, m, n, N, Ntot, Xm;370 int i, j, n, Ntot, Xm; 369 371 double *list, *dlist; 370 372 StatType stats; … … 401 403 StatType statsStarS (Catalog *catalog, int Ncatalog) { 402 404 403 int i, j, k, m, n, N, Ntot, dM;405 int i, j, n, Ntot, dM; 404 406 double *list, *dlist; 405 407 StatType stats; … … 435 437 void plot_stars (Catalog *catalog, int Ncatalog) { 436 438 437 int i, j, m, c, N,bin;439 int i, j, bin; 438 440 short dMrel; 439 441 double *xlist, *Mlist; … … 497 499 void plot_star_coords (Catalog *catalog, int Ncatalog) { 498 500 499 int i, j, m, c, N, bin; 500 short Mrel, Mcal, Mmos; 501 int i, j, N; 501 502 double *xlist, *ylist; 502 503 double Xmin, Ymin, Xmax, Ymax; … … 515 516 for (i = 0; i < Ncatalog; i++) { 516 517 for (j = 0; j < catalog[i].Naverage; j++) { 517 xlist[N] = catalog[i].average[j].R ;518 ylist[N] = catalog[i].average[j].D ;518 xlist[N] = catalog[i].average[j].R_PS; 519 ylist[N] = catalog[i].average[j].D_PS; 519 520 N++; 520 521 } -
trunk/Ohana/src/relphot/src/args.c
r3417 r4796 7 7 /* define time */ 8 8 TimeSelect = FALSE; 9 if ( N = get_argument (argc, argv, "-time")) {9 if ((N = get_argument (argc, argv, "-time"))) { 10 10 remove_argument (N, &argc, argv); 11 11 if (!str_to_time (argv[N], &TSTART)) { … … 162 162 exit (2); 163 163 } 164 164 return (TRUE); 165 165 } 166 166 -
trunk/Ohana/src/relphot/src/bcatalog.c
r2486 r4796 18 18 for (i = 0; i < catalog[0].Naverage; i++) { 19 19 if (catalog[0].average[i].Nm < 2) continue; 20 if (catalog[0].average[i].R < fullregion[0].RA[0]) continue;21 if (catalog[0].average[i].R > fullregion[0].RA[1]) continue;22 if (catalog[0].average[i].D < fullregion[0].DEC[0]) continue;23 if (catalog[0].average[i].D > fullregion[0].DEC[1]) continue;20 if (catalog[0].average[i].R_PS < fullregion[0].RA[0]) continue; 21 if (catalog[0].average[i].R_PS > fullregion[0].RA[1]) continue; 22 if (catalog[0].average[i].D_PS < fullregion[0].DEC[0]) continue; 23 if (catalog[0].average[i].D_PS > fullregion[0].DEC[1]) continue; 24 24 25 25 /* start with all stars good */ … … 116 116 subcatalog[0].Naverage, subcatalog[0].Nmeasure); 117 117 } 118 118 return (TRUE); 119 119 } -
trunk/Ohana/src/relphot/src/find_images.c
r2616 r4796 11 11 Header header; 12 12 Image *timage, *image; 13 int i, j, k, m, found, nimage, Nimage, NIMAGE , NTIMAGE, Nloop, Nlast;14 int n, Nim,status, InRange, ecode;13 int i, j, k, m, found, nimage, Nimage, NIMAGE; 14 int status, InRange, ecode; 15 15 FILE *f; 16 16 double Xc[5], Yc[5], Xi[5], Yi[5], r, d, dx, dy; 17 char line[256];18 17 int *line_number; 19 18 Coords tcoords; -
trunk/Ohana/src/relphot/src/find_regions.c
r2486 r4796 59 59 60 60 61 getfullregion (Image *image, int Nimage, GSCRegion *fullregion) {61 void getfullregion (Image *image, int Nimage, GSCRegion *fullregion) { 62 62 63 63 int i; -
trunk/Ohana/src/relphot/src/gcatalog.c
r2486 r4796 3 3 int gcatalog (Catalog *catalog, int FINAL) { 4 4 5 char mode , status;5 char mode; 6 6 7 7 if (FINAL) { -
trunk/Ohana/src/relphot/src/get_regions.c
r2486 r4796 55 55 /* use the pole regions, if near pole */ 56 56 if (maxDec > 86.25) { 57 sprintf (regions[nregions].filename, "n8230/pole.cpt \0");57 sprintf (regions[nregions].filename, "n8230/pole.cpt"); 58 58 regions[nregions].RA[0] = 0; 59 59 regions[nregions].RA[1] = 360; … … 118 118 if ((DEC1 > 0) && (minDec < DEC1) && (maxDec > DEC0) && (minRa < RA1) && (maxRa > RA0)) { 119 119 temp[5] = 0; 120 sprintf (regions[nregions].filename, "%s/%s.cpt \0", Dec2Sections[NBigDec + j], &temp[1]);120 sprintf (regions[nregions].filename, "%s/%s.cpt", Dec2Sections[NBigDec + j], &temp[1]); 121 121 regions[nregions].RA[0] = RA0; 122 122 regions[nregions].RA[1] = RA1; … … 131 131 if ((DEC1 < 0) && (minDec < DEC0) && (maxDec > DEC1) && (minRa < RA1) && (maxRa > RA0)) { 132 132 temp[5] = 0; 133 sprintf (regions[nregions].filename, "%s/%s.cpt \0", Dec2Sections[NBigDec + j], &temp[1]);133 sprintf (regions[nregions].filename, "%s/%s.cpt", Dec2Sections[NBigDec + j], &temp[1]); 134 134 regions[nregions].RA[0] = RA0; 135 135 regions[nregions].RA[1] = RA1; -
trunk/Ohana/src/relphot/src/global_stats.c
r2486 r4796 1 1 # include "relphot.h" 2 2 3 StatType statsImagedM (Catalog *catalog); 4 5 StatType statsMosaicdM (Catalog *catalog); 6 StatType statsMosaicM (Catalog *catalog); 7 StatType statsMosaicN (Catalog *catalog); 8 StatType statsMosaicX (Catalog *catalog); 9 10 global_stats (Catalog *catalog, int Ncatalog) { 3 void global_stats (Catalog *catalog, int Ncatalog) { 11 4 12 5 StatType stN, stX, stS, imN, imX, imM, imD, msM, msX, msN, msD; -
trunk/Ohana/src/relphot/src/initialize.c
r2486 r4796 2 2 3 3 void initialize (int argc, char **argv) { 4 5 int Np;6 4 7 5 /* are these set correctly? */ -
trunk/Ohana/src/relphot/src/liststats.c
r2486 r4796 6 6 static int statmode; 7 7 8 initstats (char *mode) {8 void initstats (char *mode) { 9 9 10 10 statmode = -1; -
trunk/Ohana/src/relphot/src/misc.c
r2486 r4796 1 # include "relphot.h" 1 2 2 sortA (double *X, int N) {3 void sortA (double *X, int N) { 3 4 4 5 int l,j,ir,i; … … 36 37 } 37 38 38 sortB (double *X, double *Y, int N) {39 void sortB (double *X, double *Y, int N) { 39 40 40 41 int l,j,ir,i; … … 78 79 } 79 80 80 sortC (double *X, double *Y, double *F1, double *F2, int N) {81 void sortC (double *X, double *Y, double *F1, double *F2, int N) { 81 82 82 83 int l,j,ir,i; … … 133 134 } 134 135 135 sortD (double *X, double *Y, double *Z, int N) {136 void sortD (double *X, double *Y, double *Z, int N) { 136 137 137 138 int l,j,ir,i; -
trunk/Ohana/src/relphot/src/plot_scatter.c
r2486 r4796 1 1 # include "relphot.h" 2 2 3 plot_scatter (Catalog *catalog, int Ncatalog) {3 void plot_scatter (Catalog *catalog, int Ncatalog) { 4 4 5 char c;6 5 int i, j, k, m, N, Ntot; 7 6 short Mrel, Mcal, Mmos, Mgrid; 8 7 double *xlist, *ylist, *ilist; 9 StatType stats;10 8 Graphdata graphdata; 11 9 -
trunk/Ohana/src/relphot/src/plotstuff.c
r2486 r4796 4 4 static int Xgraph[5] = {0,0,0,0,0}; 5 5 static int active; 6 7 /* 8 static union { unsigned char c[4]; float f; } f_undef = { {0xff, 0xff, 0xff, 0xfe} }; 9 # define fUNDEF (f_undef.f) 10 */ 11 12 static union { unsigned char c[8]; float d; } d_undef = { {0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00} }; 13 # define dUNDEF (d_undef.d) 6 14 7 15 void XDead () { … … 21 29 # endif /* ANSI */ 22 30 23 int i,InitSocket, status, addreslen;31 int InitSocket, status, addreslen; 24 32 struct sockaddr_un Address; 25 char temp[100] , *display_name;33 char temp[100]; 26 34 char socket_name[100]; 27 FILE *f;28 35 29 36 active = N; … … 35 42 Address.sun_family = AF_UNIX; 36 43 InitSocket = socket (AF_UNIX, SOCK_STREAM, 0); 37 status = bind (InitSocket, &Address, sizeof (Address));44 status = bind (InitSocket, (struct sockaddr *) &Address, sizeof (Address)); 38 45 status = listen (InitSocket, 1); 39 46 … … 47 54 48 55 addreslen = sizeof (Address); 49 Xgraph[N] = accept (InitSocket, &Address, &addreslen);56 Xgraph[N] = accept (InitSocket, (struct sockaddr *) &Address, &addreslen); 50 57 if (Xgraph[N] < 0) { 51 58 fprintf (stderr, "error starting kapa\n"); … … 65 72 write (Xgraph[N], "DBOX", 4); 66 73 sprintf (buffer, "%f %f %f %f", graphmode[0].xmin, graphmode[0].xmax, graphmode[0].ymin, graphmode[0].ymax); 67 sprintf (buffer2, "NBYTES: %6d", strlen (buffer));74 sprintf (buffer2, "NBYTES: %6d", (int) strlen (buffer)); 68 75 write (Xgraph[N], buffer2, 16); 69 76 write (Xgraph[N], buffer, strlen (buffer)); 70 77 71 78 sprintf (buffer, "%s %s %s", "2222", "2222", "2222"); 72 sprintf (buffer2, "NBYTES: %6d", strlen (buffer));79 sprintf (buffer2, "NBYTES: %6d", (int) strlen (buffer)); 73 80 write (Xgraph[N], buffer2, 16); 74 81 write (Xgraph[N], buffer, strlen (buffer)); … … 76 83 77 84 void JpegPlot (Graphdata *graphmode, int N, char *filename) { 78 char buffer[65], buffer2[65]; 85 86 char buffer[65]; 79 87 80 88 if (Xgraph[N] == 0) return; 81 89 82 90 write (Xgraph[N], "PNGF", 4); 83 sprintf (buffer, "LEN: %11d", strlen (filename));91 sprintf (buffer, "LEN: %11d", (int) strlen (filename)); 84 92 write (Xgraph[N], buffer, 16); 85 93 write (Xgraph[N], filename, strlen (filename)); … … 88 96 89 97 void PSPlot (Graphdata *graphmode, int N, char *filename) { 90 char buffer[65], buffer2[65]; 98 99 char buffer[65]; 91 100 92 101 if (Xgraph[N] == 0) return; 93 102 94 103 write (Xgraph[N], "PSIT", 4); 95 sprintf (buffer, "LEN: %11d", strlen (filename));104 sprintf (buffer, "LEN: %11d", (int) strlen (filename)); 96 105 write (Xgraph[N], buffer, 16); 97 106 write (Xgraph[N], filename, strlen (filename)); … … 126 135 graphmode[0].etype, graphmode[0].color, 127 136 graphmode[0].lweight, graphmode[0].size); 128 sprintf (buffer2, "NBYTES: %6d", strlen (buffer));137 sprintf (buffer2, "NBYTES: %6d", (int) strlen (buffer)); 129 138 write (Xgraph[N], buffer2, 16); 130 139 write (Xgraph[N], buffer, strlen (buffer)); … … 133 142 graphmode[0].xmin, graphmode[0].xmax, 134 143 graphmode[0].ymin, graphmode[0].ymax); 135 sprintf (buffer2, "NBYTES: %6d", strlen (buffer));144 sprintf (buffer2, "NBYTES: %6d", (int) strlen (buffer)); 136 145 write (Xgraph[N], buffer2, 16); 137 146 write (Xgraph[N], buffer, strlen (buffer)); … … 146 155 147 156 write (Xgraph[N], "LABL", 4); 148 sprintf (buffer, " %6d %6d", strlen (string), 2);157 sprintf (buffer, " %6d %6d", (int) strlen (string), 2); 149 158 write (Xgraph[N], buffer, 16); 150 159 write (Xgraph[N], string, strlen (string)); … … 170 179 } 171 180 172 plot_list (Graphdata *graphdata, double *xlist, double *ylist, int N, char *label, char *file) {181 void plot_list (Graphdata *graphdata, double *xlist, double *ylist, int N, char *label, char *file) { 173 182 174 183 int i; 175 char c;176 184 StatType stats; 177 185 … … 207 215 } 208 216 209 plot_defaults (Graphdata *graphdata) {217 void plot_defaults (Graphdata *graphdata) { 210 218 211 219 graphdata[0].style = 2; -
trunk/Ohana/src/relphot/src/relphot.c
r2486 r4796 4 4 int main (int argc, char **argv) { 5 5 6 char c;7 6 int i, Ncatalog; 8 Catalog *catalog , tcatalog;7 Catalog *catalog; 9 8 GSCRegion fullregion, *region; 10 9 … … 81 80 reload_catalogs (region, Ncatalog, &fullregion); 82 81 wimages (); 83 82 exit (0); 84 83 } 85 84 -
trunk/Ohana/src/relphot/src/setExclusions.c
r2486 r4796 1 1 # include "relphot.h" 2 3 Coords *getCoords (int meas, int cat);4 2 5 3 int setExclusions (Catalog *catalog, int Ncatalog) { … … 27 25 /* select measurements by mag limit */ 28 26 if (AreaSelect) { 29 r = catalog[i].average[j].R + catalog[i].measure[m].dR / 360000.0;30 d = catalog[i].average[j].D + catalog[i].measure[m].dD / 360000.0;27 r = catalog[i].average[j].R_PS + catalog[i].measure[m].dR_PS / 3600.0; 28 d = catalog[i].average[j].D_PS + catalog[i].measure[m].dD_PS / 3600.0; 31 29 if ((coords = getCoords (m, i)) == NULL) goto markbad; 32 30 RD_to_XY (&x, &y, r, d, coords); … … 52 50 if (VERBOSE) fprintf (stderr, "%d measurements marked by area\n", Narea); 53 51 if (VERBOSE) fprintf (stderr, "%d measurements marked nocal\n", Nnocal); 52 return (TRUE); 54 53 } 55 56 -
trunk/Ohana/src/relphot/src/setMrelFinal.c
r2486 r4796 1 1 # include "relphot.h" 2 3 void skip_measurements (Catalog *catalog, int pass);4 Image *getimages (int *N);5 2 6 3 void setMrelFinal (Catalog *catalog) { … … 73 70 void skip_measurements (Catalog *catalog, int pass) { 74 71 75 int i, j, k, m, Nimage, ecode, d1, d2;72 int i, k, m, ecode, d1, d2; 76 73 int Ntot, Ntry, Nkeep, Nskip; 77 74 short mag; 78 Image *image;79 75 80 76 Ntot = Ntry = Nskip = Nkeep = 0; -
trunk/Ohana/src/relphot/src/time.c
r2486 r4796 1 # include <ohana.h> 2 3 int dms_to_ddd (double *Value, char *string); 4 int str_to_radec (double *ra, double *dec, char *str1, char *str2); 5 int chk_time (char *line); 6 double sec_to_jd (unsigned long second); 7 unsigned long int jd_to_sec (double jd); 8 char *sec_to_date (unsigned long second); 9 unsigned long date_to_sec (char *date); 10 1 # include "relphot.h" 2 11 3 /***** convert [-]00:00:00 to 0.0000 ****/ 12 4 int dms_to_ddd (double *Value, char *string) { … … 305 297 int Fseek (FILE *f, long offset, int whence) { 306 298 307 int status , k;299 int status; 308 300 309 301 status = fseek (f, offset, whence);
Note:
See TracChangeset
for help on using the changeset viewer.
