Changeset 6424 for trunk/Ohana/src/addstar
- Timestamp:
- Feb 13, 2006, 9:27:46 AM (21 years ago)
- Location:
- trunk/Ohana/src/addstar
- Files:
-
- 4 edited
-
include/2mass.h (modified) (1 diff)
-
src/get2mass.c (modified) (5 diffs)
-
src/get2mass_as.c (modified) (3 diffs)
-
src/get2mass_dr2.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/include/2mass.h
r5443 r6424 10 10 11 11 SkyTable *get2mass_acc (SkyRegion *patch, char *path, char *accel); 12 Stars *get2mass_2DR_data (SkyRegion *region, SkyRegion *patch, int photcode, int *nstars);13 Stars *get2mass_AS_data (SkyRegion *region, SkyRegion *patch, int phocode, int *nstars);12 Stars *get2mass_2DR_data (SkyRegion *region, char *filename, SkyRegion *patch, int photcode, int *nstars); 13 Stars *get2mass_AS_data (SkyRegion *region, char *filename, SkyRegion *patch, int phocode, int *nstars); -
trunk/Ohana/src/addstar/src/get2mass.c
r5945 r6424 32 32 case 0: 33 33 // XXX put filename from table here 34 refcat = get2mass_AS_data (&sky[0].regions[i], patch, photcode, &Nrefcat);34 refcat = get2mass_AS_data (&sky[0].regions[i], sky[0].filename[i], patch, photcode, &Nrefcat); 35 35 if (VERBOSE) fprintf (stderr, "loaded %d stars from 2MASS (allsky)\n", Nrefcat); 36 36 break; 37 37 case 1: 38 refcat = get2mass_2DR_data (&sky[0].regions[i], patch, photcode, &Nrefcat);38 refcat = get2mass_2DR_data (&sky[0].regions[i], sky[0].filename[i], patch, photcode, &Nrefcat); 39 39 if (VERBOSE) fprintf (stderr, "loaded %d stars from 2MASS (dr2)\n", Nrefcat); 40 40 break; … … 57 57 58 58 int Nregions, NREGIONS; 59 char accelfile[1024], line[256], filename[128], datafile[256] ;59 char accelfile[1024], line[256], filename[128], datafile[256], **filenames; 60 60 FILE *f; 61 61 double Rs, Re, Ds, De; … … 71 71 NREGIONS = 200; 72 72 ALLOCATE (regions, SkyRegion, NREGIONS); 73 ALLOCATE (filenames, char *, NREGIONS); 73 74 74 75 /* read in stars line-by-line */ … … 84 85 if (Ds > patch[0].Dmax) continue; 85 86 if (De < patch[0].Dmin) continue; 86 sprintf (datafile, "%s/%s", path, filename);87 // XXX : put in table regions[Nregions].filename = (e_void) strcreate (datafile);88 87 regions[Nregions].Rmin = Rs; 89 88 regions[Nregions].Rmax = Re; 90 89 regions[Nregions].Dmin = Ds; 91 90 regions[Nregions].Dmax = De; 91 92 sprintf (datafile, "%s/%s", path, filename); 93 filenames[Nregions] = strcreate (datafile); 94 92 95 Nregions ++; 93 96 CHECK_REALLOCATE (regions, SkyRegion, NREGIONS, Nregions, 20); 97 CHECK_REALLOCATE (filenames, char *, NREGIONS, Nregions, 20); 94 98 } 95 99 fclose (f); … … 97 101 ALLOCATE (sky, SkyTable, 1); 98 102 sky[0].regions = regions; 103 sky[0].filename = filenames; 99 104 sky[0].Nregions = Nregions; 100 105 return (sky); -
trunk/Ohana/src/addstar/src/get2mass_as.c
r5945 r6424 13 13 e_time get2mass_time (char *ptr, char *buffer, int Nbound, int Nbyte); 14 14 15 Stars *get2mass_AS_data (SkyRegion *region, SkyRegion *patch, int photcode, int *nstars) {15 Stars *get2mass_AS_data (SkyRegion *region, char *filename, SkyRegion *patch, int photcode, int *nstars) { 16 16 17 17 int FilterSkip, TimeSkip; … … 20 20 gzFile gf; 21 21 char qc; 22 char *buffer , *filename;22 char *buffer; 23 23 char *p, *q, *ptr, *tmp; 24 24 double RA, DEC, M, dM; … … 55 55 if (!FilterSkip) Shutdown ("invalid photcode %s", GetPhotcodeNamebyCode(photcode)); 56 56 57 // filename = (char *) region[0].filename;58 57 gf = gzopen (filename, "rb"); 59 58 if (gf == NULL) Shutdown ("can't read 2mass data file: %s", filename); -
trunk/Ohana/src/addstar/src/get2mass_dr2.c
r5945 r6424 5 5 # define NLINE 30000 6 6 7 Stars *get2mass_2DR_data (SkyRegion *region, SkyRegion *patch, int photcode, int *nstars) {7 Stars *get2mass_2DR_data (SkyRegion *region, char *filename, SkyRegion *patch, int photcode, int *nstars) { 8 8 9 9 int i, Nstars, NSTARS, Nbyte, Nline; 10 10 Stars *stars; 11 11 gzFile gf; 12 char *buffer , *filename;12 char *buffer; 13 13 char line[303]; 14 14 double RA, DEC, J, H, K, dJ, dH, dK; … … 27 27 fprintf (stderr, "overlap: %f - %f, %f - %f\n", RA0, RA1, DEC0, DEC1); 28 28 29 // XXX get from args30 // filename = (char *) region[0].filename;31 29 gf = gzopen (filename, "rb"); 32 30 if (gf == NULL) Shutdown ("can't read 2mass data file: %s", filename);
Note:
See TracChangeset
for help on using the changeset viewer.
