Data units is incorrectly infered

Open
#244 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
julia
Domain
data

Research direction

Reproduce the issue using the seasonal prediction dataset and inspect the Julia dataset expressions shown for ds[Variable="t2m"] and ds[Variable="v10"]. Trace how variable properties are assigned from the source metadata. Done means each variable retains its own units, long_name, standard_name, and related properties instead of inheriting another variable's values.

Written by the indexing model from the issue text.

Description

I have a seasonal prediction dataset with 16 variables. It seems that thay all inherit the same definition, which is one of the 16 variables.

What we should get:

for ivar in list(ds.keys()):
    print(ivar, ds[ivar].attrs)

rsn {'units': 'kg m**-3', 'long_name': 'Snow density'}
tclw {'units': 'kg m**-2', 'long_name': 'Total column cloud liquid water'}
tciw {'units': 'kg m**-2', 'long_name': 'Total column cloud ice water'}
sd {'units': 'm of water equivalent', 'long_name': 'Snow depth', 'standard_name': 'lwe_thickness_of_surface_snow_amount'}
lsp {'units': 'm', 'long_name': 'Large-scale precipitation', 'standard_name': 'lwe_thickness_of_stratiform_precipitation_amount'}
cp {'units': 'm', 'long_name': 'Convective precipitation', 'standard_name': 'lwe_thickness_of_convective_precipitation_amount'}
sf {'units': 'm of water equivalent', 'long_name': 'Snowfall', 'standard_name': 'lwe_thickness_of_snowfall_amount'}
u10 {'units': 'm s**-1', 'long_name': '10 metre U wind component'}
v10 {'units': 'm s**-1', 'long_name': '10 metre V wind component'}
t2m {'units': 'K', 'long_name': '2 metre temperature'}
d2m {'units': 'K', 'long_name': '2 metre dewpoint temperature'}
tp {'units': 'm', 'long_name': 'Total precipitation'}
fg10 {'units': 'm s**-1', 'long_name': '10 metre wind gust since previous post-processing'}
mx2t24 {'units': 'K', 'long_name': 'Maximum temperature at 2 metres in the last 24 hours'}
mn2t24 {'units': 'K', 'long_name': 'Minimum temperature at 2 metres in the last 24 hours'}
mean2t24 {'units': 'K', 'long_name': 'Mean temperature at 2 metres in the last 24 hours'}

What we get instead:


ds[Variable="t2m"].properties

Dict{String, Any} with 7 entries:
  "missing_value" => -32767
  "units"         => "K"
  "add_offset"    => 279.534
  "long_name"     => "Maximum temperature at 2 metres in the last 24 hours"
  "scale_factor"  => 0.00103738
  "standard_name" => "lwe_thickness_of_snowfall_amount"
  "_FillValue"    => -32767

ds[Variable="v10"].properties

Dict{String, Any} with 7 entries:
  "missing_value" => -32767
  "units"         => "K"
  "add_offset"    => 279.534
  "long_name"     => "Maximum temperature at 2 metres in the last 24 hours"
  "scale_factor"  => 0.00103738
  "standard_name" => "lwe_thickness_of_snowfall_amount"
  "_FillValue"    => -32767

Dominant language
Julia
Stars
132
Forks
25
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from JuliaDataCubes/YAXArrays.jl

All issues in JuliaDataCubes/YAXArrays.jl

Similar issues

More Julia issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.