-
Notifications
You must be signed in to change notification settings - Fork 32
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
decouple mooring_array from cutout + bug + refactor + ... #399
Conversation
hmm I though adding |
hmm. I had to add |
this is taking way to long... I am going to restart the build of 3.11 |
Good, finally. FYI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a lot of work and is really really cool!
Feel free to merge this. I introduced some functions in |
Closes #378 #379 #384
Checklist
pytest
.black
andflake8
.Changes
This is essentially Part 2 of work I began back in March, when I started to work on
mooring_array
to allow compatibility withxoak
. Here, a substantially more challenging and overwhelming effort which I began in July, decouplesmooring_array
fromcutout
, and addresses various open issues. In particular it closes: #378 , #379, #384 . See also #398.To enumerate the features / fixes:
mooring_array
to be calculated without going throughcutout
first, whenever the extra argumentserial=True
is passed.serial=False
is the default behavior, and the new code implementation is separate from the previous way mooring_array works. This allows legacy code to remain intact.scipy
, and as a result OceanSpy will fail to build a tree when there is nan-data in the coordinates. This can happen with cutout + llc-data at high lats, resulting in an Error.mooring_array + serial=True
should be preferably used when face is a dimension.mooring_array
and also returns the pair (diffX
,diffY
), which is necessary formooring_volume_transport
. These variables are otherwise computed inmooring_volume_transport
in a way that is incompatible with datasets withface
as a dimension.mooring_array
+serial=True
, computes the coordinates [XU
,YU
,XV
,YV
] from the coordinates of themooring_array
. Before, these were computed duringcutout
for the entire area encompassing themooring_array
, which was extremely inefficient. These 4 variables are required to be present in the dataset when computingmooring_volume_transport
.In addition, this PR also refactors quite a bit
subsample
, although I had to create a bunch of functions and added them tollc_rearrange
.To see some of the behavior, I uploaded a testing notebook to GH, that is rather clean. The link is here: https://github.com/Mikejmnez/Notebooks/blob/main/ospy_mooring_latest.ipynb
Also, see this notebook for a comparison between the behavior of
mooring_array
via cutout (serial=False
) and the new implementation (serial=True
) with ECCO, one single snapshot.https://github.com/Mikejmnez/Notebooks/blob/main/Mooring_volume_transport.ipynb