Subject: Re: min and max table column keywords

From: thompson at serts.gsfc.nasa.gov (William Thompson)
Date: 3 Aug 93 16:40:57 GMT

pence at tetra.gsfc.nasa.gov (William Pence) writes:

>Here within the OGIP/HEASARC we have a need to define a pair of standard
>FITS header keywords to give the minimum and maximum values contained
>within a column in a FITS table.  These keywords would be analogous to
>the DATAMIN and DATAMAX keywords which are defined for use with
>FITS images.   An obvious choice of names for these new keywords would
>be:

>TDMINnnn =  0.0    / the actual minimum value contained in column nnn of the table
>TDMAXnnn = 1000.   / the actual maximum value contained in column nnn of the table

>Does anyone have any comment on these keyword names?  Or has an alternative
>keyword already been proposed and/or used for this purpose?

I had proposed these same keywords earlier, and have been planning to use them
for the SOHO project.  It is the most obvious choice.

William Thompson

---

From: leb at Hypatia.gsfc.nasa.gov (Lee E. Brotzman)
Date: 6 Aug 93 01:28:39 GMT

>keyword already been proposed and/or used for this purpose?

A resounding yes!  This convention was mentioned some time ago, and I have been
a big fan ever since.  Future FITS tables from the Astronomical Data Center 
will definitely use this convention, and I plan to propose that they be made
standard keywords whenever the next NOST FITS committee begins operation.

One remaining question is about the datatype of the value.  Should it always
be floating point?  In ASCII tables, the TNULL field is defined to be a string
readable with the format given in TFORM.  This may present a problem for
binary tables where the value of the keyword is character, regardless of
whether it is enclosed in quotes or not, whereas the actual data you'd be
comparing TDMIN/TDMAX against are binary.  I think that it would suffice for
both ASCII and BINTABLE extensions to have the TDMIN/TDMAX be strings readable
by the TFORM keyword, implying that a sensible mapping of the BINTABLE TFORMs
can be made to some default formats in Fortran, C, etc.

The reason I'd like to have it this way is to allow a MAX and MIN for
ASCII-valued columns.  I'd hate to see a really useful feature like this
restricted to just numbers.  The ADC has found that specifying maximum and
minimum values for strings in tables, e.g. note flags that range from 'A' to
'M', provide for easy validation checking of the contents of a table.  It has
become extremely useful and very nearly mandatory for us to do our jobs.

Does anyone have any comment on that?  It's still unresolved in my own mind,
and I'd really appreciate hearing from the community before we go into
production on our tables.  (Paul Kuin and I have just won a grant to generate 
FITS tables from another 150 or so ADC catalogs over the next two years, so 
there *will* be new FITS data from the ADC, and it *will* be using TDMIN and 
TDMAX and possibly TSORT to indicate sorted columns.)

>Similarly, we need to define a pair of keywords which give the minimum
>and maximum _legal_ value for the numbers in a column.  For example, a
>table column containing the X coordinate of a list of detected photon
>in an image may have legal values from 0 - 255 inclusive.  A good
>keyword name for this purpose is less obvious, but the following pair
>of keywords has been suggested:

>TAMINnnn =   0.0   / the smallest possible value for column nnn of the table
>TAMAXnnn = 255.0   / the largest possible value for column nnn of the table

I might suggest, TLMINnnn and TLMAXnnn for "Table Legal Min" and "Table Legal
Max", respectively.  I think that these keywords are not needed as much as the
ones mentioned above.  It's much more important to know the *real* value
boundaries then the *expected* boundaries, at least in the applications that I
can think of.

--
-- Lee E. Brotzman                    Internet:  leb at hypatia.gsfc.nasa.gov
-- Hughes STX                         DECNET:    NDADSA::BROTZMAN
-- NASA Goddard Space Flight Center   BITNET:    ZMLEB at GIBBS