Changeset 8496
- Timestamp:
- Aug 22, 2006, 4:43:45 PM (20 years ago)
- Location:
- trunk/Ohana/src/gastro2
- Files:
-
- 1 added
- 4 deleted
- 13 edited
-
Makefile (modified) (4 diffs)
-
include/gastro2.h (modified) (4 diffs)
-
src/ConfigInit.c (modified) (3 diffs)
-
src/extr2mass.c (deleted)
-
src/gcatalog.c (deleted)
-
src/getgsc.c (added)
-
src/getptolemy.c (modified) (5 diffs)
-
src/getusno.c (modified) (3 diffs)
-
src/getusnob.c (modified) (8 diffs)
-
src/gfit2.c (modified) (1 diff)
-
src/gptolemy2.c (deleted)
-
src/greference2.c (modified) (4 diffs)
-
src/gregions2.c (deleted)
-
src/lumfunc.c (modified) (2 diffs)
-
src/misc.c (modified) (2 diffs)
-
src/plots.c (modified) (2 diffs)
-
src/plotstuff.c (modified) (1 diff)
-
src/polyfit.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/gastro2/Makefile
r8300 r8496 29 29 30 30 GASTRO = \ 31 $(SRC)/getptolemy.$(ARCH).o \32 $(SRC)/gptolemy2.$(ARCH).o \33 31 $(SRC)/plots.$(ARCH).o \ 34 32 $(SRC)/gheader2.$(ARCH).o \ … … 42 40 $(SRC)/grid.$(ARCH).o \ 43 41 $(SRC)/lumfunc.$(ARCH).o \ 44 $(SRC)/gregions2.$(ARCH).o \45 42 $(SRC)/sort.$(ARCH).o \ 46 43 $(SRC)/misc.$(ARCH).o \ … … 52 49 $(SRC)/getusno.$(ARCH).o \ 53 50 $(SRC)/getusnob.$(ARCH).o \ 54 $(SRC)/gcatalog.$(ARCH).o \ 51 $(SRC)/getptolemy.$(ARCH).o \ 52 $(SRC)/getgsc.$(ARCH).o \ 55 53 $(SRC)/remove_clumps.$(ARCH).o \ 56 54 $(SRC)/rfits.$(ARCH).o \ 57 55 $(SRC)/rtext.$(ARCH).o 56 57 #$(SRC)/gptolemy2.$(ARCH).o \ 58 #$(SRC)/gregions2.$(ARCH).o \ 58 59 59 60 OBJ = $(GASTRO) … … 64 65 65 66 $(GASTRO): $(INC)/gastro2.h 66 67 extr2mass: $(2MASS)68 $(CC) $(2MASS) -o $(BIN)/extr2mass.linux $(CCFLAGS)69 67 70 68 coordtest: $(COORDTEST) -
trunk/Ohana/src/gastro2/include/gastro2.h
r8241 r8496 93 93 int FLIPX, FLIPY; 94 94 int NPOLYTERMS; 95 char CDROM[256];96 char USNO_B_DIR[256];97 95 char CATDIR[256]; 98 96 char CATMODE[16]; /* raw, mef, split, mysql */ … … 117 115 double F_DEC; 118 116 119 char GSCFILE[256], GSC_DIR[256], LONEOS_REGION_FILE[256];120 char TWO_MASS_DIR[256];121 117 double ASEC_PIX; 122 118 char ROUGH_ASTROMETRY[64]; 119 120 /* locations for reference data */ 121 char GSCFILE[256]; 122 char GSCDIR[256]; 123 char CATDIR[256]; 124 char USNO_A_DIR[256]; 125 char USNO_B_DIR[256]; 126 char TWO_MASS_CATDIR[256]; 127 char ASTROM_CATDIR[256]; 128 char LONEOS_REGION_FILE[256]; 123 129 124 130 typedef struct { … … 143 149 void ahelp (); 144 150 void area_of_region (CatStats *region); 151 double area_of_skyregion (SkyRegion *region); 145 152 void args (int *argc, char **argv, Coords *coords); 146 153 void define_region (CatStats *catstats, CmpCatalog *Target); … … 182 189 int mk_vector (int n, int m, int norder); 183 190 int open_graph (int N); 191 184 192 void pair_add (int i1, int i2); 185 193 void pair_init (); 194 int pair_lists (int **index1, int **index2); 195 186 196 int parse_GSC_line (CatStats *tregion, char *line); 187 197 int plot_addpt_gridplot (double x, double y); -
trunk/Ohana/src/gastro2/src/ConfigInit.c
r8241 r8496 15 15 if (VERBOSE) fprintf (stderr, "loaded config file: %s\n", file); 16 16 17 GASTRO_MAX_NSTARS = 300; 17 18 ScanConfig (config, "OFFSET_RADIUS", "%lf", 0, &SEARCH_RADIUS); 18 19 ScanConfig (config, "MIN_MATCHES", "%d", 0, &MIN_MATCHES); … … 34 35 ScanConfig (config, "POLAR_ALIGNMENT", "%d", 0, &POLAR_ALIGNMENT); 35 36 ScanConfig (config, "GSCFILE", "%s", 0, GSCFILE); 36 ScanConfig (config, "GSCDIR", "%s", 0, GSC_DIR);37 ScanConfig (config, "2MASS_DIR", "%s", 0, TWO_MASS_DIR);38 37 ScanConfig (config, "POLAR_AXIS_RA", "%lf", 0, &POLE_RA); 39 38 ScanConfig (config, "POLAR_AXIS_DEC", "%lf", 0, &POLE_DEC); … … 41 40 ScanConfig (config, "DEC_OFFSET", "%lf", 0, &DEC_OFFSET); 42 41 ScanConfig (config, "LONEOS_REGIONS", "%s", 0, LONEOS_REGION_FILE); 43 ScanConfig (config, "USNO_CDROM", "%s", 0, CDROM); 42 43 /* possible sources of astrometric reference data */ 44 if (!ScanConfig (config, "USNO_A_DIR", "%s", 0, USNO_A_DIR)) { 45 ScanConfig (config, "USNO_CDROM", "%s", 0, USNO_A_DIR); 46 } 44 47 ScanConfig (config, "USNO_B_DIR", "%s", 0, USNO_B_DIR); 48 ScanConfig (config, "ASTROM_CATDIR", "%s", 0, ASTROM_CATDIR); 49 ScanConfig (config, "2MASS_CATDIR", "%s", 0, TWO_MASS_CATDIR); 50 ScanConfig (config, "GSCDIR", "%s", 0, GSCDIR); 51 45 52 ScanConfig (config, "ASTRO_REFCAT", "%s", 0, REFCAT); 46 53 ScanConfig (config, "CATDIR", "%s", 0, CATDIR); -
trunk/Ohana/src/gastro2/src/getptolemy.c
r7973 r8496 1 1 # include "gastro2.h" 2 double catalog_area (Average *average, int Naverage, SkyRegion *region); 2 3 3 4 int getptolemy (CatStats *catstats, RefCatalog *Ref) { 4 5 5 int i, j, k, Ns , Nptolemy, Nregions;6 int i, j, k, Ns; 6 7 double FracArea; 7 GSCdata *ptolemy; 8 CatStats *regions; 8 Catalog catalog; 9 SkyList *skylist; 10 SkyTable *sky; 11 SkyRegion patch; 9 12 10 13 Ref[0].N = 0; … … 12 15 ALLOCATE (Ref[0].stars, StarData, 1); 13 16 14 regions = gregions (catstats, &Nregions); 17 patch.Rmin = catstats[0].RA[0]; 18 patch.Rmax = catstats[0].RA[1]; 19 patch.Dmin = catstats[0].DEC[0]; 20 patch.Dmax = catstats[0].DEC[1]; 21 22 /* load regions from GSC table, restrict to patch */ 23 sky = SkyTableFromGSC (GSCFILE, 3, VERBOSE); 24 SkyTableSetFilenames (sky, CATDIR, "cpt"); 25 skylist = SkyListByPatch (sky, -1, &patch); 15 26 16 for (i = 0; i < Nregions; i++) { 17 ptolemy = gptolemy (regions[i].name, &Nptolemy); 18 if (Nptolemy == 0) continue; 27 for (i = 0; i < skylist[0].Nregions; i++) { 28 // set the parameters which guide catalog open/load/create 29 catalog.filename = skylist[0].filename[i]; 30 catalog.catflags = LOAD_AVES | LOAD_MEAS; 31 catalog.Nsecfilt = 0; 19 32 20 // XXX this measurement adjusts a DVO database for 21 // partial coverage; the correction is bogus if the 22 // sky density of the catalog is too low (<< 100 stars 23 // per field 33 // an error exit status here is a significant error 34 if (!dvo_catalog_open (&catalog, skylist[0].regions[i], VERBOSE, "w")) { 35 fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename); 36 exit (2); 37 } 38 dvo_catalog_unlock (&catalog); 39 40 // Nave_disk == 0 implies an empty catalog file 41 // for only_match, skip empty catalogs 42 if (!catalog.Nave_disk) { 43 dvo_catalog_free (&catalog); 44 continue; 45 } 46 47 // this measurement adjusts a DVO database for partial coverage 48 // XXX the correction is bogus if the sky density of the catalog 49 // is too low (<< 100 stars per field) 24 50 FracArea = 1.0; 25 51 if (PTOLEMY_FILL_FACTOR) { 26 FracArea = ptolemy_area (ptolemy, Nptolemy, ®ions[i]);52 FracArea = catalog_area (catalog.average, catalog.Naverage, skylist[0].regions[i]); 27 53 } 28 54 29 55 Ns = Ref[0].N; 30 Ref[0].N += Nptolemy;31 Ref[0].Area += regions[i].Area * FracArea;56 Ref[0].N += catalog.Naverage; 57 Ref[0].Area += FracArea * area_of_skyregion (skylist[0].regions[i]); 32 58 33 59 REALLOCATE (Ref[0].stars, StarData, MAX (1, Ref[0].N)); 34 for (k = Ns, j = 0; j < Nptolemy; k++, j++) {35 Ref[0].stars[k].R = ptolemy[j].R;36 Ref[0].stars[k].D = ptolemy[j].D;37 Ref[0].stars[k].M = ptolemy[j].M;60 for (k = Ns, j = 0; j < catalog.Naverage; k++, j++) { 61 Ref[0].stars[k].R = catalog.average[j].R; 62 Ref[0].stars[k].D = catalog.average[j].D; 63 Ref[0].stars[k].M = catalog.measure[catalog.average[j].offset].M_PS; 38 64 } 39 free (ptolemy);65 dvo_catalog_free (&catalog); 40 66 } 41 67 … … 52 78 } 53 79 54 double ptolemy_area (GSCdata *ptolemy, int N, CatStats *patch) {80 double catalog_area (Average *average, int Naverage, SkyRegion *region) { 55 81 56 82 int i, xb, yb, Nb; … … 58 84 double frac, Rmin, Rmax, Dmin, Dmax, dR, dD; 59 85 60 Rmin = patch[0].RA[0];61 Rmax = patch[0].RA[1];62 Dmin = patch[0].DEC[0];63 Dmax = patch[0].DEC[1];86 Rmin = region[0].Rmin; 87 Rmax = region[0].Rmax; 88 Dmin = region[0].Dmin; 89 Dmax = region[0].Dmax; 64 90 dR = Rmax - Rmin; 65 91 dD = Dmax - Dmin; … … 71 97 } 72 98 73 for (i = 0; i < N ; i++) {74 xb = MAX (MIN (0, 10 * ( ptolemy[i].R - Rmin) / dR), 9);75 yb = MAX (MIN (0, 10 * ( ptolemy[i].D - Dmin) / dD), 9);99 for (i = 0; i < Naverage; i++) { 100 xb = MAX (MIN (0, 10 * (average[i].R - Rmin) / dR), 9); 101 yb = MAX (MIN (0, 10 * (average[i].D - Dmin) / dD), 9); 76 102 bin[xb][yb] ++; 77 103 } -
trunk/Ohana/src/gastro2/src/getusno.c
r6242 r8496 15 15 float hours[100]; 16 16 int start[100], number[100], *buffer, *buf; 17 char filename[128] , c;17 char filename[128]; 18 18 FILE *f; 19 19 double DEC1; … … 49 49 } 50 50 if (disk < 0) { 51 fprintf (stderr, "ERROR: can't find cdromfor spd %d\n", spd);51 fprintf (stderr, "ERROR: can't find USNO zone for spd %d\n", spd); 52 52 exit (0); 53 53 } 54 54 55 55 /* load accelerator file */ 56 sprintf (filename, "%s/zone%04d.acc", CDROM, spd);56 sprintf (filename, "%s/zone%04d.acc", USNO_A_DIR, spd); 57 57 fprintf (stderr, "reading from %s\n", filename); 58 58 f = fopen (filename, "r"); 59 59 if (f == (FILE *) NULL) { 60 fprintf (stderr, "can't open file %s, is cdrom %d in drive?\n", filename, disk); 61 fprintf (stderr, "press return when ready to continue: "); 62 fscanf (stdin, "%c", &c); 63 fprintf (stderr, "trying again...\n"); 64 f = fopen (filename, "r"); 65 if (f == (FILE *) NULL) { 66 fprintf (stderr, "ERROR: can't open file %s, is cdrom %d in drive?\n", filename, disk); 67 exit (1); 68 } 60 fprintf (stderr, "ERROR: can't open accelerator file %s\n", filename); 61 exit (1); 69 62 } 70 63 for (i = 0; fscanf (f, "%f %d %d", &hours[i], &start[i], &number[i]) != EOF; i++); … … 84 77 85 78 /* open data file */ 86 sprintf (filename, "%s/zone%04d.cat", CDROM, spd);79 sprintf (filename, "%s/zone%04d.cat", USNO_A_DIR, spd); 87 80 fprintf (stderr, "reading from %s\n", filename); 88 81 f = fopen (filename, "r"); -
trunk/Ohana/src/gastro2/src/getusnob.c
r6426 r8496 1 1 # include "gastro2.h" 2 2 # define NZONE 180 3 # define NBYTE 4 4 # define NELEM 20 3 5 4 6 int getusnob (CatStats *catstats, RefCatalog *Ref, double epoch) { … … 8 10 float hours[100]; 9 11 int start[100], number[100], *buffer, *buf; 10 char filename[128] , c;12 char filename[128]; 11 13 FILE *f; 12 14 double DEC1; … … 14 16 float mB1, mB2, mR1, mR2, mB, mR; 15 17 int iDEC0, iDEC1, iRA0, iRA1; 16 int spd, spd_start, spd_end , disk;18 int spd, spd_start, spd_end; 17 19 int NUSNO, Nusno, Nstars; 18 20 StarData *stars; … … 42 44 /* load accelerator file */ 43 45 sprintf (filename, "%s/%03d/b%04d.acc", USNO_B_DIR, (int)(spd/10), spd); 44 fprintf (stderr, "reading from %s\n", filename);46 if (VERBOSE) fprintf (stderr, "reading from %s\n", filename); 45 47 f = fopen (filename, "r"); 46 48 if (f == (FILE *) NULL) { 47 fprintf (stderr, "can't open file %s, is cdrom %d in drive?\n", filename, disk); 48 fprintf (stderr, "press return when ready to continue: "); 49 fscanf (stdin, "%c", &c); 50 fprintf (stderr, "trying again...\n"); 51 f = fopen (filename, "r"); 52 if (f == (FILE *) NULL) { 53 fprintf (stderr, "ERROR: can't open file %s, is cdrom %d in drive?\n", filename, disk); 54 exit (1); 55 } 49 fprintf (stderr, "ERROR: can't open accelerator file %s\n", filename); 50 exit (1); 56 51 } 57 52 for (i = 0; fscanf (f, "%f %d %d", &hours[i], &start[i], &number[i]) != EOF; i++); … … 71 66 72 67 /* open data file */ 73 sprintf (filename, "%s/ zone%04d.cat", CDROM, spd);74 fprintf (stderr, "reading from %s\n", filename);68 sprintf (filename, "%s/%03d/b%04d.cat", USNO_B_DIR, (int)(spd/10), spd); 69 if (VERBOSE) fprintf (stderr, "reading from %s\n", filename); 75 70 f = fopen (filename, "r"); 76 71 if (f == (FILE *) NULL) { … … 79 74 } 80 75 76 /** USNO-B consists of 20 x 4byte (int) records **/ 81 77 /* advance file pointer to first slice */ 82 /**** 80 is record-length for USNO-B ****/ 83 offset = 80*sizeof(int)*(start[first] - 1); 78 offset = NELEM*NBYTE*(start[first] - 1); 84 79 fseek (f, offset, SEEK_SET); 85 80 … … 89 84 Nstars += number[bin]; 90 85 } 91 Nitems = 80*Nstars/4; /* number of integer blocks; need to use Fread for byte-swapping read */86 Nitems = NELEM*Nstars; /* number of integer blocks; need to use Fread for byte-swapping read */ 92 87 93 88 /* allocate space for stars in segment */ 94 89 ALLOCATE (buffer, int, Nitems); 95 nitems = Fread (buffer, sizeof(int), Nitems, f, "int"); 90 // data has the WRONG byte order? 91 // nitems = Fread (buffer, sizeof(int), Nitems, f, "int"); 92 nitems = fread (buffer, sizeof(int), Nitems, f); 96 93 if (nitems != Nitems) { 97 94 fprintf (stderr, "ERROR: failure reading data from file %s\n", filename); … … 101 98 buf = buffer; 102 99 /* print out data from slice within RA and DEC range */ 103 for (i = 0; i < Nstars; i++, buf +=20) {100 for (i = 0; i < Nstars; i++, buf += NELEM) { 104 101 if (buf[0] < iRA0) continue; 105 102 if (buf[0] > iRA1) continue; -
trunk/Ohana/src/gastro2/src/gfit2.c
r8241 r8496 76 76 if (PLOTSTUFF) fprintf (stderr, "ploting resid (2)\n"); 77 77 plot_resid_init (0, (double) Target[0].header.Naxis[0]); 78 plot_resid_init (1, (double) Target[0].header.Naxis[1]); 78 // XXX test: plotting fit_apply and RD_to_XY results plot_resid_init (1, (double) Target[0].header.Naxis[1]); 79 plot_resid_init (1, (double) Target[0].header.Naxis[0]); 79 80 if (PLOTSTUFF) plot_resid (st, sr, &Target[0].coords); 80 81 free (idx1); -
trunk/Ohana/src/gastro2/src/greference2.c
r8241 r8496 29 29 /* get stars from 2MASS for the given region -- add PHOTCODE check? */ 30 30 if (!strcasecmp (REFCAT, "2MASS")) { 31 strcpy (CATDIR, TWO_MASS_ DIR);31 strcpy (CATDIR, TWO_MASS_CATDIR); 32 32 getptolemy (&catstats, Ref); 33 /* get2mass (&catstats, Ref); */34 33 } 35 34 36 35 /* get stars from the DVO CATDIR for the given region */ 37 36 if (!strcasecmp (REFCAT, "PTOLEMY")) { 37 strcpy (CATDIR, ASTROM_CATDIR); 38 38 getptolemy (&catstats, Ref); 39 39 } … … 44 44 } 45 45 46 Ref[0].lum.Mz = (2 + log (Ref[0].Area) / log (10.) - Ref[0].lum.Mo) / Ref[0].lum.dNdM; 47 Target[0].lum.Mz = (2 + log (Target[0].Area) / log (10.) - Target[0].lum.Mo) / Target[0].lum.dNdM; 48 Ref[0].Moff = Target[0].lum.Mz - Ref[0].lum.Mz; 49 fprintf (stderr, "mag offset: %f (Areas: %f vs %f)\n", Ref[0].Moff, Target[0].Area, Ref[0].Area); 46 { 47 double Mref, Mtar, logRho; 48 49 /* what is the offset between the two lines at the average magnitude? */ 50 Mref = 0.5*(Ref[0].lum.Mmin + Ref[0].lum.Mmax); 51 logRho = Mref * Ref[0].lum.dNdM + Ref[0].lum.Mo - log10(Ref[0].Area); 52 Mtar = (logRho + log10(Ref[0].Area) - Target[0].lum.Mo) / Target[0].lum.dNdM; 53 54 Ref[0].lum.Mz = Mref; 55 Target[0].lum.Mz = Mtar; 56 Ref[0].Moff = Target[0].lum.Mz - Ref[0].lum.Mz; 57 fprintf (stderr, "mag offset: %f (Areas: %f vs %f; log(Rho): %f @ %f mags)\n", Ref[0].Moff, Target[0].Area, Ref[0].Area, logRho, Mref); 58 } 50 59 51 60 if (PLOTSTUFF) plot_lumfunc (Target, Ref); … … 79 88 } 80 89 90 catstats[0].RA[0] = 360.0; 91 catstats[0].RA[1] = 0.0; 92 catstats[0].DEC[0] = +90.0; 93 catstats[0].DEC[1] = -90.0; 94 81 95 for (x = 0; x <= 1.0; x += 0.5) { 82 96 for (y = 0; y <= 1.0; y += 0.5) { … … 98 112 /* is a pole in the image? if so, include it... */ 99 113 status = RD_to_XY (&X, &Y, 0.0, 90.0, &Target[0].coords); 100 if (status) catstats[0].DEC[1] = 90.0; 101 114 if (status) { 115 if (fabs(X - NX*0.5) < (NFIELD + 0.5)*NX) goto not_north; 116 if (fabs(Y - NY*0.5) < (NFIELD + 0.5)*NY) goto not_north; 117 catstats[0].DEC[1] = 90.0; 118 } 119 not_north: 120 102 121 status = RD_to_XY (&X, &Y, 0.0, -90.0, &Target[0].coords); 103 if (status) catstats[0].DEC[0] = -90.0; 122 if (status) { 123 if (fabs(X - NX*0.5) < (NFIELD + 0.5)*NX) goto not_south; 124 if (fabs(Y - NY*0.5) < (NFIELD + 0.5)*NY) goto not_south; 125 catstats[0].DEC[0] = -90.0; 126 } 127 not_south: 104 128 105 129 if (VERBOSE) fprintf (stderr, "full region: %f - %f, %f - %f\n", -
trunk/Ohana/src/gastro2/src/lumfunc.c
r8300 r8496 9 9 int get_luminosity_func (StarData *stars, int N, LumStats *lum) { 10 10 11 int i, j, Nb ;11 int i, j, Nb, peaki, peakn; 12 12 double mbin[NMBIN]; 13 13 double bin[NMBIN], lbin[NMBIN], rbin[NMBIN]; … … 28 28 } 29 29 30 /* find peak bin */ 31 peaki = 0; 32 peakn = mbin[0]; 33 for (i = 0; i < NMBIN; i++) { 34 if (mbin[i] > peakn) { 35 peaki = i; 36 peakn = mbin[i]; 37 } 38 } 39 30 40 /* select filled bins */ 31 for (Nb = i = 0; i < NMBIN; i++) {41 for (Nb = i = 0; i < peaki; i++) { 32 42 if (mbin[i] > 0) { 33 43 bin[Nb] = i * dM + MMIN; -
trunk/Ohana/src/gastro2/src/misc.c
r2442 r8496 35 35 } 36 36 37 /***** convert [-]00:00:00 to 0.0000 ****/38 int dms_to_ddd (double *Value, char *string) {39 40 int valid, neg, status;41 double tmp, value;42 char *p1, *p2, *px;43 44 valid = FALSE;45 neg = FALSE;46 stripwhite (string);47 p1 = string;48 px = string + strlen(string);49 50 if (string[0] == '-') {51 valid = TRUE;52 neg = TRUE;53 p1 = &string[1];54 }55 if (string[0] == '+') {56 valid = TRUE;57 neg = FALSE;58 p1 = &string[1];59 }60 if (isdigit(string[0])) {61 valid = TRUE;62 p1 = &string[0];63 }64 if (!valid) { return (FALSE); }65 66 status = 1;67 tmp = strtod (p1, &p2);68 if (p2 == p1) return (FALSE); /* entry not a number: +fred */69 value = tmp;70 if (p2 == px) goto escape; /* entry only number: +1.0 */71 p1 = p2 + 1;72 73 tmp = strtod (p1, &p2);74 if (p2 == p1) goto escape; /* entry not a number: +1:fred */75 status = 2;76 value += tmp / 60.0;77 if (p2 == px) goto escape; /* entry only number: +1:1 */78 p1 = p2 + 1;79 80 tmp = strtod (p1, &p2);81 if (p2 == p1) goto escape; /* entry not a number: +1:1:fred */82 value += tmp / 3600.0;83 84 escape:85 if (neg) {86 value *= -1;87 }88 *Value = value;89 90 return (status);91 }92 93 /**********/94 int str_to_radec (double *ra, double *dec, char *str1, char *str2) {95 96 double Ra, Dec;97 98 *ra = *dec = 0;99 switch (dms_to_ddd (&Ra, str1)) {100 case 0:101 fprintf (stderr, "syntax error in RA\n");102 return (FALSE);103 case 1:104 break;105 case 2:106 Ra = Ra * 15;107 break;108 }109 switch (dms_to_ddd (&Dec, str2)) {110 case 0:111 fprintf (stderr, "syntax error in DEC\n");112 return (FALSE);113 case 1:114 case 2:115 break;116 }117 *ra = Ra;118 *dec = Dec;119 return (TRUE);120 }121 122 37 void area_of_region (CatStats *region) { 123 38 … … 126 41 area = DEG_RAD*(region[0].RA[1] - region[0].RA[0])*(sin(region[0].DEC[1]*RAD_DEG) - sin(region[0].DEC[0]*RAD_DEG)); 127 42 region[0].Area = area; 43 } 44 45 double area_of_skyregion (SkyRegion *region) { 46 47 double area; 48 49 area = DEG_RAD*(region[0].Rmax - region[0].Rmin)*(sin(region[0].Dmax*RAD_DEG) - sin(region[0].Dmin*RAD_DEG)); 50 return (area); 128 51 } 129 52 -
trunk/Ohana/src/gastro2/src/plots.c
r8300 r8496 359 359 RD_to_XY (&x, &y, sr[idx2[i]].R, sr[idx2[i]].D, coords); 360 360 361 dx = x - st[idx1[i]].X;362 dy = y - st[idx1[i]].Y;361 dx = st[idx1[i]].X - x; 362 dy = st[idx1[i]].Y - y; 363 363 364 364 xvect0[i] = st[idx1[i]].X; … … 381 381 fit_apply (&x, &y, st[idx1[i]].X, st[idx1[i]].Y); 382 382 383 dx = 5.0*(x - sr[idx2[i]].P);384 dy = 5.0*(y - sr[idx2[i]].Q);383 dx = (x - sr[idx2[i]].P)/coords[0].cdelt1; 384 dy = (y - sr[idx2[i]].Q)/coords[0].cdelt2; 385 385 386 386 xvect0[i] = st[idx1[i]].X; -
trunk/Ohana/src/gastro2/src/plotstuff.c
r4772 r8496 37 37 status = listen (InitSocket, 1); 38 38 39 sprintf (temp, "kapa %s &", socket_name);39 sprintf (temp, "kapa %s -name %d &", socket_name, N); 40 40 # ifndef DEBUG 41 41 system (temp); -
trunk/Ohana/src/gastro2/src/polyfit.c
r8300 r8496 237 237 int fit_adjust (Coords *coords) { 238 238 239 int i , j, N;240 double a 00, a10, a01, a20, a11, a02, a30, a21, a12, a03, dA;241 double b 00, b10, b01, b20, b11, b02, b30, b21, b12, b03, dB;239 int i; 240 double a10, a01, a20, a11, a02, a30, a21, a12, a03; 241 double b10, b01, b20, b11, b02, b30, b21, b12, b03; 242 242 double Xo, Yo, det; 243 int Np, Nv;244 243 double **A, **B, Fx, Fy; 245 244
Note:
See TracChangeset
for help on using the changeset viewer.
