HARPgroup / model_meteorology

0 stars 0 forks source link

Bug: Extents in PRISM and nldas2 imports are super weird (but daymet extent is spot-on) #81

Open rburghol opened 1 month ago

rburghol commented 1 month ago

@mwdunlap2004 This of interest as it speaks to the out of memory issue that we get when we don't clip before resampling.

Query to show weird and good extents:

Short term fix

Query 1: Update non-conforming bbox:

#!/bin/bash

echo "update dh_timeseries_weather set rast = st_clip(dh_timeseries_weather.rast, st_envelope(tpr.rast)), bbox = st_envelope(tpr.rast) from raster_templates as tpr where tpr.varkey = 'daymet_mod_daily' and varid = 1451 and NOT (bbox = st_envelope(tpr.rast)) ;" | psql -h dbase2 drupal.dh03
mwdunlap2004 commented 1 month ago

That's really interesting, I do wonder if just re-importing could fix it, but it's good to know your "short term fix" has led to PRISM being to the correct extent

rburghol commented 1 month ago

Yeah @mwdunlap2004 I'd like to have taken the time to do a reimport but wanted to move forward. Also, the NLDAS2 data is also no fixed, so, we should be able to avoid those clips in future calculations.

COBrogan commented 1 month ago

@rburghol do you want me to look into this a bit? I'm wondering if specifying the source and destination CRS may help. There's a couple of SO posts about vaguely similar issues but in each case they had coordinate transformations not being specified. This _shouldn't__ be a problem in our case, but it's worth a try imo.

It's just weird because that gdalwarp line was called (theoretically) for every data set