Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Support more data types? #1119

Open
Yaqiang opened this issue Jul 19, 2018 · 3 comments
Open

Support more data types? #1119

Yaqiang opened this issue Jul 19, 2018 · 3 comments

Comments

@Yaqiang
Copy link

Yaqiang commented Jul 19, 2018

Is it possible to add more data types in DataType enum, for example Date and Complex. I know OBJECT data type can include them, but it will be more clear with specific names.

@ethanrd
Copy link
Member

ethanrd commented Jul 19, 2018

The DataType enum is a list of the data types supported by the netCDF data model. The Object type is just a helper-type which is only used in a few places in Arrays and when converting an unsigned long type to the appropriate type in Java, BigInteger.

So, no, that's not really the right place for new types like Date or Complex.

@ethanrd
Copy link
Member

ethanrd commented Jul 19, 2018

@Yaqiang - I forgot to mention user defined types. The netCDF Enhanced Data model supports compound data types. You could create a Ccompound type to represent, for example, complex numbers. (In netCDF-Java, the compound type is handled by the Structure class.) The CDL might look something like:

types:
  compound complex_number_t {
    float real ;
    float imaginary ;
    }
dimensions:
    lat = 18 ;
    lon = 36 ;
variables:
    complex_number_t my_data( lat, lon) ;

Best practices around using compound types in netCDF is still developing and there aren't a lot of widely used conventions that support compound types. However, depending on your needs, it might be a good option.

@Yaqiang
Copy link
Author

Yaqiang commented Aug 3, 2018

@ethanrd Thanks for your explain and suggestion!

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