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/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
|
|
roms_tools/setup/grid.py
CHANGED
|
@@ -13,7 +13,7 @@ from roms_tools.setup.plot import _plot, _section_plot, _profile_plot, _line_plo
|
|
|
13
13
|
from roms_tools.setup.utils import interpolate_from_rho_to_u, interpolate_from_rho_to_v
|
|
14
14
|
from roms_tools.setup.vertical_coordinate import sigma_stretch, compute_depth
|
|
15
15
|
from roms_tools.setup.utils import extract_single_value, save_datasets
|
|
16
|
-
import
|
|
16
|
+
import logging
|
|
17
17
|
from pathlib import Path
|
|
18
18
|
|
|
19
19
|
RADIUS_OF_EARTH = 6371315.0 # in m
|
|
@@ -350,11 +350,7 @@ class Grid:
|
|
|
350
350
|
_plot(self.ds, straddle=self.straddle)
|
|
351
351
|
|
|
352
352
|
def plot_vertical_coordinate(
|
|
353
|
-
self,
|
|
354
|
-
varname="layer_depth_rho",
|
|
355
|
-
s=None,
|
|
356
|
-
eta=None,
|
|
357
|
-
xi=None,
|
|
353
|
+
self, varname="layer_depth_rho", s=None, eta=None, xi=None, ax=None
|
|
358
354
|
) -> None:
|
|
359
355
|
"""Plot the vertical coordinate system for a given eta-, xi-, or s-slice.
|
|
360
356
|
|
|
@@ -376,6 +372,8 @@ class Grid:
|
|
|
376
372
|
The eta-index to plot. Default is None.
|
|
377
373
|
xi : int, optional
|
|
378
374
|
The xi-index to plot. Default is None.
|
|
375
|
+
ax : matplotlib.axes.Axes, optional
|
|
376
|
+
The axes to plot on. If None, a new figure is created. Note that this argument does not work for horizontal plots that display the eta- and xi-dimensions at the same time.
|
|
379
377
|
|
|
380
378
|
Returns
|
|
381
379
|
-------
|
|
@@ -477,12 +475,13 @@ class Grid:
|
|
|
477
475
|
interface_depth=interface_depth,
|
|
478
476
|
title=title,
|
|
479
477
|
kwargs=kwargs,
|
|
478
|
+
ax=ax,
|
|
480
479
|
)
|
|
481
480
|
else:
|
|
482
481
|
if "s_rho" in field.dims or "s_w" in field.dims:
|
|
483
|
-
_profile_plot(field, title=title)
|
|
482
|
+
_profile_plot(field, title=title, ax=ax)
|
|
484
483
|
else:
|
|
485
|
-
_line_plot(field, title=title)
|
|
484
|
+
_line_plot(field, title=title, ax=ax)
|
|
486
485
|
|
|
487
486
|
def save(
|
|
488
487
|
self, filepath: Union[str, Path], np_eta: int = None, np_xi: int = None
|
|
@@ -728,9 +727,8 @@ class Grid:
|
|
|
728
727
|
roms_tools_version_current = "unknown"
|
|
729
728
|
|
|
730
729
|
if roms_tools_version_header != roms_tools_version_current:
|
|
731
|
-
|
|
730
|
+
logging.warning(
|
|
732
731
|
f"Current roms-tools version ({roms_tools_version_current}) does not match the version in the YAML header ({roms_tools_version_header}).",
|
|
733
|
-
UserWarning,
|
|
734
732
|
)
|
|
735
733
|
|
|
736
734
|
if grid_data is None:
|
|
@@ -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
|
|
@@ -91,14 +92,13 @@ class InitialConditions:
|
|
|
91
92
|
self._input_checks()
|
|
92
93
|
|
|
93
94
|
processed_fields = {}
|
|
94
|
-
processed_fields = self._process_data(
|
|
95
|
+
processed_fields, variable_info = self._process_data(
|
|
96
|
+
processed_fields, type="physics"
|
|
97
|
+
)
|
|
95
98
|
|
|
96
99
|
if self.bgc_source is not None:
|
|
97
|
-
processed_fields = self._process_data(
|
|
98
|
-
|
|
99
|
-
for var_name in processed_fields.keys():
|
|
100
|
-
processed_fields[var_name] = transpose_dimensions(
|
|
101
|
-
processed_fields[var_name]
|
|
100
|
+
processed_fields, bgc_variable_info = self._process_data(
|
|
101
|
+
processed_fields, type="bgc"
|
|
102
102
|
)
|
|
103
103
|
|
|
104
104
|
d_meta = get_variable_metadata()
|
|
@@ -106,7 +106,9 @@ class InitialConditions:
|
|
|
106
106
|
|
|
107
107
|
ds = self._add_global_metadata(ds)
|
|
108
108
|
|
|
109
|
-
self.
|
|
109
|
+
if self.bgc_source is not None:
|
|
110
|
+
variable_info = {**variable_info, **bgc_variable_info}
|
|
111
|
+
self._validate(ds, variable_info)
|
|
110
112
|
|
|
111
113
|
# substitute NaNs over land by a fill value to avoid blow-up of ROMS
|
|
112
114
|
for var_name in ds.data_vars:
|
|
@@ -184,7 +186,12 @@ class InitialConditions:
|
|
|
184
186
|
{"time": processed_fields["temp"]["time"]}
|
|
185
187
|
)
|
|
186
188
|
|
|
187
|
-
|
|
189
|
+
for var_name in processed_fields.keys():
|
|
190
|
+
processed_fields[var_name] = transpose_dimensions(
|
|
191
|
+
processed_fields[var_name]
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
return processed_fields, variable_info
|
|
188
195
|
|
|
189
196
|
def _input_checks(self):
|
|
190
197
|
|
|
@@ -259,11 +266,21 @@ class InitialConditions:
|
|
|
259
266
|
- `vector_pair`: For vector variables, this indicates the associated variable that forms the vector (e.g., 'u' and 'v').
|
|
260
267
|
- `is_3d`: Indicates whether the variable is 3D (True for variables like 'temp' and 'salt') or 2D (False for 'zeta').
|
|
261
268
|
|
|
269
|
+
Parameters
|
|
270
|
+
----------
|
|
271
|
+
data : object
|
|
272
|
+
The data object which contains variable names for the "bgc" type variables.
|
|
273
|
+
|
|
274
|
+
type : str, optional, default="physics"
|
|
275
|
+
The type of variable metadata to return. Can be one of:
|
|
276
|
+
- "physics": for physical variables such as temperature, salinity, and velocity components.
|
|
277
|
+
- "bgc": for biogeochemical variables (like ALK).
|
|
278
|
+
|
|
262
279
|
Returns
|
|
263
280
|
-------
|
|
264
281
|
dict
|
|
265
282
|
A dictionary where the keys are variable names and the values are dictionaries of metadata
|
|
266
|
-
about each variable, including 'location', 'is_vector', 'vector_pair', and '
|
|
283
|
+
about each variable, including 'location', 'is_vector', 'vector_pair', 'is_3d', and 'validate'.
|
|
267
284
|
"""
|
|
268
285
|
default_info = {
|
|
269
286
|
"location": "rho",
|
|
@@ -272,7 +289,6 @@ class InitialConditions:
|
|
|
272
289
|
"is_3d": True,
|
|
273
290
|
}
|
|
274
291
|
|
|
275
|
-
# Define a dictionary for variable names and their associated information
|
|
276
292
|
if type == "physics":
|
|
277
293
|
variable_info = {
|
|
278
294
|
"zeta": {
|
|
@@ -280,38 +296,54 @@ class InitialConditions:
|
|
|
280
296
|
"is_vector": False,
|
|
281
297
|
"vector_pair": None,
|
|
282
298
|
"is_3d": False,
|
|
299
|
+
"validate": True,
|
|
283
300
|
},
|
|
284
|
-
"temp": default_info,
|
|
285
|
-
"salt": default_info,
|
|
301
|
+
"temp": {**default_info, "validate": False},
|
|
302
|
+
"salt": {**default_info, "validate": False},
|
|
286
303
|
"u": {
|
|
287
304
|
"location": "u",
|
|
288
305
|
"is_vector": True,
|
|
289
306
|
"vector_pair": "v",
|
|
290
307
|
"is_3d": True,
|
|
308
|
+
"validate": False,
|
|
291
309
|
},
|
|
292
310
|
"v": {
|
|
293
311
|
"location": "v",
|
|
294
312
|
"is_vector": True,
|
|
295
313
|
"vector_pair": "u",
|
|
296
314
|
"is_3d": True,
|
|
315
|
+
"validate": False,
|
|
297
316
|
},
|
|
298
317
|
"ubar": {
|
|
299
318
|
"location": "u",
|
|
300
319
|
"is_vector": True,
|
|
301
320
|
"vector_pair": "vbar",
|
|
302
321
|
"is_3d": False,
|
|
322
|
+
"validate": False,
|
|
303
323
|
},
|
|
304
324
|
"vbar": {
|
|
305
325
|
"location": "v",
|
|
306
326
|
"is_vector": True,
|
|
307
327
|
"vector_pair": "ubar",
|
|
308
328
|
"is_3d": False,
|
|
329
|
+
"validate": False,
|
|
330
|
+
},
|
|
331
|
+
"w": {
|
|
332
|
+
"location": "rho",
|
|
333
|
+
"is_vector": False,
|
|
334
|
+
"vector_pair": None,
|
|
335
|
+
"is_3d": True,
|
|
336
|
+
"validate": False,
|
|
309
337
|
},
|
|
310
338
|
}
|
|
311
|
-
|
|
339
|
+
|
|
340
|
+
if type == "bgc":
|
|
312
341
|
variable_info = {}
|
|
313
342
|
for var_name in data.var_names.keys():
|
|
314
|
-
|
|
343
|
+
if var_name == "ALK":
|
|
344
|
+
variable_info[var_name] = {**default_info, "validate": True}
|
|
345
|
+
else:
|
|
346
|
+
variable_info[var_name] = {**default_info, "validate": False}
|
|
315
347
|
|
|
316
348
|
return variable_info
|
|
317
349
|
|
|
@@ -356,24 +388,29 @@ class InitialConditions:
|
|
|
356
388
|
ds["Cs_w"] = self.grid.ds["Cs_w"]
|
|
357
389
|
|
|
358
390
|
# Preserve absolute time coordinate for readability
|
|
359
|
-
|
|
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})
|
|
360
397
|
|
|
361
398
|
# Translate the time coordinate to days since the model reference date
|
|
362
399
|
model_reference_date = np.datetime64(self.model_reference_date)
|
|
363
400
|
|
|
364
|
-
# 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)
|
|
365
402
|
ocean_time = (ds["time"] - model_reference_date).astype("float64") * 1e-9
|
|
366
403
|
ds = ds.assign_coords(ocean_time=("time", ocean_time.data.astype("float64")))
|
|
367
404
|
ds["ocean_time"].attrs[
|
|
368
405
|
"long_name"
|
|
369
|
-
] = f"seconds since {str(self.model_reference_date)}"
|
|
406
|
+
] = f"relative time: seconds since {str(self.model_reference_date)}"
|
|
370
407
|
ds["ocean_time"].attrs["units"] = "seconds"
|
|
371
408
|
ds = ds.swap_dims({"time": "ocean_time"})
|
|
372
409
|
ds = ds.drop_vars("time")
|
|
373
410
|
|
|
374
411
|
return ds
|
|
375
412
|
|
|
376
|
-
def _validate(self, ds):
|
|
413
|
+
def _validate(self, ds, variable_info):
|
|
377
414
|
"""Validates the dataset by checking for NaN values in SSH at wet points, which
|
|
378
415
|
would indicate missing raw data coverage over the target domain.
|
|
379
416
|
|
|
@@ -381,6 +418,8 @@ class InitialConditions:
|
|
|
381
418
|
----------
|
|
382
419
|
ds : xarray.Dataset
|
|
383
420
|
The dataset to validate.
|
|
421
|
+
variable_info : dict
|
|
422
|
+
A dictionary containing metadata about the variables, including whether to validate them.
|
|
384
423
|
|
|
385
424
|
Raises
|
|
386
425
|
------
|
|
@@ -393,8 +432,11 @@ class InitialConditions:
|
|
|
393
432
|
This check is only applied to the 2D variable SSH to improve performance.
|
|
394
433
|
"""
|
|
395
434
|
|
|
396
|
-
|
|
397
|
-
|
|
435
|
+
for var_name in variable_info:
|
|
436
|
+
# Only validate variables based on "validate" flag if use_dask is False
|
|
437
|
+
if not self.use_dask or variable_info[var_name]["validate"]:
|
|
438
|
+
ds[var_name].load()
|
|
439
|
+
nan_check(ds[var_name].squeeze(), self.grid.ds.mask_rho)
|
|
398
440
|
|
|
399
441
|
def _add_global_metadata(self, ds):
|
|
400
442
|
|
|
@@ -425,6 +467,7 @@ class InitialConditions:
|
|
|
425
467
|
xi=None,
|
|
426
468
|
depth_contours=False,
|
|
427
469
|
layer_contours=False,
|
|
470
|
+
ax=None,
|
|
428
471
|
) -> None:
|
|
429
472
|
"""Plot the initial conditions field for a given eta-, xi-, or s_rho- slice.
|
|
430
473
|
|
|
@@ -492,6 +535,8 @@ class InitialConditions:
|
|
|
492
535
|
be added to the plot. This is particularly useful in vertical sections to
|
|
493
536
|
visualize the layering of the water column. For clarity, the number of layer
|
|
494
537
|
contours displayed is limited to a maximum of 10. Default is False.
|
|
538
|
+
ax : matplotlib.axes.Axes, optional
|
|
539
|
+
The axes to plot on. If None, a new figure is created. Note that this argument does not work for horizontal plots that display the eta- and xi-dimensions at the same time.
|
|
495
540
|
|
|
496
541
|
Returns
|
|
497
542
|
-------
|
|
@@ -639,13 +684,17 @@ class InitialConditions:
|
|
|
639
684
|
|
|
640
685
|
if len(field.dims) == 2:
|
|
641
686
|
_section_plot(
|
|
642
|
-
field,
|
|
687
|
+
field,
|
|
688
|
+
interface_depth=interface_depth,
|
|
689
|
+
title=title,
|
|
690
|
+
kwargs=kwargs,
|
|
691
|
+
ax=ax,
|
|
643
692
|
)
|
|
644
693
|
else:
|
|
645
694
|
if "s_rho" in field.dims:
|
|
646
|
-
_profile_plot(field, title=title)
|
|
695
|
+
_profile_plot(field, title=title, ax=ax)
|
|
647
696
|
else:
|
|
648
|
-
_line_plot(field, title=title)
|
|
697
|
+
_line_plot(field, title=title, ax=ax)
|
|
649
698
|
|
|
650
699
|
def save(
|
|
651
700
|
self, filepath: Union[str, Path], np_eta: int = None, np_xi: int = None
|
|
@@ -710,48 +759,8 @@ class InitialConditions:
|
|
|
710
759
|
filepath : Union[str, Path]
|
|
711
760
|
The path to the YAML file where the parameters will be saved.
|
|
712
761
|
"""
|
|
713
|
-
filepath = Path(filepath)
|
|
714
762
|
|
|
715
|
-
|
|
716
|
-
grid_data = asdict(self.grid)
|
|
717
|
-
grid_data.pop("ds", None) # Exclude non-serializable fields
|
|
718
|
-
grid_data.pop("straddle", None)
|
|
719
|
-
|
|
720
|
-
# Include the version of roms-tools
|
|
721
|
-
try:
|
|
722
|
-
roms_tools_version = importlib.metadata.version("roms-tools")
|
|
723
|
-
except importlib.metadata.PackageNotFoundError:
|
|
724
|
-
roms_tools_version = "unknown"
|
|
725
|
-
|
|
726
|
-
# Create header
|
|
727
|
-
header = f"---\nroms_tools_version: {roms_tools_version}\n---\n"
|
|
728
|
-
|
|
729
|
-
grid_yaml_data = {"Grid": grid_data}
|
|
730
|
-
|
|
731
|
-
initial_conditions_data = {
|
|
732
|
-
"InitialConditions": {
|
|
733
|
-
"ini_time": self.ini_time.isoformat(),
|
|
734
|
-
"source": self.source,
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
# Include bgc_source if it's not None
|
|
738
|
-
if self.bgc_source is not None:
|
|
739
|
-
initial_conditions_data["InitialConditions"]["bgc_source"] = self.bgc_source
|
|
740
|
-
|
|
741
|
-
initial_conditions_data["InitialConditions"][
|
|
742
|
-
"model_reference_date"
|
|
743
|
-
] = self.model_reference_date.isoformat()
|
|
744
|
-
|
|
745
|
-
yaml_data = {
|
|
746
|
-
**grid_yaml_data,
|
|
747
|
-
**initial_conditions_data,
|
|
748
|
-
}
|
|
749
|
-
|
|
750
|
-
with filepath.open("w") as file:
|
|
751
|
-
# Write header
|
|
752
|
-
file.write(header)
|
|
753
|
-
# Write YAML data
|
|
754
|
-
yaml.dump(yaml_data, file, default_flow_style=False, sort_keys=False)
|
|
763
|
+
_to_yaml(self, filepath)
|
|
755
764
|
|
|
756
765
|
@classmethod
|
|
757
766
|
def from_yaml(
|
|
@@ -772,35 +781,7 @@ class InitialConditions:
|
|
|
772
781
|
An instance of the InitialConditions class.
|
|
773
782
|
"""
|
|
774
783
|
filepath = Path(filepath)
|
|
775
|
-
# Read the entire file content
|
|
776
|
-
with filepath.open("r") as file:
|
|
777
|
-
file_content = file.read()
|
|
778
|
-
|
|
779
|
-
# Split the content into YAML documents
|
|
780
|
-
documents = list(yaml.safe_load_all(file_content))
|
|
781
|
-
|
|
782
|
-
initial_conditions_data = None
|
|
783
|
-
|
|
784
|
-
# Process the YAML documents
|
|
785
|
-
for doc in documents:
|
|
786
|
-
if doc is None:
|
|
787
|
-
continue
|
|
788
|
-
if "InitialConditions" in doc:
|
|
789
|
-
initial_conditions_data = doc["InitialConditions"]
|
|
790
|
-
break
|
|
791
|
-
|
|
792
|
-
if initial_conditions_data is None:
|
|
793
|
-
raise ValueError(
|
|
794
|
-
"No InitialConditions configuration found in the YAML file."
|
|
795
|
-
)
|
|
796
|
-
|
|
797
|
-
# Convert from string to datetime
|
|
798
|
-
for date_string in ["model_reference_date", "ini_time"]:
|
|
799
|
-
initial_conditions_data[date_string] = datetime.fromisoformat(
|
|
800
|
-
initial_conditions_data[date_string]
|
|
801
|
-
)
|
|
802
784
|
|
|
803
785
|
grid = Grid.from_yaml(filepath)
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
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
|
@@ -12,6 +12,32 @@ def _plot(
|
|
|
12
12
|
title="",
|
|
13
13
|
kwargs={},
|
|
14
14
|
):
|
|
15
|
+
"""Plots a grid or field on a map with optional depth contours.
|
|
16
|
+
|
|
17
|
+
This function plots a map using Cartopy projections. It supports plotting a grid, a field, and adding depth contours if desired.
|
|
18
|
+
The projection can be customized, and the grid can be adjusted for domains straddling the 180° meridian.
|
|
19
|
+
|
|
20
|
+
Parameters
|
|
21
|
+
----------
|
|
22
|
+
grid_ds : xarray.Dataset
|
|
23
|
+
The grid dataset containing coordinates (`lon_rho`, `lat_rho`).
|
|
24
|
+
field : xarray.DataArray, optional
|
|
25
|
+
The field to plot. If None, only the grid is plotted.
|
|
26
|
+
depth_contours : bool, optional
|
|
27
|
+
If True, adds depth contours to the plot.
|
|
28
|
+
straddle : bool, optional
|
|
29
|
+
If True, adjusts longitude values to straddle across the 180° meridian.
|
|
30
|
+
c : str, optional
|
|
31
|
+
Color for the boundary plot (default is 'red').
|
|
32
|
+
title : str, optional
|
|
33
|
+
Title of the plot.
|
|
34
|
+
kwargs : dict, optional
|
|
35
|
+
Additional keyword arguments to pass to `pcolormesh` (e.g., colormap or color limits).
|
|
36
|
+
|
|
37
|
+
Notes
|
|
38
|
+
-----
|
|
39
|
+
The function raises a `NotImplementedError` if the domain contains the North or South Pole.
|
|
40
|
+
"""
|
|
15
41
|
|
|
16
42
|
if field is None:
|
|
17
43
|
lon_deg = grid_ds["lon_rho"]
|
|
@@ -32,16 +58,71 @@ def _plot(
|
|
|
32
58
|
if straddle:
|
|
33
59
|
lon_deg = xr.where(lon_deg > 180, lon_deg - 360, lon_deg)
|
|
34
60
|
|
|
35
|
-
|
|
36
|
-
proj = ccrs.PlateCarree()
|
|
37
|
-
|
|
38
|
-
trans = ccrs.NearsidePerspective(
|
|
39
|
-
central_longitude=lon_deg.mean().values, central_latitude=lat_deg.mean().values
|
|
40
|
-
)
|
|
61
|
+
trans = _get_projection(lon_deg, lat_deg)
|
|
41
62
|
|
|
42
63
|
lon_deg = lon_deg.values
|
|
43
64
|
lat_deg = lat_deg.values
|
|
44
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
|
+
|
|
45
126
|
# find corners
|
|
46
127
|
corners = [
|
|
47
128
|
(lon_deg[0, 0], lat_deg[0, 0]),
|
|
@@ -54,14 +135,13 @@ def _plot(
|
|
|
54
135
|
transformed_corners = [trans.transform_point(lo, la, proj) for lo, la in corners]
|
|
55
136
|
transformed_lons, transformed_lats = zip(*transformed_corners)
|
|
56
137
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
)
|
|
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
|
+
)
|
|
65
145
|
|
|
66
146
|
ax.coastlines(
|
|
67
147
|
resolution="50m", linewidth=0.5, color="black"
|
|
@@ -78,18 +158,25 @@ def _plot(
|
|
|
78
158
|
label = f"{field.Long_name} [{field.units}]"
|
|
79
159
|
else:
|
|
80
160
|
label = ""
|
|
81
|
-
|
|
161
|
+
if add_colorbar:
|
|
162
|
+
plt.colorbar(p, label=label)
|
|
82
163
|
|
|
83
164
|
if depth_contours:
|
|
84
165
|
cs = ax.contour(lon_deg, lat_deg, field.layer_depth, transform=proj, colors="k")
|
|
85
166
|
ax.clabel(cs, inline=True, fontsize=10)
|
|
86
167
|
|
|
87
|
-
return fig
|
|
88
168
|
|
|
169
|
+
def _get_projection(lon, lat):
|
|
170
|
+
|
|
171
|
+
return ccrs.NearsidePerspective(
|
|
172
|
+
central_longitude=lon.mean().values, central_latitude=lat.mean().values
|
|
173
|
+
)
|
|
89
174
|
|
|
90
|
-
def _section_plot(field, interface_depth=None, title="", kwargs={}):
|
|
91
175
|
|
|
92
|
-
|
|
176
|
+
def _section_plot(field, interface_depth=None, title="", kwargs={}, ax=None):
|
|
177
|
+
|
|
178
|
+
if ax is None:
|
|
179
|
+
fig, ax = plt.subplots(1, 1, figsize=(9, 5))
|
|
93
180
|
|
|
94
181
|
dims_to_check = ["eta_rho", "eta_u", "eta_v", "xi_rho", "xi_u", "xi_v"]
|
|
95
182
|
try:
|
|
@@ -132,7 +219,23 @@ def _section_plot(field, interface_depth=None, title="", kwargs={}):
|
|
|
132
219
|
ax.set_title(title)
|
|
133
220
|
|
|
134
221
|
|
|
135
|
-
def _profile_plot(field, title=""):
|
|
222
|
+
def _profile_plot(field, title="", ax=None):
|
|
223
|
+
"""Plots a profile of the given field against depth.
|
|
224
|
+
|
|
225
|
+
Parameters
|
|
226
|
+
----------
|
|
227
|
+
field : xarray.DataArray
|
|
228
|
+
Data to plot.
|
|
229
|
+
title : str, optional
|
|
230
|
+
Title of the plot.
|
|
231
|
+
ax : matplotlib.axes.Axes, optional
|
|
232
|
+
Axes to plot on. If None, a new figure is created.
|
|
233
|
+
|
|
234
|
+
Raises
|
|
235
|
+
------
|
|
236
|
+
ValueError
|
|
237
|
+
If no expected depth coordinate is found in the field.
|
|
238
|
+
"""
|
|
136
239
|
|
|
137
240
|
depths_to_check = [
|
|
138
241
|
"layer_depth_rho",
|
|
@@ -153,16 +256,33 @@ def _profile_plot(field, title=""):
|
|
|
153
256
|
"None of the expected coordinates (layer_depth_rho, layer_depth_u, layer_depth_v, interface_depth_rho, interface_depth_u, interface_depth_v) found in field.coords"
|
|
154
257
|
)
|
|
155
258
|
|
|
156
|
-
|
|
259
|
+
if ax is None:
|
|
260
|
+
fig, ax = plt.subplots(1, 1, figsize=(4, 7))
|
|
157
261
|
kwargs = {"y": depth_label, "yincrease": False}
|
|
158
262
|
field.plot(**kwargs)
|
|
159
263
|
ax.set_title(title)
|
|
160
264
|
ax.grid()
|
|
161
265
|
|
|
162
266
|
|
|
163
|
-
def _line_plot(field, title=""):
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
267
|
+
def _line_plot(field, title="", ax=None):
|
|
268
|
+
"""Plots a line graph of the given field.
|
|
269
|
+
|
|
270
|
+
Parameters
|
|
271
|
+
----------
|
|
272
|
+
field : xarray.DataArray
|
|
273
|
+
Data to plot.
|
|
274
|
+
title : str, optional
|
|
275
|
+
Title of the plot.
|
|
276
|
+
ax : matplotlib.axes.Axes, optional
|
|
277
|
+
Axes to plot on. If None, a new figure is created.
|
|
278
|
+
|
|
279
|
+
Returns
|
|
280
|
+
-------
|
|
281
|
+
None
|
|
282
|
+
Modifies the plot in-place.
|
|
283
|
+
"""
|
|
284
|
+
if ax is None:
|
|
285
|
+
fig, ax = plt.subplots(1, 1, figsize=(7, 4))
|
|
286
|
+
field.plot(ax=ax)
|
|
167
287
|
ax.set_title(title)
|
|
168
288
|
ax.grid()
|