Changeset 5448 for trunk/Ohana/src/opihi
- Timestamp:
- Oct 27, 2005, 10:38:30 AM (21 years ago)
- Location:
- trunk/Ohana/src/opihi/dvo
- Files:
-
- 14 edited
-
catalog.c (modified) (1 diff)
-
dmt.c (modified) (4 diffs)
-
extract.c (modified) (1 diff)
-
gcat.c (modified) (4 diffs)
-
gstar.c (modified) (2 diffs)
-
imdata.c (modified) (5 diffs)
-
init.c (modified) (3 diffs)
-
lcat.c (modified) (5 diffs)
-
lcurve.c (modified) (3 diffs)
-
lightcurve.c (modified) (3 diffs)
-
pcat.c (modified) (1 diff)
-
pmeasure.c (modified) (4 diffs)
-
region_list.c (modified) (3 diffs)
-
subpix.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/dvo/catalog.c
r5320 r5448 9 9 # define MISSCALE 2 10 10 11 // XXX EAM : should this function be dropped? 11 12 int catlog (int argc, char **argv) { 12 13 -
trunk/Ohana/src/opihi/dvo/dmt.c
r5320 r5448 4 4 int dmt (int argc, char **argv) { 5 5 6 int i, m, k, N, N regions, Ngraph, SaveVectors;6 int i, m, k, N, Ngraph, SaveVectors; 7 7 int Ns, Nsec, NPTS; 8 8 char catdir[256], filename[256]; … … 13 13 Catalog catalog; 14 14 Graphdata graphmode, graphsky; 15 RegionFile *regions; 15 SkyTable *sky; 16 SkyList *skylist; 16 17 Vector Xvec, Yvec, Zvec, Rvec, Dvec; 17 18 Vector *vec1, *vec2, *vec3, *vec4, *vec5; … … 53 54 Ns = GetPhotcodeNsec (code[0].code); 54 55 56 /* load sky from correct table */ 57 sky = SkyTableLoadOptimal (CATDIR, SKY_TABLE, GSCFILE, -1, VERBOSE); 58 SkyTableSetFilenames (sky, CATDIR, "cpt"); 59 55 60 Radius = MAX (fabs(graphsky.xmax), fabs(graphsky.ymax)); 56 regions = find_regions (graphsky.coords.crval1, graphsky.coords.crval2, Radius, &Nregions);61 skylist = SkyListByRadius (sky, -1, graphsky.coords.crval1, graphsky.coords.crval2, Radius); 57 62 58 63 N = 0; … … 66 71 } 67 72 68 for (k = 0; k < Nregions; k++) {73 for (k = 0; k < skylist[0].Nregions; k++) { 69 74 70 sprintf (filename, "%s/%s", catdir, regions[k].name);71 75 /* lock, load, unlock catalog */ 72 catalog.filename = filename;76 catalog.filename = skylist[0].regions[k][0].filename; 73 77 switch (lock_catalog (&catalog, LCK_SOFT)) { 74 78 case 2: -
trunk/Ohana/src/opihi/dvo/extract.c
r5320 r5448 1 1 # include "dvo1.h" 2 // XXX EAM : this function is deprecated 2 3 3 4 enum {ZERO, RA, DEC, MAG, dMAG, Xm, Xp, NMEAS, NMISS, REF, TYPE, NPHOT, NCODE, FLAG}; -
trunk/Ohana/src/opihi/dvo/gcat.c
r3462 r5448 3 3 int gcat (int argc, char **argv) { 4 4 5 int i, Nregions; 6 RegionFile *regions; 7 char filename[128]; 5 int i; 8 6 struct stat filestat; 9 7 double Ra, Dec, Radius; 8 SkyTable *sky; 9 SkyList *skylist; 10 10 char catdir[256]; 11 11 … … 17 17 } 18 18 19 /* load sky from correct table */ 20 sky = SkyTableLoadOptimal (CATDIR, SKY_TABLE, GSCFILE, -1, VERBOSE); 21 SkyTableSetFilenames (sky, CATDIR, "cpt"); 22 19 23 Ra = atof (argv[1]); 20 24 Dec = atof (argv[2]); … … 24 28 Radius = 0.0001; 25 29 26 regions = find_regions (Ra, Dec, Radius, &Nregions);30 skylist = SkyListByRadius (sky, -1, Ra, Dec, Radius); 27 31 28 for (i = 0; i < Nregions; i++) { 29 sprintf (filename, "%s/%s", catdir, regions[i].name); 30 if (stat (filename, &filestat) != -1) { 32 for (i = 0; i < skylist[0].Nregions; i++) { 33 if (stat (skylist[0].regions[i][0].filename, &filestat) != -1) { 31 34 fprintf (stderr, "%3d %s *\n", i, regions[i].name); 32 35 } else { … … 37 40 38 41 return (TRUE); 39 free (regions); 40 42 SkyListFree (regions); 41 43 } 42 -
trunk/Ohana/src/opihi/dvo/gstar.c
r5320 r5448 9 9 double Mcat, Mrel; 10 10 float *RA, *DEC; 11 int i, j, k, m, N, *N1, N regions, Nsec, NPTS;11 int i, j, k, m, N, *N1, Nsec, NPTS; 12 12 int Nstars, found, GetMeasures, Nlo, Nhi; 13 13 int SaveVectors; 14 14 Vector *vec1, *vec2, *vec3, *vec4; 15 RegionFile *regions; 15 SkyTable *sky; 16 SkyList *skylist; 16 17 Catalog catalog; 17 18 PhotCode *code; … … 52 53 while (Ra > 360.0) Ra -= 360.0; 53 54 54 regions = find_regions (Ra, Dec, Radius, &Nregions); 55 56 if (Nregions > 1) { 55 /* load sky from correct table */ 56 sky = SkyTableLoadOptimal (CATDIR, SKY_TABLE, GSCFILE, -1, VERBOSE); 57 SkyTableSetFilenames (sky, CATDIR, "cpt"); 58 skylist = SkyListByRadius (sky, -1, Ra, Dec, Radius); 59 60 if (skylist[0].Nregions > 1) { 57 61 fprintf (stderr, "warning, radius overlaps region boundary, not yet implemented\n"); 58 62 } 59 63 60 /* set filename, read in header */61 sprintf (filename, "%s/%s", catdir, regions[0].name);62 64 /* lock, load, unlock catalog */ 63 catalog.filename = filename;65 catalog.filename = skylist[0].regions[0][0].filename; 64 66 switch (lock_catalog (&catalog, LCK_SOFT)) { 65 67 case 2: -
trunk/Ohana/src/opihi/dvo/imdata.c
r5320 r5448 1 1 # include "dvo1.h" 2 void copy_region (GSCRegion *in, GSCRegion *out);3 2 4 3 int imdata (int argc, char **argv) { … … 13 12 Image *image; 14 13 Catalog catalog; 15 GSCRegion *region, *tregion; 14 SkyTable *sky; 15 SkyList *skylist, *skyset; 16 16 Vector *vec; 17 17 … … 80 80 GetTimeFormat (&TimeReference, &TimeFormat); 81 81 82 /* load sky from correct table */ 83 sky = SkyTableLoadOptimal (CATDIR, SKY_TABLE, GSCFILE, -1, VERBOSE); 84 SkyTableSetFilenames (sky, CATDIR, "cpt"); 85 86 Nregions = 0; 87 NREGIONS = 10; 88 ALLOCATE (skylist, SkyList, 1); 89 ALLOCATE (skylist[0].regions, SkyRegions *, NREGIONS); 90 82 91 /* for each image of interest, find the appropriate region files */ 83 Nregion = 0;84 ALLOCATE (region, GSCRegion, 1);85 92 for (i = 0; i < Nsubset; i++) { 86 93 I = subset[i]; 94 87 95 if (!FindMosaicForImage (image, Nimage, I)) continue; 88 tregion = get_regions (&image[I], &Ntregion);89 REALLOCATE (region, GSCRegion, MAX (1, Nregion + Ntregion)); 90 for (j = 0; j < Ntregion; j++) {91 skip= FALSE;92 for (k = 0; (k < Nregion) && !skip; k++) {93 if (!strcmp (region[k].filename, tregion[j].filename)) skip = TRUE;94 } 95 if ( !skip) {96 copy_region (&tregion[j], ®ion[Nregion]);97 Nregion++;98 }99 } 100 free (tregion);96 skyset = SkyListByImage (table, -1, &image[I]); 97 98 for (j = 0; j < skyset[0].Nregions; j++) { 99 found = FALSE; 100 for (k = 0; (k < skylist[0].Nregion) && !found; k++) { 101 found = !strcmp (skylist[0].regions[k].name, skyset[0].regions[j].name); 102 } 103 if (found) continue; 104 skylist[0].regions[Nregions] = skyset[0].regions[j]; 105 Nregions ++; 106 CHECK_REALLOCATE (skylist[0].regions, SkyRegions *, NREGIONS, Nregions, 10); 107 } 108 SkyListFree (skyset); 101 109 } 102 110 free (subset); 103 for (i = 0; i < Nregion; i++) {104 fprintf (stderr, "try %s\n", region[i].filename);111 for (i = 0; i < skylist[0].Nregions; i++) { 112 fprintf (stderr, "try %s\n", skylist[0].regions[i][0].name); 105 113 } 106 114 … … 111 119 112 120 /* for each region file, extract the data of interest in the right time range */ 113 for (j = 0; j < Nregion; j++) {121 for (j = 0; j < skylist[0].Nregions; j++) { 114 122 115 123 /* get file name and open */ 116 strcpy (filename, region[j].filename); 117 catalog.filename = filename; 124 catalog.filename = skylist[0].regions[j][0].filename; 118 125 switch (lock_catalog (&catalog, LCK_SOFT)) { 119 126 case 2: … … 210 217 return (TRUE); 211 218 } 212 213 214 void copy_region (GSCRegion *in, GSCRegion *out) {215 216 out[0].RA[0] = in[0].RA[0];217 out[0].RA[1] = in[0].RA[1];218 out[0].DEC[0] = in[0].DEC[0];219 out[0].DEC[1] = in[0].DEC[1];220 strcpy (out[0].filename, in[0].filename);221 }222 -
trunk/Ohana/src/opihi/dvo/init.c
r5442 r5448 53 53 {"addxtra", addxtra, "add extra data to object"}, 54 54 {"getxtra", getxtra, "get extra data from object"}, 55 {"catalog", catlog, "plot catalog stars"}, 55 56 */ 56 57 … … 60 61 {"calextract", calextract, "extract photometry calibration"}, 61 62 {"calmextract", calmextract, "extract photometry calibration"}, 62 {"catalog", catlog, "plot catalog stars"},63 63 {"ccd", ccd, "plot color-color diagram"}, 64 64 {"cmatch", cmatch, "match two catalogs"}, … … 91 91 {"lightcurve", lightcurve, "extract lightcurve for a star"}, 92 92 {"mextract", mextract, "extract measure data values"}, 93 {"pcat", pcat,"plot catalog boundaries"},93 {"pcat", skycat, "plot catalog boundaries"}, 94 94 {"photcodes", photcodes, "list photometry codes"}, 95 95 {"pmeasure", pmeasure, "plot individual measurements"}, -
trunk/Ohana/src/opihi/dvo/lcat.c
r4689 r5448 5 5 double Radius; 6 6 int i, N, Nregions, ShowAll; 7 RegionFile *regions;8 7 char filename[128], exists; 9 8 struct stat filestat; … … 11 10 Graphdata graphmode; 12 11 int Ngraph; 12 SkyTable *sky; 13 SkyList *skylist; 13 14 14 15 Ngraph = 0; … … 16 17 17 18 VarConfig ("CATDIR", "%s", catdir); 19 20 /* load sky from correct table */ 21 sky = SkyTableLoadOptimal (CATDIR, SKY_TABLE, GSCFILE, -1, VERBOSE); 22 SkyTableSetFilenames (sky, CATDIR, "cpt"); 18 23 19 24 ShowAll = FALSE; … … 28 33 29 34 Radius = MAX (fabs(graphmode.xmax), fabs(graphmode.ymax)); 30 regions = find_regions (graphmode.coords.crval1, graphmode.coords.crval2, Radius, &Nregions);35 skylist = SkyListByRadius (sky, -1, graphmode.coords.crval1, graphmode.coords.crval2, Radius); 31 36 32 for (i = 0; i < Nregions; i++) { 33 sprintf (filename, "%s/%s", catdir, regions[i].name); 37 for (i = 0; i < skylist[0].Nregions; i++) { 34 38 exists = 'Y'; 35 if (stat ( filename, &filestat) == -1) exists = 'N';39 if (stat (skylist[0].regions[i][0].filename, &filestat) == -1) exists = 'N'; 36 40 if (ShowAll) { 37 fprintf (stderr, "%3d %s %c\n", i, regions[i].name, exists);41 fprintf (stderr, "%3d %s %c\n", i, skylist[0].regions[i][0].name, exists); 38 42 } else { 39 43 if (exists == 'Y') { 40 fprintf (stderr, "%3d %s\n", i, regions[i].name);44 fprintf (stderr, "%3d %s\n", i, skylist[0].regions[i][0].name); 41 45 } 42 46 } … … 44 48 45 49 return (TRUE); 46 47 free (regions); 48 50 SkyListFree (regions); 49 51 } 50 52 -
trunk/Ohana/src/opihi/dvo/lcurve.c
r5320 r5448 8 8 int Ngraph, Xgraph, TimeFormat; 9 9 int Nstars, found, AutoLimits, ErrorBars, GalMag, AbsPhot, SaveVectors; 10 int i, j, m, N, NPTS, *N1 , Nregions;10 int i, j, m, N, NPTS, *N1; 11 11 time_t TimeReference; 12 12 struct tm *timeptr; 13 RegionFile *regions;14 13 Vector *xvec, *yvec; 15 14 Vector Xvec, Yvec, dYvec; 16 15 Catalog catalog; 17 16 Graphdata graphmode; 17 SkyTable *sky; 18 SkyList *skylist; 18 19 19 20 VarConfig ("CATDIR", "%s", catdir); … … 69 70 } 70 71 72 /* load sky from correct table */ 73 sky = SkyTableLoadOptimal (CATDIR, SKY_TABLE, GSCFILE, -1, VERBOSE); 74 SkyTableSetFilenames (sky, CATDIR, "cpt"); 75 71 76 Ra = atof (argv[1]); 72 77 Dec = atof (argv[2]); 73 78 Radius = atof (argv[3]); 74 79 75 regions = find_regions (Ra, Dec, Radius, &Nregions);76 77 if ( Nregions > 1) {80 skylist = SkyListByRadius (sky, -1, Ra, Dec, Radius); 81 82 if (skylist[0].Nregions > 1) { 78 83 fprintf (stderr, "warning, radius overlaps region boundary, not yet implemented\n"); 79 84 } 80 85 81 86 /* set filename, read in header */ 82 sprintf (filename, "%s/%s", catdir, regions[0].name); 83 catalog.filename = filename; 87 catalog.filename = skylist[0].regions[0][0].filename; 84 88 switch (lock_catalog (&catalog, LCK_SOFT)) { 85 89 case 2: … … 198 202 if (catalog.measure != 0) free (catalog.measure); 199 203 204 SkyListFree (skylist); 200 205 return (TRUE); 201 202 206 } -
trunk/Ohana/src/opihi/dvo/lightcurve.c
r5320 r5448 7 7 float *RA, *DEC; 8 8 int Nstars, found, PhotCodeSelect; 9 int i, j, k, m, N, NPTS, Nsec, RELPHOT, *N1, Nregions,TimeFormat;9 int i, j, k, m, N, NPTS, Nsec, RELPHOT, *N1, TimeFormat; 10 10 time_t TimeReference; 11 RegionFile *regions;12 11 Vector *tvec, *mvec, *dmvec; 13 12 Catalog catalog; … … 50 49 Radius = atof (argv[3]); 51 50 52 regions = find_regions (Ra, Dec, Radius, &Nregions); 51 sky = SkyTableLoadOptimal (CATDIR, SKY_TABLE, GSCFILE, -1, VERBOSE); 52 SkyTableSetFilenames (sky, CATDIR, "cpt"); 53 skylist = SkyListByRadius (sky, -1, Ra, Dec, Radius); 53 54 54 if ( Nregions > 1) {55 if (skylist[0].Nregions > 1) { 55 56 fprintf (stderr, "warning, radius overlaps region boundary, not yet implemented\n"); 56 57 } 57 58 58 59 /* set filename, read in header */ 59 sprintf (filename, "%s/%s", catdir, regions[0].name); 60 catalog.filename = filename; 60 catalog.filename = skylist[0].regions[0][0].filename; 61 61 switch (lock_catalog (&catalog, LCK_SOFT)) { 62 62 case 2: … … 148 148 if (catalog.secfilt != 0) free (catalog.secfilt); 149 149 150 SkyListFree (skylist); 150 151 return (TRUE); 151 152 152 } -
trunk/Ohana/src/opihi/dvo/pcat.c
r5442 r5448 2 2 int RD_to_XYpic (double *x, double *y, double r, double d, Coords *coords, double Rmin, double Rmax, double Rmid, int *leftside); 3 3 4 // XXX EAM : this function is deprecated (now points at skycat) 4 5 int pcat (int argc, char **argv) { 5 6 -
trunk/Ohana/src/opihi/dvo/pmeasure.c
r5320 r5448 5 5 FILE *f; 6 6 int i, j, k, m, N; 7 int InRegion, Nregions,Ngraph;7 int Ngraph; 8 8 char filename[128], catdir[256]; 9 9 double Mz, Mr, mag; … … 13 13 int PhotcodeClip; 14 14 15 SkyTable *sky; 16 SkyList *skylist; 15 17 Catalog catalog; 16 RegionFile *regions;17 18 Graphdata graphmode; 18 19 Vector Xvec, Yvec, Zvec; … … 23 24 if (VarConfig ("CATDIR", "%s", catdir) == NULL) return (FALSE); 24 25 25 regions = (RegionFile *) NULL;26 26 f = (FILE *) NULL; 27 27 Mz = 17.0; … … 68 68 } 69 69 70 InRegion = FALSE; 71 if ((N = get_argument (argc, argv, "-all"))) { 72 remove_argument (N, &argc, argv); 73 InRegion = TRUE; 74 } 75 76 if ((InRegion || (argc != 2)) && (!InRegion || (argc != 1))) { 77 fprintf (stderr, "USAGE: catalog (filename / -all) [-m M M] [-n N N] [-g] [-a RA DEC MAG] \n"); 70 if (argc != 2) { 71 fprintf (stderr, "USAGE: pmeasure (-all) [-m M M] [-p photcode] [-ID ID] [-flag value] [-x]\n"); 78 72 return (FALSE); 79 73 } 80 74 81 if (InRegion) {82 Radius = MAX (fabs(graphmode.xmax), fabs(graphmode.ymax)); 83 regions = find_regions (graphmode.coords.crval1, graphmode.coords.crval2, Radius, &Nregions);84 } else {85 Nregions = 1;86 }75 Radius = MAX (fabs(graphmode.xmax), fabs(graphmode.ymax)); 76 77 /* load sky from correct table */ 78 sky = SkyTableLoadOptimal (CATDIR, SKY_TABLE, GSCFILE, -1, VERBOSE); 79 SkyTableSetFilenames (sky, CATDIR, "cpt"); 80 skylist = SkyListByRadius (sky, -1, graphmode.coords.crval1, graphmode.coords.crval2, Radius); 87 81 88 for (j = 0; j < Nregions; j++) {82 for (j = 0; j < skylist[0].Nregions; j++) { 89 83 catalog.average = 0; 90 84 91 if (InRegion) {92 sprintf (filename, "%s/%s", catdir, regions[j].name);93 } else {94 sprintf (filename, "%s/%s", catdir, argv[1]);95 }96 97 85 /* lock, load, unlock catalog */ 98 catalog.filename = filename;86 catalog.filename = skylist[0].regions[j][0].filename; 99 87 switch (lock_catalog (&catalog, LCK_SOFT)) { 100 88 case 2: -
trunk/Ohana/src/opihi/dvo/region_list.c
r4689 r5448 1 1 # include "dvo1.h" 2 3 /* XXX note : for RegionName or RegionList, we need to free the skylist 4 elements, but not in the case of radius selection - this implies 5 information carried back up */ 2 6 3 7 static int RegionSelect; … … 42 46 } 43 47 44 RegionFile *SelectRegions (char *RegionName, char *RegionList, int *nregions) {48 SkyList *SelectRegions (char *RegionName, char *RegionList) { 45 49 46 50 double Radius; 47 51 int Ngraph; 48 52 Graphdata graphsky; 49 RegionFile *regions; 53 SkyTable *sky; 54 SkyList *skylist; 50 55 51 56 /* determine region-file names */ 52 57 if (RegionName != NULL) { 53 *nregions = 1; 54 ALLOCATE (regions, RegionFile, 1); 55 strcpy (regions[0].name, RegionName); 58 ALLOCATE (skylist, SkyList, 1); 59 ALLOCATE (skylist[0].regions[0], SkyRegion *, 1); 60 ALLOCATE (skylist[0].regions[0][0], SkyRegion, 1); 61 strcpy (skylist[0].regions[0][0].name, RegionName); 62 sprintf (filename, "%s/%s.cpt", CATDIR, RegionName); 63 skylist[0].regions[0][0].filename = strcreate (filename); 56 64 free (RegionName); 57 65 RegionName = NULL; 58 return ( regions);66 return (skylist); 59 67 } 60 68 if (RegionList != NULL) { 61 regions = region_list (RegionList, nregions);69 skylist = SkyListLoadFile (RegionList); 62 70 free (RegionList); 63 71 RegionList = NULL; 64 return ( regions);72 return (skylist); 65 73 } 66 74 … … 72 80 73 81 Radius = MAX (fabs(graphsky.xmax), fabs(graphsky.ymax)); 74 regions = find_regions (graphsky.coords.crval1, graphsky.coords.crval2, Radius, nregions); 75 return (regions); 82 83 /* load sky from correct table */ 84 sky = SkyTableLoadOptimal (CATDIR, SKY_TABLE, GSCFILE, -1, VERBOSE); 85 SkyTableSetFilenames (sky, CATDIR, "cpt"); 86 skylist = SkyListByRadius (sky, -1, graphmode.coords.crval1, graphmode.coords.crval2, Radius); 87 88 return (skylist); 76 89 } 77 90 91 /* XXX EAM this should perhaps return a skytable? */ 78 92 /* returns a list of region files names from file */ 79 RegionFile *region_list (char *filename, int *Nregions) {93 SkyList *SkyListFromFile (char *filename) { 80 94 95 FILE *f; 81 96 int NREGIONS, nregion; 82 RegionFile *regions; 83 FILE *f; 97 SkyList *skylist; 98 99 ALLOCATE (skylist, SkyList, 1); 84 100 85 101 f = fopen (filename, "r"); 86 102 if (f == NULL) { 87 103 fprintf (stderr, "ERROR: can't find region list file %s\n", filename); 88 *Nregions = 0; 89 return (NULL); 104 skylist[0].Nregions = 0; 105 skylist[0].regions = NULL; 106 return (skylist); 90 107 } 91 108 109 Nregions = 0; 92 110 NREGIONS = 50; 93 ALLOCATE (regions, RegionFile, NREGIONS); 94 nregion = 0; 111 ALLOCATE (skylist[0].regions, SkyRegion *, NREGIONS); 95 112 96 while (fscanf (f, "%s", regions[nregion].name) != EOF) { 97 nregion ++; 98 if (nregion == NREGIONS) { 99 NREGIONS += 50; 100 REALLOCATE (regions, RegionFile, NREGIONS); 113 while (fscanf (f, "%s", filename) != EOF) { 114 ALLOCATE (skylist[0].regions[Nregions], SkyRegion, 1); 115 strcpy (skylist[0].regions[Nregions][0].name, filename); 116 sprintf (filename, "%s/%s.cpt", CATDIR, skylist[0].regions[Nregions][0].name); 117 skylist[0].regions[Nregions][0].filename = strcreate (filename); 118 Nregions ++; 119 CHECK_REALLOCATE (skylist[0].regions, SkyRegion *, NREGIONS, Nregions, 50); 101 120 } 102 121 } -
trunk/Ohana/src/opihi/dvo/subpix.c
r5320 r5448 5 5 int subpix (int argc, char **argv) { 6 6 7 int i, j, I, Nlo, Nhi, Nentry, Nstars, N regions, Nimage, Nmeasure;7 int i, j, I, Nlo, Nhi, Nentry, Nstars, Nimage, Nmeasure; 8 8 int *index, *entry; 9 9 int Nmin, Nsub, NSUB, status; … … 17 17 Measure *measure; 18 18 Image *image; 19 RegionFile *regions;20 19 Catalog catalog; 21 20 … … 35 34 Radius = atof (argv[3]); 36 35 36 /* load sky from correct table */ 37 sky = SkyTableLoadOptimal (CATDIR, SKY_TABLE, GSCFILE, -1, VERBOSE); 38 SkyTableSetFilenames (sky, CATDIR, "cpt"); 39 37 40 /* load star nearest position */ 38 regions = find_regions (Ra, Dec, Radius, &Nregions);39 if ( Nregions > 1) {41 skylist = SkyListByRadius (sky, -1, Ra, Dec, Radius); 42 if (skylist[0].Nregions > 1) { 40 43 fprintf (stderr, "warning, radius overlaps region boundary, not yet implemented\n"); 41 44 } 42 45 43 46 /* lock, load, unlock catalog */ 44 sprintf (filename, "%s/%s", catdir, regions[0].name); 45 catalog.filename = filename; 47 catalog.filename = skylist[0].regions[0][0].filename; 46 48 switch (lock_catalog (&catalog, LCK_SOFT)) { 47 49 case 2: … … 92 94 if (catalog.average != 0) free (catalog.average); 93 95 if (catalog.measure != 0) free (catalog.measure); 94 free (regions);96 SkyListFree (skylist); 95 97 return (TRUE); 96 98 } … … 158 160 free (image); 159 161 free (index); 160 free (regions);162 SkyListFree (regions); 161 163 162 164 return (TRUE);
Note:
See TracChangeset
for help on using the changeset viewer.
