fdetsch / MODIS

Download and processing framework for MODIS imagery. The package provides automated access to the global online data archives LP DAAC, LAADS and NSIDC as well as processing capabilities such as file conversion, mosaicking, subsetting and time series.
Other
58 stars 27 forks source link

getSds returning wrong SDS #61

Open gregrz opened 5 years ago

gregrz commented 5 years ago

Maybe I'm mistaken but the getSds function appears to return wrong values when the SDSstring argument is provided. In my case I was querying MOD13Q1.006 HDF files and no matter which SDS I provided as argument it returned "250m 16 days NIR reflectance" in the $SDSnames slot and "0 0 0 0 1 0 0 0 0 0 0 0" in the $SDSstring slot. To my understanding in the function definition of getSds this happens on lines 129 - 132 where msk is assigned TRUE for all elements of SDSstring == 1. If I do not collapse the white spaces from SDSstring (line 121) and replace the for loop (lines 129 - 132) with msk <- sds == SDSstring the function returns the correct values. Hope this helps.