Python syntax error: File "<string>", line 1
Hi there! I am trying to find the surface area of a city using Landsat 9 satellite imagery. I am going through the steps but when I get to calculating brightness temperature, I keep receiving the same error with the Raster Calculator ( Python syntax error: File "<string>", line 1 ).
This is the equation I'm using when I receive the error:
(1321.0789/ (Ln (774.8853) / "TOA") + 1)) - 273.15
"TOA" is a a previously calculated value also using the raster calculator directly before this.
Solved! Go to Solution.
SOLVED: If you think you've double-checked your equation a million times already, do it again or recruit a friend to stare at it for you. I had an extra parenthesis after the Ln function. Go figure.
(1321.0789/ (Ln (774.8853) / "TOA") + 1)) - 273.15
Should be: (1321.0789/ (Ln (774.8853 / "TOA") + 1)) - 273.15
Ln (Spatial Analyst)—ArcGIS Pro | Documentation
in_raster_or_constant
Input values for which to find the natural logarithm (Ln).
To use a number as an input for this parameter, the cell size and extent must first be set in the environment.
Did you set the cell size and extent in the Environments tab of the raster calculator?
I hadn't messed with the cell size since the tutorials I have been following didn't. However, when I did change it around in a few different ways just now, such as "Same as TOA", I still get the same error.
For reference, these are the steps I've been following (using my own numbers from Landsat data- which are comparative to the ones used in the video)
For reference, these are the steps I've been following (using my own numbers from Landsat data- which are comparative to the ones used in the video)
SOLVED: If you think you've double-checked your equation a million times already, do it again or recruit a friend to stare at it for you. I had an extra parenthesis after the Ln function. Go figure.
(1321.0789/ (Ln (774.8853) / "TOA") + 1)) - 273.15
Should be: (1321.0789/ (Ln (774.8853 / "TOA") + 1)) - 273.15