Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netcdf file content order #18

Open
ggalibert opened this issue Apr 22, 2015 · 0 comments
Open

netcdf file content order #18

ggalibert opened this issue Apr 22, 2015 · 0 comments

Comments

@ggalibert
Copy link
Contributor

For ease of readability purpose, the order of the variables, their variable attributes, the global attributes visible in a dump should be consistent with the one specified in the .xml template.

For example at the moment, ncdump -h file.nc | less would give :

netcdf file {
dimensions:
        TIME = 28191 ;
variables:
        byte CNDC_quality_control(TIME) ;
                CNDC_quality_control:standard_name = "sea_water_electrical_conductivity status_flag" ;
                CNDC_quality_control:valid_max = 9b ;
                CNDC_quality_control:long_name = "quality flag for sea_water_electrical_conductivity" ;
                CNDC_quality_control:_FillValue = 99b ;
                CNDC_quality_control:flag_meaning = "No_QC_performed Good_data Probably_good_data Bad_data_that_are_potentially_correctable B
ad_data Value_changed Not_used Not_used Not_used Missing_value" ;
                CNDC_quality_control:quality_control_conventions = "IMOS standard set using the IODE flags" ;
                CNDC_quality_control:flag_values = 0b, 1b, 2b, 3b, 4b, 5b, 6b, 7b, 8b, 9b ;
                CNDC_quality_control:valid_min = 0b ;
                CNDC_quality_control:quality_control_set = 1 ;
        double TIME(TIME) ;
                TIME:axis = "T" ;
                TIME:standard_name = "time" ;
                TIME:valid_max = 90000. ;
                TIME:long_name = "time" ;
                TIME:valid_min = 0. ;
                TIME:units = "days since 1950-01-01 00:00:00 UTC" ;
                TIME:calendar = "gregorian" ;
etc...

while the .xml template says :

<variable>
      <name>TIME</name>
      <encoder>double</encoder>
      <dimensions>
        <dimension name="TIME"/>
      </dimensions>
      <attributes>
        <attribute name="standard_name" value="time"/>
        <attribute name="long_name" value="time"/>
        <attribute name="units" value="days since 1950-01-01 00:00:00 UTC"/>
        <attribute name="calendar" value="gregorian"/>
        <attribute name="axis" value="T"/>
        <attribute name="valid_min" value="0."/> <!-- this guy needs to be casted in the relevant type -->
        <attribute name="valid_max" value="90000."/> <!-- this guy needs to be casted in the relevant type -->
      </attributes>
    </variable>
    <variable>
      <name>LATITUDE</name>
      <encoder>double</encoder>
      <attributes>
        <attribute name="standard_name" value="latitude"/>
        <attribute name="long_name" value="latitude"/>
        <attribute name="units" value="degrees north"/>
        <attribute name="axis" value="Y"/>
        <attribute name="reference_datum" value="geographical coordinates, WGS84 projection"/>
        <attribute name="valid_min" value="-90."/> <!-- this guy needs to be casted in the relevant type -->
        <attribute name="valid_max" value="90."/> <!-- this guy needs to be casted in the relevant type -->
      </attributes>
    </variable>
etc...

So that what we should have is :

netcdf file {
dimensions:
        TIME = 28191 ;
variables:
        double TIME(TIME) ;
                TIME:standard_name = "time" ;
                TIME:long_name = "time" ;
                TIME:units = "days since 1950-01-01 00:00:00 UTC" ;
                TIME:calendar = "gregorian" ;
                TIME:axis = "T" ;
                TIME:valid_min = 0. ;
                TIME:valid_max = 90000. ;
        double LATITUDE ;
                LATITUDE:standard_name = "latitude" ;
                LATITUDE:long_name = "latitude" ;
                LATITUDE:units = "degrees_north" ;
                LATITUDE:axis = "Y" ;
                LATITUDE:reference_datum = "geographical coordinates, WGS84 projection" ;
                LATITUDE:valid_min = -90. ;
                LATITUDE:valid_max = 90. ;
etc...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant