Giter VIP home page Giter VIP logo

radiotools's People

Contributors

anelles avatar cg-laser avatar christophwelling avatar fschlueter avatar jean1995 avatar mijnheerd avatar relamber avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

radiotools's Issues

Implementing continuous Integration

Since we have implemented some basic unittests so far, we should implement CI to exploit the full power of these tests.
When I have some free time I will give it a shot and will try to start with one of the most common CI's (e.g. something like travis ci). At the beginning only some simple routines are needed I think.
Any objections @cg-laser ?

Incompatible with Python3.11

Executing from radiotools import helper on Python3.11 fails with

>>> from radiotools import helper
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/homebrew/lib/python3.11/site-packages/radiotools/helper.py", line 4, in <module>
    from radiotools.atmosphere import models as atm
  File "/opt/homebrew/lib/python3.11/site-packages/radiotools/atmosphere/models.py", line 3, in <module>
    from past.builtins import xrange
  File "/opt/homebrew/lib/python3.11/site-packages/past/builtins/__init__.py", line 43, in <module>
    from past.builtins.noniterators import (filter, map, range, reduce, zip)
  File "/opt/homebrew/lib/python3.11/site-packages/past/builtins/noniterators.py", line 24, in <module>
    from past.types import basestring
  File "/opt/homebrew/lib/python3.11/site-packages/past/types/__init__.py", line 25, in <module>
    from .oldstr import oldstr
  File "/opt/homebrew/lib/python3.11/site-packages/past/types/oldstr.py", line 5, in <module>
    from collections import Iterable
ImportError: cannot import name 'Iterable' from 'collections' (/opt/homebrew/Cellar/[email protected]/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/collections/__init__.py)

Bug in coordinatesystems.py

When running: the test code in coordinatesystems.py (python2 radiotools/coordinatesystems.py)

File "radiotools/coordinatesystems.py", line 138, in transform_to_vxB_vxvxB nX, nY = station_position.shape ValueError: need more than 1 value to unpack
This happens when transforming a single station position.
Line 143 looks like it should catch this case (array with shape (3,)) however it never reaches this point.
if(len(station_position.shape) == 1):
Adding somethink like
# if a single station position is transformed: (3,) -> (1, 3) if station_position.ndim == 1: station_position = np.expand_dims(station_position, axis=0)
would solve this issue. However than the test code does not return same values for the vector is both coordinate systems (are they supposed to do that?).

Documentation is confusing on use of rad/degrees

The homepage mentions that the default unit for angles is radians, however everywhere in the documentation and examples degrees are used. This is particularly confusing when looking at the documentation of the __init__ function for cstrafo, where the zenith and azimuth descriptions are in degrees. If this could be updated to use radians instead, it would help first time users like me tremendously ๐Ÿ‘๐Ÿฝ

Package doesn't install nicely on Python 3.9

I was trying to install the latest version in my Python 3.9 virtual environment, but kept getting this error:

ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+

Even though I downgraded my urllib package to version 1.26.6. After digging around for a while I managed to track down the issue to the project's TOML file. With TOML files, an isolated build environment is created. In this build environment, urllib v2.0+ was installed, leading to the crash. A simple fix for this is to add the build requirement "urllib3 < 2.0".

Can this be added or does this potentially cause (security) issues?

Enable radiotools for python 3

Hi,
this might be a good place to share opinions about the conversion to a python 2 and 3 compatible library?!
I started a corresponding branch! Please share any opinion.

Curved earth RefractrivityTable creates inhomogeneous array

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)

Using "observation_level" in get_atmosphere() throughout the models.py

Hi @cg-laser,
this is related to the merged PR #38. The observation level have to be used consistently in functions like:
_get_vertical_height_numeric or _get_distance_xmax. Do you agree?
What I do not quite see is how that effects the calculation via taylor expansions. It is necessary to just include the obersvation_level there too? Or does one need to repeat the determination of the used parameter.
Cheers

While instead of if?

Hi @cg-laser,
is there a reason why using while in the code below:

helpers.py:

def get_normalized_angle(angle, degree=False, interval=np.deg2rad([0, 360])): import collections if degree: interval = np.rad2deg(interval) delta = interval[1] - interval[0] if(isinstance(angle, (collections.Sequence, np.ndarray))): angle[angle >= interval[1]] -= delta angle[angle < interval[0]] += delta else: while (angle >= interval[1]): angle -= delta while (angle < interval[0]): angle += delta return angle

PS: is there a better way to reference code from the repo?

Missing module depenencies

On a fresh install of a python environment with Python 3.10.12 and pip 22.0.2 and installing this project via pip install radiotools

importing radiotools fails with

ModuleNotFoundError: No module named 'past'
ModuleNotFoundError: No module named 'scipy'

add

Py2 CI fails

It seems that on the last PR merged the py2 pipeline failed. However the failure seemed not to be related to the changes (based on the log). Or are they? Regardless of this. Is it worth keeping py2 compatibility and the checks or should we remove them?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.