Changeset 27435 for trunk/Ohana/src/relphot
- Timestamp:
- Mar 24, 2010, 11:22:25 AM (16 years ago)
- Location:
- trunk/Ohana
- Files:
-
- 1 deleted
- 13 edited
-
. (modified) (1 prop)
-
src/relphot/include/relphot.h (modified) (8 diffs)
-
src/relphot/src/GridOps.c (modified) (10 diffs)
-
src/relphot/src/ImageOps.c (modified) (20 diffs)
-
src/relphot/src/MosaicOps.c (modified) (28 diffs)
-
src/relphot/src/StarOps.c (modified) (15 diffs)
-
src/relphot/src/bcatalog.c (modified) (2 diffs)
-
src/relphot/src/load_images.c (modified) (3 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) (3 diffs)
-
src/relphot/src/setExclusions.c (modified) (2 diffs)
-
src/relphot/src/setMrelFinal.c (modified) (4 diffs)
-
src/relphot/src/sort.c (deleted)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana
-
Property svn:mergeinfo
set to
/branches/eam_branches/20091201/Ohana merged eligible /branches/eam_branches/largefiles.20100314/Ohana merged eligible
-
Property svn:mergeinfo
set to
-
trunk/Ohana/src/relphot/include/relphot.h
r21508 r27435 7 7 # define GRID_V2 8 8 # define NO_IMAGE -100 9 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 9 18 10 typedef struct { … … 110 102 111 103 # ifdef GRID_V1 112 int setGridMeasure ( int meas, int cat, double X, double Y);104 int setGridMeasure (off_t meas, int cat, double X, double Y); 113 105 # endif 114 106 115 107 # ifdef GRID_V2 116 int setGridMeasure ( int meas, int cat, double X, double Y, int ccdnum);108 int setGridMeasure (off_t meas, int cat, double X, double Y, int ccdnum); 117 109 # endif 118 110 … … 122 114 char *GetPhotnamebyCode PROTO((PhotCodeData *photcodes, int code)); 123 115 void InterpolateGrid PROTO((float *buffer, int Nx, int Ny, Coords *ccd, Coords *gcoords)); 124 int *SelectRefMosaic PROTO((Mosaic **refmosaic, int *Nimage));116 off_t *SelectRefMosaic PROTO((Mosaic **refmosaic, off_t *Nimage)); 125 117 int args PROTO((int argc, char **argv)); 126 118 int bcatalog PROTO((Catalog *subcatalog, Catalog *catalog)); … … 137 129 138 130 void set_db (FITS_DB *in); 139 int Shutdown (char *format, ...) ;131 int Shutdown (char *format, ...) OHANA_FORMAT(printf, 1, 2) ; 140 132 void TrapSignal (int sig); 141 133 void SetProtect (int mode); … … 147 139 void free_catalogs PROTO((Catalog *catalog, int Ncatalog)); 148 140 int gcatalog PROTO((Catalog *catalog, int FINAL)); 149 Coords *getCoords PROTO(( int meas, int cat));150 int getImageEntry PROTO((int meas, int cat));151 float getMcal PROTO(( int meas, int cat));152 float getMgrid PROTO(( int meas, int cat));153 float getMmos PROTO(( int meas, int cat));154 float getMrel PROTO((Catalog *catalog, int meas, int cat));155 Image *getimage PROTO(( int N));156 Image *getimages PROTO(( int *N));141 Coords *getCoords PROTO((off_t meas, int cat)); 142 off_t getImageEntry PROTO((off_t meas, int cat)); 143 float getMcal PROTO((off_t meas, int cat)); 144 float getMgrid PROTO((off_t meas, int cat)); 145 float getMmos PROTO((off_t meas, int cat)); 146 float getMrel PROTO((Catalog *catalog, off_t meas, int cat)); 147 Image *getimage PROTO((off_t N)); 148 Image *getimages PROTO((off_t *N)); 157 149 void global_stats PROTO((Catalog *catalog, int Ncatalog)); 158 150 void initGrid PROTO((int dX, int dY)); 159 151 void initGridBins PROTO((Catalog *catalog, int Ncatalog)); 160 152 void initImageBins PROTO((Catalog *catalog, int Ncatalog)); 161 void initImages PROTO((Image *input, int N));153 void initImages PROTO((Image *input, off_t N)); 162 154 void initMosaicBins PROTO((Catalog *catalog, int Ncatalog)); 163 void initMosaicGrid PROTO((Image *image, int Nimage));164 void initMosaics PROTO((Image *image, int Nimage));155 void initMosaicGrid PROTO((Image *image, off_t Nimage)); 156 void initMosaics PROTO((Image *image, off_t Nimage)); 165 157 void initMrel PROTO((Catalog *catalog, int Ncatalog)); 166 158 void initialize PROTO((int argc, char **argv)); … … 169 161 Catalog *load_catalogs PROTO((SkyList *skylist, int *Ncatalog)); 170 162 SkyList *load_images PROTO((FITS_DB *db, char *regionName, SkyRegion *region, int RegionSelect)); 171 Image *select_images PROTO((SkyList *skylist, Image *timage, int Ntimage, int **LineNumber, int *Nimage));163 Image *select_images PROTO((SkyList *skylist, Image *timage, off_t Ntimage, off_t **LineNumber, off_t *Nimage)); 172 164 173 165 int main PROTO((int argc, char **argv)); 174 void mark_images PROTO((Image *image, int Nimage, Image *timage, int Ntimage));175 void matchImage PROTO((Catalog *catalog, int meas, int cat));176 void matchMosaics PROTO((Catalog *catalog, int meas, int cat));166 void mark_images PROTO((Image *image, off_t Nimage, Image *timage, off_t Ntimage)); 167 void matchImage PROTO((Catalog *catalog, off_t meas, int cat)); 168 void matchMosaics PROTO((Catalog *catalog, off_t meas, int cat)); 177 169 double opening_angle PROTO((double x1, double y1, double x2, double y2, double x3, double y3)); 178 170 void plot_chisq PROTO((Catalog *catalog, int Ncatalog)); … … 180 172 void plot_grid PROTO((Catalog *catalog)); 181 173 void plot_images PROTO((void)); 182 void plot_list PROTO((Graphdata *graphdata, double *xlist, double *ylist, int N, char *label, char *format, ...) );174 void plot_list PROTO((Graphdata *graphdata, double *xlist, double *ylist, int N, char *label, char *format, ...) OHANA_FORMAT(printf, 6, 7) ); 183 175 void plot_mosaic_fields PROTO((Catalog *catalog)); 184 176 void plot_mosaics PROTO((void)); … … 199 191 int setMave PROTO((Catalog *catalog, int Ncatalog)); 200 192 void set_ZP PROTO((double ZERO)); 201 int setrefcode PROTO((Image *image, int Nimage));193 int setrefcode PROTO((Image *image, off_t Nimage)); 202 194 void skip_measurements PROTO((Catalog *catalog, int pass)); 203 195 void sortA PROTO((double *X, int N)); -
trunk/Ohana/src/relphot/src/GridOps.c
r21508 r27435 7 7 }; 8 8 9 static int Ngrid; 9 static int Ngrid; // number of grid elements (gridX * gridY) 10 10 static float *gridM; // magnitude offset for this grid cell 11 11 static float *gridS; // stdev of the magnitude offset for this grid cell 12 12 static int *gridN; // number of stars used to measure the magnitude offset for this grid cell 13 13 static int *gridV; // data mode for this cell: fitted, frozen, reference 14 static int gridX; 15 static int gridY; 16 17 static int **bin; 18 static int **Xmeas; 19 static int **Ymeas; 14 static int gridX; // number of grid elements in X direction 15 static int gridY; // number of grid elements in Y direction 16 17 static int **bin; // link from catalog, measure to grid element 18 static int **Xmeas; // grid x-coordinate for a measurement 19 static int **Ymeas; // grid y-coordinate for a measurement 20 20 21 21 static int **clist; // link from measurement on a cell to catalog containing measurement 22 static int**mlist; // link from measurement on a cell to measurement in a catalog23 static int *Nlist; // listof measurements for each grid cell24 static int *NLIST;22 static off_t **mlist; // link from measurement on a cell to measurement in a catalog 23 static off_t *Nlist; // number of measurements for each grid cell 24 static off_t *NLIST; // allocated number of measurements for each grid cell 25 25 26 26 static struct { … … 159 159 ALLOCATE (Ymeas, int *, Ncatalog); 160 160 for (i = 0; i < Ncatalog; i++) { 161 ALLOCATE (bin[i], int, MAX (catalog[i].Nmeasure, 1));161 ALLOCATE (bin[i], int, MAX (catalog[i].Nmeasure, 1)); 162 162 ALLOCATE (Xmeas[i], int, MAX (catalog[i].Nmeasure, 1)); 163 163 ALLOCATE (Ymeas[i], int, MAX (catalog[i].Nmeasure, 1)); … … 166 166 167 167 /* define grid -> cat,meas pointers */ 168 ALLOCATE (Nlist, int,Ngrid);169 ALLOCATE (NLIST, int,Ngrid);170 ALLOCATE (clist, int *, Ngrid);171 ALLOCATE (mlist, int *, Ngrid);168 ALLOCATE (Nlist, off_t, Ngrid); 169 ALLOCATE (NLIST, off_t, Ngrid); 170 ALLOCATE (clist, int *, Ngrid); 171 ALLOCATE (mlist, off_t *, Ngrid); 172 172 173 173 for (i = 0; i < Ngrid; i++) { 174 174 Nlist[i] = 0; 175 175 NLIST[i] = 100; 176 ALLOCATE (clist[i], int, NLIST[i]);177 ALLOCATE (mlist[i], int, NLIST[i]);176 ALLOCATE (clist[i], int, NLIST[i]); 177 ALLOCATE (mlist[i], off_t, NLIST[i]); 178 178 } 179 179 } … … 206 206 } 207 207 208 int setGridMeasure ( int meas, int cat, double X, double Y, int ccdnum) {208 int setGridMeasure (off_t meas, int cat, double X, double Y, int ccdnum) { 209 209 210 210 int ix, iy, Cx, Cy, i; … … 241 241 if (Nlist[i] == NLIST[i]) { 242 242 NLIST[i] += 100; 243 REALLOCATE (clist[i], int, NLIST[i]);244 REALLOCATE (mlist[i], int, NLIST[i]);243 REALLOCATE (clist[i], int, NLIST[i]); 244 REALLOCATE (mlist[i], off_t, NLIST[i]); 245 245 } 246 246 return (TRUE); … … 264 264 } 265 265 266 float getMgrid ( int meas, int cat) {266 float getMgrid (off_t meas, int cat) { 267 267 268 268 int i; … … 287 287 288 288 int **gotstar, **gridmeas; 289 int i, j, k, N , Ngood, Nbad, Nmos, Ncal, Nrel, Nsys;289 int i, j, k, Ngood, Nbad, Nmos, Ncal, Nrel, Nsys; 290 290 double **A, **B, *Mjx, *Wjx; 291 291 float Msys, Mcal, Mmos, Merr, Wsys; … … 498 498 gridM[i] = B[i][0]; 499 499 gridS[i] = sqrt(A[i][i]); 500 gridN[i] = N ;500 gridN[i] = Ngood; 501 501 } 502 502 … … 673 673 void dump_grid () { 674 674 675 int i, j, Nimage, Nbytes, Nformat; 676 int *imlist; 675 off_t i, Nimage; 676 int j, Nbytes, Nformat; 677 off_t *imlist; 677 678 FILE *f; 678 679 Header header, theader; … … 702 703 gfits_create_header (&header); 703 704 gfits_create_matrix (&header, &matrix); 704 gfits_modify (&header, "NEXTEND", "% d", 1,Nimage + 3);705 gfits_modify (&header, "NEXTEND", "%lld", 1, (long long) Nimage + 3); 705 706 gfits_modify (&header, "FILTER", "%s", 1, photcode[0].name); 706 gfits_modify (&header, "COMMENT", "%S", 1, "Mosaic Photometry Grid Analysis");707 gfits_modify_alt (&header, "COMMENT", "%S", 1, "Mosaic Photometry Grid Analysis"); 707 708 708 709 // we need to add lines to the PHU to identify the camera and format; these are used by the ipp config system -
trunk/Ohana/src/relphot/src/ImageOps.c
r21508 r27435 3 3 static unsigned int *start; 4 4 static unsigned int *stop; 5 static int**bin;6 7 static int**clist;8 static int**mlist;9 static int*Nlist;10 static int*NLIST;5 static off_t **bin; 6 7 static off_t **clist; 8 static off_t **mlist; 9 static off_t *Nlist; 10 static off_t *NLIST; 11 11 12 12 static Image *image; 13 static intNimage;14 15 void initImages (Image *input, int N) {16 17 int i;13 static off_t Nimage; 14 15 void initImages (Image *input, off_t N) { 16 17 off_t i; 18 18 19 19 image = input; … … 31 31 void initImageBins (Catalog *catalog, int Ncatalog) { 32 32 33 int i, j;34 35 ALLOCATE (bin, int *, Ncatalog);33 off_t i, j; 34 35 ALLOCATE (bin, off_t *, Ncatalog); 36 36 for (i = 0; i < Ncatalog; i++) { 37 ALLOCATE (bin[i], int, MAX (catalog[i].Nmeasure, 1));37 ALLOCATE (bin[i], off_t, MAX (catalog[i].Nmeasure, 1)); 38 38 for (j = 0; j < catalog[i].Nmeasure; j++) bin[i][j] = -1; 39 39 } 40 40 41 ALLOCATE (Nlist, int, Nimage);42 ALLOCATE (NLIST, int, Nimage);43 ALLOCATE (clist, int *, Nimage);44 ALLOCATE (mlist, int *, Nimage);41 ALLOCATE (Nlist, off_t, Nimage); 42 ALLOCATE (NLIST, off_t, Nimage); 43 ALLOCATE (clist, off_t *, Nimage); 44 ALLOCATE (mlist, off_t *, Nimage); 45 45 46 46 for (i = 0; i < Nimage; i++) { 47 47 Nlist[i] = 0; 48 48 NLIST[i] = 100; 49 ALLOCATE (clist[i], int, NLIST[i]);50 ALLOCATE (mlist[i], int, NLIST[i]);49 ALLOCATE (clist[i], off_t, NLIST[i]); 50 ALLOCATE (mlist[i], off_t, NLIST[i]); 51 51 } 52 52 } … … 54 54 void freeImageBins (int Ncatalog) { 55 55 56 int i;56 off_t i; 57 57 58 58 for (i = 0; i < Ncatalog; i++) { … … 70 70 /* **** use this to mimic the Mosaic version ***/ 71 71 # if (0) 72 void initImageGrid (Image *image, int Nimage) {72 void initImageGrid (Image *image, off_t Nimage) { 73 73 74 74 /* find max dR, dD range for all mosaics */ … … 76 76 /* send results to initGridBins */ 77 77 78 int i, j, m, NX, NY;78 off_t i, j, m, NX, NY; 79 79 int dXmax, dYmax; 80 80 double dS, dX, dY; … … 151 151 void findImages (Catalog *catalog, int Ncatalog) { 152 152 153 int i, j, ecode; 153 off_t j; 154 int i, ecode; 154 155 155 156 for (i = 0; i < Ncatalog; i++) { … … 164 165 /* XXX convert this to use the values of measure->Xccd,Yccd */ 165 166 /* XXX need to apply the conversion for ELIXIR and LONEOS formats */ 166 void matchImage (Catalog *catalog, int meas, int cat) { 167 168 int i, ccdnum; 167 void matchImage (Catalog *catalog, off_t meas, int cat) { 168 169 off_t i; 170 int ccdnum; 169 171 double X, Y; 170 172 char *pname, *filter, *p, base[256]; … … 220 222 if (Nlist[i] == NLIST[i]) { 221 223 NLIST[i] += 100; 222 REALLOCATE (clist[i], int, NLIST[i]);223 REALLOCATE (mlist[i], int, NLIST[i]);224 REALLOCATE (clist[i], off_t, NLIST[i]); 225 REALLOCATE (mlist[i], off_t, NLIST[i]); 224 226 } 225 227 return; … … 228 230 } 229 231 230 int getImageEntry (int meas, int cat) {231 232 int i;232 off_t getImageEntry (off_t meas, int cat) { 233 234 off_t i; 233 235 234 236 i = bin[cat][meas]; … … 236 238 } 237 239 238 float getMcal ( int meas, int cat) {239 240 int i;240 float getMcal (off_t meas, int cat) { 241 242 off_t i; 241 243 float value; 242 244 … … 249 251 } 250 252 251 Coords *getCoords ( int meas, int cat) {252 253 int i;253 Coords *getCoords (off_t meas, int cat) { 254 255 off_t i; 254 256 255 257 i = bin[cat][meas]; … … 261 263 void setMcal (Catalog *catalog, int PoorImages) { 262 264 263 int i, j, m, c, n, N, Nmax, mark, bad, Nfew, Nbad, Nmos, Ngrid, Nrel, Nsys; 265 off_t i, j, m, c, n, N, Nmax, mark, bad; 266 int Nfew, Nbad, Nmos, Ngrid, Nrel, Nsys; 264 267 float Msys, Mrel, Mmos, Mgrid; 265 268 double *list, *dlist; … … 359 362 void clean_images () { 360 363 361 int i, N, mark, Nmark; 364 int mark, Nmark; 365 off_t i, N; 362 366 double *mlist, *slist, *dlist; 363 367 double MaxOffset, MaxScatter, MedOffset; … … 409 413 void plot_images () { 410 414 411 int i, bin;415 off_t i, bin; 412 416 double *xlist, *Mlist, *dlist; 413 417 Graphdata graphdata; … … 457 461 StatType statsImageN (Catalog *catalog) { 458 462 459 int i, j, m, c, n, N;463 off_t i, j, m, c, n, N; 460 464 double *list, *dlist; 461 465 float Mcal, Mmos, Mgrid; … … 499 503 StatType statsImageX (Catalog *catalog) { 500 504 501 int i, n;505 off_t i, n; 502 506 double *list, *dlist; 503 507 StatType stats; … … 527 531 StatType statsImageM (Catalog *catalog) { 528 532 529 int i, n;533 off_t i, n; 530 534 double *list, *dlist; 531 535 StatType stats; … … 555 559 StatType statsImagedM (Catalog *catalog) { 556 560 557 int i, n;561 off_t i, n; 558 562 double *list, *dlist; 559 563 StatType stats; … … 581 585 } 582 586 583 Image *getimages ( int *N) {587 Image *getimages (off_t *N) { 584 588 585 589 *N = Nimage; … … 587 591 } 588 592 589 Image *getimage ( int N) {593 Image *getimage (off_t N) { 590 594 return (&image[N]); 591 595 } -
trunk/Ohana/src/relphot/src/MosaicOps.c
r21508 r27435 1 1 # include "relphot.h" 2 2 3 Image *getimages (int *N); 4 5 static int Nmosaic; 3 static off_t Nmosaic; 6 4 static Mosaic *mosaic; 7 5 8 static int*Nimlist;9 static int **imlist; /* mosaic -> image[] */10 static int **bin; /* catalog, measure -> mosaic */11 12 static int **clist; /* mosaic -> catalog[] */13 static int **mlist; /* mosiac -> measure[] */14 static int *Nlist;15 static int *NLIST;6 static off_t *Nimlist; 7 static off_t **imlist; /* mosaic -> image[] */ 8 static off_t **bin; /* catalog, measure -> mosaic */ 9 10 static int **clist; /* mosaic -> catalog[] */ 11 static off_t **mlist; /* mosiac -> measure[] */ 12 static off_t *Nlist; 13 static off_t *NLIST; 16 14 17 15 /* find mosaic frames (unique time periods & photcode name matches mosaic) */ 18 void initMosaics (Image *image, int Nimage) {19 20 int i, j, status, found, NMOSAIC, *NIMLIST;16 void initMosaics (Image *image, off_t Nimage) { 17 18 off_t i, j, status, found, NMOSAIC, *NIMLIST; 21 19 unsigned int start, stop; 22 20 char *pname; … … 28 26 ALLOCATE (mosaic, Mosaic, NMOSAIC); 29 27 30 ALLOCATE (imlist, int *, NMOSAIC);31 ALLOCATE (Nimlist, int,NMOSAIC);32 ALLOCATE (NIMLIST, int,NMOSAIC);28 ALLOCATE (imlist, off_t *, NMOSAIC); 29 ALLOCATE (Nimlist, off_t, NMOSAIC); 30 ALLOCATE (NIMLIST, off_t, NMOSAIC); 33 31 34 32 /* generate list of unique mosaics */ … … 56 54 if (Nimlist[j] == NIMLIST[j]) { 57 55 NIMLIST[j] += 10; 58 REALLOCATE (imlist[j], int, NIMLIST[j]);56 REALLOCATE (imlist[j], off_t, NIMLIST[j]); 59 57 } 60 58 … … 74 72 NIMLIST[Nmosaic] = 10; 75 73 Nimlist[Nmosaic] = 1; 76 ALLOCATE (imlist[Nmosaic], int, NIMLIST[Nmosaic]);74 ALLOCATE (imlist[Nmosaic], off_t, NIMLIST[Nmosaic]); 77 75 imlist[Nmosaic][0] = i; 78 76 … … 80 78 if (Nmosaic == NMOSAIC) { 81 79 NMOSAIC += 10; 82 REALLOCATE (mosaic, Mosaic,NMOSAIC);83 REALLOCATE (imlist, int *, NMOSAIC);84 REALLOCATE (Nimlist, int,NMOSAIC);85 REALLOCATE (NIMLIST, int,NMOSAIC);80 REALLOCATE (mosaic, Mosaic, NMOSAIC); 81 REALLOCATE (imlist, off_t *, NMOSAIC); 82 REALLOCATE (Nimlist, off_t, NMOSAIC); 83 REALLOCATE (NIMLIST, off_t, NMOSAIC); 86 84 } 87 85 } … … 91 89 } 92 90 93 void initMosaicGrid (Image *image, int Nimage) {91 void initMosaicGrid (Image *image, off_t Nimage) { 94 92 95 93 /* find max dR, dD range for all mosaics */ … … 97 95 /* send results to initGridBins */ 98 96 99 int i, j, m, NX, NY;97 off_t i, j, m, NX, NY; 100 98 int dXmax, dYmax; 101 99 double dS, dX, dY; … … 170 168 void setMcalFinal () { 171 169 172 int i, j, im, Nimage;170 off_t i, j, im, Nimage; 173 171 Image *image; 174 172 … … 191 189 void initMosaicBins (Catalog *catalog, int Ncatalog) { 192 190 193 int i, j;191 off_t i, j; 194 192 195 193 /* measure -> mosaic */ 196 194 if (!MOSAIC_ZEROPT) return; 197 195 198 ALLOCATE (bin, int *, Ncatalog);196 ALLOCATE (bin, off_t *, Ncatalog); 199 197 for (i = 0; i < Ncatalog; i++) { 200 ALLOCATE (bin[i], int, MAX (catalog[i].Nmeasure, 1));198 ALLOCATE (bin[i], off_t, MAX (catalog[i].Nmeasure, 1)); 201 199 for (j = 0; j < catalog[i].Nmeasure; j++) bin[i][j] = -1; 202 200 } 203 201 204 202 /* mosaic -> measure */ 205 ALLOCATE (Nlist, int,Nmosaic);206 ALLOCATE (NLIST, int,Nmosaic);207 ALLOCATE (clist, int *, Nmosaic);208 ALLOCATE (mlist, int *, Nmosaic);203 ALLOCATE (Nlist, off_t, Nmosaic); 204 ALLOCATE (NLIST, off_t, Nmosaic); 205 ALLOCATE (clist, int *, Nmosaic); 206 ALLOCATE (mlist, off_t *, Nmosaic); 209 207 210 208 for (i = 0; i < Nmosaic; i++) { 211 209 Nlist[i] = 0; 212 210 NLIST[i] = 100; 213 ALLOCATE (clist[i], int, NLIST[i]);214 ALLOCATE (mlist[i], int, NLIST[i]);211 ALLOCATE (clist[i], int, NLIST[i]); 212 ALLOCATE (mlist[i], off_t, NLIST[i]); 215 213 } 216 214 } … … 218 216 void freeMosaicBins (int Ncatalog) { 219 217 220 int i;218 off_t i; 221 219 222 220 /* measure -> mosaic */ … … 241 239 int findMosaics (Catalog *catalog, int Ncatalog) { 242 240 243 int i, j, ecode; 241 int i, ecode; 242 off_t j; 244 243 245 244 if (!MOSAIC_ZEROPT) return (FALSE); … … 259 258 } 260 259 261 void matchMosaics (Catalog *catalog, int meas, int cat) {260 void matchMosaics (Catalog *catalog, off_t meas, int cat) { 262 261 263 262 int i; … … 287 286 if (Nlist[i] == NLIST[i]) { 288 287 NLIST[i] += 100; 289 REALLOCATE (clist[i], int, NLIST[i]);290 REALLOCATE (mlist[i], int, NLIST[i]);288 REALLOCATE (clist[i], int, NLIST[i]); 289 REALLOCATE (mlist[i], off_t, NLIST[i]); 291 290 } 292 291 return; … … 296 295 } 297 296 298 float getMmos ( int meas, int cat) {299 300 int i;297 float getMmos (off_t meas, int cat) { 298 299 off_t i; 301 300 float value; 302 301 … … 313 312 int setMmos (Catalog *catalog, int PoorImages) { 314 313 315 int i, j, m, c, n, N, Nmax, mark, bad, Nfew, Nbad, Ncal, Nrel, Ngrid, Nsys; 314 off_t i, j, m, c, N, Nmax; 315 int n, mark, bad, Nfew, Nbad, Ncal, Nrel, Ngrid, Nsys; 316 316 float Msys, Mrel, Mcal, Mgrid; 317 317 double *list, *dlist, *Mlist, *dMlist; … … 392 392 mark = (N < IMAGE_TOOFEW) || (N < IMAGE_GOOD_FRACTION*Nlist[i]); 393 393 if (mark) { 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]);394 fprintf (stderr, "marked image %s (%lld), (%lld < %d) || (%lld < %f*%lld)\n", image[imlist[i][0]].name, (long long) i, (long long) N, IMAGE_TOOFEW, (long long) N, IMAGE_GOOD_FRACTION, (long long) Nlist[i]); 395 395 mosaic[i].flags |= ID_IMAGE_FEW; 396 396 Nfew ++; … … 400 400 } 401 401 liststats (list, dlist, N, &stats); 402 if (PoorImages) fprintf (stderr, "Mmos: %f %f %d % d\n", stats.mean, stats.sigma, stats.Nmeas,N);402 if (PoorImages) fprintf (stderr, "Mmos: %f %f %d %lld\n", stats.mean, stats.sigma, stats.Nmeas, (long long) N); 403 403 mosaic[i].Mcal = stats.mean; 404 404 mosaic[i].dMcal = stats.sigma; … … 422 422 StatType statsMosaicM (Catalog *catalog) { 423 423 424 int i, n; 424 off_t i; 425 int n; 425 426 double *list, *dlist; 426 427 StatType stats; … … 448 449 StatType statsMosaicdM (Catalog *catalog) { 449 450 450 int i, n;451 off_t i, n; 451 452 double *list, *dlist; 452 453 StatType stats; … … 476 477 StatType statsMosaicN (Catalog *catalog) { 477 478 478 int i, j, m, c, n, N;479 off_t i, j, m, c, n, N; 479 480 double *list, *dlist; 480 481 float Mcal, Mgrid, Mrel; … … 510 511 n++; 511 512 } 512 fprintf (stderr, "Nmosaic: % d, n: %d\n", Nmosaic,n);513 fprintf (stderr, "Nmosaic: %lld, n: %lld\n", (long long) Nmosaic, (long long) n); 513 514 514 515 liststats (list, dlist, n, &stats); … … 520 521 StatType statsMosaicX (Catalog *catalog) { 521 522 522 int i, n;523 off_t i, n; 523 524 double *list, *dlist; 524 525 StatType stats; … … 549 550 void clean_mosaics () { 550 551 551 int i, N, mark, Nmark;552 off_t i, N, mark, Nmark; 552 553 double *mlist, *slist, *dlist; 553 554 double MaxOffset, MedOffset, MaxScatter; … … 590 591 } 591 592 592 fprintf (stderr, "% d mosaics marked poor\n",Nmark);593 fprintf (stderr, "%lld mosaics marked poor\n", (long long) Nmark); 593 594 initstats (STATMODE); 594 595 free (mlist); … … 599 600 void plot_mosaic_fields (Catalog *catalog) { 600 601 601 int i, j, m, c, N, ave, Nimage;602 off_t i, j, m, c, N, ave, Nimage; 602 603 double *xlist, *ylist; 603 604 double Xmin, Xmax, Ymin, Ymax; … … 634 635 } 635 636 636 sprintf (string, "Mosaic % d",i);637 sprintf (string, "Mosaic %lld", (long long) i); 637 638 plot_defaults (&graphdata); 638 639 plot_list (&graphdata, xlist, ylist, N, string, NULL); … … 645 646 void plot_mosaics () { 646 647 647 int i, bin;648 off_t i, bin; 648 649 double *xlist, *Mlist, *dlist; 649 650 Graphdata graphdata; … … 694 695 } 695 696 696 int *SelectRefMosaic (Mosaic **refmosaic, int *Nimage) {697 698 int i, Imax, Nmax;697 off_t *SelectRefMosaic (Mosaic **refmosaic, off_t *Nimage) { 698 699 off_t i, Imax, Nmax; 699 700 700 701 Imax = 0; -
trunk/Ohana/src/relphot/src/StarOps.c
r25735 r27435 7 7 void initMrel (Catalog *catalog, int Ncatalog) { 8 8 9 int i, j;9 off_t i, j; 10 10 11 11 Nmax = 0; … … 20 20 } 21 21 22 float getMrel (Catalog *catalog, int meas, int cat) {22 float getMrel (Catalog *catalog, off_t meas, int cat) { 23 23 24 24 int ave; … … 34 34 int setMrel (Catalog *catalog, int Ncatalog) { 35 35 36 int i, j, k, m, N, Nfew, Nsys, Nbad, Ncal, Nmos, Ngrid; 36 off_t j, k, m; 37 int i, N, Nfew, Nsys, Nbad, Ncal, Nmos, Ngrid; 37 38 float Msys, Mcal, Mmos, Mgrid; 38 39 StatType stats; … … 109 110 int setMrelOutput (Catalog *catalog, int Ncatalog, int mark) { 110 111 111 int i, j, k, m, N, Nmax; 112 int i, N; 113 off_t j, k, m, Nmax; 112 114 float Msys, Mcal, Mmos, Mgrid; 113 115 double *list, *dlist; … … 173 175 int setMave (Catalog *catalog, int Ncatalog) { 174 176 175 int i, j, k, m, Ns, Nsecfilt, N, Nmax, Nc; 177 off_t j, k, m, Nmax; 178 int i, Ns, Nsecfilt, N, Nc; 176 179 float Msys; 177 180 double *list, *dlist; … … 293 296 int setMcalOutput (Catalog *catalog, int Ncatalog) { 294 297 295 int i, j, k, m; 298 int i; 299 off_t j, k, m; 296 300 float Mcal, Mmos, Mgrid; 297 301 … … 380 384 void clean_measures (Catalog *catalog, int Ncatalog, int final) { 381 385 382 int i, j, k, m, N, Ndel, Nave, Nmax, image_bad, TOOFEW; 383 int *ilist; 386 off_t j, k, m, Nmax, Ndel, Nave; 387 int i, N, image_bad, TOOFEW; 388 off_t *ilist; 384 389 double *tlist, *list, *dlist, Ns; 385 390 float Msys, Mcal, Mmos, Mgrid; … … 396 401 ALLOCATE (list, double, MAX (1, Nmax)); 397 402 ALLOCATE (dlist, double, MAX (1, Nmax)); 398 ALLOCATE (ilist, int, Nmax);403 ALLOCATE (ilist, off_t, Nmax); 399 404 ALLOCATE (tlist, double, Nmax); 400 405 … … 480 485 } 481 486 initstats (STATMODE); 482 if (VERBOSE) fprintf (stderr, "% d measures marked poor, %d total\n", Ndel,Nave);487 if (VERBOSE) fprintf (stderr, "%lld measures marked poor, %lld total\n", (long long) Ndel, (long long) Nave); 483 488 free (ilist); 484 489 free (tlist); … … 487 492 StatType statsStarN (Catalog *catalog, int Ncatalog) { 488 493 489 int i, j, k, m, n, N, Ntot; 494 off_t j, k, m, Ntot; 495 int i, n, N; 490 496 double *list, *dlist; 491 497 float Mcal, Mmos, Mgrid; … … 533 539 StatType statsStarX (Catalog *catalog, int Ncatalog) { 534 540 535 int i, j, n, Ntot, Xm; 541 off_t j, Ntot; 542 int i, n, Xm; 536 543 double *list, *dlist; 537 544 StatType stats; … … 568 575 StatType statsStarS (Catalog *catalog, int Ncatalog) { 569 576 570 int i, j, n, Ntot; 577 int i, n; 578 off_t j, Ntot; 571 579 double *list, *dlist; 572 580 float dM; … … 603 611 void plot_stars (Catalog *catalog, int Ncatalog) { 604 612 605 int i, j, bin; 613 int i, bin; 614 off_t j; 606 615 float dMrel; 607 616 double *xlist, *Mlist; … … 634 643 void plot_chisq (Catalog *catalog, int Ncatalog) { 635 644 636 int i, j, N, Ntotal, value; 645 off_t j, Ntotal; 646 int i, N, value; 637 647 double *xlist, *ylist; 638 648 Graphdata graphdata; … … 665 675 void plot_star_coords (Catalog *catalog, int Ncatalog) { 666 676 667 int i, j, N; 677 int i; 678 off_t j, N; 668 679 double *xlist, *ylist; 669 680 double Xmin, Ymin, Xmax, Ymax; -
trunk/Ohana/src/relphot/src/bcatalog.c
r21508 r27435 3 3 int bcatalog (Catalog *subcatalog, Catalog *catalog) { 4 4 5 int i, j, offset, ecode; 6 int NAVERAGE, NMEASURE, Naverage, Nmeasure, Nm; 5 off_t i, j, offset; 6 int ecode; 7 off_t NAVERAGE, NMEASURE, Naverage, Nmeasure, Nm; 7 8 float mag; 8 9 … … 113 114 114 115 if (VERBOSE) { 115 fprintf (stderr, "% d: using %d stars (%d measures) for catalog\n",i,116 subcatalog[0].Naverage,subcatalog[0].Nmeasure);116 fprintf (stderr, "%lld: using %lld stars (%lld measures) for catalog\n", (long long) i, 117 (long long) subcatalog[0].Naverage, (long long) subcatalog[0].Nmeasure); 117 118 } 118 119 return (TRUE); -
trunk/Ohana/src/relphot/src/load_images.c
r25757 r27435 4 4 5 5 Image *image, *subset; 6 intNimage, Nsubset, Nchar;7 int*LineNumber;6 off_t Nimage, Nsubset, Nchar; 7 off_t *LineNumber; 8 8 9 9 SkyTable *sky = NULL; … … 40 40 41 41 Image *image; 42 intNimage, Nx, i;42 off_t Nimage, Nx, i; 43 43 VTable *vtable; 44 44 … … 47 47 vtable = &db[0].vtable; 48 48 49 gfits_scan (vtable[0].header, "NAXIS1", "% d", 1,&Nx);49 gfits_scan (vtable[0].header, "NAXIS1", "%lld", 1, (long long *) &Nx); 50 50 for (i = 0; i < Nimage; i++) { 51 51 memcpy (vtable[0].buffer[i], &image[i], Nx); -
trunk/Ohana/src/relphot/src/plot_scatter.c
r21508 r27435 3 3 void plot_scatter (Catalog *catalog, int Ncatalog) { 4 4 5 int i, j, k, m, N, Ntot;5 off_t i, j, k, m, N, Ntot; 6 6 float Mrel, Mcal, Mmos, Mgrid; 7 7 double *xlist, *ylist, *ilist; -
trunk/Ohana/src/relphot/src/relphot_objects.c
r25757 r27435 3 3 int relphot_objects () { 4 4 5 int i, j, k, m;5 off_t i, j, k, m; 6 6 int Nsecfilt; 7 7 -
trunk/Ohana/src/relphot/src/select_images.c
r21508 r27435 13 13 } SkyRegionCoords; 14 14 15 Image *select_images (SkyList *skylist, Image *timage, int Ntimage, int **LineNumber, int *Nimage) {15 Image *select_images (SkyList *skylist, Image *timage, off_t Ntimage, off_t **LineNumber, off_t *Nimage) { 16 16 17 17 Image *image; 18 int i, j, k, m, found, nimage, NIMAGE; 19 int InRange, ecode; 18 off_t i, j, k, m; 19 off_t *line_number, nimage, NIMAGE; 20 int InRange, ecode, found; 20 21 double Ri[5], Di[5], Xi[5], Yi[5], dx, dy; 21 int *line_number;22 22 Coords tcoords; 23 23 SkyRegionCoords *skycoords; … … 71 71 NIMAGE = 100; 72 72 ALLOCATE (image, Image, NIMAGE); 73 ALLOCATE (line_number, int, NIMAGE);73 ALLOCATE (line_number, off_t, NIMAGE); 74 74 75 75 // go through the complete list of images, selecting ones which overlap any region … … 146 146 NIMAGE += 100; 147 147 REALLOCATE (image, Image, NIMAGE); 148 REALLOCATE (line_number, int, NIMAGE);148 REALLOCATE (line_number, off_t, NIMAGE); 149 149 } 150 150 } 151 151 } 152 152 153 if (VERBOSE) fprintf (stderr, "found % d images\n",nimage);153 if (VERBOSE) fprintf (stderr, "found %lld images\n", (long long) nimage); 154 154 155 155 REALLOCATE (image, Image, MAX (nimage, 1)); 156 REALLOCATE (line_number, int, MAX (nimage, 1));156 REALLOCATE (line_number, off_t, MAX (nimage, 1)); 157 157 free (skycoords); 158 158 -
trunk/Ohana/src/relphot/src/setExclusions.c
r16810 r27435 3 3 int setExclusions (Catalog *catalog, int Ncatalog) { 4 4 5 int i, j, k, m, Narea, Nnocal, Ngood, ecode; 5 off_t i, j, k, m, Narea, Nnocal, Ngood; 6 int ecode; 6 7 Coords *coords; 7 8 double r, d, x, y; … … 49 50 } 50 51 } 51 if (VERBOSE) fprintf (stderr, "% d measurements marked by area\n",Narea);52 if (VERBOSE) fprintf (stderr, "% d measurements marked nocal\n",Nnocal);53 if (VERBOSE) fprintf (stderr, "% d measurements kept for analysis\n",Ngood);52 if (VERBOSE) fprintf (stderr, "%lld measurements marked by area\n", (long long) Narea); 53 if (VERBOSE) fprintf (stderr, "%lld measurements marked nocal\n", (long long) Nnocal); 54 if (VERBOSE) fprintf (stderr, "%lld measurements kept for analysis\n", (long long) Ngood); 54 55 return (TRUE); 55 56 } -
trunk/Ohana/src/relphot/src/setMrelFinal.c
r26154 r27435 3 3 void setMrelFinal (Catalog *catalog) { 4 4 5 int i, j, m, ecode; 5 off_t i, j, m; 6 int ecode; 6 7 7 8 /* if we reset the catalog, reset all the current measurements */ … … 39 40 40 41 /* set catalog[0].found[i] = FALSE */ 41 ALLOCATE (catalog[0].found, int, MAX (1, catalog[0].Naverage));42 ALLOCATE (catalog[0].found, off_t, MAX (1, catalog[0].Naverage)); 42 43 for (i = 0; i < catalog[0].Naverage; i++) { 43 44 catalog[0].found[i] = FALSE; … … 66 67 void skip_measurements (Catalog *catalog, int pass) { 67 68 68 int i, k, m, ecode, d1, d2; 69 int Ntot, Ntry, Nkeep, Nskip; 69 off_t i, k, m; 70 int ecode; 71 off_t Ntot, Ntry, Nkeep, Nskip; 70 72 float mag; 71 73 … … 136 138 } 137 139 } 138 if (VERBOSE) fprintf (stderr, "pass %d, Ntot: % d, Ntry: %d, Nskip: %d, Nkeep: %d\n",139 pass, Ntot, Ntry, Nskip,Nkeep);140 if (VERBOSE) fprintf (stderr, "pass %d, Ntot: %lld, Ntry: %lld, Nskip: %lld, Nkeep: %lld\n", 141 pass, (long long) Ntot, (long long) Ntry, (long long) Nskip, (long long) Nkeep); 140 142 } 141 143
Note:
See TracChangeset
for help on using the changeset viewer.
