ruisdael-observatory / disdroDL

disdrometer data logger to NetCDF
GNU General Public License v3.0
0 stars 0 forks source link

remove backslashes from "weather_code_metar_4678_5min" var deifition #13

Closed andrecastro0o closed 3 weeks ago

andrecastro0o commented 3 weeks ago

Original comment from @mschleiss https://github.com/ruisdael-observatory/disdroDL/issues/2#issuecomment-2290918916:

Issue 1: There are some backslashes in the metadata description of variable "weather_code_metar_4678_5min" that need to be removed:

string weather_code_metar_4678_5min\ (unitless)(time) ;
string weather_code_metar_4678_5min\ (unitless):_FillValue = "" ;
weather_code_metar_4678_5min\ (unitless):long_name = "5-minute METAR Tab.4678 code" ;
weather_code_metar_4678_5min\ (unitless):standard_name = "weather_code_metar_4678_5min (unitless)" ;
weather_code_metar_4678_5min\ (unitless):comment = "See Table 7: Code SYNOP/METAR in the documentation for possible values" ;

Merge to branch https://github.com/ruisdael-observatory/disdroDL/tree/0.3.2

andrecastro0o commented 3 weeks ago

@mschleiss the backslash are escape characters, denoting the space and parenthesis are literal. The simple solution for not having it in the NetCDF is to move this added info, in parenthesis, from the standard_name to the long_name, where all characters are literal ie.

Now:

        string weather_code_metar_4678_5min\ \(unitless\)(time) ;
                string weather_code_metar_4678_5min\ \(unitless\):_FillValue = "" ;
                weather_code_metar_4678_5min\ \(unitless\):long_name = "5-minute METAR Tab.4678 code" ;
                weather_code_metar_4678_5min\ \(unitless\):standard_name = "weather_code_metar_4678_5min (unitless)" ;
                weather_code_metar_4678_5min\ \(unitless\):comment = "See Table 7: Code SYNOP/METAR in the documentation for possible values" ;

shall become

        string weather_code_metar_4678_5min(time) ;
                string weather_code_metar_4678_5min:_FillValue = "" ;
                weather_code_metar_4678_5min:long_name = "5-minute METAR Tab.4678 code  (unitless)" ;
                weather_code_metar_4678_5min:standard_name = "weather_code_metar_4678_5min" ;
                weather_code_metar_4678_5min:comment = "See Table 7: Code SYNOP/METAR in the documentation for possible values" ;

This is already the case in most vars:

    '11':
        dimensions:
            - time
        dtype: 'f4'
        include_in_nc: 'always'
        var_attrs:
            long_name: '1-minute SYNOP Tab.4677 (unitless)'
            standard_name: 'weather_code_synop_4677'
            comment: 'See Table 7: Code SYNOP/METAR in the documentation for possible values'

And those changes need to be performed in configs_netcdf/config_general_thies.yml

    '9':
        dimensions:
            - time
        dtype: 'S4'
        include_in_nc: 'always'
        var_attrs:
            long_name: '5-minute METAR Tab.4678 code (unitless)'
            standard_name: 'weather_code_metar_4678_5min'
            comment: 'See Table 7: Code SYNOP/METAR in the documentation for possible values'
andrecastro0o commented 3 weeks ago

merged in https://github.com/ruisdael-observatory/disdroDL/pull/19