Skip to content

Commit

Permalink
Merge pull request #29 from axiom-data-science/mostly_kerchunk_improv…
Browse files Browse the repository at this point in the history
…ements

added CIOFS Fresh
  • Loading branch information
kthyng authored Oct 25, 2024
2 parents 66d6047 + a2b3454 commit af96e94
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
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

0 comments on commit af96e94

Please sign in to comment.