Giter Club home page Giter Club logo

Comments (8)

johncoxon avatar johncoxon commented on September 17, 2024 1
>>> 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.

aburrell avatar aburrell commented on September 17, 2024

@johncoxon could you test #43 ? It should be good to go now.

from aacgmv2.

johncoxon avatar johncoxon commented on September 17, 2024

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.

johncoxon avatar johncoxon commented on September 17, 2024

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.

aburrell avatar aburrell commented on September 17, 2024

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.

aburrell avatar aburrell commented on September 17, 2024

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.

johncoxon avatar johncoxon commented on September 17, 2024

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.

aburrell avatar aburrell commented on September 17, 2024

Ok, I merged into develop and will prepare the version bump to major next week.

from aacgmv2.

Related Issues (20)

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.