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
ci/environment.yml
CHANGED
roms_tools/__init__.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from importlib.metadata import version as _version
|
|
2
|
-
|
|
2
|
+
import logging # noqa: F811
|
|
3
3
|
|
|
4
4
|
try:
|
|
5
5
|
__version__ = _version("roms_tools")
|
|
@@ -13,3 +13,7 @@ from roms_tools.setup.tides import TidalForcing # noqa: F401
|
|
|
13
13
|
from roms_tools.setup.surface_forcing import SurfaceForcing # noqa: F401
|
|
14
14
|
from roms_tools.setup.initial_conditions import InitialConditions # noqa: F401
|
|
15
15
|
from roms_tools.setup.boundary_forcing import BoundaryForcing # noqa: F401
|
|
16
|
+
from roms_tools.setup.river_forcing import RiverForcing # noqa: F401
|
|
17
|
+
|
|
18
|
+
# Configure logging when the package is imported
|
|
19
|
+
logging.basicConfig(level=logging.INFO, format="%(levelname)s - %(message)s")
|
roms_tools/_version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# Do not change! Do not track in version control!
|
|
2
|
-
__version__ = "1.
|
|
2
|
+
__version__ = "1.7.0"
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import xarray as xr
|
|
2
2
|
import numpy as np
|
|
3
|
-
|
|
4
|
-
import
|
|
3
|
+
from scipy.ndimage import label
|
|
4
|
+
import logging
|
|
5
5
|
import importlib.metadata
|
|
6
|
-
import warnings
|
|
7
6
|
from typing import Dict, Union, List
|
|
8
|
-
from dataclasses import dataclass, field
|
|
7
|
+
from dataclasses import dataclass, field
|
|
9
8
|
from roms_tools.setup.grid import Grid
|
|
10
9
|
from roms_tools.setup.regrid import LateralRegrid, VerticalRegrid
|
|
11
10
|
from datetime import datetime
|
|
@@ -21,6 +20,9 @@ from roms_tools.setup.utils import (
|
|
|
21
20
|
one_dim_fill,
|
|
22
21
|
nan_check,
|
|
23
22
|
substitute_nans_by_fillvalue,
|
|
23
|
+
convert_to_roms_time,
|
|
24
|
+
_to_yaml,
|
|
25
|
+
_from_yaml,
|
|
24
26
|
)
|
|
25
27
|
from roms_tools.setup.plot import _section_plot, _line_plot
|
|
26
28
|
import matplotlib.pyplot as plt
|
|
@@ -58,12 +60,12 @@ class BoundaryForcing:
|
|
|
58
60
|
- "physics": for physical atmospheric forcing.
|
|
59
61
|
- "bgc": for biogeochemical forcing.
|
|
60
62
|
|
|
61
|
-
model_reference_date : datetime, optional
|
|
62
|
-
Reference date for the model. Default is January 1, 2000.
|
|
63
63
|
apply_2d_horizontal_fill: bool, optional
|
|
64
64
|
Indicates whether to perform a two-dimensional horizontal fill on the source data prior to regridding to boundaries.
|
|
65
65
|
If `False`, a one-dimensional horizontal fill is performed separately on each of the four regridded boundaries.
|
|
66
66
|
Defaults to `False`.
|
|
67
|
+
model_reference_date : datetime, optional
|
|
68
|
+
Reference date for the model. Default is January 1, 2000.
|
|
67
69
|
use_dask: bool, optional
|
|
68
70
|
Indicates whether to use dask for processing. If True, data is processed with dask; if False, data is processed eagerly. Defaults to False.
|
|
69
71
|
|
|
@@ -92,8 +94,8 @@ class BoundaryForcing:
|
|
|
92
94
|
)
|
|
93
95
|
source: Dict[str, Union[str, Path, List[Union[str, Path]]]]
|
|
94
96
|
type: str = "physics"
|
|
95
|
-
model_reference_date: datetime = datetime(2000, 1, 1)
|
|
96
97
|
apply_2d_horizontal_fill: bool = False
|
|
98
|
+
model_reference_date: datetime = datetime(2000, 1, 1)
|
|
97
99
|
use_dask: bool = False
|
|
98
100
|
|
|
99
101
|
ds: xr.Dataset = field(init=False, repr=False)
|
|
@@ -197,6 +199,13 @@ class BoundaryForcing:
|
|
|
197
199
|
].isel(**bdry_coords[location][direction])
|
|
198
200
|
|
|
199
201
|
if not self.apply_2d_horizontal_fill:
|
|
202
|
+
self._validate_1d_fill(
|
|
203
|
+
processed_fields,
|
|
204
|
+
variable_info,
|
|
205
|
+
bdry_coords,
|
|
206
|
+
direction,
|
|
207
|
+
bdry_data.dim_names["depth"],
|
|
208
|
+
)
|
|
200
209
|
processed_fields = apply_1d_horizontal_fill(processed_fields)
|
|
201
210
|
|
|
202
211
|
# vertical regridding
|
|
@@ -329,38 +338,46 @@ class BoundaryForcing:
|
|
|
329
338
|
"is_vector": False,
|
|
330
339
|
"vector_pair": None,
|
|
331
340
|
"is_3d": False,
|
|
341
|
+
"validate": True,
|
|
332
342
|
},
|
|
333
|
-
"temp": default_info,
|
|
334
|
-
"salt": default_info,
|
|
343
|
+
"temp": {**default_info, "validate": True},
|
|
344
|
+
"salt": {**default_info, "validate": False},
|
|
335
345
|
"u": {
|
|
336
346
|
"location": "u",
|
|
337
347
|
"is_vector": True,
|
|
338
348
|
"vector_pair": "v",
|
|
339
349
|
"is_3d": True,
|
|
350
|
+
"validate": True,
|
|
340
351
|
},
|
|
341
352
|
"v": {
|
|
342
353
|
"location": "v",
|
|
343
354
|
"is_vector": True,
|
|
344
355
|
"vector_pair": "u",
|
|
345
356
|
"is_3d": True,
|
|
357
|
+
"validate": True,
|
|
346
358
|
},
|
|
347
359
|
"ubar": {
|
|
348
360
|
"location": "u",
|
|
349
361
|
"is_vector": True,
|
|
350
362
|
"vector_pair": "vbar",
|
|
351
363
|
"is_3d": False,
|
|
364
|
+
"validate": False,
|
|
352
365
|
},
|
|
353
366
|
"vbar": {
|
|
354
367
|
"location": "v",
|
|
355
368
|
"is_vector": True,
|
|
356
369
|
"vector_pair": "ubar",
|
|
357
370
|
"is_3d": False,
|
|
371
|
+
"validate": False,
|
|
358
372
|
},
|
|
359
373
|
}
|
|
360
374
|
elif self.type == "bgc":
|
|
361
375
|
variable_info = {}
|
|
362
376
|
for var_name in data.var_names.keys():
|
|
363
|
-
|
|
377
|
+
if var_name == "ALK":
|
|
378
|
+
variable_info[var_name] = {**default_info, "validate": True}
|
|
379
|
+
else:
|
|
380
|
+
variable_info[var_name] = {**default_info, "validate": False}
|
|
364
381
|
|
|
365
382
|
return variable_info
|
|
366
383
|
|
|
@@ -458,57 +475,88 @@ class BoundaryForcing:
|
|
|
458
475
|
ds.attrs["hc"] = self.grid.ds.attrs["hc"]
|
|
459
476
|
|
|
460
477
|
# Convert the time coordinate to the format expected by ROMS
|
|
461
|
-
|
|
462
|
-
ds.
|
|
463
|
-
|
|
464
|
-
ds = ds.assign_coords(
|
|
465
|
-
{"abs_time": np.datetime64(self.model_reference_date) + ds["time"]}
|
|
466
|
-
)
|
|
467
|
-
# Convert to pandas TimedeltaIndex
|
|
468
|
-
timedelta_index = pd.to_timedelta(ds["time"].values)
|
|
478
|
+
ds, bry_time = convert_to_roms_time(
|
|
479
|
+
ds, self.model_reference_date, data.climatology
|
|
480
|
+
)
|
|
469
481
|
|
|
470
|
-
|
|
471
|
-
|
|
482
|
+
ds = ds.assign_coords({"bry_time": bry_time})
|
|
483
|
+
ds = ds.swap_dims({"time": "bry_time"})
|
|
484
|
+
ds = ds.drop_vars("time")
|
|
472
485
|
|
|
473
|
-
|
|
474
|
-
offset = self.model_reference_date - start_of_year
|
|
486
|
+
return ds
|
|
475
487
|
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
488
|
+
def _validate_1d_fill(
|
|
489
|
+
self, processed_fields, variable_info, bdry_coords, direction, depth_dim
|
|
490
|
+
):
|
|
491
|
+
"""Check if any boundary is divided by land and issue a warning if so,
|
|
492
|
+
suggesting the use of 2D horizontal fill for safer regridding.
|
|
481
493
|
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
"float64"
|
|
488
|
-
)
|
|
489
|
-
/ 3600
|
|
490
|
-
/ 24
|
|
491
|
-
* 1e-9
|
|
492
|
-
)
|
|
494
|
+
Parameters
|
|
495
|
+
----------
|
|
496
|
+
processed_fields : dict
|
|
497
|
+
A dictionary where keys are variable names and values are `xarray.DataArray`
|
|
498
|
+
objects representing the processed data for each variable.
|
|
493
499
|
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
ds["bry_time"].encoding["units"] = "days"
|
|
499
|
-
ds["bry_time"].attrs["units"] = "days"
|
|
500
|
-
ds = ds.swap_dims({"time": "bry_time"})
|
|
501
|
-
ds = ds.drop_vars("time")
|
|
502
|
-
ds.encoding["unlimited_dims"] = "bry_time"
|
|
500
|
+
variable_info : dict
|
|
501
|
+
A dictionary containing metadata about each variable (e.g., location,
|
|
502
|
+
whether it's a 3D variable, etc.). Used to retrieve information for
|
|
503
|
+
validating each variable.
|
|
503
504
|
|
|
504
|
-
|
|
505
|
-
|
|
505
|
+
bdry_coords : dict
|
|
506
|
+
A dictionary containing boundary coordinates for different directions (north, south,
|
|
507
|
+
east, west), used to slice the boundary-specific data for each variable.
|
|
506
508
|
|
|
507
|
-
|
|
509
|
+
direction : str
|
|
510
|
+
The boundary direction being processed (e.g., "north", "south", "east", or "west").
|
|
511
|
+
|
|
512
|
+
depth_dim : str
|
|
513
|
+
The dimension representing depth (e.g., 'z', 'depth', etc.), used when slicing 3D
|
|
514
|
+
data for a specific depth level.
|
|
515
|
+
|
|
516
|
+
Returns
|
|
517
|
+
-------
|
|
518
|
+
None
|
|
519
|
+
If a boundary is divided by land, a warning is issued. No return value is provided.
|
|
520
|
+
"""
|
|
521
|
+
|
|
522
|
+
for var_name in processed_fields.keys():
|
|
523
|
+
# Only validate variables based on "validate" flag if use_dask is False
|
|
524
|
+
if not self.use_dask or variable_info[var_name]["validate"]:
|
|
525
|
+
location = variable_info[var_name]["location"]
|
|
526
|
+
|
|
527
|
+
# Select the appropriate mask based on variable location
|
|
528
|
+
if location == "rho":
|
|
529
|
+
mask = self.grid.ds.mask_rho
|
|
530
|
+
elif location == "u":
|
|
531
|
+
mask = self.grid.ds.mask_u
|
|
532
|
+
elif location == "v":
|
|
533
|
+
mask = self.grid.ds.mask_v
|
|
534
|
+
|
|
535
|
+
mask = mask.isel(**bdry_coords[location][direction])
|
|
536
|
+
|
|
537
|
+
if variable_info[var_name]["is_3d"]:
|
|
538
|
+
da = processed_fields[var_name].isel({depth_dim: 0, "time": 0})
|
|
539
|
+
else:
|
|
540
|
+
da = processed_fields[var_name].isel({"time": 0})
|
|
541
|
+
|
|
542
|
+
wet_nans = xr.where(da.where(mask).isnull(), 1, 0)
|
|
543
|
+
# Apply label to find connected components of wet NaNs
|
|
544
|
+
labeled_array, num_features = label(wet_nans)
|
|
545
|
+
left_margin = labeled_array[0]
|
|
546
|
+
right_margin = labeled_array[-1]
|
|
547
|
+
if left_margin != 0:
|
|
548
|
+
num_features = num_features - 1
|
|
549
|
+
if right_margin != 0:
|
|
550
|
+
num_features = num_features - 1
|
|
551
|
+
if num_features > 0:
|
|
552
|
+
logging.warning(
|
|
553
|
+
f"For {var_name}, the {direction}ern boundary is divided by land. It would be safer (but slower) to use `apply_2d_horizontal_fill = True`."
|
|
554
|
+
)
|
|
508
555
|
|
|
509
556
|
def _validate(self, ds, variable_info, bdry_coords):
|
|
510
|
-
"""Validate the dataset for NaN values at the first time step
|
|
511
|
-
|
|
557
|
+
"""Validate the dataset for NaN values at the first time step (bry_time=0) for
|
|
558
|
+
specified variables. If NaN values are found at wet points, this function raises
|
|
559
|
+
an error.
|
|
512
560
|
|
|
513
561
|
Parameters
|
|
514
562
|
----------
|
|
@@ -530,14 +578,11 @@ class BoundaryForcing:
|
|
|
530
578
|
Notes
|
|
531
579
|
-----
|
|
532
580
|
Validation is performed on the initial boundary time step (`bry_time=0`) for each
|
|
533
|
-
variable in the dataset.
|
|
534
|
-
a warning is issued instead of a strict NaN check, as the data may not be reliably validated.
|
|
535
|
-
Conversely, if `apply_2d_horizontal_fill` is True, a strict NaN check is performed, raising
|
|
536
|
-
a ValueError if any NaN values are detected.
|
|
581
|
+
variable in the dataset.
|
|
537
582
|
"""
|
|
538
|
-
|
|
539
|
-
#
|
|
540
|
-
|
|
583
|
+
for var_name in variable_info:
|
|
584
|
+
# only validate variables based on "validate" flag if use_dask is false
|
|
585
|
+
if not self.use_dask or variable_info[var_name]["validate"]:
|
|
541
586
|
location = variable_info[var_name]["location"]
|
|
542
587
|
|
|
543
588
|
# Select the appropriate mask based on variable location
|
|
@@ -547,38 +592,29 @@ class BoundaryForcing:
|
|
|
547
592
|
mask = self.grid.ds.mask_u
|
|
548
593
|
elif location == "v":
|
|
549
594
|
mask = self.grid.ds.mask_v
|
|
550
|
-
else:
|
|
551
|
-
continue # Skip if location is not recognized
|
|
552
595
|
|
|
553
596
|
for direction in ["south", "east", "north", "west"]:
|
|
554
597
|
if self.boundaries[direction]:
|
|
555
598
|
bdry_var_name = f"{var_name}_{direction}"
|
|
556
599
|
|
|
557
600
|
# Check for NaN values at the first time step using the nan_check function
|
|
601
|
+
if self.apply_2d_horizontal_fill:
|
|
602
|
+
error_message = None
|
|
603
|
+
else:
|
|
604
|
+
error_message = (
|
|
605
|
+
f"{bdry_var_name} consists entirely of NaNs after regridding. "
|
|
606
|
+
f"This may be due to the {direction}ern boundary being on land in the "
|
|
607
|
+
f"{self.source['name']} data, which could have a coarser resolution than the ROMS domain. "
|
|
608
|
+
f"Try setting `apply_2d_horizontal_fill = True` to resolve this issue."
|
|
609
|
+
)
|
|
610
|
+
|
|
558
611
|
nan_check(
|
|
559
612
|
ds[bdry_var_name].isel(bry_time=0),
|
|
560
613
|
mask.isel(**bdry_coords[location][direction]),
|
|
614
|
+
error_message=error_message,
|
|
561
615
|
)
|
|
562
|
-
else:
|
|
563
|
-
# Can't apply strict NaN check because land values haven't been filled before regridding step; instead warn user
|
|
564
|
-
for direction in ["south", "east", "north", "west"]:
|
|
565
|
-
if self.boundaries[direction]:
|
|
566
|
-
for var_name in variable_info:
|
|
567
|
-
bdry_var_name = f"{var_name}_{direction}"
|
|
568
|
-
if ds[bdry_var_name].isel(bry_time=0).isnull().any().values:
|
|
569
|
-
warnings.warn(
|
|
570
|
-
f"NaN values detected in regridded variables along the {direction}ern boundary. This may indicate that the entire boundary is on land in the source data, or that the source data does not cover this boundary.",
|
|
571
|
-
UserWarning,
|
|
572
|
-
)
|
|
573
|
-
# Break after the first warning for this direction to avoid duplicates
|
|
574
|
-
break
|
|
575
616
|
|
|
576
|
-
def plot(
|
|
577
|
-
self,
|
|
578
|
-
var_name,
|
|
579
|
-
time=0,
|
|
580
|
-
layer_contours=False,
|
|
581
|
-
) -> None:
|
|
617
|
+
def plot(self, var_name, time=0, layer_contours=False, ax=None) -> None:
|
|
582
618
|
"""Plot the boundary forcing field for a given time-slice.
|
|
583
619
|
|
|
584
620
|
Parameters
|
|
@@ -634,6 +670,8 @@ class BoundaryForcing:
|
|
|
634
670
|
If True, contour lines representing the boundaries between vertical layers will
|
|
635
671
|
be added to the plot. For clarity, the number of layer
|
|
636
672
|
contours displayed is limited to a maximum of 10. Default is False.
|
|
673
|
+
ax : matplotlib.axes.Axes, optional
|
|
674
|
+
The axes to plot on. If None, a new figure is created.
|
|
637
675
|
|
|
638
676
|
Returns
|
|
639
677
|
-------
|
|
@@ -700,10 +738,14 @@ class BoundaryForcing:
|
|
|
700
738
|
interface_depth = None
|
|
701
739
|
|
|
702
740
|
_section_plot(
|
|
703
|
-
field,
|
|
741
|
+
field,
|
|
742
|
+
interface_depth=interface_depth,
|
|
743
|
+
title=title,
|
|
744
|
+
kwargs=kwargs,
|
|
745
|
+
ax=ax,
|
|
704
746
|
)
|
|
705
747
|
else:
|
|
706
|
-
_line_plot(field, title=title)
|
|
748
|
+
_line_plot(field, title=title, ax=ax)
|
|
707
749
|
|
|
708
750
|
def save(
|
|
709
751
|
self,
|
|
@@ -780,45 +822,8 @@ class BoundaryForcing:
|
|
|
780
822
|
filepath : Union[str, Path]
|
|
781
823
|
The path to the YAML file where the parameters will be saved.
|
|
782
824
|
"""
|
|
783
|
-
filepath = Path(filepath)
|
|
784
|
-
|
|
785
|
-
# Serialize Grid data
|
|
786
|
-
grid_data = asdict(self.grid)
|
|
787
|
-
grid_data.pop("ds", None) # Exclude non-serializable fields
|
|
788
|
-
grid_data.pop("straddle", None)
|
|
789
|
-
|
|
790
|
-
# Include the version of roms-tools
|
|
791
|
-
try:
|
|
792
|
-
roms_tools_version = importlib.metadata.version("roms-tools")
|
|
793
|
-
except importlib.metadata.PackageNotFoundError:
|
|
794
|
-
roms_tools_version = "unknown"
|
|
795
825
|
|
|
796
|
-
|
|
797
|
-
header = f"---\nroms_tools_version: {roms_tools_version}\n---\n"
|
|
798
|
-
|
|
799
|
-
grid_yaml_data = {"Grid": grid_data}
|
|
800
|
-
|
|
801
|
-
boundary_forcing_data = {
|
|
802
|
-
"BoundaryForcing": {
|
|
803
|
-
"start_time": self.start_time.isoformat(),
|
|
804
|
-
"end_time": self.end_time.isoformat(),
|
|
805
|
-
"boundaries": self.boundaries,
|
|
806
|
-
"source": self.source,
|
|
807
|
-
"type": self.type,
|
|
808
|
-
"model_reference_date": self.model_reference_date.isoformat(),
|
|
809
|
-
}
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
yaml_data = {
|
|
813
|
-
**grid_yaml_data,
|
|
814
|
-
**boundary_forcing_data,
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
with filepath.open("w") as file:
|
|
818
|
-
# Write header
|
|
819
|
-
file.write(header)
|
|
820
|
-
# Write YAML data
|
|
821
|
-
yaml.dump(yaml_data, file, default_flow_style=False, sort_keys=False)
|
|
826
|
+
_to_yaml(self, filepath)
|
|
822
827
|
|
|
823
828
|
@classmethod
|
|
824
829
|
def from_yaml(
|
|
@@ -839,36 +844,12 @@ class BoundaryForcing:
|
|
|
839
844
|
An instance of the BoundaryForcing class.
|
|
840
845
|
"""
|
|
841
846
|
filepath = Path(filepath)
|
|
842
|
-
# Read the entire file content
|
|
843
|
-
with filepath.open("r") as file:
|
|
844
|
-
file_content = file.read()
|
|
845
|
-
|
|
846
|
-
# Split the content into YAML documents
|
|
847
|
-
documents = list(yaml.safe_load_all(file_content))
|
|
848
|
-
|
|
849
|
-
boundary_forcing_data = None
|
|
850
|
-
|
|
851
|
-
# Process the YAML documents
|
|
852
|
-
for doc in documents:
|
|
853
|
-
if doc is None:
|
|
854
|
-
continue
|
|
855
|
-
if "BoundaryForcing" in doc:
|
|
856
|
-
boundary_forcing_data = doc["BoundaryForcing"]
|
|
857
|
-
break
|
|
858
|
-
|
|
859
|
-
if boundary_forcing_data is None:
|
|
860
|
-
raise ValueError("No BoundaryForcing configuration found in the YAML file.")
|
|
861
|
-
|
|
862
|
-
# Convert from string to datetime
|
|
863
|
-
for date_string in ["model_reference_date", "start_time", "end_time"]:
|
|
864
|
-
boundary_forcing_data[date_string] = datetime.fromisoformat(
|
|
865
|
-
boundary_forcing_data[date_string]
|
|
866
|
-
)
|
|
867
847
|
|
|
868
848
|
grid = Grid.from_yaml(filepath)
|
|
849
|
+
params = _from_yaml(cls, filepath)
|
|
869
850
|
|
|
870
851
|
# Create and return an instance of InitialConditions
|
|
871
|
-
return cls(grid=grid, **
|
|
852
|
+
return cls(grid=grid, **params, use_dask=use_dask)
|
|
872
853
|
|
|
873
854
|
|
|
874
855
|
def get_boundary_info():
|
|
@@ -952,6 +933,7 @@ def apply_1d_horizontal_fill(processed_fields: dict) -> dict:
|
|
|
952
933
|
raise ValueError(
|
|
953
934
|
f"No valid horizontal dimension found for variable '{var_name}'."
|
|
954
935
|
)
|
|
936
|
+
|
|
955
937
|
# Forward and backward fill in the horizontal direction
|
|
956
938
|
filled = one_dim_fill(
|
|
957
939
|
processed_fields[var_name], selected_horizontal_dim, direction="forward"
|