roms-tools 1.6.2__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 +1 -0
- roms_tools/_version.py +1 -1
- roms_tools/setup/boundary_forcing.py +13 -112
- roms_tools/setup/datasets.py +778 -191
- roms_tools/setup/download.py +30 -0
- roms_tools/setup/initial_conditions.py +14 -76
- roms_tools/setup/plot.py +77 -15
- roms_tools/setup/river_forcing.py +589 -0
- roms_tools/setup/surface_forcing.py +10 -112
- roms_tools/setup/tides.py +6 -67
- roms_tools/setup/utils.py +259 -1
- roms_tools/tests/test_setup/test_boundary_forcing.py +0 -2
- 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_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_west/.zattrs +1 -1
- 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_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_west/.zattrs +1 -1
- 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_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_west/.zattrs +1 -1
- 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_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_west/.zattrs +1 -1
- 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_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_west/.zattrs +1 -1
- 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_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_west/.zattrs +1 -1
- 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_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_west/.zattrs +1 -1
- 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_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_west/.zattrs +1 -1
- 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_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_west/.zattrs +1 -1
- 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_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_west/.zattrs +1 -1
- 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_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_west/.zattrs +1 -1
- 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_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_west/.zattrs +1 -1
- 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_north/.zattrs +1 -1
- 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_west/.zattrs +1 -1
- 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_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_west/.zattrs +1 -1
- 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_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_west/.zattrs +1 -1
- 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_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_west/.zattrs +1 -1
- 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_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_west/.zattrs +1 -1
- 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_north/.zattrs +1 -1
- 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_west/.zattrs +1 -1
- 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_north/.zattrs +1 -1
- 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_west/.zattrs +1 -1
- 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_north/.zattrs +1 -1
- 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_west/.zattrs +1 -1
- 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_north/.zattrs +1 -1
- 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_west/.zattrs +1 -1
- 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_north/.zattrs +1 -1
- 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_west/.zattrs +1 -1
- 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_north/.zattrs +1 -1
- 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_west/.zattrs +1 -1
- 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_north/.zattrs +1 -1
- 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_west/.zattrs +1 -1
- 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_north/.zattrs +1 -1
- 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_west/.zattrs +1 -1
- 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_north/.zattrs +1 -1
- 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_west/.zattrs +1 -1
- 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_north/.zattrs +1 -1
- 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_west/.zattrs +1 -1
- 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_north/.zattrs +1 -1
- 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_west/.zattrs +1 -1
- 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_north/.zattrs +1 -1
- 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_west/.zattrs +1 -1
- 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_north/.zattrs +1 -1
- 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_west/.zattrs +1 -1
- 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_north/.zattrs +1 -1
- 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_west/.zattrs +1 -1
- 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_north/.zattrs +1 -1
- 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_west/.zattrs +1 -1
- 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/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_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.2.dist-info → roms_tools-1.7.0.dist-info}/METADATA +5 -5
- {roms_tools-1.6.2.dist-info → roms_tools-1.7.0.dist-info}/RECORD +221 -168
- {roms_tools-1.6.2.dist-info → roms_tools-1.7.0.dist-info}/WHEEL +1 -1
- {roms_tools-1.6.2.dist-info → roms_tools-1.7.0.dist-info}/LICENSE +0 -0
- {roms_tools-1.6.2.dist-info → roms_tools-1.7.0.dist-info}/top_level.txt +0 -0
roms_tools/setup/download.py
CHANGED
|
@@ -24,6 +24,16 @@ correction_data = pooch.create(
|
|
|
24
24
|
},
|
|
25
25
|
)
|
|
26
26
|
|
|
27
|
+
# Create a Pooch object to manage the global topography data
|
|
28
|
+
river_data = pooch.create(
|
|
29
|
+
# Use the default cache folder for the operating system
|
|
30
|
+
path=pooch.os_cache("roms-tools"),
|
|
31
|
+
base_url="https://github.com/CWorthy-ocean/roms-tools-data/raw/main/",
|
|
32
|
+
# The registry specifies the files that can be fetched
|
|
33
|
+
registry={
|
|
34
|
+
"dai_trenberth_may2019.nc": "sha256:793849e6aa60d1f6bdb480c345515fb2453d903c0a30599241b3d752f53715ab",
|
|
35
|
+
},
|
|
36
|
+
)
|
|
27
37
|
# Create a Pooch object to manage the test data
|
|
28
38
|
pup_test_data = pooch.create(
|
|
29
39
|
# Use the default cache folder for the operating system
|
|
@@ -77,6 +87,26 @@ def fetch_topo(topography_source: str) -> xr.Dataset:
|
|
|
77
87
|
return ds
|
|
78
88
|
|
|
79
89
|
|
|
90
|
+
def download_river_data(filename: str) -> xr.Dataset:
|
|
91
|
+
"""Download river data file.
|
|
92
|
+
|
|
93
|
+
Parameters
|
|
94
|
+
----------
|
|
95
|
+
filename : str
|
|
96
|
+
The name of the test data file to be downloaded. Available options:
|
|
97
|
+
- "dai_trenberth_may2019.nc"
|
|
98
|
+
Returns
|
|
99
|
+
-------
|
|
100
|
+
str
|
|
101
|
+
The path to the downloaded test data file.
|
|
102
|
+
"""
|
|
103
|
+
|
|
104
|
+
# Fetch the file using Pooch, downloading if necessary
|
|
105
|
+
fname = river_data.fetch(filename)
|
|
106
|
+
|
|
107
|
+
return fname
|
|
108
|
+
|
|
109
|
+
|
|
80
110
|
def download_correction_data(filename: str) -> str:
|
|
81
111
|
"""Download the correction data file.
|
|
82
112
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import xarray as xr
|
|
2
2
|
import numpy as np
|
|
3
|
-
import yaml
|
|
4
3
|
import importlib.metadata
|
|
5
|
-
from dataclasses import dataclass, field
|
|
4
|
+
from dataclasses import dataclass, field
|
|
6
5
|
from typing import Dict, Union, List, Optional
|
|
7
6
|
from roms_tools.setup.grid import Grid
|
|
8
7
|
from datetime import datetime
|
|
@@ -16,6 +15,8 @@ from roms_tools.setup.utils import (
|
|
|
16
15
|
rotate_velocities,
|
|
17
16
|
compute_barotropic_velocity,
|
|
18
17
|
transpose_dimensions,
|
|
18
|
+
_to_yaml,
|
|
19
|
+
_from_yaml,
|
|
19
20
|
)
|
|
20
21
|
from roms_tools.setup.regrid import LateralRegrid, VerticalRegrid
|
|
21
22
|
from roms_tools.setup.plot import _plot, _section_plot, _profile_plot, _line_plot
|
|
@@ -387,17 +388,22 @@ class InitialConditions:
|
|
|
387
388
|
ds["Cs_w"] = self.grid.ds["Cs_w"]
|
|
388
389
|
|
|
389
390
|
# Preserve absolute time coordinate for readability
|
|
390
|
-
|
|
391
|
+
abs_time = ds["time"]
|
|
392
|
+
attrs = [key for key in abs_time.attrs]
|
|
393
|
+
for attr in attrs:
|
|
394
|
+
del abs_time.attrs[attr]
|
|
395
|
+
abs_time.attrs["long_name"] = "absolute time"
|
|
396
|
+
ds = ds.assign_coords({"abs_time": abs_time})
|
|
391
397
|
|
|
392
398
|
# Translate the time coordinate to days since the model reference date
|
|
393
399
|
model_reference_date = np.datetime64(self.model_reference_date)
|
|
394
400
|
|
|
395
|
-
# Convert the time coordinate to the format expected by ROMS (
|
|
401
|
+
# Convert the time coordinate to the format expected by ROMS (seconds since model reference date)
|
|
396
402
|
ocean_time = (ds["time"] - model_reference_date).astype("float64") * 1e-9
|
|
397
403
|
ds = ds.assign_coords(ocean_time=("time", ocean_time.data.astype("float64")))
|
|
398
404
|
ds["ocean_time"].attrs[
|
|
399
405
|
"long_name"
|
|
400
|
-
] = f"seconds since {str(self.model_reference_date)}"
|
|
406
|
+
] = f"relative time: seconds since {str(self.model_reference_date)}"
|
|
401
407
|
ds["ocean_time"].attrs["units"] = "seconds"
|
|
402
408
|
ds = ds.swap_dims({"time": "ocean_time"})
|
|
403
409
|
ds = ds.drop_vars("time")
|
|
@@ -753,48 +759,8 @@ class InitialConditions:
|
|
|
753
759
|
filepath : Union[str, Path]
|
|
754
760
|
The path to the YAML file where the parameters will be saved.
|
|
755
761
|
"""
|
|
756
|
-
filepath = Path(filepath)
|
|
757
|
-
|
|
758
|
-
# Serialize Grid data
|
|
759
|
-
grid_data = asdict(self.grid)
|
|
760
|
-
grid_data.pop("ds", None) # Exclude non-serializable fields
|
|
761
|
-
grid_data.pop("straddle", None)
|
|
762
|
-
|
|
763
|
-
# Include the version of roms-tools
|
|
764
|
-
try:
|
|
765
|
-
roms_tools_version = importlib.metadata.version("roms-tools")
|
|
766
|
-
except importlib.metadata.PackageNotFoundError:
|
|
767
|
-
roms_tools_version = "unknown"
|
|
768
|
-
|
|
769
|
-
# Create header
|
|
770
|
-
header = f"---\nroms_tools_version: {roms_tools_version}\n---\n"
|
|
771
|
-
|
|
772
|
-
grid_yaml_data = {"Grid": grid_data}
|
|
773
|
-
|
|
774
|
-
initial_conditions_data = {
|
|
775
|
-
"InitialConditions": {
|
|
776
|
-
"ini_time": self.ini_time.isoformat(),
|
|
777
|
-
"source": self.source,
|
|
778
|
-
}
|
|
779
|
-
}
|
|
780
|
-
# Include bgc_source if it's not None
|
|
781
|
-
if self.bgc_source is not None:
|
|
782
|
-
initial_conditions_data["InitialConditions"]["bgc_source"] = self.bgc_source
|
|
783
|
-
|
|
784
|
-
initial_conditions_data["InitialConditions"][
|
|
785
|
-
"model_reference_date"
|
|
786
|
-
] = self.model_reference_date.isoformat()
|
|
787
|
-
|
|
788
|
-
yaml_data = {
|
|
789
|
-
**grid_yaml_data,
|
|
790
|
-
**initial_conditions_data,
|
|
791
|
-
}
|
|
792
762
|
|
|
793
|
-
|
|
794
|
-
# Write header
|
|
795
|
-
file.write(header)
|
|
796
|
-
# Write YAML data
|
|
797
|
-
yaml.dump(yaml_data, file, default_flow_style=False, sort_keys=False)
|
|
763
|
+
_to_yaml(self, filepath)
|
|
798
764
|
|
|
799
765
|
@classmethod
|
|
800
766
|
def from_yaml(
|
|
@@ -815,35 +781,7 @@ class InitialConditions:
|
|
|
815
781
|
An instance of the InitialConditions class.
|
|
816
782
|
"""
|
|
817
783
|
filepath = Path(filepath)
|
|
818
|
-
# Read the entire file content
|
|
819
|
-
with filepath.open("r") as file:
|
|
820
|
-
file_content = file.read()
|
|
821
|
-
|
|
822
|
-
# Split the content into YAML documents
|
|
823
|
-
documents = list(yaml.safe_load_all(file_content))
|
|
824
|
-
|
|
825
|
-
initial_conditions_data = None
|
|
826
|
-
|
|
827
|
-
# Process the YAML documents
|
|
828
|
-
for doc in documents:
|
|
829
|
-
if doc is None:
|
|
830
|
-
continue
|
|
831
|
-
if "InitialConditions" in doc:
|
|
832
|
-
initial_conditions_data = doc["InitialConditions"]
|
|
833
|
-
break
|
|
834
|
-
|
|
835
|
-
if initial_conditions_data is None:
|
|
836
|
-
raise ValueError(
|
|
837
|
-
"No InitialConditions configuration found in the YAML file."
|
|
838
|
-
)
|
|
839
|
-
|
|
840
|
-
# Convert from string to datetime
|
|
841
|
-
for date_string in ["model_reference_date", "ini_time"]:
|
|
842
|
-
initial_conditions_data[date_string] = datetime.fromisoformat(
|
|
843
|
-
initial_conditions_data[date_string]
|
|
844
|
-
)
|
|
845
784
|
|
|
846
785
|
grid = Grid.from_yaml(filepath)
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
return cls(grid=grid, **initial_conditions_data, use_dask=use_dask)
|
|
786
|
+
initial_conditions_params = _from_yaml(cls, filepath)
|
|
787
|
+
return cls(grid=grid, **initial_conditions_params, use_dask=use_dask)
|
roms_tools/setup/plot.py
CHANGED
|
@@ -58,16 +58,71 @@ def _plot(
|
|
|
58
58
|
if straddle:
|
|
59
59
|
lon_deg = xr.where(lon_deg > 180, lon_deg - 360, lon_deg)
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
proj = ccrs.PlateCarree()
|
|
63
|
-
|
|
64
|
-
trans = ccrs.NearsidePerspective(
|
|
65
|
-
central_longitude=lon_deg.mean().values, central_latitude=lat_deg.mean().values
|
|
66
|
-
)
|
|
61
|
+
trans = _get_projection(lon_deg, lat_deg)
|
|
67
62
|
|
|
68
63
|
lon_deg = lon_deg.values
|
|
69
64
|
lat_deg = lat_deg.values
|
|
70
65
|
|
|
66
|
+
fig, ax = plt.subplots(1, 1, figsize=(13, 7), subplot_kw={"projection": trans})
|
|
67
|
+
|
|
68
|
+
_add_plot_to_ax(
|
|
69
|
+
ax, lon_deg, lat_deg, trans, field, depth_contours, c, title, kwargs=kwargs
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def _add_plot_to_ax(
|
|
74
|
+
ax,
|
|
75
|
+
lon_deg,
|
|
76
|
+
lat_deg,
|
|
77
|
+
trans,
|
|
78
|
+
field=None,
|
|
79
|
+
depth_contours=False,
|
|
80
|
+
c="red",
|
|
81
|
+
title="",
|
|
82
|
+
add_colorbar=True,
|
|
83
|
+
kwargs=None,
|
|
84
|
+
):
|
|
85
|
+
"""Plots a grid or field on a map with optional depth contours.
|
|
86
|
+
|
|
87
|
+
Parameters
|
|
88
|
+
----------
|
|
89
|
+
ax : matplotlib.axes._axes.Axes
|
|
90
|
+
The axes on which to plot the data (Cartopy axis with projection).
|
|
91
|
+
|
|
92
|
+
lon_deg : np.ndarray
|
|
93
|
+
Longitude values in degrees.
|
|
94
|
+
|
|
95
|
+
lat_deg : np.ndarray
|
|
96
|
+
Latitude values in degrees.
|
|
97
|
+
|
|
98
|
+
trans : cartopy.crs.Projection
|
|
99
|
+
The projection for transforming coordinates.
|
|
100
|
+
|
|
101
|
+
field : xarray.DataArray, optional
|
|
102
|
+
Field data to plot (e.g., temperature, salinity). If None, only the grid is plotted.
|
|
103
|
+
|
|
104
|
+
depth_contours : bool, optional
|
|
105
|
+
If True, adds depth contours to the plot.
|
|
106
|
+
|
|
107
|
+
c : str, optional
|
|
108
|
+
Color of the grid boundary (default is 'red').
|
|
109
|
+
|
|
110
|
+
title : str, optional
|
|
111
|
+
Title of the plot.
|
|
112
|
+
|
|
113
|
+
add_colorbar : bool, optional
|
|
114
|
+
If True, add colobar.
|
|
115
|
+
|
|
116
|
+
kwargs : dict, optional
|
|
117
|
+
Additional keyword arguments passed to `pcolormesh` (e.g., colormap, limits).
|
|
118
|
+
|
|
119
|
+
Notes
|
|
120
|
+
-----
|
|
121
|
+
- If `field` is provided, a colorbar is added.
|
|
122
|
+
- If `depth_contours` is True, the field’s `layer_depth` is used to add contours.
|
|
123
|
+
"""
|
|
124
|
+
proj = ccrs.PlateCarree()
|
|
125
|
+
|
|
71
126
|
# find corners
|
|
72
127
|
corners = [
|
|
73
128
|
(lon_deg[0, 0], lat_deg[0, 0]),
|
|
@@ -80,14 +135,13 @@ def _plot(
|
|
|
80
135
|
transformed_corners = [trans.transform_point(lo, la, proj) for lo, la in corners]
|
|
81
136
|
transformed_lons, transformed_lats = zip(*transformed_corners)
|
|
82
137
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
)
|
|
138
|
+
if c is not None:
|
|
139
|
+
ax.plot(
|
|
140
|
+
list(transformed_lons) + [transformed_lons[0]],
|
|
141
|
+
list(transformed_lats) + [transformed_lats[0]],
|
|
142
|
+
"o-",
|
|
143
|
+
c=c,
|
|
144
|
+
)
|
|
91
145
|
|
|
92
146
|
ax.coastlines(
|
|
93
147
|
resolution="50m", linewidth=0.5, color="black"
|
|
@@ -104,13 +158,21 @@ def _plot(
|
|
|
104
158
|
label = f"{field.Long_name} [{field.units}]"
|
|
105
159
|
else:
|
|
106
160
|
label = ""
|
|
107
|
-
|
|
161
|
+
if add_colorbar:
|
|
162
|
+
plt.colorbar(p, label=label)
|
|
108
163
|
|
|
109
164
|
if depth_contours:
|
|
110
165
|
cs = ax.contour(lon_deg, lat_deg, field.layer_depth, transform=proj, colors="k")
|
|
111
166
|
ax.clabel(cs, inline=True, fontsize=10)
|
|
112
167
|
|
|
113
168
|
|
|
169
|
+
def _get_projection(lon, lat):
|
|
170
|
+
|
|
171
|
+
return ccrs.NearsidePerspective(
|
|
172
|
+
central_longitude=lon.mean().values, central_latitude=lat.mean().values
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
|
|
114
176
|
def _section_plot(field, interface_depth=None, title="", kwargs={}, ax=None):
|
|
115
177
|
|
|
116
178
|
if ax is None:
|