Rrs to Lwn

Technical questions about ACOLITE
Post Reply
Marena
Posts: 1
Joined: Tue May 12, 2020 3:01 pm

Rrs to Lwn

Post by Marena »

Hello!,
I am wondering if there is a possibility to retrieve Lwn information from acolite outputs (Rrs or rhow) in order to compare these results with AERONET L1.5 data in which Rrs data are not available.
I guess that one option would be obtain F0 values and convert the Rrs data as Rrs=Lwn/F0, but I couldn't found the F0 value in the run file.
Thanks!.
quinten
Posts: 1019
Joined: Tue Mar 03, 2015 8:13 am

Re: Rrs to Lwn

Post by quinten »

Hi Marena

I use the Thuillier 2003 solar irradiance spectrum to convert between the AERONET-OC radiances and rhow/Rrs, with a 10 nm window on the reported AERONET wavelength, but you could also convert the satellite reflectance to radiance. Which satellites are you working with?

If you have the ACOLITE GitHub code then you could run bits of the code to perhaps get what you need. For example:

Code: Select all

## import stuff
import sys, os
user_home = os.path.expanduser("~")
sys.path.append(user_home+'/git/acolite') ## change path to your acolite GitHub clone
import acolite as ac
import numpy as np

## convert a single AERONET observation to reflectance
aeronet_wave = 443
aeronet_lwn = 4.0
aeronet_f0 = ac.shared.f0_wave(float(aeronet_wave),width=10)
aeronet_rhow = np.pi*(aeronet_lwn/aeronet_f0)
aeronet_Rrs = aeronet_rhow/np.pi

## compute F0 for Venise
wave = [ 412.,  443.,  490.,  532.,  551.,  667.,  870., 1020.]
widths = [8, 10, 10, 10, 10, 10, 10, 10]
hwidths = [w/2 for w in widths]
f0 = []
for iw, w in enumerate(wave):
    wv_cur = np.linspace(w-hwidths[iw], w+hwidths[iw], widths[iw]+1)
    f0_cur = ac.shared.f0_band(wv_cur, [1]*len(wv_cur))
    f0.append(f0_cur)
f0 = np.asarray(f0)

## compute band weighted F0 for Sentinel-2A
sensor='S2A_MSI'
rsr_file="{}/RSR/{}.txt".format(ac.config['pp_data_dir'],sensor)
rsr, rsr_bands = ac.rsr_read(file=rsr_file)
sensor_dict = {}
for i,band in enumerate(rsr_bands):
    ## get relative spectral response, convert from micron to nm
    band_rsr=rsr[band]['response']
    band_wave=[float(i*1000) for i in rsr[band]['wave']]
    ## compute f0
    f0=ac.shared.f0_band(band_wave, band_rsr)
    ## compute band weigthed wavelength
    wave = ac.shared.rsr_convolute(band_wave, rsr[band]['wave'], 
                                           rsr[band]['response'], 
                                           rsr[band]['wave'])
    sensor_dict[band] = {'name': band, 'wave': wave, 'f0': f0}
Quinten
ArenaM
Posts: 1
Joined: Tue May 12, 2020 2:53 pm

Re: Rrs to Lwn

Post by ArenaM »

Hi Quinten!,
Thank you so much for you reply, these is exactly that I'm looking for. I'm working with Landsat8-OLI scenes, I will try to use the github code and convert the sensors bands to radiance.
liangdp8
Posts: 3
Joined: Tue Jan 03, 2023 10:21 am

Re: Rrs to Lwn

Post by liangdp8 »

Hi Quinten!,
Thanks for your reply about the conversion between Rrs and Lwn of AERONET.

I see a function (ac.shared.f0_wave) above, but I can not find it in the latest version of Acolite. So I want to know what it means.

Looking for your reply!
quinten
Posts: 1019
Joined: Tue Mar 03, 2015 8:13 am

Re: Rrs to Lwn

Post by quinten »

This function was removed, but you can do a simple interpolation of a F0 spectrum for a given wavelength, e.g. finding F0 at 561 nm using numpy:

Code: Select all

import acolite as ac
import numpy as np
f0 = ac.shared.f0_get(f0_dataset='Coddington2021_1_0nm')
wave = 561
print(wave, np.interp(wave, f0['wave'], f0['data']))
For a specific sensor you can use other functions, e.g. for Landsat 9 OLI:

Code: Select all

import acolite as ac
f0 = ac.shared.f0_get(f0_dataset='Coddington2021_1_0nm')
sensor = 'L9_OLI'
rsrd = ac.shared.rsr_dict(sensor=sensor)
f0_sensor = ac.shared.rsr_convolute_dict(f0['wave']/1000, f0['data'], rsrd[sensor]['rsr'])
print(sensor, f0_sensor)
I hope this helps!

Quinten
liangdp8
Posts: 3
Joined: Tue Jan 03, 2023 10:21 am

Re: Rrs to Lwn

Post by liangdp8 »

Thanks for your help!!! It gives a right result.
Post Reply