IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 13, 2006, 9:27:46 AM (21 years ago)
Author:
eugene
Message:

various minor fixes

Location:
trunk/Ohana/src/addstar
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/addstar/include/2mass.h

    r5443 r6424  
    1010
    1111SkyTable *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);
     12Stars *get2mass_2DR_data (SkyRegion *region, char *filename, SkyRegion *patch, int photcode, int *nstars);
     13Stars *get2mass_AS_data (SkyRegion *region, char *filename, SkyRegion *patch, int phocode, int *nstars);
  • trunk/Ohana/src/addstar/src/get2mass.c

    r5945 r6424  
    3232      case 0:
    3333        // 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);
    3535        if (VERBOSE) fprintf (stderr, "loaded %d stars from 2MASS (allsky)\n", Nrefcat);
    3636        break;
    3737      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);
    3939        if (VERBOSE) fprintf (stderr, "loaded %d stars from 2MASS (dr2)\n", Nrefcat);
    4040        break;
    … …  
    5757
    5858  int Nregions, NREGIONS;
    59   char accelfile[1024], line[256], filename[128], datafile[256];
     59  char accelfile[1024], line[256], filename[128], datafile[256], **filenames;
    6060  FILE *f;
    6161  double Rs, Re, Ds, De;
    … …  
    7171  NREGIONS = 200;
    7272  ALLOCATE (regions, SkyRegion, NREGIONS);
     73  ALLOCATE (filenames, char *, NREGIONS);
    7374
    7475  /* read in stars line-by-line */
    … …  
    8485    if (Ds > patch[0].Dmax) continue;
    8586    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);
    8887    regions[Nregions].Rmin = Rs;
    8988    regions[Nregions].Rmax = Re;
    9089    regions[Nregions].Dmin = Ds;
    9190    regions[Nregions].Dmax = De;
     91
     92    sprintf (datafile, "%s/%s", path, filename);
     93    filenames[Nregions] = strcreate (datafile);
     94
    9295    Nregions ++;
    9396    CHECK_REALLOCATE (regions, SkyRegion, NREGIONS, Nregions, 20);
     97    CHECK_REALLOCATE (filenames, char *, NREGIONS, Nregions, 20);
    9498  }   
    9599  fclose (f);
    … …  
    97101  ALLOCATE (sky, SkyTable, 1);
    98102  sky[0].regions = regions;
     103  sky[0].filename = filenames;
    99104  sky[0].Nregions = Nregions;
    100105  return (sky);
  • trunk/Ohana/src/addstar/src/get2mass_as.c

    r5945 r6424  
    1313e_time get2mass_time (char *ptr, char *buffer, int Nbound, int Nbyte);
    1414
    15 Stars *get2mass_AS_data (SkyRegion *region, SkyRegion *patch, int photcode, int *nstars) {
     15Stars *get2mass_AS_data (SkyRegion *region, char *filename, SkyRegion *patch, int photcode, int *nstars) {
    1616 
    1717  int FilterSkip, TimeSkip;
    … …  
    2020  gzFile gf;
    2121  char qc;
    22   char *buffer, *filename;
     22  char *buffer;
    2323  char *p, *q, *ptr, *tmp;
    2424  double RA, DEC, M, dM;
    … …  
    5555  if (!FilterSkip) Shutdown ("invalid photcode %s", GetPhotcodeNamebyCode(photcode));
    5656
    57   // filename = (char *) region[0].filename;
    5857  gf = gzopen (filename, "rb");
    5958  if (gf == NULL) Shutdown ("can't read 2mass data file: %s", filename);
  • trunk/Ohana/src/addstar/src/get2mass_dr2.c

    r5945 r6424  
    55# define NLINE 30000
    66
    7 Stars *get2mass_2DR_data (SkyRegion *region, SkyRegion *patch, int photcode, int *nstars) {
     7Stars *get2mass_2DR_data (SkyRegion *region, char *filename, SkyRegion *patch, int photcode, int *nstars) {
    88 
    99  int i, Nstars, NSTARS, Nbyte, Nline;
    1010  Stars *stars;
    1111  gzFile gf;
    12   char *buffer, *filename;
     12  char *buffer;
    1313  char line[303];
    1414  double RA, DEC, J, H, K, dJ, dH, dK;
    … …  
    2727  fprintf (stderr, "overlap: %f - %f, %f - %f\n", RA0, RA1, DEC0, DEC1);
    2828
    29   // XXX get from args
    30   // filename = (char *) region[0].filename;
    3129  gf = gzopen (filename, "rb");
    3230  if (gf == NULL) Shutdown ("can't read 2mass data file: %s", filename);
Note: See TracChangeset for help on using the changeset viewer.