# this simulation uses an AFGL tropical atmosphere at a latitude of 0°, with aerosols, ozone (300 DU)
# and a surface pressure of 960 hPa.
# aerosols model "maritime polluted" from OPAC with an optical thickness of 0.2 at 555 nm
# the surface is a wind-roughened sea surface with a wind speed of 5 m/s,
# and the effect of wave shadows is included, index of refraction of water is 1.34.
# The ocean is considered homogeneous, typical of case 1 waters with a Chlorophyll a concentration
# of 0.1 mg/m3 and is 30 m deep. the sea bottom is a lambert reflector with a grey albedo of 0.2
# Stokes vector computation in Local Estimate mode
# the outputs directions are specified by the user : here Zenith angles (10) and Azimuth angles (40)
# equally spaced (so 400 directions)
# wavelength is 555 nm, number of photons is 10^6
# (in local estimate mode all photons contributes to the different directions,
# so less photons are necessary than for the Cone sampling mode)
S=Smartg() # the Smartg object is created (compilation is done once for all)
wl_ref= 555.
wl= wl_ref
nvza=10
nraa=40
aer1 = AeroOPAC('maritime_polluted', 0.2, wl_ref)
atm = AtmAFGL('afglms', lat=0., O3=300., P0=960., comp=[aer1])
surf = RoughSurface(WIND=5., NH2O=1.34, WAVE_SHADOW=True)
water= IOP_1(chl=0.1, DEPTH=30., ALB=Albedo_cst(0.2))
le={}
le.update(phi_deg=np.linspace(0.,360., num=nvza, dtype=np.float32, endpoint=False))
le.update(th_deg= np.linspace(0.1,90., num=nraa, dtype=np.float32, endpoint=False))
m=S.run(THVDEG=30.,
wl=wl,
NBPHOTONS=1e6,
water=water,
atm=atm,
surf=surf,
le = le, # activate Local Estimate mode
OUTPUT_LAYERS=3, # compute also radiation fields at the surface (0+, 0-), sea bottom, upward and downward
progress=False) # disable progress bar
print (m.attrs['kernel time (s)'])