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
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"attributes": {
|
|
3
3
|
"title": "ROMS tidal forcing created by ROMS-Tools",
|
|
4
|
-
"roms_tools_version": "
|
|
4
|
+
"roms_tools_version": "3.1.3.dev32+g91d580e67.d20250929",
|
|
5
5
|
"source": "TPXO",
|
|
6
6
|
"model_reference_date": "2000-01-01 00:00:00"
|
|
7
7
|
},
|
|
@@ -10,20 +10,21 @@
|
|
|
10
10
|
"kind": "inline",
|
|
11
11
|
"must_understand": false,
|
|
12
12
|
"metadata": {
|
|
13
|
-
"
|
|
13
|
+
"ntides": {
|
|
14
14
|
"shape": [
|
|
15
|
-
1
|
|
16
|
-
4,
|
|
17
|
-
5
|
|
15
|
+
1
|
|
18
16
|
],
|
|
19
|
-
"data_type":
|
|
17
|
+
"data_type": {
|
|
18
|
+
"name": "null_terminated_bytes",
|
|
19
|
+
"configuration": {
|
|
20
|
+
"length_bytes": 3
|
|
21
|
+
}
|
|
22
|
+
},
|
|
20
23
|
"chunk_grid": {
|
|
21
24
|
"name": "regular",
|
|
22
25
|
"configuration": {
|
|
23
26
|
"chunk_shape": [
|
|
24
|
-
1
|
|
25
|
-
4,
|
|
26
|
-
5
|
|
27
|
+
1
|
|
27
28
|
]
|
|
28
29
|
}
|
|
29
30
|
},
|
|
@@ -33,13 +34,10 @@
|
|
|
33
34
|
"separator": "/"
|
|
34
35
|
}
|
|
35
36
|
},
|
|
36
|
-
"fill_value":
|
|
37
|
+
"fill_value": "",
|
|
37
38
|
"codecs": [
|
|
38
39
|
{
|
|
39
|
-
"name": "bytes"
|
|
40
|
-
"configuration": {
|
|
41
|
-
"endian": "little"
|
|
42
|
-
}
|
|
40
|
+
"name": "bytes"
|
|
43
41
|
},
|
|
44
42
|
{
|
|
45
43
|
"name": "zstd",
|
|
@@ -50,35 +48,29 @@
|
|
|
50
48
|
}
|
|
51
49
|
],
|
|
52
50
|
"attributes": {
|
|
53
|
-
"long_name": "
|
|
54
|
-
"units": "m/s",
|
|
55
|
-
"coordinates": "omega",
|
|
56
|
-
"_FillValue": "AAAAAAAA+H8="
|
|
51
|
+
"long_name": "constituent label"
|
|
57
52
|
},
|
|
58
53
|
"dimension_names": [
|
|
59
|
-
"ntides"
|
|
60
|
-
"eta_v",
|
|
61
|
-
"xi_rho"
|
|
54
|
+
"ntides"
|
|
62
55
|
],
|
|
63
56
|
"zarr_format": 3,
|
|
64
57
|
"node_type": "array",
|
|
65
58
|
"storage_transformers": []
|
|
66
59
|
},
|
|
67
|
-
"
|
|
60
|
+
"pot_Im": {
|
|
68
61
|
"shape": [
|
|
69
|
-
1
|
|
62
|
+
1,
|
|
63
|
+
5,
|
|
64
|
+
5
|
|
70
65
|
],
|
|
71
|
-
"data_type":
|
|
72
|
-
"name": "null_terminated_bytes",
|
|
73
|
-
"configuration": {
|
|
74
|
-
"length_bytes": 3
|
|
75
|
-
}
|
|
76
|
-
},
|
|
66
|
+
"data_type": "float32",
|
|
77
67
|
"chunk_grid": {
|
|
78
68
|
"name": "regular",
|
|
79
69
|
"configuration": {
|
|
80
70
|
"chunk_shape": [
|
|
81
|
-
1
|
|
71
|
+
1,
|
|
72
|
+
5,
|
|
73
|
+
5
|
|
82
74
|
]
|
|
83
75
|
}
|
|
84
76
|
},
|
|
@@ -88,10 +80,13 @@
|
|
|
88
80
|
"separator": "/"
|
|
89
81
|
}
|
|
90
82
|
},
|
|
91
|
-
"fill_value":
|
|
83
|
+
"fill_value": 0.0,
|
|
92
84
|
"codecs": [
|
|
93
85
|
{
|
|
94
|
-
"name": "bytes"
|
|
86
|
+
"name": "bytes",
|
|
87
|
+
"configuration": {
|
|
88
|
+
"endian": "little"
|
|
89
|
+
}
|
|
95
90
|
},
|
|
96
91
|
{
|
|
97
92
|
"name": "zstd",
|
|
@@ -102,16 +97,21 @@
|
|
|
102
97
|
}
|
|
103
98
|
],
|
|
104
99
|
"attributes": {
|
|
105
|
-
"long_name": "
|
|
100
|
+
"long_name": "Tidal potential, complex part",
|
|
101
|
+
"units": "m",
|
|
102
|
+
"coordinates": "omega",
|
|
103
|
+
"_FillValue": "AAAAAAAA+H8="
|
|
106
104
|
},
|
|
107
105
|
"dimension_names": [
|
|
108
|
-
"ntides"
|
|
106
|
+
"ntides",
|
|
107
|
+
"eta_rho",
|
|
108
|
+
"xi_rho"
|
|
109
109
|
],
|
|
110
110
|
"zarr_format": 3,
|
|
111
111
|
"node_type": "array",
|
|
112
112
|
"storage_transformers": []
|
|
113
113
|
},
|
|
114
|
-
"
|
|
114
|
+
"pot_Re": {
|
|
115
115
|
"shape": [
|
|
116
116
|
1,
|
|
117
117
|
5,
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
}
|
|
152
152
|
],
|
|
153
153
|
"attributes": {
|
|
154
|
-
"long_name": "Tidal
|
|
154
|
+
"long_name": "Tidal potential, real part",
|
|
155
155
|
"units": "m",
|
|
156
156
|
"coordinates": "omega",
|
|
157
157
|
"_FillValue": "AAAAAAAA+H8="
|
|
@@ -165,10 +165,10 @@
|
|
|
165
165
|
"node_type": "array",
|
|
166
166
|
"storage_transformers": []
|
|
167
167
|
},
|
|
168
|
-
"
|
|
168
|
+
"v_Im": {
|
|
169
169
|
"shape": [
|
|
170
170
|
1,
|
|
171
|
-
|
|
171
|
+
4,
|
|
172
172
|
5
|
|
173
173
|
],
|
|
174
174
|
"data_type": "float32",
|
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
"configuration": {
|
|
178
178
|
"chunk_shape": [
|
|
179
179
|
1,
|
|
180
|
-
|
|
180
|
+
4,
|
|
181
181
|
5
|
|
182
182
|
]
|
|
183
183
|
}
|
|
@@ -205,24 +205,24 @@
|
|
|
205
205
|
}
|
|
206
206
|
],
|
|
207
207
|
"attributes": {
|
|
208
|
-
"long_name": "Tidal
|
|
209
|
-
"units": "m",
|
|
208
|
+
"long_name": "Tidal velocity in y-direction, complex part",
|
|
209
|
+
"units": "m/s",
|
|
210
210
|
"coordinates": "omega",
|
|
211
211
|
"_FillValue": "AAAAAAAA+H8="
|
|
212
212
|
},
|
|
213
213
|
"dimension_names": [
|
|
214
214
|
"ntides",
|
|
215
|
-
"
|
|
215
|
+
"eta_v",
|
|
216
216
|
"xi_rho"
|
|
217
217
|
],
|
|
218
218
|
"zarr_format": 3,
|
|
219
219
|
"node_type": "array",
|
|
220
220
|
"storage_transformers": []
|
|
221
221
|
},
|
|
222
|
-
"
|
|
222
|
+
"v_Re": {
|
|
223
223
|
"shape": [
|
|
224
224
|
1,
|
|
225
|
-
|
|
225
|
+
4,
|
|
226
226
|
5
|
|
227
227
|
],
|
|
228
228
|
"data_type": "float32",
|
|
@@ -231,7 +231,7 @@
|
|
|
231
231
|
"configuration": {
|
|
232
232
|
"chunk_shape": [
|
|
233
233
|
1,
|
|
234
|
-
|
|
234
|
+
4,
|
|
235
235
|
5
|
|
236
236
|
]
|
|
237
237
|
}
|
|
@@ -259,24 +259,24 @@
|
|
|
259
259
|
}
|
|
260
260
|
],
|
|
261
261
|
"attributes": {
|
|
262
|
-
"long_name": "Tidal
|
|
263
|
-
"units": "m",
|
|
262
|
+
"long_name": "Tidal velocity in y-direction, real part",
|
|
263
|
+
"units": "m/s",
|
|
264
264
|
"coordinates": "omega",
|
|
265
265
|
"_FillValue": "AAAAAAAA+H8="
|
|
266
266
|
},
|
|
267
267
|
"dimension_names": [
|
|
268
268
|
"ntides",
|
|
269
|
-
"
|
|
269
|
+
"eta_v",
|
|
270
270
|
"xi_rho"
|
|
271
271
|
],
|
|
272
272
|
"zarr_format": 3,
|
|
273
273
|
"node_type": "array",
|
|
274
274
|
"storage_transformers": []
|
|
275
275
|
},
|
|
276
|
-
"
|
|
276
|
+
"ssh_Re": {
|
|
277
277
|
"shape": [
|
|
278
278
|
1,
|
|
279
|
-
|
|
279
|
+
5,
|
|
280
280
|
5
|
|
281
281
|
],
|
|
282
282
|
"data_type": "float32",
|
|
@@ -285,7 +285,7 @@
|
|
|
285
285
|
"configuration": {
|
|
286
286
|
"chunk_shape": [
|
|
287
287
|
1,
|
|
288
|
-
|
|
288
|
+
5,
|
|
289
289
|
5
|
|
290
290
|
]
|
|
291
291
|
}
|
|
@@ -313,14 +313,14 @@
|
|
|
313
313
|
}
|
|
314
314
|
],
|
|
315
315
|
"attributes": {
|
|
316
|
-
"long_name": "Tidal
|
|
317
|
-
"units": "m
|
|
316
|
+
"long_name": "Tidal elevation, real part",
|
|
317
|
+
"units": "m",
|
|
318
318
|
"coordinates": "omega",
|
|
319
319
|
"_FillValue": "AAAAAAAA+H8="
|
|
320
320
|
},
|
|
321
321
|
"dimension_names": [
|
|
322
322
|
"ntides",
|
|
323
|
-
"
|
|
323
|
+
"eta_rho",
|
|
324
324
|
"xi_rho"
|
|
325
325
|
],
|
|
326
326
|
"zarr_format": 3,
|
|
@@ -428,11 +428,11 @@
|
|
|
428
428
|
"node_type": "array",
|
|
429
429
|
"storage_transformers": []
|
|
430
430
|
},
|
|
431
|
-
"
|
|
431
|
+
"ssh_Im": {
|
|
432
432
|
"shape": [
|
|
433
433
|
1,
|
|
434
434
|
5,
|
|
435
|
-
|
|
435
|
+
5
|
|
436
436
|
],
|
|
437
437
|
"data_type": "float32",
|
|
438
438
|
"chunk_grid": {
|
|
@@ -441,7 +441,7 @@
|
|
|
441
441
|
"chunk_shape": [
|
|
442
442
|
1,
|
|
443
443
|
5,
|
|
444
|
-
|
|
444
|
+
5
|
|
445
445
|
]
|
|
446
446
|
}
|
|
447
447
|
},
|
|
@@ -468,25 +468,25 @@
|
|
|
468
468
|
}
|
|
469
469
|
],
|
|
470
470
|
"attributes": {
|
|
471
|
-
"long_name": "Tidal
|
|
472
|
-
"units": "m
|
|
471
|
+
"long_name": "Tidal elevation, complex part",
|
|
472
|
+
"units": "m",
|
|
473
473
|
"coordinates": "omega",
|
|
474
474
|
"_FillValue": "AAAAAAAA+H8="
|
|
475
475
|
},
|
|
476
476
|
"dimension_names": [
|
|
477
477
|
"ntides",
|
|
478
478
|
"eta_rho",
|
|
479
|
-
"
|
|
479
|
+
"xi_rho"
|
|
480
480
|
],
|
|
481
481
|
"zarr_format": 3,
|
|
482
482
|
"node_type": "array",
|
|
483
483
|
"storage_transformers": []
|
|
484
484
|
},
|
|
485
|
-
"
|
|
485
|
+
"u_Im": {
|
|
486
486
|
"shape": [
|
|
487
487
|
1,
|
|
488
488
|
5,
|
|
489
|
-
|
|
489
|
+
4
|
|
490
490
|
],
|
|
491
491
|
"data_type": "float32",
|
|
492
492
|
"chunk_grid": {
|
|
@@ -495,7 +495,7 @@
|
|
|
495
495
|
"chunk_shape": [
|
|
496
496
|
1,
|
|
497
497
|
5,
|
|
498
|
-
|
|
498
|
+
4
|
|
499
499
|
]
|
|
500
500
|
}
|
|
501
501
|
},
|
|
@@ -522,15 +522,15 @@
|
|
|
522
522
|
}
|
|
523
523
|
],
|
|
524
524
|
"attributes": {
|
|
525
|
-
"long_name": "Tidal
|
|
526
|
-
"units": "m",
|
|
525
|
+
"long_name": "Tidal velocity in x-direction, complex part",
|
|
526
|
+
"units": "m/s",
|
|
527
527
|
"coordinates": "omega",
|
|
528
528
|
"_FillValue": "AAAAAAAA+H8="
|
|
529
529
|
},
|
|
530
530
|
"dimension_names": [
|
|
531
531
|
"ntides",
|
|
532
532
|
"eta_rho",
|
|
533
|
-
"
|
|
533
|
+
"xi_u"
|
|
534
534
|
],
|
|
535
535
|
"zarr_format": 3,
|
|
536
536
|
"node_type": "array",
|
|
@@ -236,6 +236,20 @@ def test_plot(grid_that_straddles_180_degree_meridian):
|
|
|
236
236
|
grid_that_straddles_180_degree_meridian.plot(with_dim_names=True)
|
|
237
237
|
|
|
238
238
|
|
|
239
|
+
def test_plot_wide_grid():
|
|
240
|
+
# This grid should be handled via different cartopy projection
|
|
241
|
+
grid = Grid(
|
|
242
|
+
nx=10,
|
|
243
|
+
ny=10,
|
|
244
|
+
size_x=15000,
|
|
245
|
+
size_y=15000,
|
|
246
|
+
center_lon=-161,
|
|
247
|
+
center_lat=14.4,
|
|
248
|
+
rot=-3,
|
|
249
|
+
)
|
|
250
|
+
grid.plot()
|
|
251
|
+
|
|
252
|
+
|
|
239
253
|
@pytest.mark.skipif(xesmf is None, reason="xesmf required")
|
|
240
254
|
def test_plot_along_lat_lon(grid_that_straddles_180_degree_meridian):
|
|
241
255
|
grid_that_straddles_180_degree_meridian.plot(lat=61)
|
|
@@ -11,7 +11,7 @@ import xarray as xr
|
|
|
11
11
|
from conftest import calculate_data_hash
|
|
12
12
|
from roms_tools import Grid, InitialConditions
|
|
13
13
|
from roms_tools.download import download_test_data
|
|
14
|
-
from roms_tools.setup.
|
|
14
|
+
from roms_tools.setup.lat_lon_datasets import (
|
|
15
15
|
CESMBGCDataset,
|
|
16
16
|
UnifiedBGCDataset,
|
|
17
17
|
)
|
|
@@ -9,15 +9,14 @@ import pytest
|
|
|
9
9
|
import xarray as xr
|
|
10
10
|
|
|
11
11
|
from roms_tools.download import download_test_data
|
|
12
|
-
from roms_tools.setup.
|
|
12
|
+
from roms_tools.setup.lat_lon_datasets import (
|
|
13
13
|
GLORYS_GLOBAL_GRID_PATH,
|
|
14
14
|
CESMBGCDataset,
|
|
15
|
-
Dataset,
|
|
16
15
|
ERA5ARCODataset,
|
|
17
16
|
ERA5Correction,
|
|
18
17
|
GLORYSDataset,
|
|
19
18
|
GLORYSDefaultDataset,
|
|
20
|
-
|
|
19
|
+
LatLonDataset,
|
|
21
20
|
TPXODataset,
|
|
22
21
|
_concatenate_longitudes,
|
|
23
22
|
choose_subdomain,
|
|
@@ -158,7 +157,7 @@ def test_select_times(data_fixture, expected_time_values, request, tmp_path, use
|
|
|
158
157
|
|
|
159
158
|
filepath = tmp_path / "test.nc"
|
|
160
159
|
dataset.to_netcdf(filepath)
|
|
161
|
-
dataset =
|
|
160
|
+
dataset = LatLonDataset(
|
|
162
161
|
filename=filepath,
|
|
163
162
|
var_names={"var": "var"},
|
|
164
163
|
start_time=start_time,
|
|
@@ -192,7 +191,7 @@ def test_select_times_valid_start_no_end_time(
|
|
|
192
191
|
dataset.to_netcdf(filepath)
|
|
193
192
|
|
|
194
193
|
# Instantiate Dataset object using the temporary file
|
|
195
|
-
dataset =
|
|
194
|
+
dataset = LatLonDataset(
|
|
196
195
|
filename=filepath,
|
|
197
196
|
var_names={"var": "var"},
|
|
198
197
|
start_time=start_time,
|
|
@@ -229,7 +228,7 @@ def test_select_times_invalid_start_no_end_time(
|
|
|
229
228
|
ValueError,
|
|
230
229
|
match="No exact match found ",
|
|
231
230
|
):
|
|
232
|
-
dataset =
|
|
231
|
+
dataset = LatLonDataset(
|
|
233
232
|
filename=filepath,
|
|
234
233
|
var_names={"var": "var"},
|
|
235
234
|
start_time=datetime(2022, 5, 1),
|
|
@@ -245,7 +244,7 @@ def test_multiple_matching_times(
|
|
|
245
244
|
"""
|
|
246
245
|
filepath = tmp_path / "test.nc"
|
|
247
246
|
global_dataset_with_multiple_times_per_day.to_netcdf(filepath)
|
|
248
|
-
dataset =
|
|
247
|
+
dataset = LatLonDataset(
|
|
249
248
|
filename=filepath,
|
|
250
249
|
var_names={"var": "var"},
|
|
251
250
|
start_time=datetime(2021, 12, 31, 22, 0),
|
|
@@ -265,7 +264,7 @@ def test_warnings_times(global_dataset, tmp_path, caplog, use_dask):
|
|
|
265
264
|
start_time = datetime(2021, 1, 1)
|
|
266
265
|
end_time = datetime(2021, 2, 1)
|
|
267
266
|
|
|
268
|
-
|
|
267
|
+
LatLonDataset(
|
|
269
268
|
filename=filepath,
|
|
270
269
|
var_names={"var": "var"},
|
|
271
270
|
start_time=start_time,
|
|
@@ -279,7 +278,7 @@ def test_warnings_times(global_dataset, tmp_path, caplog, use_dask):
|
|
|
279
278
|
start_time = datetime(2024, 1, 1)
|
|
280
279
|
end_time = datetime(2024, 2, 1)
|
|
281
280
|
|
|
282
|
-
|
|
281
|
+
LatLonDataset(
|
|
283
282
|
filename=filepath,
|
|
284
283
|
var_names={"var": "var"},
|
|
285
284
|
start_time=start_time,
|
|
@@ -291,13 +290,13 @@ def test_warnings_times(global_dataset, tmp_path, caplog, use_dask):
|
|
|
291
290
|
|
|
292
291
|
|
|
293
292
|
def test_from_ds(global_dataset, global_dataset_with_noon_times, use_dask, tmp_path):
|
|
294
|
-
"""Test the from_ds method of the
|
|
293
|
+
"""Test the from_ds method of the LatLonDataset class."""
|
|
295
294
|
start_time = datetime(2022, 1, 1)
|
|
296
295
|
|
|
297
296
|
filepath = tmp_path / "test.nc"
|
|
298
297
|
global_dataset.to_netcdf(filepath)
|
|
299
298
|
|
|
300
|
-
dataset =
|
|
299
|
+
dataset = LatLonDataset(
|
|
301
300
|
filename=filepath,
|
|
302
301
|
var_names={"var": "var"},
|
|
303
302
|
dim_names={
|
|
@@ -311,9 +310,9 @@ def test_from_ds(global_dataset, global_dataset_with_noon_times, use_dask, tmp_p
|
|
|
311
310
|
allow_flex_time=True,
|
|
312
311
|
)
|
|
313
312
|
|
|
314
|
-
new_dataset =
|
|
313
|
+
new_dataset = LatLonDataset.from_ds(dataset, global_dataset_with_noon_times)
|
|
315
314
|
|
|
316
|
-
assert isinstance(new_dataset,
|
|
315
|
+
assert isinstance(new_dataset, LatLonDataset)
|
|
317
316
|
assert new_dataset.ds.equals(
|
|
318
317
|
global_dataset_with_noon_times
|
|
319
318
|
) # Verify the new ds attribute is set correctly
|
|
@@ -330,7 +329,7 @@ def test_reverse_latitude_reverse_depth_choose_subdomain(
|
|
|
330
329
|
global_dataset, tmp_path, use_dask
|
|
331
330
|
):
|
|
332
331
|
"""Test reversing latitude when it is not ascending, the choose_subdomain method,
|
|
333
|
-
and the convert_to_negative_depth method of the
|
|
332
|
+
and the convert_to_negative_depth method of the LatLonDataset class.
|
|
334
333
|
"""
|
|
335
334
|
start_time = datetime(2022, 1, 1)
|
|
336
335
|
|
|
@@ -339,7 +338,7 @@ def test_reverse_latitude_reverse_depth_choose_subdomain(
|
|
|
339
338
|
global_dataset["depth"] = global_dataset["depth"][::-1]
|
|
340
339
|
global_dataset.to_netcdf(filepath)
|
|
341
340
|
|
|
342
|
-
dataset =
|
|
341
|
+
dataset = LatLonDataset(
|
|
343
342
|
filename=filepath,
|
|
344
343
|
var_names={"var": "var"},
|
|
345
344
|
dim_names={
|
|
@@ -393,7 +392,9 @@ def test_reverse_latitude_reverse_depth_choose_subdomain(
|
|
|
393
392
|
def test_check_if_global_with_global_dataset(global_dataset, tmp_path, use_dask):
|
|
394
393
|
filepath = tmp_path / "test.nc"
|
|
395
394
|
global_dataset.to_netcdf(filepath)
|
|
396
|
-
dataset =
|
|
395
|
+
dataset = LatLonDataset(
|
|
396
|
+
filename=filepath, var_names={"var": "var"}, use_dask=use_dask
|
|
397
|
+
)
|
|
397
398
|
is_global = dataset.check_if_global(dataset.ds)
|
|
398
399
|
assert is_global
|
|
399
400
|
|
|
@@ -403,7 +404,9 @@ def test_check_if_global_with_non_global_dataset(
|
|
|
403
404
|
):
|
|
404
405
|
filepath = tmp_path / "test.nc"
|
|
405
406
|
non_global_dataset.to_netcdf(filepath)
|
|
406
|
-
dataset =
|
|
407
|
+
dataset = LatLonDataset(
|
|
408
|
+
filename=filepath, var_names={"var": "var"}, use_dask=use_dask
|
|
409
|
+
)
|
|
407
410
|
is_global = dataset.check_if_global(dataset.ds)
|
|
408
411
|
|
|
409
412
|
assert not is_global
|
|
@@ -421,7 +424,7 @@ def test_check_dataset(global_dataset, tmp_path, use_dask):
|
|
|
421
424
|
with pytest.raises(
|
|
422
425
|
ValueError, match="Dataset does not contain all required variables."
|
|
423
426
|
):
|
|
424
|
-
|
|
427
|
+
LatLonDataset(
|
|
425
428
|
filename=filepath,
|
|
426
429
|
var_names={"var": "var"},
|
|
427
430
|
start_time=start_time,
|
|
@@ -440,7 +443,7 @@ def test_check_dataset(global_dataset, tmp_path, use_dask):
|
|
|
440
443
|
with pytest.raises(
|
|
441
444
|
ValueError, match="Dataset does not contain all required dimensions."
|
|
442
445
|
):
|
|
443
|
-
|
|
446
|
+
LatLonDataset(
|
|
444
447
|
filename=filepath,
|
|
445
448
|
var_names={"var": "var"},
|
|
446
449
|
start_time=start_time,
|
|
@@ -760,48 +763,6 @@ class TestTPXODataset:
|
|
|
760
763
|
global_tpxo_dataset.select_constituents(11, omega)
|
|
761
764
|
|
|
762
765
|
|
|
763
|
-
class TestRiverDataset:
|
|
764
|
-
def test_deduplicate_river_names(self, tmp_path):
|
|
765
|
-
sample_dim_and_var_names = {
|
|
766
|
-
"dim_names": {"station": "station", "time": "time"},
|
|
767
|
-
"var_names": {
|
|
768
|
-
"latitude": "lat",
|
|
769
|
-
"longitude": "lon",
|
|
770
|
-
"flux": "flux",
|
|
771
|
-
"ratio": "ratio",
|
|
772
|
-
"name": "name",
|
|
773
|
-
},
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
data = {
|
|
777
|
-
"lat": (["station"], [10.0, 20.0, 30.0]),
|
|
778
|
-
"lon": (["station"], [100.0, 110.0, 120.0]),
|
|
779
|
-
"flux": (["time", "station"], np.random.rand(1, 3)),
|
|
780
|
-
"ratio": (["time", "station"], np.random.rand(1, 3)),
|
|
781
|
-
"name": (["station"], ["Amazon", "Nile", "Amazon"]), # duplicate
|
|
782
|
-
}
|
|
783
|
-
coords = {"station": [0, 1, 2], "time": [0]}
|
|
784
|
-
ds = xr.Dataset(data, coords=coords)
|
|
785
|
-
|
|
786
|
-
# Write to temporary NetCDF file
|
|
787
|
-
file_path = tmp_path / "rivers.nc"
|
|
788
|
-
ds.to_netcdf(file_path)
|
|
789
|
-
|
|
790
|
-
river_dataset = RiverDataset(
|
|
791
|
-
filename=file_path,
|
|
792
|
-
start_time=datetime(2000, 1, 1),
|
|
793
|
-
end_time=datetime(2000, 1, 2),
|
|
794
|
-
dim_names=sample_dim_and_var_names["dim_names"],
|
|
795
|
-
var_names=sample_dim_and_var_names["var_names"],
|
|
796
|
-
)
|
|
797
|
-
|
|
798
|
-
names = river_dataset.ds["name"].values
|
|
799
|
-
assert "Amazon_1" in names
|
|
800
|
-
assert "Amazon_2" in names
|
|
801
|
-
assert "Nile" in names
|
|
802
|
-
assert len(set(names)) == len(names) # all names must be unique
|
|
803
|
-
|
|
804
|
-
|
|
805
766
|
# test _concatenate_longitudes
|
|
806
767
|
|
|
807
768
|
|