I have trouble when I try to set null some value, when I try this code, it didn't do anything or exporting any file. I run this code on Python ArcGIS Pro and when I import the ArcPy and os it seems ok.
import arcpy
import os
#inputcloudmask
arcpy.env.workspace = "E:\aa\TUGAS AKHIR\VNP46\2018\1 Juni 2018\QF Cloud Mask"
path = "E:\aa\TUGAS AKHIR\VNP46\2018\1 Juni 2018\QF Cloud Mask"
raw_name = os.listdir(path)
rname: str
outname = []
for rname in raw_name:
portion = os.path.splitext(rname)
temp_name = 'filter' + portion[0] + '.TIF'
outname.append(temp_name)
rasters = arcpy.ListRasters("QF*","TIF")
i = 0
for raster in rasters:
Oname = outname[i]
i = i + 1
outSetNull = arcpy.sa.SetNull(raster, 1, "VALUE <> 32 And VALUE <> 34 And VALUE <> 36 And VALUE <> 42 And VALUE <> 48 And VALUE <> 50 And VALUE <> 52 And VALUE <> 58 And VALUE <> 1056 And VALUE <> 1058 And VALUE <> 1060 And VALUE <> 1066 And VALUE <> 1072 And VALUE <> 1074 And VALUE <> 1076 And VALUE <> 1082")
on = "E:/aa/TUGAS AKHIR/VNP46/2018/1 Juni 2018\output" + Oname
outSetNull.save(on)
print(raster + "---->" + Oname)
This is the file in my path (E:\aa\TUGAS AKHIR\VNP46\2018\1 Juni 2018\QF Cloud Mask)
What is wrong with my code?