Skip to content
This repository was archived by the owner on Oct 24, 2024. It is now read-only.

Resolve dimension coordinates from parents #297

Closed
@dehorsley

Description

@dehorsley

Basically this issue but for datatree pydata/xarray#1982

We have some hourly and weekly data in different groups, and shared coordinates in the root. For example, I have a netCDF with the following structure:

netcdf test {
dimensions:
        storage = 11 ;
        sample = 780 ;
        case = 1 ;
        generator = 31 ;
        line = 1 ;
        region = 1 ;
        price_scenario = 78 ;
variables:
        string storage(storage) ;
        float sample(sample) ;
        string case(case) ;
        string generator(generator) ;
        string line(line) ;
        string region(region) ;
        int price_scenario(price_scenario) ;

group: weekly {
  dimensions:
        time = 549 ;
  variables:
        int time(time) ;
                time:units = "Seconds since 1970" ;
        float generation(time, generator, sample, case) ;
                generation:units = "GWh" ;
        float storage_volume(time, storage, sample, case) ;
                storage_volume:units = "CMD" ;
        float line_flow(time, line, sample, case) ;
                line_flow:units = "GWh" ;
        float line_flow_back(time, line, sample, case) ;
                line_flow_back:units = "GWh" ;
        float generator_offer(time, generator, sample, case) ;
                generator_offer:units = "$/MWh" ;
  } // group weekly

group: hourly {
  dimensions:
        time = 92232 ;
  variables:
        int time(time) ;
                time:units = "Seconds since 1970" ;
        float region_price(time, region, price_scenario, case) ;
                region_price:units = "$/MWh" ;
  } // group hourly
}

I was hoping datatree would add the shared coordinates variables when I access one of the child groups, but instead if I access one of the Datasets, I have a whole bunch of dimensions without coordinates. Eg:

image

Is this something you think datatree should/will address? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions