robintw / Py6S

A Python interface to the 6S Radiative Transfer Model
GNU Lesser General Public License v3.0
191 stars 105 forks source link

About SixS Parameter "visibility" #46

Closed YangTze7 closed 5 years ago

YangTze7 commented 5 years ago

Hello,I'm not familiar with this tool,and I have a problem to change the parament "visibility".When i change visibility to 40.0,it doesn‘work.Or it cannot be modified once i choose specific aero_profile or atmos_profile?

robintw commented 5 years ago

Hi,

I'm a bit confused about exactly what the problem is. Can you send some example code that shows the problem, please? Please also include the output of s.produce_debug_report().

YangTze7 commented 5 years ago

Thanks, Below is my code, i input s.visibility = 40.0,when i open 'B5.txt',the visibility is not 40 km but 8.49 km. `from Py6S import * s = SixS() s.visibility = 40.0

s.aero_profile = AeroProfile.PredefinedType(AeroProfile.Urban) s.atmos_profile = AtmosProfile.PredefinedType(AtmosProfile.SubarcticSummer) s.wavelength = Wavelength(PredefinedWavelengths.LANDSAT_OLI_B5) s.ground_reflectance = GroundReflectance.HomogeneousLambertian(GroundReflectance.GreenVegetation) s.geometry.view_a = 0 s.geometry.view_z = 0 s.geometry.solar_a = 156.96 s.geometry.solar_z = 47.80 s.geometry.month = 10 s.geometry.day = 6 s.geometry.gmt_decimal_hour = 2.895 s.geometry.latitude = 40.320665 s.geometry.longitude = 116.71512 s.atmos_corr= AtmosCorr.AtmosCorrLambertianFromRadiance(1) s.run() s.outputs.write_output_file("D:/B5.txt") s.produce_debug_report()`

YangTze7 commented 5 years ago

Py6S Debugging Report

Run on 2018-11-06 22:56:48.042469 Platform: Windows-10-10.0.17134-SP0 Python version: 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 10:22:32) [MSC v.1900 64 bit (AMD64)] Py6S version: 1.7.2

6S wrapper script by Robin Wilson Using 6S located at C:\Windows\system32\sixs.exe Running 6S using a set of test parameters 6sV version: 1.1 The results are: Expected result: 619.158000 Actual result: 619.158000

Results agree, Py6S is working correctly


0 (User defined) 47.800000 156.960000 0.000000 0.000000 10 6 4 3 0 0.500000 value 0.000000 0.000000 1 User's defined filtered function 0.829000 0.899000 0.0 7.5e-05 0.000314 0.0008525 0.002107 0.0059015 0.017346 0.066277 0.249733 0.66383 0.960215 0.9768695 1.0 0.978334 0.957357 0.950103 0.94845 0.9533555 0.969821 0.8398995 0.448364 0.137481 0.034532 0.0100205 0.002944 0.0009675 0.000241 1.55e-05 0.0 0 Homogeneous surface 0 No directional effects 1 0 Atm. correction Lambertian 1.000000 radiance

robintw commented 5 years ago

Thank you for the details.

I've realised that I never documented how the AOT/Visibility parameterisation actually worked. Basically, you can either set s.aot550 or s.visibility - and so one of them should always be set to None and one to the value you want to use. By default s.aot550 is set to 0.5, so setting s.visibility has no effect. So, to fix your problem you need to add an extra line: s.aot550 = None - and then it will work.

I will improve the documentation about this, and look into a better way of doing this in future versions.

YangTze7 commented 5 years ago

I get it, thanks for your help.