@@ -1544,96 +1544,6 @@ def test_huc_border():
15441544 assert math .isnan (data [0 , 0 , 0 ])
15451545
15461546
1547- @pytest .mark .private_dataset
1548- def test_get_wtd ():
1549- """Unit test reading the 3 resolution of water table depth files."""
1550-
1551- # Test the 1000 meter resolution version
1552- x = 1500
1553- y = 1500
1554- grid_bound_x_width = 2
1555- grid_bounds_y_height = 2
1556- bounds = [x , y , x + grid_bound_x_width , y + grid_bounds_y_height ]
1557- options = {
1558- "dataset" : "conus2_current_conditions" ,
1559- "grid_bounds" : bounds ,
1560- "variable" : "water_table_depth" ,
1561- "grid" : "conus2_wtd" ,
1562- }
1563- data = hf .get_gridded_data (options )
1564- assert (
1565- hf .get_path (options )
1566- in "/hydrodata/temp/high_resolution_data/WTD_estimates/30m/remapped_data/wtd_mean_estimate_RF_additional_inputs_dummy_drop0LP_1000m_CONUS2_m_1s_remapped.tif"
1567- )
1568-
1569- assert data .shape == (2 , 2 )
1570- assert str (round (data [0 , 0 ], 4 )) == "52.86"
1571- assert str (round (data [0 , 1 ], 4 )) == "43.374"
1572- assert str (round (data [1 , 0 ], 4 )) == "27.7567"
1573- assert str (round (data [1 , 1 ], 4 )) == "36.6467"
1574-
1575- # Test the 100 meter resolution version
1576- # Same points, but values are not exactly the same as 1000 because of aggregation in resolutions
1577- x = 1500 * 10
1578- y = 1500 * 10
1579- bounds = [x , y , x + grid_bound_x_width , y + grid_bounds_y_height ]
1580- options = {
1581- "dataset" : "conus2_current_conditions" ,
1582- "grid_bounds" : bounds ,
1583- "variable" : "water_table_depth" ,
1584- "grid" : "conus2_wtd.100" ,
1585- }
1586- data = hf .get_gridded_data (options )
1587- assert (
1588- hf .get_path (options )
1589- in "/hydrodata/temp/high_resolution_data/WTD_estimates/30m/remapped_data/wtd_mean_estimate_RF_additional_inputs_dummy_drop0LP_100m_CONUS2_m_1s_remapped.tif"
1590- )
1591- assert data .shape == (2 , 2 )
1592- assert str (round (data [0 , 0 ], 3 )) == "58.015"
1593- assert str (round (data [0 , 1 ], 3 )) == "54.305"
1594- assert str (round (data [1 , 0 ], 3 )) == "48.614"
1595- assert str (round (data [1 , 1 ], 3 )) == "49.047"
1596-
1597- # Test the 30 meter resolution version
1598- # Same points, but values are not exactly the same as 1000 because of aggregation in resolutions
1599- x = int ((1500 * 1000 ) / 30 )
1600- y = int ((1500 * 1000 ) / 30 )
1601- bounds = [x , y , x + grid_bound_x_width , y + grid_bounds_y_height ]
1602- options = {
1603- "dataset" : "conus2_current_conditions" ,
1604- "grid_bounds" : bounds ,
1605- "variable" : "water_table_depth" ,
1606- "grid" : "conus2_wtd.30" ,
1607- }
1608- data = hf .get_gridded_data (options )
1609- assert (
1610- hf .get_path (options )
1611- in "/hydrodata/temp/high_resolution_data/WTD_estimates/30m/compressed_data/wtd_mean_estimate_RF_additional_inputs_dummy_drop0LP_1s_CONUS2_m_remapped_unflip_compressed.tif"
1612- )
1613-
1614- assert data .shape == (2 , 2 )
1615- assert data .shape == (2 , 2 )
1616- assert str (round (data [0 , 0 ], 3 )) == "77.192"
1617- assert str (round (data [0 , 1 ], 3 )) == "78.744"
1618- assert str (round (data [1 , 0 ], 3 )) == "78.691"
1619- assert str (round (data [1 , 1 ], 3 )) == "78.744"
1620-
1621-
1622- @pytest .mark .private_dataset
1623- def test_wtd_1000m_north ():
1624- """Unit test edge condition found during integration testing."""
1625-
1626- bounds = [1593 , 1724 , 3420 , 3484 ]
1627- options = {
1628- "dataset" : "conus2_current_conditions" ,
1629- "grid_bounds" : bounds ,
1630- "variable" : "water_table_depth" ,
1631- "grid" : "conus2_wtd" ,
1632- }
1633- data = hf .get_gridded_data (options )
1634- assert data .shape == ((1760 , 1827 ))
1635-
1636-
16371547def test_noaa_precip ():
16381548 """Unit test NOAA precip"""
16391549 bounds = [1000 , 1000 , 1005 , 1005 ]
0 commit comments