-
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
40
commits into
delete-spacetime
Choose a base branch
from
joss-paper
base: delete-spacetime
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 32 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
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 45b3277
Merge branch 'main' into joss-paper
j-atkins 4a0cb0c
update draft
j-atkins cb38330
Merge branch 'delete-spacetime' into joss-paper
j-atkins fd40691
Merge branch 'delete-spacetime' into joss-paper
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 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] 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 aef558a
Merge branch 'delete-spacetime' into joss-paper
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
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,112 @@ | ||
| # %% | ||
|
|
||
| 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, | ||
| ) | ||
|
|
||
|
|
||
| # fig | ||
| fig = plt.figure(figsize=(12, 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 | ||
| ax0.set_title(r"$\bf{a}$" + ") MFP expedition overview", loc="left") | ||
| img = mpimg.imread(f"{SAMPLE_DIR}expedition_overview.png") | ||
| ax0.imshow(img) | ||
| ax0.axis("off") | ||
|
|
||
| # adcp | ||
| ax1.set_title(r"$\bf{b}$" + ") ADCP (flow speed)", loc="left") | ||
| ax1.set_ylabel("Depth (m)") | ||
| ax1.set_xlabel("Distance (km)") | ||
| plot_adcp(adcp_ds, ax1) | ||
| add_waypoint_markers(ax1, waypoint_distances) | ||
|
|
||
| # drifters | ||
| ax2.set_title(r"$\bf{c}$" + ") Surface drifters", loc="left") | ||
| plot_drifters( | ||
| drifter_ds, | ||
| ax2, | ||
| vmin=drifter_ds.temperature.min(), | ||
| vmax=drifter_ds.temperature.max(), | ||
| ) | ||
|
|
||
| # CTD (temperature) | ||
| ax3.set_title(r"$\bf{d}$" + ") CTD (temperature)", loc="left") | ||
| 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) | ||
| ax4.set_title(r"$\bf{e}$" + ") CTD (oxygen)", loc="left") | ||
| 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) | ||
|
|
||
| # %% |
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: