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.
Files changed (202) hide show
  1. roms_tools/__init__.py +1 -1
  2. roms_tools/plot.py +38 -30
  3. roms_tools/setup/boundary_forcing.py +2 -2
  4. roms_tools/setup/grid.py +13 -5
  5. roms_tools/setup/initial_conditions.py +5 -5
  6. roms_tools/setup/{datasets.py → lat_lon_datasets.py} +23 -804
  7. roms_tools/setup/nesting.py +262 -90
  8. roms_tools/setup/river_datasets.py +527 -0
  9. roms_tools/setup/river_forcing.py +2 -2
  10. roms_tools/setup/surface_forcing.py +4 -4
  11. roms_tools/setup/tides.py +1 -1
  12. roms_tools/setup/topography.py +4 -6
  13. roms_tools/setup/utils.py +263 -2
  14. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_ALT_CO2_east/c/0/0/0 +0 -0
  15. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_ALT_CO2_north/c/0/0/0 +0 -0
  16. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_ALT_CO2_west/c/0/0/0 +0 -0
  17. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_east/c/0/0/0 +0 -0
  18. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_north/c/0/0/0 +0 -0
  19. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_west/c/0/0/0 +0 -0
  20. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_ALT_CO2_east/c/0/0/0 +0 -0
  21. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_ALT_CO2_north/c/0/0/0 +0 -0
  22. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_ALT_CO2_west/c/0/0/0 +0 -0
  23. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_east/c/0/0/0 +0 -0
  24. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_north/c/0/0/0 +0 -0
  25. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_west/c/0/0/0 +0 -0
  26. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOC_east/c/0/0/0 +0 -0
  27. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOC_north/c/0/0/0 +0 -0
  28. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOC_west/c/0/0/0 +0 -0
  29. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOCr_east/c/0/0/0 +0 -0
  30. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOCr_north/c/0/0/0 +0 -0
  31. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOCr_west/c/0/0/0 +0 -0
  32. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DON_east/c/0/0/0 +0 -0
  33. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DON_north/c/0/0/0 +0 -0
  34. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DON_west/c/0/0/0 +0 -0
  35. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DONr_east/c/0/0/0 +0 -0
  36. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DONr_north/c/0/0/0 +0 -0
  37. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DONr_west/c/0/0/0 +0 -0
  38. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOP_east/c/0/0/0 +0 -0
  39. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOP_north/c/0/0/0 +0 -0
  40. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOP_west/c/0/0/0 +0 -0
  41. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOPr_east/c/0/0/0 +0 -0
  42. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOPr_north/c/0/0/0 +0 -0
  43. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOPr_west/c/0/0/0 +0 -0
  44. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Fe_east/c/0/0/0 +0 -0
  45. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Fe_north/c/0/0/0 +0 -0
  46. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Fe_west/c/0/0/0 +0 -0
  47. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Lig_east/c/0/0/0 +0 -0
  48. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Lig_north/c/0/0/0 +0 -0
  49. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Lig_west/c/0/0/0 +0 -0
  50. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NH4_east/c/0/0/0 +0 -0
  51. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NH4_north/c/0/0/0 +0 -0
  52. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NH4_west/c/0/0/0 +0 -0
  53. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NO3_east/c/0/0/0 +0 -0
  54. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NO3_north/c/0/0/0 +0 -0
  55. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NO3_west/c/0/0/0 +0 -0
  56. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/O2_east/c/0/0/0 +0 -0
  57. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/O2_north/c/0/0/0 +0 -0
  58. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/O2_west/c/0/0/0 +0 -0
  59. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/PO4_east/c/0/0/0 +0 -0
  60. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/PO4_north/c/0/0/0 +0 -0
  61. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/PO4_west/c/0/0/0 +0 -0
  62. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/SiO3_east/c/0/0/0 +0 -0
  63. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/SiO3_north/c/0/0/0 +0 -0
  64. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/SiO3_west/c/0/0/0 +0 -0
  65. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatC_east/c/0/0/0 +0 -0
  66. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatC_north/c/0/0/0 +0 -0
  67. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatC_west/c/0/0/0 +0 -0
  68. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatChl_east/c/0/0/0 +0 -0
  69. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatChl_north/c/0/0/0 +0 -0
  70. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatChl_west/c/0/0/0 +0 -0
  71. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatFe_east/c/0/0/0 +0 -0
  72. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatFe_north/c/0/0/0 +0 -0
  73. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatFe_west/c/0/0/0 +0 -0
  74. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatP_east/c/0/0/0 +0 -0
  75. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatP_north/c/0/0/0 +0 -0
  76. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatP_west/c/0/0/0 +0 -0
  77. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatSi_east/c/0/0/0 +0 -0
  78. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatSi_north/c/0/0/0 +0 -0
  79. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatSi_west/c/0/0/0 +0 -0
  80. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazC_east/c/0/0/0 +0 -0
  81. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazC_north/c/0/0/0 +0 -0
  82. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazC_west/c/0/0/0 +0 -0
  83. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazChl_east/c/0/0/0 +0 -0
  84. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazChl_north/c/0/0/0 +0 -0
  85. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazChl_west/c/0/0/0 +0 -0
  86. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazFe_east/c/0/0/0 +0 -0
  87. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazFe_north/c/0/0/0 +0 -0
  88. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazFe_west/c/0/0/0 +0 -0
  89. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazP_east/c/0/0/0 +0 -0
  90. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazP_north/c/0/0/0 +0 -0
  91. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazP_west/c/0/0/0 +0 -0
  92. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spC_east/c/0/0/0 +0 -0
  93. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spC_north/c/0/0/0 +0 -0
  94. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spC_west/c/0/0/0 +0 -0
  95. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spCaCO3_east/c/0/0/0 +0 -0
  96. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spCaCO3_north/c/0/0/0 +0 -0
  97. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spCaCO3_west/c/0/0/0 +0 -0
  98. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spChl_east/c/0/0/0 +0 -0
  99. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spChl_north/c/0/0/0 +0 -0
  100. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spChl_west/c/0/0/0 +0 -0
  101. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spFe_east/c/0/0/0 +0 -0
  102. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spFe_north/c/0/0/0 +0 -0
  103. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spFe_west/c/0/0/0 +0 -0
  104. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spP_east/c/0/0/0 +0 -0
  105. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spP_north/c/0/0/0 +0 -0
  106. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spP_west/c/0/0/0 +0 -0
  107. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zarr.json +406 -406
  108. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zooC_east/c/0/0/0 +0 -0
  109. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zooC_north/c/0/0/0 +0 -0
  110. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zooC_west/c/0/0/0 +0 -0
  111. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/salt_east/c/0/0/0 +0 -0
  112. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/salt_north/c/0/0/0 +0 -0
  113. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/salt_south/c/0/0/0 +0 -0
  114. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/salt_west/c/0/0/0 +0 -0
  115. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/temp_east/c/0/0/0 +0 -0
  116. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/temp_north/c/0/0/0 +0 -0
  117. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/temp_south/c/0/0/0 +0 -0
  118. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/temp_west/c/0/0/0 +0 -0
  119. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/u_east/c/0/0/0 +0 -0
  120. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/u_north/c/0/0/0 +0 -0
  121. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/u_south/c/0/0/0 +0 -0
  122. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/u_west/c/0/0/0 +0 -0
  123. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/ubar_east/c/0/0 +0 -0
  124. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/ubar_north/c/0/0 +0 -0
  125. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/ubar_south/c/0/0 +0 -0
  126. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/ubar_west/c/0/0 +0 -0
  127. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/v_east/c/0/0/0 +0 -0
  128. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/v_north/c/0/0/0 +0 -0
  129. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/v_south/c/0/0/0 +0 -0
  130. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/v_west/c/0/0/0 +0 -0
  131. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/vbar_east/c/0/0 +0 -0
  132. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/vbar_north/c/0/0 +0 -0
  133. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/vbar_south/c/0/0 +0 -0
  134. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/vbar_west/c/0/0 +0 -0
  135. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/zarr.json +182 -182
  136. roms_tools/tests/test_setup/test_data/grid.zarr/h/c/0/0 +0 -0
  137. roms_tools/tests/test_setup/test_data/grid.zarr/zarr.json +191 -191
  138. roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/h/c/0/0 +0 -0
  139. roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/zarr.json +210 -210
  140. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/ALK/c/0/0/0/0 +0 -0
  141. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/ALK_ALT_CO2/c/0/0/0/0 +0 -0
  142. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DIC/c/0/0/0/0 +0 -0
  143. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DIC_ALT_CO2/c/0/0/0/0 +0 -0
  144. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DOC/c/0/0/0/0 +0 -0
  145. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DOCr/c/0/0/0/0 +0 -0
  146. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DON/c/0/0/0/0 +0 -0
  147. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DONr/c/0/0/0/0 +0 -0
  148. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DOP/c/0/0/0/0 +0 -0
  149. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DOPr/c/0/0/0/0 +0 -0
  150. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/Fe/c/0/0/0/0 +0 -0
  151. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/Lig/c/0/0/0/0 +0 -0
  152. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/NH4/c/0/0/0/0 +0 -0
  153. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/NO3/c/0/0/0/0 +0 -0
  154. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/O2/c/0/0/0/0 +0 -0
  155. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/PO4/c/0/0/0/0 +0 -0
  156. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/SiO3/c/0/0/0/0 +0 -0
  157. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diatC/c/0/0/0/0 +0 -0
  158. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diatChl/c/0/0/0/0 +0 -0
  159. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diatFe/c/0/0/0/0 +0 -0
  160. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diatP/c/0/0/0/0 +0 -0
  161. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diatSi/c/0/0/0/0 +0 -0
  162. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diazC/c/0/0/0/0 +0 -0
  163. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diazChl/c/0/0/0/0 +0 -0
  164. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diazFe/c/0/0/0/0 +0 -0
  165. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diazP/c/0/0/0/0 +0 -0
  166. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/salt/c/0/0/0/0 +0 -0
  167. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/spC/c/0/0/0/0 +0 -0
  168. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/spCaCO3/c/0/0/0/0 +0 -0
  169. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/spChl/c/0/0/0/0 +0 -0
  170. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/spFe/c/0/0/0/0 +0 -0
  171. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/spP/c/0/0/0/0 +0 -0
  172. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/temp/c/0/0/0/0 +0 -0
  173. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/u/c/0/0/0/0 +0 -0
  174. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/ubar/c/0/0/0 +0 -0
  175. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/v/c/0/0/0/0 +0 -0
  176. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/vbar/c/0/0/0 +0 -0
  177. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/zarr.json +182 -182
  178. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/zooC/c/0/0/0/0 +0 -0
  179. roms_tools/tests/test_setup/test_data/initial_conditions_with_unified_bgc_from_climatology.zarr/salt/c/0/0/0/0 +0 -0
  180. roms_tools/tests/test_setup/test_data/initial_conditions_with_unified_bgc_from_climatology.zarr/temp/c/0/0/0/0 +0 -0
  181. roms_tools/tests/test_setup/test_data/initial_conditions_with_unified_bgc_from_climatology.zarr/u/c/0/0/0/0 +0 -0
  182. roms_tools/tests/test_setup/test_data/initial_conditions_with_unified_bgc_from_climatology.zarr/ubar/c/0/0/0 +0 -0
  183. roms_tools/tests/test_setup/test_data/initial_conditions_with_unified_bgc_from_climatology.zarr/v/c/0/0/0/0 +0 -0
  184. roms_tools/tests/test_setup/test_data/initial_conditions_with_unified_bgc_from_climatology.zarr/vbar/c/0/0/0 +0 -0
  185. roms_tools/tests/test_setup/test_data/initial_conditions_with_unified_bgc_from_climatology.zarr/zarr.json +187 -187
  186. roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/u_Im/c/0/0/0 +0 -0
  187. roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/u_Re/c/0/0/0 +0 -0
  188. roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/v_Im/c/0/0/0 +0 -0
  189. roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/v_Re/c/0/0/0 +0 -0
  190. roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/zarr.json +66 -66
  191. roms_tools/tests/test_setup/test_grid.py +14 -0
  192. roms_tools/tests/test_setup/test_initial_conditions.py +1 -1
  193. roms_tools/tests/test_setup/{test_datasets.py → test_lat_lon_datasets.py} +22 -61
  194. roms_tools/tests/test_setup/test_nesting.py +119 -31
  195. roms_tools/tests/test_setup/test_river_datasets.py +48 -0
  196. roms_tools/tests/test_setup/test_surface_forcing.py +1 -1
  197. roms_tools/tests/test_setup/test_utils.py +1 -1
  198. {roms_tools-3.2.0.dist-info → roms_tools-3.3.0.dist-info}/METADATA +1 -1
  199. {roms_tools-3.2.0.dist-info → roms_tools-3.3.0.dist-info}/RECORD +202 -200
  200. {roms_tools-3.2.0.dist-info → roms_tools-3.3.0.dist-info}/WHEEL +0 -0
  201. {roms_tools-3.2.0.dist-info → roms_tools-3.3.0.dist-info}/licenses/LICENSE +0 -0
  202. {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
- modify_child_topography_and_mask,
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=10,
73
+ center_lon=0,
75
74
  center_lat=61,
76
- rot=-20,
77
- size_x=500,
78
- size_y=500,
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
- # Verify the warning message in the log
106
- assert (
107
- "Some boundary points of the child grid are very close to the boundary of the parent grid."
108
- in caplog.text
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 = small_grid.ds[f"lon_{location}"].isel(**bdry_coords)
150
- lat = small_grid.ds[f"lat_{location}"].isel(**bdry_coords)
151
- mask = small_grid.ds[f"mask_{location}"].isel(**bdry_coords)
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(big_grid.ds, lon, lat, mask)
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 = big_grid.ds.eta_rho[-1] - 0.5
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 = big_grid.ds.xi_rho[-1] - 0.5
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
- small_grid.ds, baby_grid.ds, update_land_indices=False
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
- small_grid.ds, baby_grid.ds, update_land_indices=True
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
- ds = map_child_boundaries_onto_parent_grid_indices(big_grid.ds, small_grid.ds)
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
- big_grid.ds, small_grid.ds, update_land_indices=update_land_indices
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 = modify_child_topography_and_mask(
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 = modify_child_topography_and_mask(grid.ds, 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 = modify_child_topography_and_mask(big_grid.ds, small_grid.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(ValueError, match="Some points are outside the grid."):
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.datasets import RawDataSource
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.datasets import ERA5Correction
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.2.0
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