roms-tools 3.2.0__py3-none-any.whl → 3.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- roms_tools/__init__.py +1 -1
- roms_tools/plot.py +38 -30
- roms_tools/setup/boundary_forcing.py +2 -2
- roms_tools/setup/grid.py +13 -5
- roms_tools/setup/initial_conditions.py +5 -5
- roms_tools/setup/{datasets.py → lat_lon_datasets.py} +23 -804
- roms_tools/setup/nesting.py +262 -90
- roms_tools/setup/river_datasets.py +527 -0
- roms_tools/setup/river_forcing.py +2 -2
- roms_tools/setup/surface_forcing.py +4 -4
- roms_tools/setup/tides.py +1 -1
- roms_tools/setup/topography.py +4 -6
- roms_tools/setup/utils.py +263 -2
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_ALT_CO2_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_ALT_CO2_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_ALT_CO2_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_ALT_CO2_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_ALT_CO2_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_ALT_CO2_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOC_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOC_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOC_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOCr_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOCr_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOCr_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DON_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DON_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DON_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DONr_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DONr_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DONr_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOP_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOP_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOP_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOPr_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOPr_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOPr_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Fe_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Fe_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Fe_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Lig_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Lig_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Lig_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NH4_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NH4_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NH4_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NO3_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NO3_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NO3_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/O2_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/O2_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/O2_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/PO4_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/PO4_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/PO4_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/SiO3_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/SiO3_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/SiO3_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatC_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatC_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatC_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatChl_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatChl_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatChl_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatFe_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatFe_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatFe_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatP_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatP_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatP_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatSi_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatSi_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatSi_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazC_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazC_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazC_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazChl_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazChl_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazChl_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazFe_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazFe_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazFe_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazP_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazP_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazP_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spC_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spC_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spC_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spCaCO3_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spCaCO3_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spCaCO3_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spChl_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spChl_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spChl_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spFe_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spFe_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spFe_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spP_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spP_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spP_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zarr.json +406 -406
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zooC_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zooC_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zooC_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/salt_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/salt_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/salt_south/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/salt_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/temp_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/temp_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/temp_south/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/temp_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/u_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/u_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/u_south/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/u_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/ubar_east/c/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/ubar_north/c/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/ubar_south/c/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/ubar_west/c/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/v_east/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/v_north/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/v_south/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/v_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/vbar_east/c/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/vbar_north/c/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/vbar_south/c/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/vbar_west/c/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/zarr.json +182 -182
- roms_tools/tests/test_setup/test_data/grid.zarr/h/c/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/grid.zarr/zarr.json +191 -191
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/h/c/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/zarr.json +210 -210
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/ALK/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/ALK_ALT_CO2/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DIC/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DIC_ALT_CO2/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DOC/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DOCr/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DON/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DONr/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DOP/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DOPr/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/Fe/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/Lig/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/NH4/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/NO3/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/O2/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/PO4/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/SiO3/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diatC/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diatChl/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diatFe/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diatP/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diatSi/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diazC/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diazChl/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diazFe/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diazP/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/salt/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/spC/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/spCaCO3/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/spChl/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/spFe/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/spP/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/temp/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/u/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/ubar/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/v/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/vbar/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/zarr.json +182 -182
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/zooC/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_unified_bgc_from_climatology.zarr/salt/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_unified_bgc_from_climatology.zarr/temp/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_unified_bgc_from_climatology.zarr/u/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_unified_bgc_from_climatology.zarr/ubar/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_unified_bgc_from_climatology.zarr/v/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_unified_bgc_from_climatology.zarr/vbar/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_unified_bgc_from_climatology.zarr/zarr.json +187 -187
- roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/u_Im/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/u_Re/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/v_Im/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/v_Re/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/zarr.json +66 -66
- roms_tools/tests/test_setup/test_grid.py +14 -0
- roms_tools/tests/test_setup/test_initial_conditions.py +1 -1
- roms_tools/tests/test_setup/{test_datasets.py → test_lat_lon_datasets.py} +22 -61
- roms_tools/tests/test_setup/test_nesting.py +119 -31
- roms_tools/tests/test_setup/test_river_datasets.py +48 -0
- roms_tools/tests/test_setup/test_surface_forcing.py +1 -1
- roms_tools/tests/test_setup/test_utils.py +1 -1
- {roms_tools-3.2.0.dist-info → roms_tools-3.3.0.dist-info}/METADATA +1 -1
- {roms_tools-3.2.0.dist-info → roms_tools-3.3.0.dist-info}/RECORD +202 -200
- {roms_tools-3.2.0.dist-info → roms_tools-3.3.0.dist-info}/WHEEL +0 -0
- {roms_tools-3.2.0.dist-info → roms_tools-3.3.0.dist-info}/licenses/LICENSE +0 -0
- {roms_tools-3.2.0.dist-info → roms_tools-3.3.0.dist-info}/top_level.txt +0 -0
|
@@ -11,9 +11,10 @@ from roms_tools.setup.nesting import (
|
|
|
11
11
|
compute_boundary_distance,
|
|
12
12
|
interpolate_indices,
|
|
13
13
|
map_child_boundaries_onto_parent_grid_indices,
|
|
14
|
-
|
|
14
|
+
modify_child_mask,
|
|
15
|
+
modify_child_topography,
|
|
15
16
|
)
|
|
16
|
-
from roms_tools.setup.utils import get_boundary_coords
|
|
17
|
+
from roms_tools.setup.utils import get_boundary_coords, wrap_longitudes
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
@pytest.fixture()
|
|
@@ -46,9 +47,7 @@ def big_grid_that_straddles():
|
|
|
46
47
|
|
|
47
48
|
@pytest.fixture()
|
|
48
49
|
def small_grid_that_straddles():
|
|
49
|
-
return Grid(
|
|
50
|
-
nx=10, ny=10, center_lon=10, center_lat=61, rot=-20, size_x=500, size_y=500
|
|
51
|
-
)
|
|
50
|
+
return Grid(nx=10, ny=10, center_lon=0, center_lat=61, rot=0, size_x=50, size_y=200)
|
|
52
51
|
|
|
53
52
|
|
|
54
53
|
@pytest.fixture()
|
|
@@ -71,11 +70,11 @@ def child_grid_that_straddles(big_grid_that_straddles):
|
|
|
71
70
|
parent_grid=big_grid_that_straddles,
|
|
72
71
|
nx=10,
|
|
73
72
|
ny=10,
|
|
74
|
-
center_lon=
|
|
73
|
+
center_lon=0,
|
|
75
74
|
center_lat=61,
|
|
76
|
-
rot
|
|
77
|
-
size_x=
|
|
78
|
-
size_y=
|
|
75
|
+
rot=0,
|
|
76
|
+
size_x=50,
|
|
77
|
+
size_y=200,
|
|
79
78
|
)
|
|
80
79
|
|
|
81
80
|
|
|
@@ -100,13 +99,14 @@ class TestInterpolateIndices:
|
|
|
100
99
|
mask = grid.ds[f"mask_{location}"].isel(**bdry_coords)
|
|
101
100
|
|
|
102
101
|
with caplog.at_level(logging.WARNING):
|
|
103
|
-
i_eta, i_xi = interpolate_indices(grid.ds, lon, lat, mask)
|
|
102
|
+
i_eta, i_xi = interpolate_indices(grid.ds, lon, lat, mask, direction)
|
|
104
103
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
104
|
+
if mask.sum() > 0:
|
|
105
|
+
# Verify the warning message in the log
|
|
106
|
+
assert (
|
|
107
|
+
"boundary of the child grid lie very close to the edges of the parent grid"
|
|
108
|
+
in caplog.text
|
|
109
|
+
)
|
|
110
110
|
|
|
111
111
|
if direction == "south":
|
|
112
112
|
expected_i_eta = -0.5 * xr.ones_like(grid.ds.xi_rho)
|
|
@@ -142,20 +142,27 @@ class TestInterpolateIndices:
|
|
|
142
142
|
big_grid = request.getfixturevalue(big_grid_fixture)
|
|
143
143
|
small_grid = request.getfixturevalue(small_grid_fixture)
|
|
144
144
|
|
|
145
|
+
big_grid_ds = wrap_longitudes(big_grid.ds.copy(), straddle=big_grid.straddle)
|
|
146
|
+
small_grid_ds = wrap_longitudes(
|
|
147
|
+
small_grid.ds.copy(), straddle=big_grid.straddle
|
|
148
|
+
)
|
|
149
|
+
|
|
145
150
|
bdry_coords_dict = get_boundary_coords()
|
|
146
151
|
for location in ["rho", "u", "v"]:
|
|
147
152
|
for direction in ["south", "east", "north", "west"]:
|
|
148
153
|
bdry_coords = bdry_coords_dict[location][direction]
|
|
149
|
-
lon =
|
|
150
|
-
lat =
|
|
151
|
-
mask =
|
|
154
|
+
lon = small_grid_ds[f"lon_{location}"].isel(**bdry_coords)
|
|
155
|
+
lat = small_grid_ds[f"lat_{location}"].isel(**bdry_coords)
|
|
156
|
+
mask = small_grid_ds[f"mask_{location}"].isel(**bdry_coords)
|
|
152
157
|
|
|
153
|
-
i_eta, i_xi = interpolate_indices(
|
|
158
|
+
i_eta, i_xi = interpolate_indices(
|
|
159
|
+
big_grid_ds, lon, lat, mask, direction
|
|
160
|
+
)
|
|
154
161
|
|
|
155
162
|
expected_i_eta_min = -0.5
|
|
156
|
-
expected_i_eta_max =
|
|
163
|
+
expected_i_eta_max = big_grid_ds.eta_rho[-1] - 0.5
|
|
157
164
|
expected_i_xi_min = -0.5
|
|
158
|
-
expected_i_xi_max =
|
|
165
|
+
expected_i_xi_max = big_grid_ds.xi_rho[-1] - 0.5
|
|
159
166
|
|
|
160
167
|
assert (i_eta >= expected_i_eta_min).all()
|
|
161
168
|
assert (i_eta <= expected_i_eta_max).all()
|
|
@@ -166,11 +173,16 @@ class TestInterpolateIndices:
|
|
|
166
173
|
class TestMapChildBoundaries:
|
|
167
174
|
def test_update_indices_does_nothing_if_no_parent_land(self, small_grid, baby_grid):
|
|
168
175
|
"""Verify no change in indices when parent grid has no land at boundaries."""
|
|
176
|
+
small_grid_ds = wrap_longitudes(
|
|
177
|
+
small_grid.ds.copy(), straddle=small_grid.straddle
|
|
178
|
+
)
|
|
179
|
+
baby_grid_ds = wrap_longitudes(baby_grid.ds.copy(), straddle=baby_grid.straddle)
|
|
180
|
+
|
|
169
181
|
ds_without_updated_indices = map_child_boundaries_onto_parent_grid_indices(
|
|
170
|
-
|
|
182
|
+
small_grid_ds, baby_grid_ds, update_land_indices=False
|
|
171
183
|
)
|
|
172
184
|
ds_with_updated_indices = map_child_boundaries_onto_parent_grid_indices(
|
|
173
|
-
|
|
185
|
+
small_grid_ds, baby_grid_ds, update_land_indices=True
|
|
174
186
|
)
|
|
175
187
|
|
|
176
188
|
xr.testing.assert_allclose(ds_without_updated_indices, ds_with_updated_indices)
|
|
@@ -189,7 +201,12 @@ class TestMapChildBoundaries:
|
|
|
189
201
|
big_grid = request.getfixturevalue(big_grid_fixture)
|
|
190
202
|
small_grid = request.getfixturevalue(small_grid_fixture)
|
|
191
203
|
|
|
192
|
-
|
|
204
|
+
big_grid_ds = wrap_longitudes(big_grid.ds.copy(), straddle=big_grid.straddle)
|
|
205
|
+
small_grid_ds = wrap_longitudes(
|
|
206
|
+
small_grid.ds.copy(), straddle=big_grid.straddle
|
|
207
|
+
)
|
|
208
|
+
|
|
209
|
+
ds = map_child_boundaries_onto_parent_grid_indices(big_grid_ds, small_grid_ds)
|
|
193
210
|
for direction in ["south", "east", "north", "west"]:
|
|
194
211
|
for location in ["rho", "u", "v"]:
|
|
195
212
|
if location == "rho":
|
|
@@ -224,9 +241,14 @@ class TestMapChildBoundaries:
|
|
|
224
241
|
big_grid = request.getfixturevalue(big_grid_fixture)
|
|
225
242
|
small_grid = request.getfixturevalue(small_grid_fixture)
|
|
226
243
|
|
|
244
|
+
big_grid_ds = wrap_longitudes(big_grid.ds.copy(), straddle=big_grid.straddle)
|
|
245
|
+
small_grid_ds = wrap_longitudes(
|
|
246
|
+
small_grid.ds.copy(), straddle=big_grid.straddle
|
|
247
|
+
)
|
|
248
|
+
|
|
227
249
|
for update_land_indices in [False, True]:
|
|
228
250
|
ds = map_child_boundaries_onto_parent_grid_indices(
|
|
229
|
-
|
|
251
|
+
big_grid_ds, small_grid_ds, update_land_indices=update_land_indices
|
|
230
252
|
)
|
|
231
253
|
|
|
232
254
|
for direction in ["south", "east", "north", "west"]:
|
|
@@ -292,9 +314,7 @@ class TestModifyChid:
|
|
|
292
314
|
):
|
|
293
315
|
"""Confirm child mask remains unchanged if no parent land is at boundaries."""
|
|
294
316
|
mask_original = baby_grid.ds.mask_rho.copy()
|
|
295
|
-
modified_baby_grid_ds =
|
|
296
|
-
small_grid.ds, baby_grid.ds
|
|
297
|
-
)
|
|
317
|
+
modified_baby_grid_ds = modify_child_mask(small_grid.ds, baby_grid.ds)
|
|
298
318
|
xr.testing.assert_allclose(modified_baby_grid_ds.mask_rho, mask_original)
|
|
299
319
|
|
|
300
320
|
@pytest.mark.parametrize(
|
|
@@ -311,7 +331,8 @@ class TestModifyChid:
|
|
|
311
331
|
|
|
312
332
|
h_original = grid.ds.h.copy()
|
|
313
333
|
mask_original = grid.ds.mask_rho.copy()
|
|
314
|
-
modified_grid_ds =
|
|
334
|
+
modified_grid_ds = modify_child_mask(grid.ds, grid.ds)
|
|
335
|
+
modified_grid_ds = modify_child_topography(grid.ds, modified_grid_ds)
|
|
315
336
|
|
|
316
337
|
xr.testing.assert_allclose(modified_grid_ds.h, h_original)
|
|
317
338
|
xr.testing.assert_allclose(modified_grid_ds.mask_rho, mask_original)
|
|
@@ -325,7 +346,8 @@ class TestModifyChid:
|
|
|
325
346
|
mask_original = small_grid.ds.mask_rho.copy()
|
|
326
347
|
|
|
327
348
|
# Apply the modification function
|
|
328
|
-
modified_ds =
|
|
349
|
+
modified_ds = modify_child_mask(big_grid.ds, small_grid.ds)
|
|
350
|
+
modified_ds = modify_child_topography(big_grid.ds, modified_ds)
|
|
329
351
|
|
|
330
352
|
# Calculate the center indices for the grid
|
|
331
353
|
eta_center = h_original.sizes["eta_rho"] // 2
|
|
@@ -405,9 +427,75 @@ class TestNesting:
|
|
|
405
427
|
params = dataclasses.asdict(small_grid)
|
|
406
428
|
del params["ds"], params["straddle"]
|
|
407
429
|
|
|
408
|
-
with pytest.raises(
|
|
430
|
+
with pytest.raises(
|
|
431
|
+
ValueError, match="boundary of the child grid lie outside the parent grid"
|
|
432
|
+
):
|
|
409
433
|
ChildGrid(parent_grid=big_grid, **params)
|
|
410
434
|
|
|
435
|
+
def test_no_error_if_land_child_points_beyond_parent_grid(self):
|
|
436
|
+
# coarse resolution Pacific domain
|
|
437
|
+
parent_grid = Grid(
|
|
438
|
+
nx=50,
|
|
439
|
+
ny=50,
|
|
440
|
+
size_x=23000,
|
|
441
|
+
size_y=12000,
|
|
442
|
+
center_lon=-161,
|
|
443
|
+
center_lat=14.4,
|
|
444
|
+
rot=-3,
|
|
445
|
+
)
|
|
446
|
+
|
|
447
|
+
# California Current System domain, where some land points extend beyond Pacific domain
|
|
448
|
+
child_grid_parameters = {
|
|
449
|
+
"nx": 50,
|
|
450
|
+
"ny": 50,
|
|
451
|
+
"size_x": 2688,
|
|
452
|
+
"size_y": 5280,
|
|
453
|
+
"center_lat": 39.6,
|
|
454
|
+
"center_lon": -134.5,
|
|
455
|
+
"rot": 33.3,
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
child_grid = ChildGrid(
|
|
459
|
+
**child_grid_parameters,
|
|
460
|
+
parent_grid=parent_grid,
|
|
461
|
+
boundaries={"north": True, "west": True, "south": True, "east": False},
|
|
462
|
+
)
|
|
463
|
+
assert isinstance(child_grid.ds, xr.Dataset)
|
|
464
|
+
|
|
465
|
+
def test_no_error_if_child_boundary_entirely_on_land(self):
|
|
466
|
+
parent_grid = Grid(
|
|
467
|
+
nx=7,
|
|
468
|
+
ny=7,
|
|
469
|
+
size_x=240,
|
|
470
|
+
size_y=240,
|
|
471
|
+
center_lon=-4.1,
|
|
472
|
+
center_lat=52.36,
|
|
473
|
+
rot=0,
|
|
474
|
+
)
|
|
475
|
+
|
|
476
|
+
child_grid_parameters = {
|
|
477
|
+
"nx": 5,
|
|
478
|
+
"ny": 5,
|
|
479
|
+
"size_x": 100,
|
|
480
|
+
"size_y": 100,
|
|
481
|
+
"center_lon": -4.1,
|
|
482
|
+
"center_lat": 52.36,
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
child_grid = ChildGrid(
|
|
486
|
+
**child_grid_parameters,
|
|
487
|
+
parent_grid=parent_grid,
|
|
488
|
+
boundaries={
|
|
489
|
+
"south": True,
|
|
490
|
+
"east": True,
|
|
491
|
+
"north": True,
|
|
492
|
+
"west": True,
|
|
493
|
+
},
|
|
494
|
+
)
|
|
495
|
+
|
|
496
|
+
assert isinstance(child_grid.ds, xr.Dataset)
|
|
497
|
+
assert isinstance(child_grid.ds_nesting, xr.Dataset)
|
|
498
|
+
|
|
411
499
|
@pytest.mark.parametrize(
|
|
412
500
|
"child_grid_fixture",
|
|
413
501
|
["child_grid", "child_grid_that_straddles"],
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
|
|
3
|
+
import numpy as np
|
|
4
|
+
import xarray as xr
|
|
5
|
+
|
|
6
|
+
from roms_tools.setup.river_datasets import RiverDataset
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class TestRiverDataset:
|
|
10
|
+
def test_deduplicate_river_names(self, tmp_path):
|
|
11
|
+
sample_dim_and_var_names = {
|
|
12
|
+
"dim_names": {"station": "station", "time": "time"},
|
|
13
|
+
"var_names": {
|
|
14
|
+
"latitude": "lat",
|
|
15
|
+
"longitude": "lon",
|
|
16
|
+
"flux": "flux",
|
|
17
|
+
"ratio": "ratio",
|
|
18
|
+
"name": "name",
|
|
19
|
+
},
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
data = {
|
|
23
|
+
"lat": (["station"], [10.0, 20.0, 30.0]),
|
|
24
|
+
"lon": (["station"], [100.0, 110.0, 120.0]),
|
|
25
|
+
"flux": (["time", "station"], np.random.rand(1, 3)),
|
|
26
|
+
"ratio": (["time", "station"], np.random.rand(1, 3)),
|
|
27
|
+
"name": (["station"], ["Amazon", "Nile", "Amazon"]), # duplicate
|
|
28
|
+
}
|
|
29
|
+
coords = {"station": [0, 1, 2], "time": [0]}
|
|
30
|
+
ds = xr.Dataset(data, coords=coords)
|
|
31
|
+
|
|
32
|
+
# Write to temporary NetCDF file
|
|
33
|
+
file_path = tmp_path / "rivers.nc"
|
|
34
|
+
ds.to_netcdf(file_path)
|
|
35
|
+
|
|
36
|
+
river_dataset = RiverDataset(
|
|
37
|
+
filename=file_path,
|
|
38
|
+
start_time=datetime(2000, 1, 1),
|
|
39
|
+
end_time=datetime(2000, 1, 2),
|
|
40
|
+
dim_names=sample_dim_and_var_names["dim_names"],
|
|
41
|
+
var_names=sample_dim_and_var_names["var_names"],
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
names = river_dataset.ds["name"].values
|
|
45
|
+
assert "Amazon_1" in names
|
|
46
|
+
assert "Amazon_2" in names
|
|
47
|
+
assert "Nile" in names
|
|
48
|
+
assert len(set(names)) == len(names) # all names must be unique
|
|
@@ -10,7 +10,7 @@ import xarray as xr
|
|
|
10
10
|
from conftest import calculate_data_hash
|
|
11
11
|
from roms_tools import Grid, SurfaceForcing
|
|
12
12
|
from roms_tools.download import download_test_data
|
|
13
|
-
from roms_tools.setup.
|
|
13
|
+
from roms_tools.setup.utils import RawDataSource
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
@pytest.fixture
|
|
@@ -8,7 +8,7 @@ import xarray as xr
|
|
|
8
8
|
|
|
9
9
|
from roms_tools import BoundaryForcing, Grid
|
|
10
10
|
from roms_tools.download import download_test_data
|
|
11
|
-
from roms_tools.setup.
|
|
11
|
+
from roms_tools.setup.lat_lon_datasets import ERA5Correction
|
|
12
12
|
from roms_tools.setup.utils import (
|
|
13
13
|
get_target_coords,
|
|
14
14
|
interpolate_from_climatology,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: roms-tools
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.3.0
|
|
4
4
|
Summary: Tools for running and analysing UCLA-ROMS simulations
|
|
5
5
|
Author-email: Nora Loose <nora.loose@gmail.com>, Thomas Nicholas <tom@cworthy.org>, Scott Eilerman <scott.eilerman@cworthy.org>
|
|
6
6
|
License: Apache-2
|