Selective selection of file names

I have several satellite scenes archived by folder with the different bands in Tif format.
All the bands share a common name + _band1.tif, _band2.tif ...
How can I only import band 2 and band 4 of the different scenes within a loop?
I'm trying this, but I can not find where to add the band2 string to the name

DIR_LOOP_START DIRECTORY="F:\...\Escenas" RECURSE_DIR=YES

	IMPORT FILENAME="%DIR%%FNAME+"band2"%" TYPE=GEOTIFF RASTER_TYPE="IMAGE"

Thanks in advance
Tagged:

Answers

  • I was able to make the selection using FILENAME_MASK parameter:

    DIR_LOOP_START DIRECTORY="%ESCENAS%" RECURSE_DIR=YES FILENAME_MASKS="*band2.tif *band4.tif"

    Now I'm trying to apply the NDWI formula to the pair of loaded layers:

    IMPORT FILENAME="%FNAME_W_DIR%" TYPE=GEOTIFF RASTER_TYPE="IMAGE"

    DEFINE_VAR NAME="B2" VALUE="%DIR%*band2.tif"
    DEFINE_VAR NAME="B4" VALUE="%DIR%*band4.tif"

    APPLY_FORMULA FILENAME="%B2%" FILENAME="%B4%" OUTPUT_BIT_DEPTH="32" FORMULA="(%B2%-%B4%)/(%B2%+%B4%)" OUTPUT_GRID=YES

    EXPORT_ELEVATION FILENAME="%OUTPUT_DIR%%FNAME_WO_EXT%_ndwi.tif" TYPE=GEOTIFF COMPRESSION=NONE\
    POLYGON_CROP_FILE="%AOI%"

    The part of applying the formula is not working.
    Any ideas?
Sign In or Register to comment.