atm_layers#
- pycraf.atm.atm_layers(freq_grid, profile_func, heights=None)[source]#
Calculate physical parameters for atmospheric layers to be used with
atten_slant_annex1
and other functions of theatm
sub-package.This can be used to cache layer-profile data. Since it is only dependent on frequency, one can re-use it to save computing time when doing batch jobs (e.g., atmospheric dampening for each pixel in a map).
- Parameters:
- freq_grid
Quantity
Frequencies at which to calculate the layer properties [GHz]
- profile_func
func
A height profile function having the same signature as
profile_standard
- heights
Quantity
[km
], optional Layer heights (above ground); see Notes [km]
- freq_grid
- Returns:
- atm_layers_cache
dict
Pre-computed physical parameters for each atmopheric layer to be used by functions
raytrace_path
,path_endpoint
, andatten_slant_annex1
. It contains the following keys:“space_i” : int
Layer (edge) index of the top atmospheric layer, before space begins. (See Notes.)
“max_i” : int
Layer (edge) index of the outermost layer (can be in space). (See Notes.)
“freq_grid” :
ndarray
(float)Frequencies at which to calculate the layer properties [GHz]
“heights” :
ndarray
(float)Layer heights above ground (lower edges) [km]
“radii” :
ndarray
(float)Layer distances to Earth center (lower edges) [km]
“temp” :
ndarray
(float)Layer temperatures (at layer mid point) [K]
“press” :
ndarray
(float)Layer pressure (at layer mid point) [hPa]
“press_w” :
ndarray
(float)Layer water pressure (at layer mid point) [hPa]
“ref_index” :
ndarray
(float)Layer refractive index (at layer mid point) [dimless]
“atten_dry_db” :
ndarray
(float)Layer specific attenuation (dry; at layer mid point) [dB/km]
“atten_wet_db” :
ndarray
(float)Layer specific attenuation (wet; at layer mid point) [dB/km]
“atten_db” :
ndarray
(float)Layer specific attenuation (total; at layer mid point) [dB/km]
- atm_layers_cache
Notes
One should usually stick to the default layer heights (as defined in ITU-R Rec. P.676-11) to ensure consistency with other software/results.
The layer heights are actually the layer edges, while the physical quantities are calculated at the mid-points of the layers and only up to the maximal height of the atmospheric profile function, i.e.:
>>> import numpy as np >>> from pycraf import atm >>> from astropy import units as u >>> >>> atm_layers_cache = atm.atm_layers(1 * u.GHz, atm.profile_standard) >>> len(atm_layers_cache['heights']) 908 >>> len(atm_layers_cache['temp']) 901
This is also stored in the
space_i
variable:>>> atm_layers_cache['space_i'] 900
while the index of the last layer edge is stored in
max_i
:>>> atm_layers_cache['max_i'] 907
In contrast to P.676 we add outer-space layers (scaled for LEO, moon, solar-sys and deep-space “heights”) to allow correct path determination, e.g. for satellites. Of course, these don’t add attenuation (and have refractivity One).