Confusion: atmospheric correction using Py6S

582 views
Skip to first unread message

Mamta Kumari

unread,
Jun 18, 2015, 1:00:34 AM6/18/15
to py...@googlegroups.com
Dear Robin

I am trying to use Py6S (Py6S-1.5.4) for atmospheric correction by assuming lambertian homogeneous target (no brdf). However, I am always getting "nan" value for atmos_corrected_reflectance_Lambertian for all parameter combination (tried both image radiance/reflectance (TOA) values). Finally, I have tried parameters combination used by you as some example (for satellite image correction), still I got the same "nan" result. For more clarity I am giving code below to show parameters combination. Am I doing something wrong?   
from Py6S import *

s=SixS()

s.aeroprofile=AeroProfile.PredefinedType(AeroProfile.Maritime)

s.aot550=0.05

s.atmosprofile=AtmosProfile.UserWaterAndOzone(2, 0.318)

s.wavelength=Wavelength(PredefinedWavelengths.MODIS_B6)

s.altitudes.set_target_sea_level()

s.altitudes.set_sensor_satellite_level()

s.geometry=Geometry.User()

s.geometry.solar_z=35.8

s.geometry.solar_a=149.4

s.geometry.view_z=5.1

s.geometry.view_a=106.8

s.geometry.month=06

s.geometry.date=28

s.atmos_corr=AtmosCorr.AtmosCorrLambertianFromRadiance(137.5)

s.run()

print s.outputs.values

Outputs:

{'percent_direct_solar_irradiance': 0.953, 'coef_xa': 0.01739, 'coef_xc': 0.01297, 'percent_environmental_irradiance': 0.004, 'month': 6, 'background_radiance': 0.629, 'direct_solar_irradiance': 175.381, 'aot550': 0.05, 'environmental_irradiance': 0.716, 'scattering_angle': 147.79, 'pixel_reflectance': 0.28, 'atmospheric_intrinsic_radiance': 0.155, 'wv_mixed_with_aerosol': 0.293, 'wv_under_aerosol': 0.293, 'percent_diffuse_solar_irradiance': 0.044, 'view_a': 106, 'int_solar_spectrum': 7.17, 'background_reflectance': 0.011, 'view_z': 5, 'atmos_corrected_reflectance_lambertian': nan, 'coef_xb': 0.00277, 'wv_above_aerosol': 0.293, 'pixel_radiance': 16.693, 'azimuthal_angle_difference': 42.6, 'visibility': 151.58, 'solar_z': 35, 'apparent_reflectance': 0.2931, 'ground_altitude': 0.0, 'day': 1, 'int_funct_filt': 0.0310427, 'measured_radiance': 0.0, 'diffuse_solar_irradiance': 8.019, 'apparent_radiance': 17.477, 'atmospheric_intrinsic_reflectance': 0.003, 'total_gaseous_transmittance': 0.974, 'solar_a': 149, 'ground_pressure': 1013.0, 'atmos_corrected_reflectance_brdf': nan}


Thanks
Mamta Kumari

Robin Wilson

unread,
Jun 18, 2015, 1:07:34 PM6/18/15
to py...@googlegroups.com
Hi,

The only thing I can see wrong with the code is the:

s.geometry.month line which should be:

s.geometry.month = 6

(rather than 06)

With that alteration, I’ve tried running it with the latest version of Py6S and it works fine, giving an answer of 2.31959.

Try upgrading to the latest version (pip install -U Py6S) and then try again. If it still happens then send me the output of s.produce_debug_report() and I’ll try and work out what’s happening.

Cheers,

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 post to this group, send email to py...@googlegroups.com.
Visit this group at http://groups.google.com/group/py6s.

Mamta Kumari

unread,
Jun 23, 2015, 5:41:08 AM6/23/15
to py...@googlegroups.com
Dear Robin

Sorry for delayed response. I have used latest version of Py6S now and used 6 instead of 06 (for s.geometry.month) but still getting the same result.
I have given the output of s.produce_debug_report() below:

s.produce_debug_report()
Py6S Debugging Report
---------------------
Run on 2015-06-23 14:53:05.187000
Platform: Windows-7-6.1.7601-SP1
Python version: 2.7.6 | 32-bit | (default, Sep 15 2014, 17:34:02) [MSC v.1500 32 bit (Intel)]
Py6S version: 1.6.0
---------------------
6S wrapper script by Robin Wilson
Using 6S located at C:\Windows\system32\sixs.exe
Running 6S using a set of test parameters
The results are:
Expected result: 619.158000
Actual result: 618.371000
#### Results agree, Py6S is working correctly
---------------------
0 (User defined)
35.800000 149.400000 5.100000 106.800000 6 1
2
2
0
0.050000 value
0.000000
-1000.000000
47 (Chosen Band)
0 Homogeneous surface
0 No directional effects
0
0.3
0 Atm. correction Lambertian
137.500000 radiance

Apart from this, how come reflectance output is more than 1 (or is it 2.31959%?)?

Thanks

Mamta Kumari
Reply all
Reply to author
Forward
0 new messages