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

Modify log statement? #1233

Open
kthyng opened this issue Feb 19, 2024 · 2 comments
Open

Modify log statement? #1233

kthyng opened this issue Feb 19, 2024 · 2 comments

Comments

@kthyng
Copy link
Contributor

kthyng commented Feb 19, 2024

Hi again. This is a small issue but I think I have investigated it multiple times unnecessarily so it would be nice to avoid in the future.

My understanding is that the code here:

if 'x_wind' not in variables:
logger.debug('No wind available to calculate Stokes drift')

checks the current set of variables for the presence of x_wind and if it isn't present, the log message is written. But, the first two times this code is called, the variables were:

variables
['land_binary_mask']

and then

variables
['sea_floor_depth_below_sea_level']

which caused the message to be written, but subsequently when the code was called that line wasn't written because x_wind was present in variables. Could the logic of that section be improved to know that while the wind isn't present in variables at the moment, it also shouldn't be? I am not sure what to suggest, not being very familiar with this section of code yet.

@knutfrode
Copy link
Collaborator

Yes, this is a bit messy. As a temporary solution, I disabled that log message:
#1236

and added a comment that that hardcoded calculation of stokesdrift from wind should instead be made using the newer feature of environment_mapping
https://github.com/OpenDrift/opendrift/blob/master/opendrift/readers/basereader/variables.py#L492

We can keep this issue open until this migration has been implemented.

@kthyng
Copy link
Contributor Author

kthyng commented Feb 27, 2024

Ok thank you.

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

2 participants