IMMM-SFA / gamut

An R package to identify multi-sector teleconnection complexity
https://immm-sfa.github.io/gamut/
Other
0 stars 3 forks source link

Crop counts incorrect when run on PIC #27

Closed swd-turner closed 4 years ago

swd-turner commented 4 years ago

Several cities incorrectly returning 1 crop class when count_watershed_teleconnections is run on PIC.

KristianNelson commented 4 years ago

Do you have any particular thoughts as to why this happens? Going through the code I don't see why this would happen. If PIC is able to pull the correct number of land classes from the land cover data set it should be able to do it for this one.

swd-turner commented 4 years ago

Not sure yet but I suspect it could be PIC has a different version of one of the spatial packages/functions being applied.

swd-turner commented 4 years ago

This issue is persisting with the most recent crop count update. The culprit appears to be raster::crop when performed inside get_raster_val_classes. On my local machine this works as expected. On PIC, however, the cropping appears clip to the desired extent but zero out the data values (although only in some cases... for instance, things work as expected for "Albany | NY", but not for "Abilene | TX"). I don't think this is an issue package versions (can't find anything online about inconsistencies between releases of raster and don't see any differences). Any inspiration @crvernon @KristianNelson ??

swd-turner commented 4 years ago

ok think I figured it out... the 2016_30m_cdls.ige file on pic didn't seem to have fully unpacked. it was 4.1GB rather than 14.9GB