This video explains some information not explained in the previous video, in that we discuss how Python can be used to parse a line of text in order to assign information to other parts of the scripting process.
Remember, we want the computer to perform the mundane tasks and leave time of us "scientists" to do what we do best!
MyPhysical World on Facebook: www.facebook\myphysicalworld
Twitter: @my_physical
Instagram: @MyPhysicalWorld
Map Store: myphysicalworld.company.site
PyCharm is available at: www.jetbrain.com (free for the Community version)
ArcGIS is a registered product of Environmental Systems Research Institute (ESRI): www.esri.com
QGIS is opensource GIS software available at: www.qgis.org
Code used in this video:
import os
images = os.listdir('D:\gisdata\landsat\MtStHelens\Sept302019')
print(images)
imBase = images[1]
acYear = imBase[17:21]
acMonth = imBase[21:23]
acDay = imBase[23:25]
Path = imBase[11:13]
Row = imBase[14:16]
if imBase[43] == ".":
Band = imBase[42]
print("Single Digit Band")
else:
Band = imBase[42:43]
print("Double Digit Band")
print(imBase[0:42] + " Acquired on: " + acMonth + "/" + acDay + "/" + acYear + " Path: " + Path + " Row: " + Row + " This is Band No. " + Band)