You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenever I try to run the null_set_range tool for my data, it throws this error.
Files found which meet all input criteria: 7
Traceback (most recent call last):
File "C:\Users\tefenn\Documents\Fellow\Projects\Texas_Disasters\set_null.py", line 8, in
raster.null_set_range(rast_filelist, high_thresh = 5000, low_thresh = 0, NoData_Value = None)
File "C:\Python27\ArcGISx6410.3\lib\site-packages\dnppy\raster\null_set_range.py", line 30, in null_set_range
rast, meta = to_numpy(rastname)
File "C:\Python27\ArcGISx6410.3\lib\site-packages\dnppy\raster\to_numpy.py", line 78, in to_numpy
mask[numpy_rast != meta.NoData_Value] = False # do not mask
AttributeError: 'list' object has no attribute 'NoData_Value'
This is the script I was running.
from dnppy import time_series
from dnppy import raster
from dnppy import core
mydir = r"C:\Users\tefenn\Documents\Fellow\Projects\Texas_Disasters\data"
rast_filelist = core.list_files(False, mydir, ["tif"], ["ovr","xml"])
Ah, In order for that error to occur, it looks like you are probably using multi band tiffs. This null_set_range function does not yet support multi band tiffs (because each band may have a different nodata value, and hence the current set of inputs lead to ambiguous scenarios). I'll add that to the to-do list, it may be possible to get a quick solution up soon.
In the meantime, if it is practical to convert your raster to single band tiffs, that may be the fastest solution.
Jwely
changed the title
null_set_range 'list' object has no attribute 'NoData_Value'
null_set_range does not support multi-band tiffs. Results in 'list' object has no attribute 'NoData_Value' error
Oct 19, 2015
Whenever I try to run the null_set_range tool for my data, it throws this error.
Files found which meet all input criteria: 7
Traceback (most recent call last):
File "C:\Users\tefenn\Documents\Fellow\Projects\Texas_Disasters\set_null.py", line 8, in
raster.null_set_range(rast_filelist, high_thresh = 5000, low_thresh = 0, NoData_Value = None)
File "C:\Python27\ArcGISx6410.3\lib\site-packages\dnppy\raster\null_set_range.py", line 30, in null_set_range
rast, meta = to_numpy(rastname)
File "C:\Python27\ArcGISx6410.3\lib\site-packages\dnppy\raster\to_numpy.py", line 78, in to_numpy
mask[numpy_rast != meta.NoData_Value] = False # do not mask
AttributeError: 'list' object has no attribute 'NoData_Value'
This is the script I was running.
from dnppy import time_series
from dnppy import raster
from dnppy import core
mydir = r"C:\Users\tefenn\Documents\Fellow\Projects\Texas_Disasters\data"
rast_filelist = core.list_files(False, mydir, ["tif"], ["ovr","xml"])
raster.null_set_range(rast_filelist, high_thresh = 5000, low_thresh = 0, NoData_Value = None)
The text was updated successfully, but these errors were encountered: