An error while extracting xa,xb,xc coefficients.

81 views
Skip to first unread message

Pratanu Maity

unread,
Apr 7, 2023, 5:22:50 AM4/7/23
to Py6S
Hi Everyone,

I am trying to extract xa, xb, xc coefficient  for landsat imagery using Py6S. The codes are the following

"from Py6S import *
s = SixS()
s.atmos_profile = AtmosProfile.UserWaterAndOzone(6.5, 0.4) 
s.wavelength = Wavelength(PredefinedWavelengths.LANDSAT_TM_B3) 
s.ground_reflectance = GroundReflectance.HomogeneousWalthall(1.08, 0.48, 4.96, 0.5) 
s.geometry = Geometry.Landsat_TM()
s.geometry.month = 7
s.geometry.day = 14
s.geometry.gmt_decimal_hour = 7.75
s.geometry.latitude = 51.148
s.geometry.longitude = 0.307
s.run()
print(s.outputs.coef_xa)
print(s.outputs.coef_xb)
print(s.outputs.coef_xc)"

But I got the following error.

OutputParsingError Traceback (most recent call last) <ipython-input-49-329d756bc115> in <module> 11 s.geometry.longitude = 0.307 12 s.run() ---> 13 print(s.outputs.coef_xa) C:\ProgramData\Anaconda3\envs\py6s-env\lib\site-packages\Py6S\outputs.py in __getattr__(self, name) 108 return self.rat[name] 109 else: --> 110 raise OutputParsingError("The specifed output variable does not exist.") 111 112 def __dir__(self): OutputParsingError: The specifed output variable does not exist.
Please help me to figure out the problem.
Rergards,

Robin Wilson

unread,
Apr 8, 2023, 4:03:02 AM4/8/23
to py...@googlegroups.com
Hi,

You need to turn on atmospheric correction mode to be able to get the coefficients output. For example, something like:

s.atmos_corr = AtmosCorr.AtmosCorrLambertianFromRadiance(100)

(the actual value given for the radiance there won’t affect the coefficient results)


Best regards,

Robin
--
You received this message because you are subscribed to the Google Groups "Py6S" group.
To unsubscribe from this group and stop receiving emails from it, send an email to py6s+uns...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/py6s/0abdea53-3ab8-4f78-8cf7-1570eb7a3815n%40googlegroups.com.

Pratanu Maity

unread,
Apr 14, 2023, 6:12:54 PM4/14/23
to py...@googlegroups.com
Dear Sir,

Thank you sir for the answer.

Regards,

Pratanu Maity
Geospatial Data Analyst
Suhora Technologies Pvt.Ltd.

Reply all
Reply to author
Forward
0 new messages