Accelerating Py6s?

49 views
Skip to first unread message

Jocker Chou

unread,
Jan 11, 2022, 6:50:23 AM1/11/22
to Py6S
Hi Robin,

I hope this message finds you well.

I'm using py6s to do the atmospheric correction.
However, I found some parameter seems to only accept the single value and did not accept an array.
Such as     s.geometry.solar_z  and s.geometry.solar_a.
In this case, I need to use two for loops to calculate reflectance pixel by pixel. This makes my program very slow.

Is there any method to accelerate this process?

Hope you have a happy new year!

Jocker Chou

Robin Wilson

unread,
Jan 11, 2022, 12:00:55 PM1/11/22
to py...@googlegroups.com
Hi,

The best way to deal with repeated calculations for something like atmospheric correction is to create a Lookup Table. This would involve running the Py6S simulation for a range of parameter values, and then using interpolation within this lookup table to get the final atmospherically corrected values. This can be done in Py6S by turning on atmospheric correction mode and then using `coef_xa`, `coef_xb` and `coef_xc` output values, which give the co-efficients for a formula to do the atmospheric correction (see `outputs.fulltext` for the formula). You can then run the simulation for a number of solar_z and solar_a values, and then do two dimensional interpolation to find the coefficients for the exact values you need to do atmospheric correction. Creating the LUT will still be a relatively slow process, but it should be pretty fast to actually do the correction once you’ve got the LUT (which would be a one time process).

I keep meaning to put together an example notebook showing how to use Py6S to do this, but I keep getting too busy with other work. I’ll let you know if I have chance to do anything like that.

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/36449de0-8fde-4703-b430-5f830c65c7c7n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages