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

ML2O3 Variable error when copying values #155

Closed
nlenssen2013 opened this issue Apr 11, 2023 · 2 comments
Closed

ML2O3 Variable error when copying values #155

nlenssen2013 opened this issue Apr 11, 2023 · 2 comments

Comments

@nlenssen2013
Copy link
Contributor

191 # Copy data
192 var_group.variables[new_var_name].set_auto_maskandscale(False)

--> 193 var_group.variables[new_var_name][:] = var_data

ValueError: shape mismatch: objects cannot be broadcast to a single shape. Mismatch is between arg 0 with shape (3495, 3495) and arg 1 with shape (3495, 2770).

@nlenssen2013
Copy link
Contributor Author

nlenssen2013 commented May 19, 2023

Unique groups needed for each lat_var_name.

    input_lats_mls = ['__HDF__swaths__o3__geo__latitude',
                      '__HDF__swaths__o3 columns__geo__latitude',
                      '__HDF__swaths__o3-apiori__geo__latitude']

unique groups should be for variable subsetting:

    expected_groups_mls = ['__HDF__swaths__o3',
                                               '__HDF__swaths__o3 columns',
                                               '__HDF__swaths__o3-apiori']

@nlenssen2013
Copy link
Contributor Author

191 # Copy data
192 var_group.variables[new_var_name].set_auto_maskandscale(False)

--> 193 var_group.variables[new_var_name][:] = var_data

ValueError: shape mismatch: objects cannot be broadcast to a single shape. Mismatch is between arg 0 with shape (3495, 3495) and arg 1 with shape (3495, 2770).

Error is caused by lat_var_name_prefix. [:-1] should be more generalized to the last index for a unique group rather than assuming the unique group name is always a group above the lat variable.

line 785: GROUP_DELIM.join(lat_var_name.strip(GROUP_DELIM).split(GROUP_DELIM)[:-1])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant