Skip to content

Verify_collections assumes the last group will be the dataset with lat and lon #2168

Open
@nlenssen2013

Description

lines 341 through 347 needs to be improved to check each group if the lat/lon variable exist. Then read in the nc group into an xarray dataset. Lat and lon var names should be defined before this code block.

with netCDF4.Dataset(subsetted_filepath) as f:
        for g in f.groups:
            ds = xarray.open_dataset(subsetted_filepath, group=g, decode_times=False)
            if len(ds.variables):
                group = g
                subsetted_ds = ds
            else:
                ds.close()

    lat_var_name, lon_var_name = get_lat_lon_var_names(subsetted_ds, collection_variables)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions