-
Notifications
You must be signed in to change notification settings - Fork 10
JOSS manuscript #265
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
Open
j-atkins
wants to merge
79
commits into
main
Choose a base branch
from
joss-paper
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
JOSS manuscript #265
Changes from all commits
Commits
Show all changes
79 commits
Select commit
Hold shift + click to select a range
2ba9073
first round, delete SpaceTimeRegion object and related classes/methods
j-atkins e9dbd78
remove space time region from _plan
j-atkins 5a5e056
update base and instrument class logic to use waypoint extremes for s…
j-atkins b5eea49
clean up _plan methods
j-atkins ffe07fc
extend latlon buffer for drifters
j-atkins a5d692a
set time buffer from drifter lifetime config
j-atkins 6ebb41b
shift testing to use waypoint space-times instead of space-time-regio…
j-atkins 1f778ea
fix assert error messaging
j-atkins 14b8833
remove spatial constraint on fieldset ingestion
j-atkins f14ee31
partial first draft
j-atkins d209dd6
simulations for sample plots
j-atkins 350a772
next set of revisions to paper + new plotting
j-atkins 985abdf
enhance figure 1
j-atkins 155ed5c
edit manuscript
j-atkins a302408
clean up some todos
j-atkins 6444ffe
remove temporary debugging measures
j-atkins 1affd50
Merge branch 'main' into delete-spacetime
j-atkins 714b0bf
add control over whether to constrain spatial region in fieldset
j-atkins e820584
give argos a prescribed lifetime
j-atkins 7369f46
add lifetime field to expedition models and _plan
j-atkins 15848f3
update test with argo lifetime
j-atkins ba3793b
remove temporary debugging tools
j-atkins 340d940
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 45b3277
Merge branch 'main' into joss-paper
j-atkins 4a0cb0c
update draft
j-atkins cb38330
Merge branch 'delete-spacetime' into joss-paper
j-atkins 7eff191
update argo endtime and give depth lim in fieldset generation
j-atkins fd40691
Merge branch 'delete-spacetime' into joss-paper
j-atkins fd6a3f6
remove depth lim on fieldset generation
j-atkins 54fb025
new argo plot for example figure?
j-atkins 9ffb809
reference to VirtualFleet
j-atkins c22889f
edits to text
j-atkins ce1f01f
small edits to text, todos
j-atkins 142b7a0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 2a76df8
small edits to the manuscript
j-atkins dafc288
Merge branch 'joss-paper' of github.com:OceanParcels/virtualship into…
j-atkins efd2198
fix names and affiliations
ammedd fd1425f
Merge branch 'main' into joss-paper
j-atkins d5d1858
Apply suggestions from code review
j-atkins a83d918
Merge branch 'joss-paper' of github.com:OceanParcels/virtualship into…
j-atkins 2092dc0
incorporate suggestions
j-atkins e2663fc
incorporating further suggested edits
j-atkins 09d845c
clean up
j-atkins 7ee4dd9
update figure + small text edits
j-atkins 6f5426c
Merge branch 'delete-spacetime' into joss-paper
j-atkins 4a8bd9e
Apply suggestions from code review
j-atkins 53337c5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 308fd5c
update to just MFP
j-atkins 1f8a5b4
tidy up sample_expedition dir
j-atkins e707f9b
remove broken links
j-atkins edf8149
Merge branch 'main' into delete-spacetime
j-atkins fa4cd5f
Refactor plotting functions: add title helper, update labels for clar…
iuryt ced6cc3
Update figures: replace figure1.png and expedition_overview.png with …
iuryt cb16792
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] b00c85c
clean up comment
j-atkins 9906ea0
remove fraction and pad from cmap adding
j-atkins 483a993
rename function to _add_cbar
j-atkins c4c3d2b
re-compile sample pdf
j-atkins c13ae47
fix typo
j-atkins 86fa3f6
Merge branch 'delete-spacetime' of github.com:OceanParcels/virtualshi…
j-atkins ff43127
change lifetime in expedition model to be in days units
j-atkins 87de210
update _plan logic (+ more changes to expedition model) to handle lif…
j-atkins 593e0f2
small refactor for readability
j-atkins 6ae1317
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 2e8c14a
remove broken links
j-atkins 4fd2d77
Merge branch 'delete-spacetime' of github.com:OceanParcels/virtualshi…
j-atkins 984d441
update pre-downloaded data documentation to explain argo/drifter life…
j-atkins aef558a
Merge branch 'delete-spacetime' into joss-paper
j-atkins 009f09f
fix docs build?
j-atkins af3ec8c
another broken link
j-atkins 01dd1bb
Merge branch 'delete-spacetime' into joss-paper
j-atkins 982e52e
add error messaging for unsuported time units
j-atkins 1f4173e
Merge branch 'delete-spacetime' into joss-paper
j-atkins 5e73a03
Merge branch 'main' into joss-paper
j-atkins 88c9cf3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 99d706a
tidy up
j-atkins cf2c8da
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 2679cc7
minor changes
ammedd fab5e07
further small changes
j-atkins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| # %% | ||
|
|
||
| import cartopy.crs as ccrs | ||
| import matplotlib.gridspec as gridspec | ||
| import matplotlib.image as mpimg | ||
| import matplotlib.pyplot as plt | ||
| import numpy as np | ||
| import xarray as xr | ||
| from plotting_functions import ( | ||
| _ctd_distance_along_expedition, | ||
| plot_adcp, | ||
| plot_ctd, | ||
| plot_drifters, | ||
| ) | ||
|
|
||
| SAMPLE_DIR = "sample_expedition/" | ||
| CONFIG = "expedition.yaml" | ||
| EXPEDITION = "MY_EXPEDITION" | ||
|
|
||
| # %% | ||
|
|
||
| # VirtualShip output | ||
| ctd_ds = xr.open_dataset(f"{SAMPLE_DIR}{EXPEDITION}/results/ctd.zarr") | ||
| ctd_bgc_ds = xr.open_dataset(f"{SAMPLE_DIR}{EXPEDITION}/results/ctd_bgc.zarr") | ||
| drifter_ds = xr.open_dataset(f"{SAMPLE_DIR}{EXPEDITION}/results/drifter.zarr") | ||
| adcp_ds = xr.open_dataset(f"{SAMPLE_DIR}{EXPEDITION}/results/adcp.zarr") | ||
|
|
||
|
|
||
| # %% | ||
|
|
||
| # plot | ||
|
|
||
| PROJ = ccrs.PlateCarree() | ||
|
|
||
| waypoint_distances = np.unique(_ctd_distance_along_expedition(ctd_ds)["distance"]) | ||
|
|
||
|
|
||
| def add_waypoint_markers(ax, distances, offset=15, marker_size=70): | ||
| ax.scatter( | ||
| (distances / 1000), | ||
| np.zeros_like(distances) - offset, | ||
| marker="v", | ||
| color="black", | ||
| edgecolors="white", | ||
| s=marker_size, | ||
| clip_on=False, | ||
| ) | ||
|
|
||
|
|
||
| def add_title(ax, title, fontsize=13, y0=1.03): | ||
| """Add title.""" | ||
| ax.text( | ||
| 0, | ||
| y0, | ||
| title, | ||
| ha="left", | ||
| va="bottom", | ||
| transform=ax.transAxes, | ||
| fontsize=fontsize, | ||
| ) | ||
|
|
||
|
|
||
| # fig | ||
| fig = plt.figure(figsize=(9, 13), dpi=300) | ||
|
|
||
| # custom layout | ||
| gs = gridspec.GridSpec(3, 2, height_ratios=[1.5, 1, 1]) | ||
| ax0 = fig.add_subplot(gs[0, :]) | ||
| ax1 = fig.add_subplot(gs[1, 0]) | ||
| ax2 = fig.add_subplot(gs[1, 1], projection=PROJ) | ||
| ax3 = fig.add_subplot(gs[2, 0]) | ||
| ax4 = fig.add_subplot(gs[2, 1]) | ||
|
|
||
| # overview image | ||
| add_title(ax0, r"$\bf{a}$" + ") MFP expedition overview", y0=1.01) | ||
| img = mpimg.imread(f"{SAMPLE_DIR}expedition_overview.png") | ||
| ax0.imshow(img) | ||
| ax0.axis("off") | ||
|
|
||
| # adcp | ||
| add_title(ax1, r"$\bf{b}$" + ") ADCP (flow speed)") | ||
| ax1.set_ylabel("Depth (m)") | ||
| ax1.set_xlabel("Distance (km)") | ||
| plot_adcp(adcp_ds, ax1) | ||
| add_waypoint_markers(ax1, waypoint_distances) | ||
|
|
||
| # drifters | ||
| add_title(ax2, r"$\bf{c}$" + ") Surface drifters") | ||
| plot_drifters( | ||
| drifter_ds, | ||
| ax2, | ||
| vmin=drifter_ds.temperature.min(), | ||
| vmax=drifter_ds.temperature.max(), | ||
| ) | ||
|
|
||
| # CTD (temperature) | ||
| add_title(ax3, r"$\bf{d}$" + ") CTD (temperature)") | ||
| ax3.set_ylabel("Depth (m)") | ||
| ax3.set_xlabel("Distance (km)") | ||
| _, _distances_regular, _var_masked = plot_ctd( | ||
| ctd_ds, | ||
| ax3, | ||
| plot_variable="temperature", | ||
| vmin=ctd_ds.temperature.min(), | ||
| vmax=ctd_ds.temperature.max(), | ||
| ) | ||
|
|
||
| ctd_wp_distances = _distances_regular[np.nansum(_var_masked, axis=1) > 0] | ||
| add_waypoint_markers(ax3, ctd_wp_distances, offset=45, marker_size=60) | ||
|
|
||
| # CTD (oxygen) | ||
| add_title(ax4, r"$\bf{e}$" + ") CTD (oxygen)") | ||
| ax4.set_xlabel("Distance (km)") | ||
| plot_ctd( | ||
| ctd_bgc_ds, ax4, plot_variable="oxygen", vmin=0, vmax=ctd_bgc_ds.o2.max() | ||
| ) # vmin tailored to mark red as approximate oxygen minimum zone (~ 45 mmol/m-3) | ||
| add_waypoint_markers(ax4, ctd_wp_distances, offset=45, marker_size=60) | ||
|
|
||
|
|
||
| plt.tight_layout() | ||
| plt.show() | ||
|
|
||
| fig.savefig("figure1.png", dpi=300, bbox_inches="tight") | ||
|
|
||
| # %% |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I have a couple of suggestions for this figure. This is a version with some of my suggestions, but I could work on the
.pydirectly, but I couldn't makevirtualship run MY_EXPEDITIONwork. Do we have a tutorial on how to setup the environment usingpixi? The currentpyproject.tomldoes not have[tool.pixi.workspace].If you send the output files by email, I would be happy to directly add my suggestions to figure1.py.
What I changed in this figure: