Comments (8)
>>> import aacgmv2 as aacgm
>>> lat = [25.69817439, 17.14050096]
>>> lon = [19.184186, -4.46442997]
>>> alt = [465.28404149, 466.79848959]
>>> method = 'ALLOWTRACE|GEOCENTRIC'
>>> print(aacgm.get_aacgm_coord_arr(lat[0], lon[0], alt[0], dt.datetime(2014,12,7,16,17), method=method))
(array([21.16991252]), array([91.79687939]), array([17.81387255]))
>>> print(aacgm.get_aacgm_coord_arr(lat[1], lon[1], alt[1], dt.datetime(2014,12,7,16,17), method=method))
(array([nan]), array([nan]), array([nan]))
>>> print(aacgm.get_aacgm_coord_arr(lat, lon, alt, dt.datetime(2014,12,7,16,17), method=method))
(array([21.16991252, nan]), array([91.79687939, nan]), array([17.81387255, nan]))
I pulled the latest changes on NaN_bug_get_aacgm_coord
and this is the result, so I think this bug is addressed in that branch. Should be good to merge into the main repo!
from aacgmv2.
@johncoxon could you test #43 ? It should be good to go now.
from aacgmv2.
Hi Angeline, I've checked out origin/NaN_bug_get_aacgm_coord
and python setup.py install
'd it, and I still get the behaviour I've reported above, I'm afraid.
from aacgmv2.
The proposed bug fix actually breaks some existing behaviours, as now get_aacgm_coord_arr
returns lists rather than arrays which causes some of my existing code to need modification to cope with that; I've reverted back to master
for now so I don't have to write workarounds into my code.
from aacgmv2.
Hi @johncoxon , can you show me the results you got after installing it? I can't move forward without being able to reproduce your failure.
from aacgmv2.
The proposed bug fix actually breaks some existing behaviours, as now get_aacgm_coord_arr returns lists rather than arrays which causes some of my existing code to need modification to cope with that
Yeah, in order to do this in C, the output has to be a list. The python wrappers could cast the output as numpy arrays, and from your feedback I am guessing that would be a desired behaviour?
from aacgmv2.
Sorry, I should have said! The first now works even if I don't set allowtrace
, but the second still fails:
import aacgmv2
import datetime as dt
lat = [25.69817439, 17.14050096]
lon = [19.184186, -4.46442997]
alt = [465.28404149, 466.79848959]
method = 'geocentric|allowtrace'
print(aacgmv2.get_aacgm_coord_arr(lat[0], lon[0], alt[0], dt.datetime(2014,12,7,16,17), method=method))
for a single location, consider using convert_latlon or get_aacgm_coord
(array([21.16991252]), array([91.79687939]), array([17.81387255]))
print(aacgmv2.get_aacgm_coord_arr(lat[1], lon[1], alt[1], dt.datetime(2014,12,7,16,17), method=method))
for a single location, consider using convert_latlon or get_aacgm_coord
unable to perform vector conversion at 2014-12-07 16:17:00 using method 20: <class 'RuntimeError'>
(array([nan]), array([nan]), array([nan]))
print(aacgmv2.get_aacgm_coord_arr(lat, lon, alt, dt.datetime(2014,12,7,16,17), method=method))
unable to perform vector conversion at 2014-12-07 16:17:00 using method 20: <class 'RuntimeError'>
(array([nan, nan]), array([nan, nan]), array([nan, nan]))
I did see an error at one point which said C Error encountered: <built-in function convert_arr> returned a result with an error set
, though, if that helps: but I'm not sure why it's no longer popping up.
from aacgmv2.
Ok, I merged into develop and will prepare the version bump to major next week.
from aacgmv2.
Related Issues (20)
- Convert LatLon returning NaN HOT 1
- Installation error HOT 3
- Active or remove unused code quality tools HOT 3
- Improve unit test coverage
- Testing Python 3.7+ on Windows x64 HOT 1
- Remove Python 2 support HOT 1
- Add a zenodo.json file HOT 2
- Convert LatLong from GEO to ACGM for year 2021 HOT 2
- More use examples HOT 10
- Environment variables error in Windows HOT 7
- Lists in docstrings are unintentionally merged by Sphinx into a paragraph.
- RuntimeError when using the package HOT 5
- aacgmv2.convert_latlon_arr causes a memory leak HOT 2
- RunTime error while trying to convert geographic coordinates to geomagnetic HOT 2
- python crashes when running aacgmv HOT 1
- MAINT: remove deprecated functions
- ENH: vector transformation
- pip install aacgm2 (install fails) HOT 2
- How to use aacgmv2 beyond 2025 HOT 5
- >200x disparity in computation time between computers
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aacgmv2.