<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2018-06-28 10:26 GMT+02:00 Moritz Lennert <span dir="ltr"><<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 27/06/18 15:40, Roberto Marzocchi wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">
<br>
<br>
Il giorno mer 27 giu 2018 alle ore 15:25 Markus Metz <<a href="mailto:markus.metz.giswork@gmail.com" target="_blank">markus.metz.giswork@gmail.com</a> <mailto:<a href="mailto:markus.metz.giswork@gmail.com" target="_blank">markus.metz.giswork@gm<wbr>ail.com</a>>> ha scritto:<br>
<br>
<br>
<br>
On Wed, Jun 27, 2018 at 3:06 PM, Roberta Fagandini<br></span><span class="gmail-">
<<a href="mailto:robifagandini@gmail.com" target="_blank">robifagandini@gmail.com</a> <mailto:<a href="mailto:robifagandini@gmail.com" target="_blank">robifagandini@gmail.co<wbr>m</a>>> wrote:<br>
><br>
><br>
><br>
> 2018-06-27 14:24 GMT+02:00 Markus Metz<br></span>
<<a href="mailto:markus.metz.giswork@gmail.com" target="_blank">markus.metz.giswork@gmail.com</a> <mailto:<a href="mailto:markus.metz.giswork@gmail.com" target="_blank">markus.metz.giswork@gm<wbr>ail.com</a>>>:<span class="gmail-"><br>
>><br>
>><br>
>><br>
>> On Wed, Jun 27, 2018 at 2:16 PM, Roberta Fagandini<br></span><span class="gmail-">
<<a href="mailto:robifagandini@gmail.com" target="_blank">robifagandini@gmail.com</a> <mailto:<a href="mailto:robifagandini@gmail.com" target="_blank">robifagandini@gmail.co<wbr>m</a>>> wrote:<br>
>> ><br>
>> > I'm trying to create an automatic procedure to retrieve all<br>
the input parameters for the control file of i.atcorr.<br>
>> > I need py6S because I want to automatically read and compute<br>
AOT at 550nm from an AERONET file.<br>
>><br>
>> With AOT you mean aerosol optical thickness right? This is user<br>
input to i.atcorr. There are various sources for AOT at 550nm, e.g.<br>
MODIS.<br>
><br>
><br>
> Right!<br>
><br>
>><br>
>><br>
>><br>
>><br>
>> Anyway, it is probably much easier to to write your own routine<br>
to read the AERONET file and get the corresponding formula for AOT<br>
than to fight with 51821 lines of Fortran source code that is<br>
numerically unstable. Maybe I can help with getting AOT at 550nm<br>
from an AERONET file avoiding the Fortran version of 6S.<br>
><br>
><br>
> Ok but I'm not able to create this kind of routine on my own. If<br>
someone, more expert than me, can help me in translating the 6S/Py6S<br>
functions I can go on in this way otherwise for me it's easier to<br>
use the fortran source code.<br>
<br>
Apparently the AERONET data are simple CSV files. You can import<br></span>
them with <a href="http://r.in.xyz" rel="noreferrer" target="_blank">r.in.xyz</a> <<a href="http://r.in.xyz" rel="noreferrer" target="_blank">http://r.in.xyz</a>> or v.in.ascii.<span class="gmail-"><br>
<br>
Still, I think it is up to the user to decide on the source of AOT<br>
values. AERONET is one of many possible sources.<br>
<br>
<br>
Ok but I know that Roberta want try to simplify the procedure for atmospheric correction. In particular she would like to add an option (not the only one) to read automatically the AOT at the wave length of 550 nm from the AERONET file.<br>
<br>
The steps to do this IMHO are:<br>
<br>
1) read the file (using GRASS or maybe better Python)<br>
<br>
2) a formula to calculate the AOT550<br>
<br>
Unfortunately I have no idea about the 2nd point :-(<br>
</span></blockquote>
<br>
I'm not sure either, what exactly the necessary calculations are.<br>
<br>
Superficially reading through the relevant class in Py6S [1], I understasnd that it does two things:<br>
<br>
1) Get the value of AOT550<br>
2) Create a continuous profile by interpolating values<br>
<br>
If all you need is 1), then all they do (see _get_aot() method at the end) is to read all the AOT_* columns and chose the value of the line with the timestamp closest to the one asked for and the wavelength closest to 550. </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
As the code is GPL you could probably just extract the necessary parts and integrate them into your code. The only thing I'm not to sure about is their use of pandas which creates yet again another dependency which I don't really think necessary and desirable.</blockquote><div><br></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Yesterday I studied the library better and I understood that it only extracts the available AOT values closest to<span> </span></span><span style="font-size:small;text-decoration-style:initial;text-decoration-color:initial;background-color:rgb(255,255,255);float:none;display:inline">the wavelength 550 for the specified timestamp. No calculation is made so I'm trying to write my own routine avoiding any dependency.</span><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
It should be enough to extract from the file the date and time (or maybe easier to work with: year and the Julian day) and all AOT_* columns, parse the AOT_* columns for their wavelength value and then identify the value which has closes time and wavelength to the time requested and 550nm.<br></blockquote><div><br></div><div>That's exactly what I want to do and I'm working on it!</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Moritz<br></blockquote><div><br></div><div>I know that AERONET is not the only source and obviously in my module there will be both an option for providing manually the value, as Markus and Stefan suggested, and an option to extract the AOT from an AERONET file. I'm not an expert in MODIS data so if someone wants to give suggestions about how to retrieve the AOT from these data, I will definitely add this option too.</div><div><br></div><div>Thanks</div><div>Roberta</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
<br>
<br>
[1] <a href="https://github.com/robintw/Py6S/blob/master/Py6S/SixSHelpers/aeronet.py" rel="noreferrer" target="_blank">https://github.com/robintw/Py6<wbr>S/blob/master/Py6S/SixSHelpers<wbr>/aeronet.py</a><br>
</blockquote></div><br></div></div>