roms-tools 3.3.0__py3-none-any.whl → 3.5.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- roms_tools/__init__.py +1 -1
- roms_tools/analysis/cdr_ensemble.py +10 -13
- roms_tools/analysis/roms_output.py +5 -304
- roms_tools/{download.py → datasets/download.py} +1 -0
- roms_tools/{setup → datasets}/lat_lon_datasets.py +88 -64
- roms_tools/{setup → datasets}/river_datasets.py +9 -4
- roms_tools/datasets/roms_dataset.py +854 -0
- roms_tools/datasets/utils.py +487 -0
- roms_tools/{setup/fill.py → fill.py} +110 -13
- roms_tools/plot.py +4 -4
- roms_tools/regrid.py +76 -0
- roms_tools/setup/boundary_forcing.py +53 -45
- roms_tools/setup/cdr_release.py +2 -4
- roms_tools/setup/grid.py +46 -15
- roms_tools/setup/initial_conditions.py +330 -71
- roms_tools/setup/mask.py +2 -5
- roms_tools/setup/nesting.py +13 -6
- roms_tools/setup/river_forcing.py +4 -4
- roms_tools/setup/surface_forcing.py +15 -11
- roms_tools/setup/tides.py +7 -6
- roms_tools/setup/topography.py +10 -2
- roms_tools/setup/utils.py +292 -666
- roms_tools/tests/test_analysis/test_cdr_ensemble.py +4 -6
- roms_tools/tests/test_analysis/test_roms_output.py +1 -220
- roms_tools/tests/{test_setup → test_datasets}/test_lat_lon_datasets.py +4 -4
- roms_tools/tests/{test_setup → test_datasets}/test_river_datasets.py +1 -1
- roms_tools/tests/test_datasets/test_roms_dataset.py +743 -0
- roms_tools/tests/test_datasets/test_utils.py +527 -0
- roms_tools/tests/{test_setup/test_fill.py → test_fill.py} +72 -9
- roms_tools/tests/test_regrid.py +120 -1
- roms_tools/tests/test_setup/test_boundary_forcing.py +57 -138
- roms_tools/tests/test_setup/test_cdr_release.py +4 -5
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zarr.json +293 -2021
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/zarr.json +294 -2022
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/ALK/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/ALK_west → initial_conditions_from_roms.zarr/ALK}/zarr.json +11 -8
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/ALK_ALT_CO2/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/ALK_ALT_CO2_west → initial_conditions_from_roms.zarr/ALK_ALT_CO2}/zarr.json +11 -8
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/Cs_r/c/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_unified_climatology.zarr/diatFe_west → initial_conditions_from_roms.zarr/Cs_r}/zarr.json +5 -12
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/Cs_w/c/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/diatFe_west → initial_conditions_from_roms.zarr/Cs_w}/zarr.json +3 -10
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/DIC/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/DOCr_west → initial_conditions_from_roms.zarr/DIC}/zarr.json +11 -8
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/DIC_ALT_CO2/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/DIC_ALT_CO2/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/DOC/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/DOC/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/DOCr/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/DIC_ALT_CO2_west → initial_conditions_from_roms.zarr/DOCr}/zarr.json +11 -8
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/DON/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/DON/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/DONr/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/DONr/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/DOP/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/DOP/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/DOPr/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/DOPr/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/Fe/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/Fe/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/Lig/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/DOP_west → initial_conditions_from_roms.zarr/Lig}/zarr.json +11 -8
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/NH4/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/DON_west → initial_conditions_from_roms.zarr/NH4}/zarr.json +11 -8
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/NO3/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/NO3/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/O2/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/Lig_west → initial_conditions_from_roms.zarr/O2}/zarr.json +11 -8
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/PO4/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/PO4/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/SiO3/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/SiO3/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/abs_time/zarr.json +47 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/diatC/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/diatC_west → initial_conditions_from_roms.zarr/diatC}/zarr.json +11 -8
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/diatChl/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/diatChl_west → initial_conditions_from_roms.zarr/diatChl}/zarr.json +11 -8
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/diatFe/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/O2_west → initial_conditions_from_roms.zarr/diatFe}/zarr.json +11 -8
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/diatP/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/DIC_west → initial_conditions_from_roms.zarr/diatP}/zarr.json +11 -8
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/diatSi/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/DOC_west → initial_conditions_from_roms.zarr/diatSi}/zarr.json +11 -8
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/diazC/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/diazC/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/diazChl/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/diazChl_west → initial_conditions_from_roms.zarr/diazChl}/zarr.json +11 -8
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/diazFe/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/Fe_west → initial_conditions_from_roms.zarr/diazFe}/zarr.json +11 -8
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/diazP/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/diazP/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/ocean_time/c/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/ocean_time/zarr.json +47 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/salt/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_unified_climatology.zarr/ALK_west → initial_conditions_from_roms.zarr/salt}/zarr.json +12 -9
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/spC/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/spC/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/spCaCO3/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/spCaCO3/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/spChl/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/spChl_west → initial_conditions_from_roms.zarr/spChl}/zarr.json +11 -8
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/spFe/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/spFe/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/spP/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/spP/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/temp/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/temp/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/u/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/NH4_west → initial_conditions_from_roms.zarr/u}/zarr.json +12 -9
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/ubar/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/ubar/zarr.json +54 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/v/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/v/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/vbar/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/vbar/zarr.json +54 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/w/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/zarr.json +2481 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/zeta/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/zeta/zarr.json +54 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/zooC/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/zooC/zarr.json +57 -0
- roms_tools/tests/test_setup/test_grid.py +66 -1
- roms_tools/tests/test_setup/test_initial_conditions.py +130 -104
- roms_tools/tests/test_setup/test_nesting.py +2 -1
- roms_tools/tests/test_setup/test_surface_forcing.py +1 -1
- roms_tools/tests/test_setup/test_tides.py +1 -1
- roms_tools/tests/test_setup/test_utils.py +100 -15
- roms_tools/tests/test_setup/test_validation.py +15 -0
- roms_tools/tests/test_tiling/test_partition.py +63 -15
- roms_tools/tests/test_utils.py +365 -0
- roms_tools/tiling/partition.py +81 -211
- roms_tools/utils.py +360 -62
- {roms_tools-3.3.0.dist-info → roms_tools-3.5.0.dist-info}/METADATA +2 -3
- {roms_tools-3.3.0.dist-info → roms_tools-3.5.0.dist-info}/RECORD +137 -174
- {roms_tools-3.3.0.dist-info → roms_tools-3.5.0.dist-info}/WHEEL +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_ALT_CO2_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_ALT_CO2_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOC_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOCr_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DON_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DONr_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DONr_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOP_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOPr_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOPr_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Fe_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Lig_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NH4_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NO3_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NO3_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/O2_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/PO4_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/PO4_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/SiO3_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/SiO3_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatC_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatChl_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatFe_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatP_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatP_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatSi_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatSi_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazC_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazC_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazChl_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazFe_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazFe_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazP_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazP_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spC_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spC_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spCaCO3_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spCaCO3_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spChl_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spFe_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spFe_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spP_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spP_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zooC_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zooC_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/ALK_ALT_CO2_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/ALK_ALT_CO2_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/ALK_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DIC_ALT_CO2_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DIC_ALT_CO2_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DIC_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DIC_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DOC_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DOC_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DOCr_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DOCr_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DON_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DON_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DONr_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DONr_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DOP_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DOP_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DOPr_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DOPr_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/Fe_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/Fe_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/Lig_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/Lig_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/NH4_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/NH4_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/NO3_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/NO3_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/O2_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/O2_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/PO4_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/PO4_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/SiO3_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/SiO3_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diatC_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diatC_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diatChl_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diatChl_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diatFe_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diatP_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diatP_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diatSi_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diatSi_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diazC_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diazC_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diazChl_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diazChl_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diazFe_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diazFe_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diazP_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diazP_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/spC_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/spC_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/spCaCO3_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/spCaCO3_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/spChl_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/spChl_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/spFe_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/spFe_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/spP_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/spP_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/zooC_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/zooC_west/zarr.json +0 -54
- {roms_tools-3.3.0.dist-info → roms_tools-3.5.0.dist-info}/licenses/LICENSE +0 -0
- {roms_tools-3.3.0.dist-info → roms_tools-3.5.0.dist-info}/top_level.txt +0 -0
|
@@ -16,22 +16,32 @@ import numpy as np
|
|
|
16
16
|
import xarray as xr
|
|
17
17
|
|
|
18
18
|
from roms_tools.constants import R_EARTH
|
|
19
|
-
from roms_tools.download import (
|
|
19
|
+
from roms_tools.datasets.download import (
|
|
20
20
|
download_correction_data,
|
|
21
21
|
download_sal_data,
|
|
22
22
|
download_topo,
|
|
23
23
|
)
|
|
24
|
-
from roms_tools.
|
|
24
|
+
from roms_tools.datasets.utils import (
|
|
25
|
+
check_dataset,
|
|
26
|
+
convert_to_float64,
|
|
27
|
+
extrapolate_deepest_to_bottom,
|
|
28
|
+
select_relevant_fields,
|
|
29
|
+
select_relevant_times,
|
|
30
|
+
validate_start_end_time,
|
|
31
|
+
)
|
|
32
|
+
from roms_tools.fill import LateralFill
|
|
25
33
|
from roms_tools.setup.utils import (
|
|
26
34
|
Timed,
|
|
27
35
|
assign_dates_to_climatology,
|
|
28
|
-
check_dataset,
|
|
29
36
|
get_target_coords,
|
|
37
|
+
)
|
|
38
|
+
from roms_tools.utils import (
|
|
39
|
+
get_dask_chunks,
|
|
40
|
+
get_pkg_error_msg,
|
|
41
|
+
has_gcsfs,
|
|
30
42
|
interpolate_cyclic_time,
|
|
31
|
-
|
|
32
|
-
select_relevant_times,
|
|
43
|
+
load_data,
|
|
33
44
|
)
|
|
34
|
-
from roms_tools.utils import get_dask_chunks, get_pkg_error_msg, has_gcsfs, load_data
|
|
35
45
|
|
|
36
46
|
TConcatEndTypes = Literal["lower", "upper", "both"]
|
|
37
47
|
REPO_ROOT = Path(__file__).resolve().parents[2]
|
|
@@ -121,11 +131,11 @@ class LatLonDataset:
|
|
|
121
131
|
var_names: dict[str, str]
|
|
122
132
|
opt_var_names: dict[str, str] = field(default_factory=dict)
|
|
123
133
|
climatology: bool = False
|
|
124
|
-
needs_lateral_fill: bool
|
|
134
|
+
needs_lateral_fill: bool = True
|
|
125
135
|
use_dask: bool = False
|
|
126
136
|
read_zarr: bool = False
|
|
127
137
|
allow_flex_time: bool = False
|
|
128
|
-
apply_post_processing: bool
|
|
138
|
+
apply_post_processing: bool = True
|
|
129
139
|
|
|
130
140
|
ds_loader_fn: Callable[[], xr.Dataset] | None = None
|
|
131
141
|
is_global: bool = field(init=False, repr=False)
|
|
@@ -140,21 +150,11 @@ class LatLonDataset:
|
|
|
140
150
|
4. Ensures latitude, longitude, and depth values are in ascending order.
|
|
141
151
|
5. Checks if the dataset covers the entire globe and adjusts if necessary.
|
|
142
152
|
"""
|
|
143
|
-
|
|
144
|
-
if self.start_time is not None and not isinstance(self.start_time, datetime):
|
|
145
|
-
raise TypeError(
|
|
146
|
-
f"start_time must be a datetime object, but got {type(self.start_time).__name__}."
|
|
147
|
-
)
|
|
148
|
-
if self.end_time is not None and not isinstance(self.end_time, datetime):
|
|
149
|
-
raise TypeError(
|
|
150
|
-
f"end_time must be a datetime object, but got {type(self.end_time).__name__}."
|
|
151
|
-
)
|
|
152
|
-
|
|
153
|
+
validate_start_end_time(self.start_time, self.end_time)
|
|
153
154
|
ds = self.load_data()
|
|
154
155
|
ds = self.clean_up(ds)
|
|
155
|
-
|
|
156
|
+
check_dataset(ds, self.dim_names, self.var_names, self.opt_var_names)
|
|
156
157
|
|
|
157
|
-
# Select relevant fields
|
|
158
158
|
ds = self.select_relevant_fields(ds)
|
|
159
159
|
|
|
160
160
|
# Select relevant times
|
|
@@ -226,44 +226,30 @@ class LatLonDataset:
|
|
|
226
226
|
"""
|
|
227
227
|
return ds # Default behavior (no-op, subclasses should override)
|
|
228
228
|
|
|
229
|
-
def
|
|
230
|
-
"""Check if the dataset contains the specified variables and dimensions.
|
|
231
|
-
|
|
232
|
-
Parameters
|
|
233
|
-
----------
|
|
234
|
-
ds : xr.Dataset
|
|
235
|
-
The xarray Dataset to check.
|
|
236
|
-
|
|
237
|
-
Raises
|
|
238
|
-
------
|
|
239
|
-
ValueError
|
|
240
|
-
If the dataset does not contain the specified variables or dimensions.
|
|
229
|
+
def select_relevant_fields(self, ds: xr.Dataset) -> xr.Dataset:
|
|
241
230
|
"""
|
|
242
|
-
|
|
231
|
+
Return a subset of the dataset containing only the required and optional
|
|
232
|
+
variables defined for this object.
|
|
243
233
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
234
|
+
Variables retained are those listed in ``self.var_names`` and
|
|
235
|
+
``self.opt_var_names``. Any other data variables are removed, except for
|
|
236
|
+
the special variable ``"mask"``, which is always preserved if present.
|
|
247
237
|
|
|
248
238
|
Parameters
|
|
249
239
|
----------
|
|
250
240
|
ds : xr.Dataset
|
|
251
|
-
The input dataset from which variables will be selected.
|
|
241
|
+
The input dataset from which relevant variables will be selected.
|
|
252
242
|
|
|
253
243
|
Returns
|
|
254
244
|
-------
|
|
255
245
|
xr.Dataset
|
|
256
|
-
A dataset containing only the variables specified in
|
|
246
|
+
A new dataset containing only the required variables specified in
|
|
247
|
+
``self.var_names`` and the optional variables specified in
|
|
248
|
+
``self.opt_var_names``, along with ``"mask"`` if present.
|
|
257
249
|
"""
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
and var not in self.opt_var_names.values()
|
|
262
|
-
and var != "mask"
|
|
263
|
-
):
|
|
264
|
-
ds = ds.drop_vars(var)
|
|
265
|
-
|
|
266
|
-
return ds
|
|
250
|
+
return select_relevant_fields(
|
|
251
|
+
ds, [*self.var_names.values(), *self.opt_var_names.values()]
|
|
252
|
+
)
|
|
267
253
|
|
|
268
254
|
def add_time_info(self, ds: xr.Dataset) -> xr.Dataset:
|
|
269
255
|
"""Dummy method to be overridden by child classes to add time information to the
|
|
@@ -336,12 +322,13 @@ class LatLonDataset:
|
|
|
336
322
|
raise ValueError("select_relevant_times called but start_time is None.")
|
|
337
323
|
|
|
338
324
|
ds = select_relevant_times(
|
|
339
|
-
ds,
|
|
340
|
-
time_dim,
|
|
341
|
-
|
|
342
|
-
self.
|
|
343
|
-
self.
|
|
344
|
-
self.
|
|
325
|
+
ds=ds,
|
|
326
|
+
time_dim=time_dim,
|
|
327
|
+
time_coord=time_dim,
|
|
328
|
+
start_time=self.start_time,
|
|
329
|
+
end_time=self.end_time,
|
|
330
|
+
climatology=self.climatology,
|
|
331
|
+
allow_flex_time=self.allow_flex_time,
|
|
345
332
|
)
|
|
346
333
|
|
|
347
334
|
return ds
|
|
@@ -543,7 +530,7 @@ class LatLonDataset:
|
|
|
543
530
|
None
|
|
544
531
|
This method modifies the dataset in place and does not return anything.
|
|
545
532
|
"""
|
|
546
|
-
ds =
|
|
533
|
+
ds = convert_to_float64(self.ds)
|
|
547
534
|
self.ds = ds
|
|
548
535
|
|
|
549
536
|
return None
|
|
@@ -635,7 +622,7 @@ class LatLonDataset:
|
|
|
635
622
|
if self.needs_lateral_fill:
|
|
636
623
|
lateral_fill = LateralFill(
|
|
637
624
|
self.ds["mask"],
|
|
638
|
-
|
|
625
|
+
(self.dim_names["latitude"], self.dim_names["longitude"]),
|
|
639
626
|
)
|
|
640
627
|
|
|
641
628
|
separate_fill_for_velocities = False
|
|
@@ -644,7 +631,7 @@ class LatLonDataset:
|
|
|
644
631
|
if "mask_vel" in self.ds.data_vars:
|
|
645
632
|
lateral_fill_vel = LateralFill(
|
|
646
633
|
self.ds["mask_vel"],
|
|
647
|
-
|
|
634
|
+
(self.dim_names["latitude"], self.dim_names["longitude"]),
|
|
648
635
|
)
|
|
649
636
|
separate_fill_for_velocities = True
|
|
650
637
|
|
|
@@ -672,11 +659,19 @@ class LatLonDataset:
|
|
|
672
659
|
propagating the deepest available data downward.
|
|
673
660
|
"""
|
|
674
661
|
if "depth" in self.dim_names:
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
662
|
+
self.ds = extrapolate_deepest_to_bottom(self.ds, self.dim_names["depth"])
|
|
663
|
+
|
|
664
|
+
def rotate_velocities_to_east_and_north(self) -> None:
|
|
665
|
+
"""
|
|
666
|
+
Rotate velocity components to east/north directions.
|
|
667
|
+
|
|
668
|
+
For lat-lon datasets, velocity components are already defined in
|
|
669
|
+
earth-relative east/north coordinates. Therefore, no rotation is
|
|
670
|
+
required and this method is a no-op.
|
|
671
|
+
This method is provided for API compatibility with ROMSDataset,
|
|
672
|
+
where an explicit rotation using the grid angle is necessary.
|
|
673
|
+
"""
|
|
674
|
+
return None
|
|
680
675
|
|
|
681
676
|
@classmethod
|
|
682
677
|
def from_ds(cls, original_dataset: LatLonDataset, ds: xr.Dataset) -> LatLonDataset:
|
|
@@ -1106,7 +1101,7 @@ class UnifiedDataset(LatLonDataset):
|
|
|
1106
1101
|
attribute is set to `False`.
|
|
1107
1102
|
"""
|
|
1108
1103
|
|
|
1109
|
-
needs_lateral_fill: bool
|
|
1104
|
+
needs_lateral_fill: bool = False
|
|
1110
1105
|
|
|
1111
1106
|
# overwrite clean_up method from parent class
|
|
1112
1107
|
def clean_up(self, ds: xr.Dataset) -> xr.Dataset:
|
|
@@ -1147,7 +1142,8 @@ class UnifiedDataset(LatLonDataset):
|
|
|
1147
1142
|
if var_name in ds.data_vars and "season" in ds[var_name].dims:
|
|
1148
1143
|
ds[var_name] = interpolate_cyclic_time(
|
|
1149
1144
|
ds[var_name],
|
|
1150
|
-
|
|
1145
|
+
time_dim="season",
|
|
1146
|
+
time_coord="season",
|
|
1151
1147
|
day_of_year=ds["month"],
|
|
1152
1148
|
)
|
|
1153
1149
|
|
|
@@ -1671,6 +1667,7 @@ class ETOPO5Dataset(LatLonDataset):
|
|
|
1671
1667
|
dim_names: dict[str, str] = field(
|
|
1672
1668
|
default_factory=lambda: {"longitude": "lon", "latitude": "lat"}
|
|
1673
1669
|
)
|
|
1670
|
+
needs_lateral_fill: bool = False
|
|
1674
1671
|
|
|
1675
1672
|
def clean_up(self, ds: xr.Dataset) -> xr.Dataset:
|
|
1676
1673
|
"""Assign lat and lon as coordinates.
|
|
@@ -1706,6 +1703,32 @@ class SRTM15Dataset(LatLonDataset):
|
|
|
1706
1703
|
dim_names: dict[str, str] = field(
|
|
1707
1704
|
default_factory=lambda: {"longitude": "lon", "latitude": "lat"}
|
|
1708
1705
|
)
|
|
1706
|
+
needs_lateral_fill: bool = False
|
|
1707
|
+
|
|
1708
|
+
|
|
1709
|
+
@dataclass(kw_only=True)
|
|
1710
|
+
class EMODDataset(LatLonDataset):
|
|
1711
|
+
"""Represents topography data on the original grid from the EMOD dataset."""
|
|
1712
|
+
|
|
1713
|
+
var_names: dict[str, str] = field(
|
|
1714
|
+
default_factory=lambda: {
|
|
1715
|
+
"topo": "elevation",
|
|
1716
|
+
}
|
|
1717
|
+
)
|
|
1718
|
+
dim_names: dict[str, str] = field(
|
|
1719
|
+
default_factory=lambda: {"longitude": "lon", "latitude": "lat"}
|
|
1720
|
+
)
|
|
1721
|
+
needs_lateral_fill: bool = True
|
|
1722
|
+
|
|
1723
|
+
def post_process(self) -> None:
|
|
1724
|
+
"""Assign land mask."""
|
|
1725
|
+
mask = xr.where(
|
|
1726
|
+
self.ds[self.var_names["topo"]].isnull(),
|
|
1727
|
+
0,
|
|
1728
|
+
1,
|
|
1729
|
+
)
|
|
1730
|
+
|
|
1731
|
+
self.ds["mask"] = mask
|
|
1709
1732
|
|
|
1710
1733
|
|
|
1711
1734
|
@dataclass
|
|
@@ -2331,7 +2354,7 @@ def choose_subdomain(
|
|
|
2331
2354
|
resolution: float,
|
|
2332
2355
|
is_global: bool,
|
|
2333
2356
|
target_coords: Mapping[str, Any],
|
|
2334
|
-
buffer_points: int =
|
|
2357
|
+
buffer_points: int = DEFAULT_NR_BUFFER_POINTS,
|
|
2335
2358
|
use_dask: bool = False,
|
|
2336
2359
|
) -> xr.Dataset:
|
|
2337
2360
|
"""
|
|
@@ -2433,6 +2456,7 @@ def choose_subdomain(
|
|
|
2433
2456
|
if lon_min - margin < 0:
|
|
2434
2457
|
lon_min += 360
|
|
2435
2458
|
lon_max += 360
|
|
2459
|
+
|
|
2436
2460
|
# Select the subdomain in longitude direction
|
|
2437
2461
|
subdomain = subdomain.sel(
|
|
2438
2462
|
**{
|
|
@@ -7,12 +7,11 @@ from pathlib import Path
|
|
|
7
7
|
import numpy as np
|
|
8
8
|
import xarray as xr
|
|
9
9
|
|
|
10
|
-
from roms_tools.download import download_river_data
|
|
10
|
+
from roms_tools.datasets.download import download_river_data
|
|
11
|
+
from roms_tools.datasets.utils import check_dataset, select_relevant_times
|
|
11
12
|
from roms_tools.setup.utils import (
|
|
12
13
|
assign_dates_to_climatology,
|
|
13
|
-
check_dataset,
|
|
14
14
|
gc_dist,
|
|
15
|
-
select_relevant_times,
|
|
16
15
|
)
|
|
17
16
|
from roms_tools.utils import load_data
|
|
18
17
|
|
|
@@ -198,7 +197,13 @@ class RiverDataset:
|
|
|
198
197
|
"""
|
|
199
198
|
time_dim = self.dim_names["time"]
|
|
200
199
|
|
|
201
|
-
ds = select_relevant_times(
|
|
200
|
+
ds = select_relevant_times(
|
|
201
|
+
ds=ds,
|
|
202
|
+
time_dim=time_dim,
|
|
203
|
+
time_coord=time_dim,
|
|
204
|
+
start_time=self.start_time,
|
|
205
|
+
end_time=self.end_time,
|
|
206
|
+
)
|
|
202
207
|
|
|
203
208
|
return ds
|
|
204
209
|
|