-
Notifications
You must be signed in to change notification settings - Fork 10
Add XBT instrument simulation based on CTD #76
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
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
|
It passed the tests (including the one I created for XBT), but I have not tried or implemented it in a tutorial. I hope I made your day with this PR, @ammedd ! haha |
erikvansebille
left a comment
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.
Nice addition, @iuryt! Thanks for the contribution. Can you lok at these review comments I provided?
Co-authored-by: Erik van Sebille <[email protected]>
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Co-authored-by: Erik van Sebille <[email protected]>
|
It seems like this is failing the test because it is reaching almost at the maximum depth, but not really there (e.g. Do you have any idea what it could be? FAILED tests/instruments/test_xbt.py::test_simulate_xbts - AssertionError: Observation incorrect xbt_i=0 loc='maxdepth' var='temperature' obs_value=7.965900421142578 exp_value=8.https://github.com/OceanParcels/virtualship/actions/runs/11781564925/job/32816812061#step:5:1886 Edit: I think I know. Maybe this is because the fall speed is a float number and basically we reach the condition ( If you agree, we can either change the |
Yes I agree that would be the likely culprit
Hmm, changing # Delete particle if depth is exactly max_depth
if particle.depth + particle_ddepth == particle.max_depth:
particle.delete()
# Set particle depth to max depth if it's too deep
if particle.depth + particle_ddepth < particle.max_depth:
particle_ddepth = particle.max_depth - particle.depthSince the second |
for more information, see https://pre-commit.ci
|
It was never reaching the first condition, I changed it to particle.depth == particle.max_depth I ran the pytests and it worked locally. What do you think? |
|
Yep that sounds correct. |
|
@erikvansebille |
Summary
This PR introduces a new instrument simulation,
xbt.py, located in theinstruments/directory. Thexbt.pyfile is modeled onctd.pyand is designed to simulate data collection for Expendable Bathythermographs (XBTs), which capture water temperature at varying depths.Changes
xbt.pytoinstruments/directory for XBT data simulation.test_xbt.pybased ontest_ctd.pyinstruments/__init__.pyto includexbt.pyin the module exports.Notes
Next Steps