Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Limitation on object names #5

Open
MaartenSneepKNMI opened this issue Oct 30, 2014 · 1 comment
Open

Limitation on object names #5

MaartenSneepKNMI opened this issue Oct 30, 2014 · 1 comment

Comments

@MaartenSneepKNMI
Copy link

Note: This remark was originally part of issue #4. Split of to separate the discussions.

Use case

In issue #4 references between variables are discussed. These occur in space separated lists, and as such they put a limitation on the allowable characters in object names.

The problem

NetCDF-4 allows an object name like "χ²" (\u03C7\u00B2). This is probably very good for human readability, but accessing the field from a program or script (non-interactively) is probably pretty hard.

To get the string into this text file I went into an interactive python3 shell, and asked it to print("\u03C7\u00B2"), and those numbers were obtained from a website. Other computer systems may offer more convenient access.

Terminology

For some of the terminology refer to “CDM Object Names” and the discussion summary of issue #4.

In particular, an “object name” refers to the short name of either a group, variable, dimension, attribute, type definition or field in a compound datatype.

Suggested solution

The short names of NetCDF-4 objects must match the regular expression: [a-zA-Z_][a-zA-Z0-9_]*. This means that the name of a NetCDF-4 object can be used as a variable name in most programming languages.

If there is a need to attach a name to a variable that requires the use of other characters, then an attributes can be used. A possible solution for this would be an attribute with the name “local_name_zh_CN” for a Chinese localisation. The end of the attribute name follows ISO 639-1/ISO 639-2.

Now all we need is a code for “mathematical localisation”.

@dblodgett-usgs
Copy link
Contributor

@MaartenSneepKNMI -- should we migrate this issue to the main repository or has it been taken care of?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants