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

Creating MetDataArray with wrap_longitude=True in _contrail_optical_depth_above_contrail_layer() #219

Open
widmka opened this issue Jul 17, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@widmka
Copy link

widmka commented Jul 17, 2024

Description
I am running into
ValueError: Set 'copy=True' when using 'wrap_longitude=True'
at

mda = MetDataArray(da, wrap_longitude=wrap_longitude, copy=False)
,since copy=False...
Is this intended and does it indicate a problem with my input? Or could I set copy=wrap_longitude as a quick fix?

Details

  • Version: pycontrails==0.52.1
@widmka widmka added the bug Something isn't working label Jul 17, 2024
@thabbott
Copy link
Contributor

thabbott commented Jul 24, 2024

This seems like a problem with our code, not with your input. We have some logic on the previous line to figure out whether wrap_longitude should be True or False, but only one of those values is accepted by the MetDataArray constructor....

I'm not sure exactly how you're using pycontrails, but if you're creating a MetDataset and then using it to run CoCiP you should be able to avoid this issue by setting wrap_longitude=True when you create the MetDataset. That way the longitude will already be wrapped by the time CoCiP gets to this line of code. (That won't help, since da is created from CoCiP output and not necessarily on the same grid as your met data.) Yes, I think setting copy=wrap_longitude as a quick fix will work, though it's possible you might see some performance degradation. I'll work on a patch on our end too, though. Thanks for bringing the issue to our attention!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants