diff --git a/docs/whats_new.md b/docs/whats_new.md index 0039602..1856c94 100644 --- a/docs/whats_new.md +++ b/docs/whats_new.md @@ -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. diff --git a/particle_tracking_manager/models/opendrift/opendrift.py b/particle_tracking_manager/models/opendrift/opendrift.py index 1873997..4c0b32a 100644 --- a/particle_tracking_manager/models/opendrift/opendrift.py +++ b/particle_tracking_manager/models/opendrift/opendrift.py @@ -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( @@ -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={}, diff --git a/particle_tracking_manager/models/opendrift/utils.py b/particle_tracking_manager/models/opendrift/utils.py index 7c4443a..51bfbeb 100644 --- a/particle_tracking_manager/models/opendrift/utils.py +++ b/particle_tracking_manager/models/opendrift/utils.py @@ -10,7 +10,7 @@ from kerchunk.combine import MultiZarrToZarr -def make_ciofs_kerchunk(start, end): +def make_ciofs_kerchunk(start, end, name): """_summary_ Parameters @@ -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 diff --git a/particle_tracking_manager/the_manager.py b/particle_tracking_manager/the_manager.py index 4dc6577..9a2d645 100644 --- a/particle_tracking_manager/the_manager.py +++ b/particle_tracking_manager/the_manager.py @@ -17,6 +17,7 @@ _KNOWN_MODELS = [ "NWGOA", "CIOFS", + "CIOFSFRESH", "CIOFSOP", ]