Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Curved earth RefractrivityTable creates inhomogeneous array #61

Open
twybo opened this issue Mar 2, 2024 · 0 comments
Open

Curved earth RefractrivityTable creates inhomogeneous array #61

twybo opened this issue Mar 2, 2024 · 0 comments
Assignees

Comments

@twybo
Copy link

twybo commented Mar 2, 2024

Issue
Creating a radiotools.atmosphere.refractivity.RefractivityTable with curved=True throws an error by the attempt at creating an inhomogenous numpy array. In get_cached_table_curved_atmosphere, the list self._distances is appended with arrays of different sizes (distances = np.arange(...) with variable ending and fixed stepsize). Creating an array from this (line 234) throws the error.

Minimal working example

from radiotools.atmosphere import refractivity
tab = refractivity.RefractivityTable(curved=True)

for zdx, zen in enumerate(self._zeniths):
max_dist = atm.get_distance_for_height_above_ground(self._max_heigth, zen, 0)
distances = np.arange(0, max_dist, self._distance_increment)
refractivities_for_distances = np.array([self.get_refractivity_for_height_tabulated(
atm.get_height_above_ground(d, zen, observation_level=0)) for d in distances])
refractivity_integrated_table = np.cumsum(refractivities_for_distances * self._distance_increment)
self._distances.append(distances)
self._refractivity_integrated_table.append(refractivity_integrated_table)
self._distances = np.array(self._distances)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants