Changeset 5448 for trunk/Ohana/src/opihi/dvo/pmeasure.c
- Timestamp:
- Oct 27, 2005, 10:38:30 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/dvo/pmeasure.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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:
Note:
See TracChangeset
for help on using the changeset viewer.
