[arts-users] failure to build arts v2.5.7

2022-10-17 Thread Schwartz, Michael J (US 329D)
Hello
I am trying to build the development version of arts and pyarts on a linux 
system with gcc version 11.2.1 20220127 (Red Hat 11.2.1-9.1.0.2) (GCC).  I also 
tried on a macbook, but will focus on the linux attempt.

I downloaded the source and the arts-cat-data and arts-xml-data.
When I try to make arts, it goes well until nearly the end:

(mjschwar-env) dweezil:build$ make
-- ARTS version: 2.5.7 (git: 007883e7)
[  0%] Built target auto_version.txt
…
[ 90%] Built target arts_developer-stamp
[ 90%] Built target arts_user-stamp
doc/uguide/CMakeFiles/arts_developer-stage1.dir/build.make:169: *** target 
pattern contains no '%'.  Stop.
make[1]: *** [CMakeFiles/Makefile2:2971: 
doc/uguide/CMakeFiles/arts_developer-stage1.dir/all] Error 2
make: *** [Makefile:160: all] Error 2

So this seems to be failing somewhere in the building or checking of 
documentation.




I can (seemingly successfully) specifically make only the targets arts and 
pyarts:

make arts
make pyarts
cd python
python3 -m pip install --user -e .



I then did
conda install docutils matplotlib netCDF4 numpy pytest scipy setuptools xarray
pip install lark-parser


but when I try to import pyarts,

$ python
Python 3.9.13 (main, Oct 13 2022, 21:15:33)
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyarts
Traceback (most recent call last):
  File "", line 1, in 
  File "/users/michael/ARTS/arts-2.5/build/python/pyarts/__init__.py", line 8, 
in 
from pyarts import arts  # noqa
ImportError: cannot import name 'arts' from partially initialized module 
'pyarts' (most likely due to a circular import) 
(/users/michael/ARTS/arts-2.5/build/python/pyarts/__init__.py)
>>>


It seems that it is trying, during the initialization of pyarts, to import arts 
from pyarts.
This is the same error message that I get to with the install on my macbook.

Do you have any suggestions?

Thank you, danke,  tack,

Michael




Re: [arts-users] Custom antenna response

2022-10-17 Thread Werner, Frank (329D)
… just as an update:

I also tried manually creating a simple 1d pattern with the 
‘sensor_responseAntenna’ workspace method:

ws.sensor_responseAntenna(ws.sensor_response,
  ws.sensor_response_f,
  ws.sensor_response_pol,
  ws.sensor_response_dlos,
  ws.sensor_response_dlos_grid,
  [11875000],
  [1],
  3,
  1,
  [[0.]],
  
np.array(0.00260905],[0.00350429],[0.00465987],[0.00613486],[0.00799636],
  [0.010319  
],[0.01318377],[0.01667627],[0.02088407],[0.02589336],
  
[0.03178475],[0.03862836],[0.04647835],[0.05536716],[0.06529965],
  
[0.07624766],[0.08814531],[0.10088555],[0.1143183 ],[0.12825067],
  
[0.14244938],[0.15664572],[0.17054287],[0.18382546],[0.19617099],
  
[0.20726262],[0.21680248],[0.22452492],[0.23020879],[0.23368795],
  
[0.23485932],[0.23368795],[0.23020879],[0.22452492],[0.21680248],
  
[0.20726262],[0.19617099],[0.18382546],[0.17054287],[0.15664572],
  
[0.14244938],[0.12825067],[0.1143183 ],[0.10088555],[0.08814531],
  
[0.07624766],[0.06529965],[0.05536716],[0.04647835],[0.03862836],
  
[0.03178475],[0.02589336],[0.02088407],[0.01667627],[0.01318377],
  [0.010319  
],[0.00799636],[0.00613486],[0.00465987],[0.00350429],
  [0.00260905,
  0)
ws.sensor_responseInit()

But here, I get the error message ‘TypeError: Cannot interpret '0' as a data 
type’…

Again, thanks for your help.
Best wishes,
Frank

--
Frank Werner
Mail Stop 183-701, Jet Propulsion Laboratory
4800 Oak Grove Drive, Pasadena, California 91109, United States
Phone: +1 818 354-1918

From: "Werner, Frank (329D)" 
Date: Monday, October 17, 2022 at 9:42 AM
To: "arts_users.mi@lists.uni-hamburg.de" 
Subject: Custom antenna response

Dear ARTS team,

After playing around with a 1d Gaussian antenna response (using the workspace 
variable ‘AntennaConstantGaussian1D’), I now want to set a custom antenna 
pattern from actual lab measurements.

I have vectors for the zenith and azimuth angles, as well as a grid of 
normalized antenna responses for each Stokes vector element. The normalization 
follows the ARTS behavior, where the integral of the responses over all angle 
increments is 1.

Can you guys help me out with correctly using that info in ARTS? I briefly 
looked at creating a workspace variable named ‘antenna_response’ with 
‘GriddedField4’, but somehow the format confuses me. Also, I am pretty sure 
that this is not enough and there probably are more steps I need to take for 
ARTS to accept that variable as the antenna pattern.

Thanks for your help and best wishes,
Frank

--
Frank Werner
Mail Stop 183-701, Jet Propulsion Laboratory
4800 Oak Grove Drive, Pasadena, California 91109, United States
Phone: +1 818 354-1918


[arts-users] Custom antenna response

2022-10-17 Thread Werner, Frank (329D)
Dear ARTS team,

After playing around with a 1d Gaussian antenna response (using the workspace 
variable ‘AntennaConstantGaussian1D’), I now want to set a custom antenna 
pattern from actual lab measurements.

I have vectors for the zenith and azimuth angles, as well as a grid of 
normalized antenna responses for each Stokes vector element. The normalization 
follows the ARTS behavior, where the integral of the responses over all angle 
increments is 1.

Can you guys help me out with correctly using that info in ARTS? I briefly 
looked at creating a workspace variable named ‘antenna_response’ with 
‘GriddedField4’, but somehow the format confuses me. Also, I am pretty sure 
that this is not enough and there probably are more steps I need to take for 
ARTS to accept that variable as the antenna pattern.

Thanks for your help and best wishes,
Frank

--
Frank Werner
Mail Stop 183-701, Jet Propulsion Laboratory
4800 Oak Grove Drive, Pasadena, California 91109, United States
Phone: +1 818 354-1918


Re: [arts-users] Fwd: Direct radiation is subtracted when it should not

2022-10-17 Thread Manfred Brath

Hello Mengqi,


Am 17.10.22 um 16:33 schrieb Xia Mengqi:


Hi Freddy,


Thank you so much and this is very helpful! Just to make sure I fully 
understand how to use it in the code -- According to ARTS output, it 
seems I need to provide the skin temperature as well. I noticed that 
in one provided example it has "


ws.ArrayOfStringSet(ws.surface_props_names, ["Skin temperature"])
    ws.Tensor3SetConstant(ws.surface_props_data, 1, nlat, nlon, 
ws.t_field.value[0, 0, 0])"


I'm wondering if there is a simple way to do this for 1D.



so far you cannot use a 1d atmosphere for simulation with a direct 
source like the sun because the atmosphere dimension and (radiative 
transfer) geometry are coupled in ARTS. Since you have a zenith and an 
azimuth dependency for simulation with a direct source, you have to use 
a 3d atmosphere in ARTS as simulation of 1d atmospheres have only zenith 
dependency in ARTS.




Also, is it possible to just not include surface emission?
No, but you can set the surface temperature to a small value greter than 
0 K. This would have a similar effect.



Cheers,

Freddy


--
--
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


Re: [arts-users] Fwd: Direct radiation is subtracted when it should not

2022-10-17 Thread Xia Mengqi
Hi Freddy,


Thank you so much and this is very helpful! Just to make sure I fully 
understand how to use it in the code -- According to ARTS output, it seems I 
need to provide the skin temperature as well. I noticed that in one provided 
example it has "

ws.ArrayOfStringSet(ws.surface_props_names, ["Skin temperature"])
ws.Tensor3SetConstant(ws.surface_props_data, 1, nlat, nlon, 
ws.t_field.value[0, 0, 0])"

I'm wondering if there is a simple way to do this for 1D.
Also, is it possible to just not include surface emission? I'm getting a 
different result using the new setup (a correct surface and simulation in 3D) 
and I'm trying to understand where the difference comes from.

Thanks,
Mengqi


From: Manfred Brath 
Sent: Monday, October 17, 2022 2:38:24 PM
To: Xia Mengqi
Cc: Oliver Lemke
Subject: Re: Fwd: [arts-users] Direct radiation is subtracted when it should not


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 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>>

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", 

[arts-users] Fwd: Direct radiation is subtracted when it should not

2022-10-17 Thread Lemke, Oliver
Forwarding Freddy's answer to the list. :-)


> Begin forwarded message:
> 
> From: Manfred Brath 
> Subject: Re: Fwd: [arts-users] Direct radiation is subtracted when it should 
> not
> Date: 17 October 2022 at 14:38:24 CEST
> To: 
> Cc: Oliver Lemke 
> 
> 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 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 
>>> " 
>>> >> >
>>> 
>>> 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
>>>