RETURN-project / makeDataCube

Data management
Apache License 2.0
0 stars 0 forks source link

Test "make mask without fire data" failing #35

Open PabRod opened 3 years ago

PabRod commented 3 years ago

Problem

The tests are throwing an error:

Error: Expecting a single value: [extent=0].
Backtrace:
 1. makeDataCube::makeMaskNoFire(...) test-Prep_supporting_data.R:127:2
 3. (msklc == 1) & (mskfor == 1)
 4. e1@ptr$logic_numb(e2, oper, .terra_environment$options@ptr)

Some details

The problem happens here:

https://github.com/RETURN-project/makeDataCube/blob/8e6ffdb8d365a917d741d8e1817e9edc1b3644df/R/Prep_supporting_data.R#L497

Only mskfor is a logical object. The other two are SpatRaster objects, and the meaning of expressions such as (msklc == 1) is not obvious and, more worryingly, doesn't evaluate to a logical. Can you shed some light on this, @wandadk?

Thanks in advance!