Changeset 8394
- Timestamp:
- Aug 16, 2006, 2:31:12 PM (20 years ago)
- Location:
- trunk/Ohana/src/libdvo/src
- Files:
-
- 2 edited
-
dvo_catalog.c (modified) (2 diffs)
-
dvo_catalog_create.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libdvo/src/dvo_catalog.c
r8386 r8394 161 161 // returns FALSE if a catalog could not be opened 162 162 // returns TRUE if the catalog was empty 163 // XXX allow stdout as destination (don't lock) 163 164 enum {DVO_OPEN_NONE, DVO_OPEN_READ, DVO_OPEN_WRITE, DVO_OPEN_UPDATE); 164 165 int dvo_catalog_open (Catalog *catalog, SkyRegion *region, int VERBOSE, char *iomode) { … … 203 204 case 2: 204 205 if (DVO_OPEN_READ || DVO_OPEN_UPDATE) return (TRUE); 205 dvo_catalog_create (region, catalog , Nsecfilt); /* fills in new header info */206 dvo_catalog_create (region, catalog); /* fills in new header info */ 206 207 if (VERBOSE) fprintf (stderr, "creating new file %s\n", catalog[0].filename); 207 208 break; -
trunk/Ohana/src/libdvo/src/dvo_catalog_create.c
r8386 r8394 8 8 // catalog[0].catformat (used by dvo_catalog_save) 9 9 // catalog[0].lockmode 10 void dvo_catalog_create (SkyRegion *region, Catalog *catalog , int Nsecfilt) {10 void dvo_catalog_create (SkyRegion *region, Catalog *catalog) { 11 11 12 12 int length; … … 89 89 90 90 /* write RA,DEC range in header */ 91 gfits_modify (&catalog[0].header, "RA0", "%lf", 1, region[0].Rmin); 92 gfits_modify (&catalog[0].header, "DEC0", "%lf", 1, region[0].Dmin); 93 gfits_modify (&catalog[0].header, "RA1", "%lf", 1, region[0].Rmax); 94 gfits_modify (&catalog[0].header, "DEC1", "%lf", 1, region[0].Dmax); 91 if (region) { 92 gfits_modify (&catalog[0].header, "RA0", "%lf", 1, region[0].Rmin); 93 gfits_modify (&catalog[0].header, "DEC0", "%lf", 1, region[0].Dmin); 94 gfits_modify (&catalog[0].header, "RA1", "%lf", 1, region[0].Rmax); 95 gfits_modify (&catalog[0].header, "DEC1", "%lf", 1, region[0].Dmax); 96 } 95 97 96 98 /* write creation date in header */ … … 105 107 ALLOCATE (catalog[0].missing, Missing, 1); 106 108 ALLOCATE (catalog[0].secfilt, SecFilt, 1); 107 catalog[0].Nsecfilt = Nsecfilt;108 109 109 110 /* setup secondary filters to match photcodes: … … 113 114 } 114 115 116 int dvo_catalog_set_range (Catalog *catalog) { 117 118 int i; 119 double Rmin, Rmax, Dmin, Dmax; 120 121 /* determine RA,DEC range */ 122 Rmin = 360.0; 123 Rmax = 0.0; 124 Dmin = +90.0; 125 Dmax = -90.0; 126 for (i = 0; i < catalog[0].Naverage; i++) { 127 Rmin = MIN (Rmin, catalog[0].average[i].R); 128 Rmax = MAX (Rmax, catalog[0].average[i].R); 129 Dmin = MIN (Dmin, catalog[0].average[i].D); 130 Dmax = MAX (Dmax, catalog[0].average[i].D); 131 } 132 133 /* write RA,DEC range in header */ 134 gfits_modify (&catalog[0].header, "RA0", "%lf", 1, Rmin); 135 gfits_modify (&catalog[0].header, "DEC0", "%lf", 1, Dmin); 136 gfits_modify (&catalog[0].header, "RA1", "%lf", 1, Rmax); 137 gfits_modify (&catalog[0].header, "DEC1", "%lf", 1, Dmax); 138 139 }
Note:
See TracChangeset
for help on using the changeset viewer.
