infresnel — API Reference
- infresnel.infresnel.calculate_paths(src_lat, src_lon, rec_lat, rec_lon, dem_file=None, full_output=False)
Calculate elevation profiles, direct paths, and shortest diffracted paths.
Paths are calculated for a given DEM (either a user-supplied dem_file or automatically downloaded 1 arc-second SRTM data) and an arbitrary number of source-receiver pairs. By default, the function returns only the path length differences. If full_output is set to True, then the complete path information (lengths, coordinates, etc.) and the DEM used are returned.
Note
Input coordinates are expected to be in the WGS 84 datum. DEM file vertical units are expected to be meters.
- Parameters
rec_lat (int, float, list, tuple, or
ndarray
) – One or more receiver latitudesrec_lon (int, float, list, tuple, or
ndarray
) – One or more receiver longitudesdem_file (str or None) – Path to DEM file (if None, then SRTM data are used)
full_output (bool) – Toggle outputting full profile/path information and DEM, vs. just the path length differences
- Returns
If full_output is False — an
ndarray
of path length differences [m], one per source-receiver pairIf full_output is True — a tuple of the form
(ds_list, dem)
whereds_list
is a list ofDataset
objects, one per source-receiver pair, containing full profile and path information, anddem
is aDataArray
containing the UTM-projected DEM used to compute the profiles
- infresnel.infresnel.calculate_paths_grid(src_lat, src_lon, x_radius, y_radius, spacing, dem_file=None, output_file=None)
Calculate paths for a UTM-projected grid surrounding a source location.
Wrapper around
calculate_paths()
for computing path difference grids. See the docstring for that function for a description of how DEM data are handled.Note
Input coordinates are expected to be in the WGS 84 datum. DEM file vertical units are expected to be meters.
- Parameters
x_radius (int, float, list, or tuple) – [m] Desired grid radius in \(x\)-direction, measured from source location (specify a two-element array for different west and east extents)
y_radius (int, float, list, or tuple) – [m] Desired grid radius in \(y\)-direction, measured from source location (specify a two-element array for different south and north extents)
dem_file (str or None) – Path to DEM file (if None, then SRTM data are used)
output_file (str or None) – If a string filepath is provided, then an RGB GeoTIFF file containing the colormapped grid of path length difference values is exported to this filepath (no export if None)
- Returns
Tuple of the form
(path_length_differences, dem)
wherepath_length_differences
is aDataArray
grid of path length differences [m], anddem
is aDataArray
containing the UTM-projected DEM used to compute the profiles- Return type