roms-tools 1.6.1__py3-none-any.whl → 1.7.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.
- ci/environment.yml +1 -1
- roms_tools/__init__.py +5 -1
- roms_tools/_version.py +1 -1
- roms_tools/setup/boundary_forcing.py +128 -146
- roms_tools/setup/datasets.py +779 -192
- roms_tools/setup/download.py +30 -0
- roms_tools/setup/grid.py +8 -10
- roms_tools/setup/initial_conditions.py +77 -96
- roms_tools/setup/plot.py +144 -24
- roms_tools/setup/river_forcing.py +589 -0
- roms_tools/setup/surface_forcing.py +33 -138
- roms_tools/setup/tides.py +24 -76
- roms_tools/setup/utils.py +274 -7
- roms_tools/tests/test_setup/test_boundary_forcing.py +98 -5
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/.zmetadata +157 -130
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_ALT_CO2_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_ALT_CO2_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_ALT_CO2_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_ALT_CO2_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_ALT_CO2_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_ALT_CO2_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_ALT_CO2_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_ALT_CO2_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_ALT_CO2_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_ALT_CO2_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_ALT_CO2_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_ALT_CO2_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_ALT_CO2_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_ALT_CO2_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOC_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOC_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOC_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOC_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOC_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOC_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOC_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOCr_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOCr_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOCr_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOCr_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOCr_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOCr_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOCr_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DON_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DON_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DON_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DON_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DON_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DON_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DON_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DONr_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DONr_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DONr_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DONr_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DONr_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DONr_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DONr_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOP_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOP_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOP_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOP_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOP_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOP_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOP_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOPr_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOPr_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOPr_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOPr_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOPr_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOPr_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOPr_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Fe_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Fe_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Fe_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Fe_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Fe_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Fe_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Fe_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Lig_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Lig_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Lig_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Lig_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Lig_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Lig_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Lig_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NH4_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NH4_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NH4_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NH4_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NH4_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NH4_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NH4_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NH4_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NO3_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NO3_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NO3_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NO3_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NO3_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NO3_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NO3_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/O2_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/O2_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/O2_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/O2_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/O2_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/O2_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/O2_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/PO4_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/PO4_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/PO4_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/PO4_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/PO4_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/PO4_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/PO4_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/SiO3_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/SiO3_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/SiO3_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/SiO3_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/SiO3_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/SiO3_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/SiO3_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/abs_time/.zattrs +1 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/bry_time/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatC_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatC_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatC_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatC_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatC_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatC_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatC_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatC_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatChl_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatChl_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatChl_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatChl_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatChl_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatChl_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatChl_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatChl_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatFe_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatFe_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatFe_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatFe_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatFe_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatFe_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatFe_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatFe_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatP_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatP_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatP_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatP_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatP_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatP_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatP_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatP_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatSi_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatSi_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatSi_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatSi_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatSi_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatSi_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatSi_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatSi_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazC_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazC_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazC_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazC_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazC_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazC_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazC_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazC_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazChl_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazChl_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazChl_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazChl_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazChl_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazChl_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazChl_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazChl_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazFe_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazFe_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazFe_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazFe_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazFe_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazFe_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazFe_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazFe_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazP_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazP_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazP_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazP_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazP_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazP_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazP_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazP_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/month/.zarray +20 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/month/.zattrs +6 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/month/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spC_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spC_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spC_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spC_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spC_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spC_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spC_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spC_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spCaCO3_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spCaCO3_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spCaCO3_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spCaCO3_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spCaCO3_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spCaCO3_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spCaCO3_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spCaCO3_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spChl_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spChl_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spChl_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spChl_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spChl_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spChl_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spChl_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spChl_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spFe_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spFe_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spFe_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spFe_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spFe_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spFe_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spFe_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spFe_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spP_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spP_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spP_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spP_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spP_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spP_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spP_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spP_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zooC_east/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zooC_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zooC_north/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zooC_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zooC_south/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zooC_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zooC_west/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zooC_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/.zmetadata +39 -12
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/abs_time/.zattrs +1 -0
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/dust/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/dust_time/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/iron/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/iron_time/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/month/.zarray +20 -0
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/month/.zattrs +6 -0
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/month/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/nhy/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/nhy_time/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/nox/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/nox_time/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/pco2_air/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/pco2_air_alt/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/pco2_time/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/.zmetadata +0 -7
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/abs_time/.zattrs +0 -3
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/salt_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/salt_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/temp_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/temp_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/u_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/u_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/u_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/ubar_east/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/ubar_south/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/ubar_west/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/v_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/v_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/v_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/v_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/vbar_east/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/vbar_north/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/vbar_south/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/vbar_west/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/zeta_east/.zattrs +0 -1
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/zeta_east/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/zeta_north/.zattrs +0 -1
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/zeta_south/.zattrs +0 -1
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/zeta_south/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/zeta_west/.zattrs +0 -1
- roms_tools/tests/test_setup/test_data/river_forcing.zarr/.zattrs +3 -0
- roms_tools/tests/test_setup/test_data/river_forcing.zarr/.zgroup +3 -0
- roms_tools/tests/test_setup/test_data/river_forcing.zarr/.zmetadata +214 -0
- roms_tools/tests/test_setup/test_data/river_forcing.zarr/abs_time/.zarray +20 -0
- roms_tools/tests/test_setup/test_data/river_forcing.zarr/abs_time/.zattrs +8 -0
- roms_tools/tests/test_setup/test_data/river_forcing.zarr/abs_time/0 +0 -0
- roms_tools/tests/test_setup/test_data/river_forcing.zarr/month/.zarray +20 -0
- roms_tools/tests/test_setup/test_data/river_forcing.zarr/month/.zattrs +6 -0
- roms_tools/tests/test_setup/test_data/river_forcing.zarr/month/0 +0 -0
- roms_tools/tests/test_setup/test_data/river_forcing.zarr/river_name/.zarray +24 -0
- roms_tools/tests/test_setup/test_data/river_forcing.zarr/river_name/.zattrs +6 -0
- roms_tools/tests/test_setup/test_data/river_forcing.zarr/river_name/0 +0 -0
- roms_tools/tests/test_setup/test_data/river_forcing.zarr/river_time/.zarray +20 -0
- roms_tools/tests/test_setup/test_data/river_forcing.zarr/river_time/.zattrs +8 -0
- roms_tools/tests/test_setup/test_data/river_forcing.zarr/river_time/0 +0 -0
- roms_tools/tests/test_setup/test_data/river_forcing.zarr/river_tracer/.zarray +24 -0
- roms_tools/tests/test_setup/test_data/river_forcing.zarr/river_tracer/.zattrs +10 -0
- roms_tools/tests/test_setup/test_data/river_forcing.zarr/river_tracer/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/river_forcing.zarr/river_volume/.zarray +22 -0
- roms_tools/tests/test_setup/test_data/river_forcing.zarr/river_volume/.zattrs +9 -0
- roms_tools/tests/test_setup/test_data/river_forcing.zarr/river_volume/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/river_forcing.zarr/tracer_name/.zarray +20 -0
- roms_tools/tests/test_setup/test_data/river_forcing.zarr/tracer_name/.zattrs +6 -0
- roms_tools/tests/test_setup/test_data/river_forcing.zarr/tracer_name/0 +0 -0
- roms_tools/tests/test_setup/test_data/river_forcing_no_climatology.zarr/.zattrs +1 -0
- roms_tools/tests/test_setup/test_data/river_forcing_no_climatology.zarr/.zgroup +3 -0
- roms_tools/tests/test_setup/test_data/river_forcing_no_climatology.zarr/.zmetadata +185 -0
- roms_tools/tests/test_setup/test_data/river_forcing_no_climatology.zarr/abs_time/.zarray +20 -0
- roms_tools/tests/test_setup/test_data/river_forcing_no_climatology.zarr/abs_time/.zattrs +8 -0
- roms_tools/tests/test_setup/test_data/river_forcing_no_climatology.zarr/abs_time/0 +0 -0
- roms_tools/tests/test_setup/test_data/river_forcing_no_climatology.zarr/river_name/.zarray +24 -0
- roms_tools/tests/test_setup/test_data/river_forcing_no_climatology.zarr/river_name/.zattrs +6 -0
- roms_tools/tests/test_setup/test_data/river_forcing_no_climatology.zarr/river_name/0 +0 -0
- roms_tools/tests/test_setup/test_data/river_forcing_no_climatology.zarr/river_time/.zarray +20 -0
- roms_tools/tests/test_setup/test_data/river_forcing_no_climatology.zarr/river_time/.zattrs +7 -0
- roms_tools/tests/test_setup/test_data/river_forcing_no_climatology.zarr/river_time/0 +0 -0
- roms_tools/tests/test_setup/test_data/river_forcing_no_climatology.zarr/river_tracer/.zarray +24 -0
- roms_tools/tests/test_setup/test_data/river_forcing_no_climatology.zarr/river_tracer/.zattrs +10 -0
- roms_tools/tests/test_setup/test_data/river_forcing_no_climatology.zarr/river_tracer/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/river_forcing_no_climatology.zarr/river_volume/.zarray +22 -0
- roms_tools/tests/test_setup/test_data/river_forcing_no_climatology.zarr/river_volume/.zattrs +9 -0
- roms_tools/tests/test_setup/test_data/river_forcing_no_climatology.zarr/river_volume/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/river_forcing_no_climatology.zarr/tracer_name/.zarray +20 -0
- roms_tools/tests/test_setup/test_data/river_forcing_no_climatology.zarr/tracer_name/.zattrs +6 -0
- roms_tools/tests/test_setup/test_data/river_forcing_no_climatology.zarr/tracer_name/0 +0 -0
- roms_tools/tests/test_setup/test_datasets.py +8 -3
- roms_tools/tests/test_setup/test_grid.py +6 -5
- roms_tools/tests/test_setup/test_initial_conditions.py +0 -2
- roms_tools/tests/test_setup/test_river_forcing.py +366 -0
- roms_tools/tests/test_setup/test_surface_forcing.py +0 -2
- roms_tools/tests/test_setup/test_tides.py +0 -2
- roms_tools/tests/test_setup/test_validation.py +4 -0
- roms_tools/utils.py +12 -10
- {roms_tools-1.6.1.dist-info → roms_tools-1.7.0.dist-info}/METADATA +5 -5
- {roms_tools-1.6.1.dist-info → roms_tools-1.7.0.dist-info}/RECORD +362 -309
- {roms_tools-1.6.1.dist-info → roms_tools-1.7.0.dist-info}/WHEEL +1 -1
- {roms_tools-1.6.1.dist-info → roms_tools-1.7.0.dist-info}/LICENSE +0 -0
- {roms_tools-1.6.1.dist-info → roms_tools-1.7.0.dist-info}/top_level.txt +0 -0
roms_tools/setup/utils.py
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import xarray as xr
|
|
2
2
|
import numpy as np
|
|
3
|
-
from typing import Union
|
|
3
|
+
from typing import Union, Any, Dict, Type
|
|
4
4
|
import pandas as pd
|
|
5
5
|
import cftime
|
|
6
6
|
from roms_tools.utils import partition
|
|
7
7
|
from pathlib import Path
|
|
8
|
+
from datetime import datetime
|
|
9
|
+
from dataclasses import fields, asdict
|
|
10
|
+
import importlib.metadata
|
|
11
|
+
import yaml
|
|
8
12
|
|
|
9
13
|
|
|
10
14
|
def nan_check(field, mask, error_message=None) -> None:
|
|
@@ -724,23 +728,31 @@ def get_target_coords(grid, use_coarse_grid=False):
|
|
|
724
728
|
Returns
|
|
725
729
|
-------
|
|
726
730
|
dict
|
|
727
|
-
Dictionary containing the longitude, latitude, and
|
|
731
|
+
Dictionary containing the longitude, latitude, angle and mask arrays, along with a boolean indicating
|
|
728
732
|
if the grid straddles the meridian.
|
|
729
733
|
"""
|
|
730
734
|
# Select grid variables based on whether the coarse grid is used
|
|
731
735
|
if use_coarse_grid:
|
|
732
|
-
lat, lon, angle = (
|
|
733
|
-
grid.ds.lat_coarse,
|
|
734
|
-
grid.ds.lon_coarse,
|
|
735
|
-
grid.ds.angle_coarse
|
|
736
|
+
lat, lon, angle, mask = (
|
|
737
|
+
grid.ds.lat_coarse.rename({"eta_coarse": "eta_rho", "xi_coarse": "xi_rho"}),
|
|
738
|
+
grid.ds.lon_coarse.rename({"eta_coarse": "eta_rho", "xi_coarse": "xi_rho"}),
|
|
739
|
+
grid.ds.angle_coarse.rename(
|
|
740
|
+
{"eta_coarse": "eta_rho", "xi_coarse": "xi_rho"}
|
|
741
|
+
),
|
|
742
|
+
grid.ds.mask_coarse.rename(
|
|
743
|
+
{"eta_coarse": "eta_rho", "xi_coarse": "xi_rho"}
|
|
744
|
+
),
|
|
736
745
|
)
|
|
746
|
+
|
|
737
747
|
lat_psi = grid.ds.get("lat_psi_coarse")
|
|
738
748
|
lon_psi = grid.ds.get("lon_psi_coarse")
|
|
749
|
+
|
|
739
750
|
else:
|
|
740
|
-
lat, lon, angle = (
|
|
751
|
+
lat, lon, angle, mask = (
|
|
741
752
|
grid.ds.lat_rho,
|
|
742
753
|
grid.ds.lon_rho,
|
|
743
754
|
grid.ds.angle,
|
|
755
|
+
grid.ds.mask_rho,
|
|
744
756
|
)
|
|
745
757
|
lat_psi = grid.ds.get("lat_psi")
|
|
746
758
|
lon_psi = grid.ds.get("lon_psi")
|
|
@@ -763,6 +775,7 @@ def get_target_coords(grid, use_coarse_grid=False):
|
|
|
763
775
|
"lat_psi": lat_psi,
|
|
764
776
|
"lon_psi": lon_psi,
|
|
765
777
|
"angle": angle,
|
|
778
|
+
"mask": mask,
|
|
766
779
|
"straddle": straddle,
|
|
767
780
|
}
|
|
768
781
|
|
|
@@ -912,3 +925,257 @@ def get_vector_pairs(variable_info):
|
|
|
912
925
|
processed.update([var_name, vector_pair])
|
|
913
926
|
|
|
914
927
|
return vector_pairs
|
|
928
|
+
|
|
929
|
+
|
|
930
|
+
def gc_dist(lon1, lat1, lon2, lat2):
|
|
931
|
+
"""Calculate the great circle distance between two points on the Earth's surface.
|
|
932
|
+
Latitude and longitude must be provided in degrees (they will be converted to
|
|
933
|
+
radians).
|
|
934
|
+
|
|
935
|
+
The function uses the Haversine formula to compute the shortest distance
|
|
936
|
+
along the surface of a sphere (Earth), assuming the Earth is a perfect sphere.
|
|
937
|
+
|
|
938
|
+
Parameters
|
|
939
|
+
----------
|
|
940
|
+
lon1, lat1 : float
|
|
941
|
+
Longitude and latitude of the first point in degrees.
|
|
942
|
+
lon2, lat2 : float
|
|
943
|
+
Longitude and latitude of the second point in degrees.
|
|
944
|
+
|
|
945
|
+
Returns
|
|
946
|
+
-------
|
|
947
|
+
dis : float
|
|
948
|
+
The great circle distance between the two points in meters.
|
|
949
|
+
This is the shortest distance along the surface of a sphere (Earth).
|
|
950
|
+
|
|
951
|
+
Notes
|
|
952
|
+
-----
|
|
953
|
+
The radius of the Earth is taken to be 6371315 meters.
|
|
954
|
+
"""
|
|
955
|
+
# Convert degrees to radians
|
|
956
|
+
d2r = np.pi / 180
|
|
957
|
+
lon1 = lon1 * d2r
|
|
958
|
+
lat1 = lat1 * d2r
|
|
959
|
+
lon2 = lon2 * d2r
|
|
960
|
+
lat2 = lat2 * d2r
|
|
961
|
+
|
|
962
|
+
# Difference in latitudes and longitudes
|
|
963
|
+
dlat = lat2 - lat1
|
|
964
|
+
dlon = lon2 - lon1
|
|
965
|
+
|
|
966
|
+
# Haversine formula
|
|
967
|
+
dang = 2 * np.arcsin(
|
|
968
|
+
np.sqrt(
|
|
969
|
+
np.sin(dlat / 2) ** 2 + np.cos(lat1) * np.cos(lat2) * np.sin(dlon / 2) ** 2
|
|
970
|
+
)
|
|
971
|
+
)
|
|
972
|
+
|
|
973
|
+
# Radius of the Earth in meters
|
|
974
|
+
r_earth = 6371315.0
|
|
975
|
+
|
|
976
|
+
# Distance in meters
|
|
977
|
+
dis = r_earth * dang
|
|
978
|
+
|
|
979
|
+
return dis
|
|
980
|
+
|
|
981
|
+
|
|
982
|
+
def convert_to_roms_time(ds, model_reference_date, climatology, time_name="time"):
|
|
983
|
+
|
|
984
|
+
if climatology:
|
|
985
|
+
ds.attrs["climatology"] = str(True)
|
|
986
|
+
month = xr.DataArray(range(1, 13), dims=time_name)
|
|
987
|
+
month.attrs["long_name"] = "Month index (1-12)"
|
|
988
|
+
ds = ds.assign_coords({"month": month})
|
|
989
|
+
# Preserve absolute time coordinate for readability
|
|
990
|
+
abs_time = np.datetime64(model_reference_date) + ds[time_name]
|
|
991
|
+
# Convert to pandas TimedeltaIndex
|
|
992
|
+
timedelta_index = pd.to_timedelta(ds[time_name].values)
|
|
993
|
+
|
|
994
|
+
# Determine the start of the year for the base_datetime
|
|
995
|
+
start_of_year = datetime(model_reference_date.year, 1, 1)
|
|
996
|
+
|
|
997
|
+
# Calculate the offset from midnight of the new year
|
|
998
|
+
offset = model_reference_date - start_of_year
|
|
999
|
+
|
|
1000
|
+
# Convert the timedelta to nanoseconds first, then to days
|
|
1001
|
+
time = xr.DataArray(
|
|
1002
|
+
(timedelta_index - offset).view("int64") / 3600 / 24 * 1e-9,
|
|
1003
|
+
dims=time_name,
|
|
1004
|
+
)
|
|
1005
|
+
time.attrs["cycle_length"] = 365.25
|
|
1006
|
+
|
|
1007
|
+
else:
|
|
1008
|
+
# Preserve absolute time coordinate for readability
|
|
1009
|
+
abs_time = ds[time_name]
|
|
1010
|
+
|
|
1011
|
+
time = (
|
|
1012
|
+
(ds[time_name] - np.datetime64(model_reference_date)).astype("float64")
|
|
1013
|
+
/ 3600
|
|
1014
|
+
/ 24
|
|
1015
|
+
* 1e-9
|
|
1016
|
+
)
|
|
1017
|
+
|
|
1018
|
+
attrs = [key for key in abs_time.attrs]
|
|
1019
|
+
for attr in attrs:
|
|
1020
|
+
del abs_time.attrs[attr]
|
|
1021
|
+
abs_time.attrs["long_name"] = "absolute time"
|
|
1022
|
+
ds = ds.assign_coords({"abs_time": abs_time})
|
|
1023
|
+
|
|
1024
|
+
time.attrs["long_name"] = f"relative time: days since {str(model_reference_date)}"
|
|
1025
|
+
time.encoding["units"] = "days"
|
|
1026
|
+
time.attrs["units"] = "days"
|
|
1027
|
+
ds.encoding["unlimited_dims"] = "time"
|
|
1028
|
+
|
|
1029
|
+
return ds, time
|
|
1030
|
+
|
|
1031
|
+
|
|
1032
|
+
def _to_yaml(forcing_object, filepath: Union[str, Path]) -> None:
|
|
1033
|
+
"""Serialize a forcing object (including its grid) into a YAML file.
|
|
1034
|
+
|
|
1035
|
+
This function serializes a dataclass object (forcing_object) and its associated
|
|
1036
|
+
`grid` attribute into a YAML file. It includes additional metadata, such as
|
|
1037
|
+
the version of the `roms-tools` package, and omits fields like `grid` and `ds`
|
|
1038
|
+
that are not serializable or meant to be excluded.
|
|
1039
|
+
|
|
1040
|
+
The function also converts datetime fields to ISO format strings for proper
|
|
1041
|
+
serialization.
|
|
1042
|
+
|
|
1043
|
+
Parameters
|
|
1044
|
+
----------
|
|
1045
|
+
forcing_object : object
|
|
1046
|
+
The object that contains the forcing data, typically a dataclass with attributes
|
|
1047
|
+
such as `grid`, `start_time`, `end_time`, etc.
|
|
1048
|
+
filepath : Union[str, Path]
|
|
1049
|
+
The path where the serialized YAML file will be saved.
|
|
1050
|
+
|
|
1051
|
+
Returns
|
|
1052
|
+
-------
|
|
1053
|
+
None
|
|
1054
|
+
The function writes the serialized data directly to a YAML file at the specified path.
|
|
1055
|
+
"""
|
|
1056
|
+
|
|
1057
|
+
# Convert the filepath to a Path object
|
|
1058
|
+
filepath = Path(filepath)
|
|
1059
|
+
|
|
1060
|
+
# Step 1: Serialize Grid data
|
|
1061
|
+
# Convert the grid attribute to a dictionary and remove non-serializable fields
|
|
1062
|
+
grid_data = asdict(forcing_object.grid)
|
|
1063
|
+
grid_data.pop("ds", None) # Remove 'ds' attribute (non-serializable)
|
|
1064
|
+
grid_data.pop("straddle", None) # Remove 'straddle' if it's non-essential
|
|
1065
|
+
grid_yaml_data = {"Grid": grid_data}
|
|
1066
|
+
|
|
1067
|
+
# Step 2: Get ROMS Tools version
|
|
1068
|
+
# Fetch the version of the 'roms-tools' package for inclusion in the YAML header
|
|
1069
|
+
try:
|
|
1070
|
+
roms_tools_version = importlib.metadata.version("roms-tools")
|
|
1071
|
+
except importlib.metadata.PackageNotFoundError:
|
|
1072
|
+
roms_tools_version = "unknown"
|
|
1073
|
+
|
|
1074
|
+
# Create YAML header with version information
|
|
1075
|
+
header = f"---\nroms_tools_version: {roms_tools_version}\n---\n"
|
|
1076
|
+
|
|
1077
|
+
# Step 3: Prepare Forcing Data
|
|
1078
|
+
# Prepare the forcing object fields, excluding 'grid' and 'ds'
|
|
1079
|
+
forcing_data = {}
|
|
1080
|
+
field_names = [field.name for field in fields(forcing_object)]
|
|
1081
|
+
filtered_field_names = [
|
|
1082
|
+
param
|
|
1083
|
+
for param in field_names
|
|
1084
|
+
if param not in ("grid", "ds", "use_dask", "climatology")
|
|
1085
|
+
]
|
|
1086
|
+
|
|
1087
|
+
for field_name in filtered_field_names:
|
|
1088
|
+
# Retrieve the value of each field using getattr
|
|
1089
|
+
value = getattr(forcing_object, field_name)
|
|
1090
|
+
|
|
1091
|
+
# If the field is a datetime object, convert it to ISO format
|
|
1092
|
+
if isinstance(value, datetime):
|
|
1093
|
+
value = value.isoformat()
|
|
1094
|
+
|
|
1095
|
+
# Add the field and its value to the forcing_data dictionary
|
|
1096
|
+
forcing_data[field_name] = value
|
|
1097
|
+
|
|
1098
|
+
# Step 4: Combine Grid and Forcing Data
|
|
1099
|
+
# Combine grid and forcing data into a single dictionary for the final YAML content
|
|
1100
|
+
yaml_data = {
|
|
1101
|
+
**grid_yaml_data, # Add the grid data to the final YAML structure
|
|
1102
|
+
forcing_object.__class__.__name__: forcing_data, # Include the serialized forcing object data
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
# Step 5: Write to YAML file
|
|
1106
|
+
with filepath.open("w") as file:
|
|
1107
|
+
# Write the header first
|
|
1108
|
+
file.write(header)
|
|
1109
|
+
# Write the serialized YAML data
|
|
1110
|
+
yaml.dump(yaml_data, file, default_flow_style=False, sort_keys=False)
|
|
1111
|
+
|
|
1112
|
+
|
|
1113
|
+
def _from_yaml(forcing_object: Type, filepath: Union[str, Path]) -> Dict[str, Any]:
|
|
1114
|
+
"""Extract the configuration data for a given forcing object from a YAML file.
|
|
1115
|
+
|
|
1116
|
+
This function reads a YAML file, searches for the configuration data associated
|
|
1117
|
+
with the class name of the forcing object, and returns the configuration data
|
|
1118
|
+
as a dictionary. The dictionary contains the forcing parameters extracted from
|
|
1119
|
+
the YAML file, with any date fields converted from ISO format.
|
|
1120
|
+
|
|
1121
|
+
Parameters
|
|
1122
|
+
----------
|
|
1123
|
+
filepath : Union[str, Path]
|
|
1124
|
+
The path to the YAML file from which the parameters will be read.
|
|
1125
|
+
forcing_object : Type
|
|
1126
|
+
The class type (e.g., TidalForcing) whose configuration data is to be loaded
|
|
1127
|
+
from the YAML file. The class name is used to locate the relevant data in
|
|
1128
|
+
the YAML structure.
|
|
1129
|
+
|
|
1130
|
+
Returns
|
|
1131
|
+
-------
|
|
1132
|
+
dict
|
|
1133
|
+
A dictionary containing the forcing parameters extracted from the YAML file.
|
|
1134
|
+
This dictionary contains key-value pairs where the keys are the parameter
|
|
1135
|
+
names, and the values are the corresponding values from the YAML file.
|
|
1136
|
+
Any date fields are converted from ISO format if necessary.
|
|
1137
|
+
|
|
1138
|
+
Raises
|
|
1139
|
+
------
|
|
1140
|
+
ValueError
|
|
1141
|
+
If no configuration for the specified class name is found in the YAML file.
|
|
1142
|
+
"""
|
|
1143
|
+
|
|
1144
|
+
# Read the entire file content
|
|
1145
|
+
with filepath.open("r") as file:
|
|
1146
|
+
file_content = file.read()
|
|
1147
|
+
|
|
1148
|
+
# Split the content into YAML documents
|
|
1149
|
+
documents = list(yaml.safe_load_all(file_content))
|
|
1150
|
+
|
|
1151
|
+
forcing_data = None
|
|
1152
|
+
forcing_object_name = forcing_object.__name__
|
|
1153
|
+
|
|
1154
|
+
# Process the YAML documents to find the forcing data for the given object
|
|
1155
|
+
for doc in documents:
|
|
1156
|
+
if doc is None:
|
|
1157
|
+
continue
|
|
1158
|
+
if forcing_object_name in doc:
|
|
1159
|
+
forcing_data = doc[forcing_object_name]
|
|
1160
|
+
break
|
|
1161
|
+
|
|
1162
|
+
if forcing_data is None:
|
|
1163
|
+
raise ValueError(
|
|
1164
|
+
f"No {forcing_object_name} configuration found in the YAML file."
|
|
1165
|
+
)
|
|
1166
|
+
|
|
1167
|
+
# Convert any date fields from ISO format if necessary
|
|
1168
|
+
for key, value in forcing_data.items():
|
|
1169
|
+
forcing_data[key] = _convert_from_iso_format(value)
|
|
1170
|
+
|
|
1171
|
+
# Return the forcing data as a dictionary
|
|
1172
|
+
return forcing_data
|
|
1173
|
+
|
|
1174
|
+
|
|
1175
|
+
def _convert_from_iso_format(value):
|
|
1176
|
+
try:
|
|
1177
|
+
# Return the parsed datetime object if successful
|
|
1178
|
+
return datetime.fromisoformat(str(value))
|
|
1179
|
+
except ValueError:
|
|
1180
|
+
# Return None or raise an exception if parsing fails
|
|
1181
|
+
return value
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import pytest
|
|
2
2
|
from datetime import datetime
|
|
3
|
-
|
|
3
|
+
import xarray as xr
|
|
4
|
+
from roms_tools import Grid, BoundaryForcing
|
|
4
5
|
import textwrap
|
|
5
6
|
from roms_tools.setup.download import download_test_data
|
|
6
7
|
from conftest import calculate_file_hash
|
|
7
8
|
from pathlib import Path
|
|
9
|
+
import logging
|
|
8
10
|
|
|
9
11
|
|
|
10
12
|
@pytest.mark.parametrize(
|
|
11
13
|
"boundary_forcing_fixture",
|
|
12
14
|
[
|
|
13
15
|
"boundary_forcing",
|
|
14
|
-
"boundary_forcing_with_2d_fill",
|
|
16
|
+
# "boundary_forcing_with_2d_fill",
|
|
15
17
|
],
|
|
16
18
|
)
|
|
17
19
|
def test_boundary_forcing_creation(boundary_forcing_fixture, request):
|
|
@@ -51,7 +53,7 @@ def test_boundary_forcing_creation(boundary_forcing_fixture, request):
|
|
|
51
53
|
"boundary_forcing_fixture",
|
|
52
54
|
[
|
|
53
55
|
"bgc_boundary_forcing_from_climatology",
|
|
54
|
-
"bgc_boundary_forcing_from_climatology_with_2d_fill",
|
|
56
|
+
# "bgc_boundary_forcing_from_climatology_with_2d_fill",
|
|
55
57
|
],
|
|
56
58
|
)
|
|
57
59
|
def test_boundary_forcing_creation_with_bgc(boundary_forcing_fixture, request):
|
|
@@ -85,6 +87,99 @@ def test_boundary_forcing_creation_with_bgc(boundary_forcing_fixture, request):
|
|
|
85
87
|
assert hasattr(boundary_forcing.ds, "climatology")
|
|
86
88
|
|
|
87
89
|
|
|
90
|
+
def test_unsuccessful_boundary_forcing_creation_with_1d_fill(use_dask):
|
|
91
|
+
|
|
92
|
+
grid = Grid(
|
|
93
|
+
nx=2,
|
|
94
|
+
ny=2,
|
|
95
|
+
size_x=500,
|
|
96
|
+
size_y=1000,
|
|
97
|
+
center_lon=0,
|
|
98
|
+
center_lat=55,
|
|
99
|
+
rot=10,
|
|
100
|
+
N=3, # number of vertical levels
|
|
101
|
+
theta_s=5.0, # surface control parameter
|
|
102
|
+
theta_b=2.0, # bottom control parameter
|
|
103
|
+
hc=250.0, # critical depth
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
fname = download_test_data("GLORYS_coarse_test_data.nc")
|
|
107
|
+
|
|
108
|
+
with pytest.raises(ValueError, match="consists entirely of NaNs"):
|
|
109
|
+
|
|
110
|
+
BoundaryForcing(
|
|
111
|
+
grid=grid,
|
|
112
|
+
start_time=datetime(2021, 6, 29),
|
|
113
|
+
end_time=datetime(2021, 6, 30),
|
|
114
|
+
source={"name": "GLORYS", "path": fname},
|
|
115
|
+
apply_2d_horizontal_fill=False,
|
|
116
|
+
use_dask=use_dask,
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
fname_bgc = download_test_data("CESM_regional_coarse_test_data_climatology.nc")
|
|
120
|
+
|
|
121
|
+
with pytest.raises(ValueError, match="consists entirely of NaNs"):
|
|
122
|
+
|
|
123
|
+
BoundaryForcing(
|
|
124
|
+
grid=grid,
|
|
125
|
+
start_time=datetime(2021, 6, 29),
|
|
126
|
+
end_time=datetime(2021, 6, 30),
|
|
127
|
+
source={"path": fname_bgc, "name": "CESM_REGRIDDED", "climatology": True},
|
|
128
|
+
type="bgc",
|
|
129
|
+
apply_2d_horizontal_fill=False,
|
|
130
|
+
use_dask=use_dask,
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
def test_boundary_divided_by_land_warning(caplog, use_dask):
|
|
135
|
+
|
|
136
|
+
# Iceland intersects the western boundary of the following grid
|
|
137
|
+
grid = Grid(
|
|
138
|
+
nx=5, ny=5, size_x=500, size_y=500, center_lon=-10, center_lat=65, rot=0
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
fname = download_test_data("GLORYS_coarse_test_data.nc")
|
|
142
|
+
|
|
143
|
+
with caplog.at_level(logging.WARNING):
|
|
144
|
+
BoundaryForcing(
|
|
145
|
+
grid=grid,
|
|
146
|
+
start_time=datetime(2021, 6, 29),
|
|
147
|
+
end_time=datetime(2021, 6, 30),
|
|
148
|
+
source={"path": fname, "name": "GLORYS", "climatology": False},
|
|
149
|
+
apply_2d_horizontal_fill=False,
|
|
150
|
+
use_dask=use_dask,
|
|
151
|
+
)
|
|
152
|
+
# Verify the warning message in the log
|
|
153
|
+
assert "the western boundary is divided by land" in caplog.text
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
def test_1d_and_2d_fill_coincide_if_no_land(use_dask):
|
|
157
|
+
|
|
158
|
+
# this grid lies entirely over open ocean
|
|
159
|
+
grid = Grid(nx=5, ny=5, size_x=300, size_y=300, center_lon=-5, center_lat=65, rot=0)
|
|
160
|
+
|
|
161
|
+
fname = download_test_data("GLORYS_coarse_test_data.nc")
|
|
162
|
+
|
|
163
|
+
kwargs = {
|
|
164
|
+
"grid": grid,
|
|
165
|
+
"start_time": datetime(2021, 6, 29),
|
|
166
|
+
"end_time": datetime(2021, 6, 29),
|
|
167
|
+
"source": {"path": fname, "name": "GLORYS", "climatology": False},
|
|
168
|
+
"use_dask": use_dask,
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
bf_1d_fill = BoundaryForcing(
|
|
172
|
+
**kwargs,
|
|
173
|
+
apply_2d_horizontal_fill=False,
|
|
174
|
+
)
|
|
175
|
+
bf_2d_fill = BoundaryForcing(
|
|
176
|
+
**kwargs,
|
|
177
|
+
apply_2d_horizontal_fill=True,
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
xr.testing.assert_allclose(bf_1d_fill.ds, bf_2d_fill.ds, rtol=1.0e-4)
|
|
181
|
+
|
|
182
|
+
|
|
88
183
|
def test_boundary_forcing_plot(boundary_forcing):
|
|
89
184
|
"""Test plot."""
|
|
90
185
|
|
|
@@ -296,9 +391,7 @@ def test_from_yaml_missing_boundary_forcing(tmp_path, request, use_dask):
|
|
|
296
391
|
center_lat: 61
|
|
297
392
|
rot: -20
|
|
298
393
|
topography_source: ETOPO5
|
|
299
|
-
smooth_factor: 8
|
|
300
394
|
hmin: 5.0
|
|
301
|
-
rmax: 0.2
|
|
302
395
|
"""
|
|
303
396
|
)
|
|
304
397
|
# Create a temporary filepath using the tmp_path fixture
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"end_time": "2021-06-30 00:00:00",
|
|
4
4
|
"hc": 250.0,
|
|
5
5
|
"model_reference_date": "2000-01-01 00:00:00",
|
|
6
|
-
"roms_tools_version": "0.1.
|
|
6
|
+
"roms_tools_version": "0.1.dev169+dirty",
|
|
7
7
|
"source": "CESM_REGRIDDED",
|
|
8
8
|
"start_time": "2021-06-29 00:00:00",
|
|
9
9
|
"theta_b": 2.0,
|