Forwarding Freddy's answer to the list. :-)

> Begin forwarded message:
> 
> From: Manfred Brath <manfred.br...@uni-hamburg.de>
> Subject: Re: Fwd: [arts-users] Direct radiation is subtracted when it should 
> not
> Date: 17 October 2022 at 14:38:24 CEST
> To: <mengqi....@epfl.ch>
> Cc: Oliver Lemke <oliver.le...@uni-hamburg.de>
> 
> Hello Xia,
> 
> since the star related methods are still under development, some 
> documentation is still missing. Therefore, you chose unfortunately the wrong 
> surface agenda. The iySurfaceRtpropAgenda calculates only the surface 
> reflection/scattering from the diffusive radiation field. No direct radiation 
> is intended to be considered by this method. 
> 
> If stars are present you should use following surface methods:
> 
> for a Lambertian surface with predefined reflectivity
> 
> iySurfaceLambertian
> iySurfaceLambertianDirect
> for a flat surface with predefined reflectivity
> iySurfaceFlatReflectivity
> iySurfaceFlatReflectivityDirect
> for a flat surface (Fresnel reflection) with defined refractive index
> iySurfaceFlatRefractiveIndex
> iySurfaceFlatRefractiveIndexDirect
> 
> 
> Here is a example for a surface agenda with a Lambertian surface 
> 
> @arts_agenda
> def iy_surface_agenda(ws):
>     ws.iySurfaceInit()
>     ws.Ignore(ws.dsurface_rmatrix_dx)
>     ws.Ignore(ws.dsurface_emission_dx)
>     ws.iySurfaceLambertian()
>     ws.iySurfaceLambertianDirect()
> 
> 
> 
> and for a flat surface with Fresnel reflection
> 
> @arts_agenda
> def iy_surface_agenda(ws):
>     ws.iySurfaceInit()
>     ws.iySurfaceFlatRefractiveIndex()
>     ws.iySurfaceFlatRefractiveIndexDirect()
> 
> 
> 
> I hope this could help you.
> 
> Cheers,
> 
> Freddy
> 
> Am 17.10.22 um 13:06 schrieb Lemke, Oliver:
>> 
>> 
>>> Begin forwarded message:
>>> 
>>> From: Xia Mengqi <mengqi....@epfl.ch <mailto:mengqi....@epfl.ch>>
>>> Subject: [arts-users] Direct radiation is subtracted when it should not
>>> Date: 16 October 2022 at 14:05:16 CEST
>>> To: "arts_users.mi@lists.uni-hamburg.de 
>>> <mailto:arts_users.mi@lists.uni-hamburg.de>" 
>>> <arts_users.mi@lists.uni-hamburg.de 
>>> <mailto:arts_users.mi@lists.uni-hamburg.de>>
>>> 
>>> Hi, 
>>> 
>>> I'm new to ARTS and I set up a simple 1D test where there is sun, 
>>> absorption only gas and a specular surface with reflectivity 1. The sun and 
>>> sensor is both at 0 latitude and 0 longitude, with the sensor looking down 
>>> (los=180). For simplicity I force it to be just 1 layer by providing the 
>>> pressures on the top of the atmosphere and at 0km. I noticed that the 
>>> radiance output is almost zero, which is unexpected. However, if I comment 
>>> out the operation that subtracts the direct radiation (iy-=iy_aux[0]) in 
>>> iySurfaceRtpropAgenda the result looks correct (and validated against 
>>> libRadtran). I'm puzzled why in this case the subtraction is needed; or 
>>> maybe I made simple mistakes in the set up. It would be great if you could 
>>> help me with this problem. Thank you!
>>> 
>>> 
>>> The main part of the code is copied here:
>>> 
>>> ws = Workspace(verbosity=2)
>>> ws.ReadHITRAN(filename='/home/mandy/Github/MiAtmosphere/HITRAN/ALL.par', 
>>> hitran_type="Online", abs_lines=ws.abs_lines)
>>> 
>>> ws.LegacyContinuaInit()
>>> ws.water_p_eq_agendaSet()
>>> ws.gas_scattering_agendaSet()
>>> ws.PlanetSet(option="Earth")
>>> ws.iy_main_agendaSet( option="Clearsky" )
>>> ws.iy_space_agendaSet( option="CosmicBackground" )
>>> ws.iy_surface_agendaSet()
>>> 
>>> ws.ArrayOfStringSet( ws.iy_aux_vars, [ "Optical depth", "Radiative 
>>> background"] )
>>> 
>>> ws.propmat_clearsky_agenda=propmat_clearsky_agenda
>>> 
>>> ws.NumericSet( ws.ppath_lmax, 1e10)
>>> ws.ppath_step_agendaSet( option="GeometricPath" )
>>> ws.ppath_agendaSet( option="FollowSensorLosPath" )
>>> 
>>> # define environment
>>> # 
>>> =============================================================================
>>> # Number of Stokes components to be computed
>>> ws.IndexSet(ws.stokes_dim, 1)
>>> 
>>> # Read the spectroscopic line data from the ARTS catalogue and
>>> # create the workspace variable `lines'.
>>> ws.ReadHITRAN(filename='/home/mandy/Github/MiAtmosphere/HITRAN/ALL.par', 
>>> hitran_type="Online", abs_lines=ws.abs_lines)
>>> ws.abs_linesNormalization(ws.abs_lines, "VVH")
>>> 
>>> # Frequency grid
>>> c = 299792458
>>> wavelengths = np.linspace(1178e-9, 1177e-9, 2)
>>> f_grid = c / wavelengths
>>> ws.f_grid = f_grid
>>> 
>>> ####
>>> # set a simple blackbody sun
>>> ws.starsAddSingleBlackbody(latitude=sun_pos[0], longitude=sun_pos[1])
>>> ws.Print(ws.stars, 2)
>>> 
>>> # A pressure grid rougly matching 0 to 80 km, in steps of 2 km.
>>> #ws.p_grid = data.p.to_numpy()
>>> ws.p_grid = np.array([1.01040e+05, 2.54000e-03]) # 0 and 120km
>>> 
>>> # Definition of species
>>> ws.abs_speciesSet(species=
>>>                       ["H2O", "O3", "N2O", "CO", "CH4", "CO2", "O2"])
>>> 
>>> # This separates the lines into the different tag groups and creates
>>> # the workspace variable `abs_lines_per_species':
>>> ws.abs_lines_per_speciesCreateFromLines()
>>> 
>>> # Load atmospheric data
>>> ws.AtmRawRead(basename="../controlfiles/testdata/afglUS")
>>> 
>>> # Set surface relectivity
>>> Reflectivity = [1]
>>> ws.VectorSet(ws.surface_scalar_reflectivity, Reflectivity)
>>> ws.surface_rtprop_agendaSet(option="Specular_NoPol_ReflFix_SurfTFromt_surface"
>>>  )
>>> 
>>> # Reference ellipsoid
>>> ws.refellipsoidEarth(ws.refellipsoid, "Sphere")
>>> 
>>> # No jacobian calculations
>>> ws.jacobianOff()
>>> 
>>> # No particulate scattering
>>> ws.cloudboxOff()
>>> 
>>> # No sensor model
>>> ws.sensorOff()
>>> 
>>> ws.StringSet( ws.iy_unit, "1" )
>>> 
>>> ws.AtmosphereSet1D()
>>> ws.AtmFieldsCalc()
>>> 
>>> # Postion and line-of-sight of sensor
>>> ws.rte_pos = [600e3]
>>> ws.rte_los = [180]
>>> ws.VectorSet(ws.rte_pos2, [])
>>> 
>>> # Check model atmosphere
>>> ws.propmat_clearsky_agendaAuto()
>>> ws.propmat_clearsky_agenda_checkedCalc()
>>> ws.atmfields_checkedCalc()
>>> ws.atmgeom_checkedCalc()
>>> ws.cloudbox_checkedCalc()
>>> ws.lbl_checkedCalc()
>>> 
>>> # the actual simulation
>>> ws.iyCalc()
>>> 
>>> # output iy file
>>> ws.WriteXML(ws.output_file_format, ws.iy)
>> 
> -- 
> ----------------------------------------------------------
> Dr. Manfred Brath
> Radiation and Remote Sensing
> Meteorological Institute
> Universität Hamburg
> Bundesstraße 55
> D-20146 Hamburg
> Room 1535
> 
> Tel: +49 40 42838-8786



Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to