IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6426


Ignore:
Timestamp:
Feb 14, 2006, 6:28:31 AM (20 years ago)
Author:
eugene
Message:

fixed bugs in gastro2

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

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/gastro2/Makefile

    r5242 r6426  
    4545$(SRC)/greference2.$(ARCH).o \
    4646$(SRC)/getusno.$(ARCH).o \
     47$(SRC)/getusnob.$(ARCH).o \
    4748$(SRC)/gcatalog.$(ARCH).o \
    4849$(SRC)/remove_clumps.$(ARCH).o \
  • trunk/Ohana/src/gastro2/include/gastro2.h

    r6242 r6426  
    174174int       getptolemy (CatStats *catstats, RefCatalog *Ref);
    175175int       getusno (CatStats *catstats, RefCatalog *Ref);
     176int       getusnob (CatStats *catstats, RefCatalog *Ref, double epoch);
    176177int       get2mass (CatStats *catstats, RefCatalog *Ref);
    177178int       getgsc (CatStats *catstats, RefCatalog *Ref);
  • trunk/Ohana/src/gastro2/src/getusnob.c

    r6242 r6426  
    22# define NZONE 180
    33
    4 int getusno (CatStats *catstats, RefCatalog *Ref, double epoch) {
     4int getusnob (CatStats *catstats, RefCatalog *Ref, double epoch) {
    55
    66  long int offset;
    77  int i, bin, first, last, nitems, Nitems, Nbins;
    88  float hours[100];
    9   int start[100], number[100], *buffer, *ibuf;
    10   char filename[128], c, *cbuf;
     9  int start[100], number[100], *buffer, *buf;
     10  char filename[128], c;
    1111  FILE *f;
    1212  double DEC1;
     13  double uR, uD;
     14  float mB1, mB2, mR1, mR2, mB, mR;
    1315  int iDEC0, iDEC1, iRA0, iRA1;
    1416  int spd, spd_start, spd_end, disk;
    15   int NUSNO, Nusno;
     17  int NUSNO, Nusno, Nstars;
    1618  StarData *stars;
    1719
     
    9799    }
    98100
    99     ibuf = buffer;
     101    buf = buffer;
    100102    /* print out data from slice within RA and DEC range */
    101     for (i = 0; i < Nstars; i++, buf+=80) {
     103    for (i = 0; i < Nstars; i++, buf+=20) {
    102104      if (buf[0] < iRA0) continue;
    103105      if (buf[0] > iRA1) continue;
     
    105107      if (buf[1] > iDEC1) continue;
    106108     
     109      bzero (&stars[Nusno], sizeof(StarData));
    107110      stars[Nusno].R = buf[0]/360000.0;
    108111      stars[Nusno].D = buf[1]/360000.0 - 90.0;
    109112     
    110       uR = (buf[2] % 10000) / 3600.0 * 0.002;
    111       uD = ((buf[2] / 10000) % 10000) / 3600.0 * 0.002;
     113      uR = (buf[2] % 10000);
     114      uR = (uR - 5000.0) * 0.002 / 3600.0;
     115      uD = ((buf[2] / 10000) % 10000);
     116      uD = (uD - 5000.0) * 0.002 / 3600.0;
    112117
    113118      /* 1st blue mag */
     
    135140      stars[Nusno].R += uR*(epoch - 2000.0);
    136141      stars[Nusno].D += uD*(epoch - 2000.0);
    137 
    138142      Nusno ++;
    139       if (Nusno == NUSNO) {
    140         NUSNO += 5000;
    141         REALLOCATE (stars, StarData, NUSNO);
    142       }   
    143       free (buffer);
     143      CHECK_REALLOCATE (stars, StarData, NUSNO, Nusno, 5000);
    144144    }
     145    free (buffer);
    145146    fclose (f);
    146147  }
  • trunk/Ohana/src/gastro2/src/greference2.c

    r6242 r6426  
    1818  /* get stars from the USNO B catalog for the given region */
    1919  if (!strcmp (REFCAT, "USNOB")) {
    20     getusnob (&catstats, Ref, EPOCH);
     20    getusnob (&catstats, Ref, 2000.0);
    2121    /* calculate Ref[0].Moff from Target & Ref dMdN, Mo */
    2222  }
Note: See TracChangeset for help on using the changeset viewer.