DOI-USGS / lake-temperature-model-prep

Pipeline #1
Other
6 stars 13 forks source link

Only retain lake cell mapping for lakes within GCM footprint #350

Closed hcorson-dosch-usgs closed 2 years ago

hcorson-dosch-usgs commented 2 years ago

This PR adds in logic to filter out any lakes that fall outside of the GCM footprint before generating the final lake to cell mapping in adjust_lake_cell_tile_xwalk().

Previously, Lindsay's exploration showed that a number of queried cells in North and South Dakota were not returning data and were instead being assigned data from the easternmost parts of those states (see #347): query_tile_cell_map_missing_ORIG

With this PR, those lakes that fall outside the footprint of the cells that did return data (the GCM footprint) are dropped before the crosswalk is generated and data source cells are assigned for cells that did not return data that are within the GCM footprint: query_tile_cell_map_missing

As before, the total # of queried cells that didn't return data is 342, but now only the 76 that fall within the GCM footprint are being assigned data from a nearby cell. 266 fall outside of the GCM footprint. The exported lake_cell_tile_xwalk.csv reflects this, with 266 fewer unique spatial_cell_no yet the same # of unique data_cell_no as before.

I checked and this resulted in 613 lakes being dropped from the lake_cell_tile_xwalk_df