IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6641


Ignore:
Timestamp:
Mar 18, 2006, 5:24:44 PM (20 years ago)
Author:
eugene
Message:

various bugs introduced with skyregions

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

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/addstar/src/SkyListForStars.c

    r5443 r6641  
    44 
    55  int i, j, Nr, NR;
    6   SkyRegion *region;
     6  SkyList *here;
    77  SkyList *list;
    88 
     
    1111  ALLOCATE (list, SkyList, 1);
    1212  ALLOCATE (list[0].regions,  SkyRegion *, NR);
     13  ALLOCATE (list[0].filename, char *, NR);
    1314  list[0].Nregions = Nr;
    1415
     
    1617  for (i = 0; i < Nstars; i++) {
    1718    if (stars[i].found) continue;
    18     region = SkyRegionByPoint (table, depth, stars[i].R, stars[i].D);
     19    here = SkyRegionByPoint (table, depth, stars[i].R, stars[i].D);
    1920    stars[i].found = TRUE;
    2021    /* search forward for all contained stars */
    2122    for (j = i; j < Nstars; j++) {
    22       if (stars[j].R >= region[0].Rmax) break;
    23       if (stars[j].D <  region[0].Dmin) continue;
    24       if (stars[j].D >= region[0].Dmax) continue;
     23      if (stars[j].R >= here[0].regions[0][0].Rmax) break;
     24      if (stars[j].R <  here[0].regions[0][0].Rmin) break;
     25      if (stars[j].D <  here[0].regions[0][0].Dmin) continue;
     26      if (stars[j].D >= here[0].regions[0][0].Dmax) continue;
    2527      stars[j].found = TRUE;
    2628    }
    27     list[0].regions[Nr] = region;
     29    list[0].regions[Nr] = here[0].regions[0];
     30    list[0].filename[Nr] = here[0].filename[0];
     31    SkyListFree (here, FALSE);
    2832    Nr ++;
    29     CHECK_REALLOCATE (list[0].regions, SkyRegion *, NR, Nr, 100);
     33    if (Nr >= NR) {
     34        NR += 32;
     35        REALLOCATE (list[0].regions, SkyRegion *, NR);
     36        REALLOCATE (list[0].filename, char *, NR);
     37    }
    3038    list[0].Nregions = Nr;
    3139  }
  • trunk/Ohana/src/addstar/src/get2mass.c

    r6424 r6641  
    9494
    9595    Nregions ++;
    96     CHECK_REALLOCATE (regions, SkyRegion, NREGIONS, Nregions, 20);
    97     CHECK_REALLOCATE (filenames, char *, NREGIONS, Nregions, 20);
     96    if (Nregions >= NREGIONS) {
     97        NREGIONS += 20;
     98        REALLOCATE (regions, SkyRegion, NREGIONS);
     99        REALLOCATE (filenames, char *, NREGIONS);
     100    }
    98101  }   
    99102  fclose (f);
  • trunk/Ohana/src/addstar/src/rfits.c

    r5900 r6641  
    4040  return (NULL);
    4141}
     42
     43// **** this needs to be fixed to handle MEF smp files...
     44// there will be multiple extension names, how will these get passed?
Note: See TracChangeset for help on using the changeset viewer.