⇐ ⇒

[CF-metadata] Pre-proposal for "charset"

From: Bob Simons - NOAA Federal <bob.simons>
Date: Mon, 27 Feb 2017 17:43:39 -0800

CF section 2.2 already clarifies that it is the "last" (AKA "rightmost")
dimension that specifies the maximum number of characters and is collapsed
to interpret the char array as a String array:
>
> An n-dimensional array of strings must be implemented as a character array
> of dimension (n,max_string_length), with the last (most rapidly varying)
> dimension declared large enough to contain the longest string in the array.
> All the strings in a given array are therefore defined to be equal in
> length. For example, an array of strings containing the names of the months
> would be dimensioned (12,9) in order to accommodate "September", the month
> with the longest name.


My proposed change does not alter that text.

On Mon, Feb 27, 2017 at 4:58 PM, Chris Barker <chris.barker at noaa.gov> wrote:

> On Wed, Feb 22, 2017 at 11:38 AM, Bob Simons - NOAA Federal <
> bob.simons at noaa.gov> wrote:
>
>>
>>> We need to either specify the "string" dimension, or have a consistent
>>> convention:
>>>
>>> A 10x8 CHAR array could be either 10 8 character strings or 8 ten
>>> character strings. And it gets more confusing with higher dimensions.
>>>
>>
>> There is no standard naming system in CF to denote a String dimension
>> (ie, the number of chars, vs a char array). That is a different approach to
>> solving the problem. I don't like that approach as much because so many
>> people have written so much software that writes and reads files using
>> dimension names of their choice. I don't want to tell everyone to rewrite
>> all their exiting files and software/scripts to read/write those files in
>> order to comply with new CF rules.
>>
>> Instead, I'm proposing a separate, new attribute (data_type=string|char),
>> partly because it doesn't interfere with existing dimension names or
>> attribute names.
>>
>
> I wasn't clear -- even if you know a CHAR array is supposed to be an array
> of strings, you don't know which dimension is the "string" dimension, and
> which is the array dimension. If you have a 3x4 array of length-5 strings,
> what is your CHAR array dimension? either of these would make sense:
>
> (3,4,5)
> (5,3,4)
> and
> (3,5,4) would be possible, though a bit insane :-)
>
> even worse, if you see a "string" array that has dimensions of (3,4,5)
> what is that? and (3,4) array of length-5 strings? a (4,5) array or length
> 3 strings?
>
> -CHB
>
> --
>
> Christopher Barker, Ph.D.
> Oceanographer
>
> Emergency Response Division
> NOAA/NOS/OR&R (206) 526-6959 voice
> 7600 Sand Point Way NE (206) 526-6329 fax
> Seattle, WA 98115 (206) 526-6317 main reception
>
> Chris.Barker at noaa.gov
>



-- 
Sincerely,
Bob Simons
IT Specialist
Environmental Research Division
NOAA Southwest Fisheries Science Center
99 Pacific St., Suite 255A      (New!)
Monterey, CA 93940               (New!)
Phone: (831)333-9878            (New!)
Fax:   (831)648-8440
Email: bob.simons at noaa.gov
The contents of this message are mine personally and
do not necessarily reflect any position of the
Government or the National Oceanic and Atmospheric Administration.
<>< <>< <>< <>< <>< <>< <>< <>< <><
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cgd.ucar.edu/pipermail/cf-metadata/attachments/20170227/aa80def4/attachment.html>
Received on Mon Feb 27 2017 - 18:43:39 GMT

This archive was generated by hypermail 2.3.0 : Tue Sep 13 2022 - 23:02:42 BST

⇐ ⇒