IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8394


Ignore:
Timestamp:
Aug 16, 2006, 2:31:12 PM (20 years ago)
Author:
eugene
Message:

adjusting dvo_catalog_create to remove Nsecfilt

Location:
trunk/Ohana/src/libdvo/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libdvo/src/dvo_catalog.c

    r8386 r8394  
    161161// returns FALSE if a catalog could not be opened
    162162// returns TRUE if the catalog was empty
     163// XXX allow stdout as destination (don't lock)
    163164enum {DVO_OPEN_NONE, DVO_OPEN_READ, DVO_OPEN_WRITE, DVO_OPEN_UPDATE);
    164165int dvo_catalog_open (Catalog *catalog, SkyRegion *region, int VERBOSE, char *iomode) {
     
    203204  case 2:
    204205    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 */
    206207    if (VERBOSE) fprintf (stderr, "creating new file %s\n", catalog[0].filename);
    207208    break;
  • trunk/Ohana/src/libdvo/src/dvo_catalog_create.c

    r8386 r8394  
    88// catalog[0].catformat (used by dvo_catalog_save)
    99// catalog[0].lockmode
    10 void dvo_catalog_create (SkyRegion *region, Catalog *catalog, int Nsecfilt) {
     10void dvo_catalog_create (SkyRegion *region, Catalog *catalog) {
    1111
    1212  int length;
     
    8989
    9090  /* 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  }
    9597
    9698  /* write creation date in header */
     
    105107  ALLOCATE (catalog[0].missing, Missing, 1);
    106108  ALLOCATE (catalog[0].secfilt, SecFilt, 1);
    107   catalog[0].Nsecfilt = Nsecfilt;
    108109
    109110  /* setup secondary filters to match photcodes:
     
    113114}
    114115 
     116int 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.