mirror of
https://github.com/Richard-Sti/csiborgtools_public.git
synced 2025-05-13 06:01:13 +00:00
Evaluate LOS distances (#113)
* Add field_los * fix typo * add fix bug * bug fixes * Add docs * Add more docs
This commit is contained in:
parent
fc51f75e16
commit
66d9f46919
3 changed files with 289 additions and 1 deletions
|
@ -163,7 +163,7 @@ def evaluate_los(*fields, sky_pos, boxsize, rmax, dr, smooth_scales=None,
|
|||
raise ValueError("`sky_pos` must be a 2D array.")
|
||||
nsamples = len(sky_pos)
|
||||
|
||||
if rmax > 3**0.5 / 2 * boxsize:
|
||||
if rmax > 0.5 * boxsize:
|
||||
raise ValueError("The maximum radius must be within the box.")
|
||||
|
||||
# Radial positions to evaluate for each line of sight.
|
||||
|
@ -194,6 +194,8 @@ def evaluate_los(*fields, sky_pos, boxsize, rmax, dr, smooth_scales=None,
|
|||
field_interp = evaluate_cartesian(*fields, pos=pos,
|
||||
smooth_scales=smooth_scales,
|
||||
verbose=verbose)
|
||||
if len(fields) == 1:
|
||||
field_interp = [field_interp]
|
||||
|
||||
# Now we reshape the interpolated field to have the same shape as the
|
||||
# input `sky_pos`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue