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

added CIOFS Fresh #29

Merged
merged 3 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/whats_new.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# What's New

## v0.9.1 (October 25, 2024)

* Added local model option of CIOFS Fresh for which kerchunk files also can be generated on the fly

## v0.9.0 (July 26, 2024)

* Added utilities to generate kerchunk files on the fly for the time period of the simulation length for CIOFS and NWGOA. This has majorly sped up CIOFS simulations and modestly sped up NWGOA simulations.
Expand Down
19 changes: 15 additions & 4 deletions particle_tracking_manager/models/opendrift/opendrift.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,12 +682,19 @@ def run_add_reader(
end = (
f"{self.end_time.year}_{str(self.end_time.dayofyear).zfill(4)}"
)
loc_local = make_ciofs_kerchunk(start=start, end=end)
# loc_local = make_ciofs_kerchunk(start="2005_0052", end="2005_0068")
# loc_local = "/mnt/vault/ciofs/HINDCAST/ciofs_kerchunk_2005.parq"
# loc_local = "/mnt/vault/ciofs/HINDCAST/ciofs_kerchunk.parq"
loc_local = make_ciofs_kerchunk(start=start, end=end, name="ciofs")
loc_remote = "http://xpublish-ciofs.srv.axds.co/datasets/ciofs_hindcast/zarr/"

elif self.ocean_model == "CIOFSFRESH":
start = f"{self.start_time.year}_{str(self.start_time.dayofyear - 1).zfill(4)}"
end = (
f"{self.end_time.year}_{str(self.end_time.dayofyear).zfill(4)}"
)
loc_local = make_ciofs_kerchunk(
start=start, end=end, name="ciofs_fresh"
)
loc_remote = None

elif self.ocean_model == "CIOFSOP":

standard_name_mapping.update(
Expand Down Expand Up @@ -727,6 +734,10 @@ def run_add_reader(
# otherwise remote
else:
if ".nc" in loc_remote:

if self.ocean_model == "CIOFSFRESH":
raise NotImplementedError

ds = xr.open_dataset(
loc_remote,
chunks={},
Expand Down
4 changes: 2 additions & 2 deletions particle_tracking_manager/models/opendrift/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from kerchunk.combine import MultiZarrToZarr


def make_ciofs_kerchunk(start, end):
def make_ciofs_kerchunk(start, end, name):
"""_summary_

Parameters
Expand All @@ -25,7 +25,7 @@ def make_ciofs_kerchunk(start, end):
_description_
"""

output_dir_single_files = "/home/kristen/projects/kerchunk_setup/ciofs"
output_dir_single_files = f"/home/kristen/projects/kerchunk_setup/{name}"

fs2 = fsspec.filesystem("") # local file system to save final jsons to

Expand Down
1 change: 1 addition & 0 deletions particle_tracking_manager/the_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
_KNOWN_MODELS = [
"NWGOA",
"CIOFS",
"CIOFSFRESH",
"CIOFSOP",
]

Expand Down
Loading