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

Daily Ap index using get_Ap() and get_space_indices() #80

Closed
sxd190026 opened this issue May 17, 2022 · 0 comments
Closed

Daily Ap index using get_Ap() and get_space_indices() #80

sxd190026 opened this issue May 17, 2022 · 0 comments

Comments

@sxd190026
Copy link

I am trying to use NRLMSIS for getting neutral density, where daily Ap index is one of the arguments. I am trying to use the function "get_Ap" as given below:

get_Ap(date_to_jd(DateTime(2019,1,1,0,0,0)); mean = (), daily=true)
but it generates the following error message:

IndexError: <PyCall.jlwrap (in a Julia function called from Python)
JULIA: BoundsError: attempt to access 1216-element interpolate((::Vector{Float64},), ::Vector{StaticArrays.SVector{8, Float64}}, Gridded(Constant{Interpolations.Nearest}())) with element type StaticArrays.SVector{8, Float64} at index [2.4584845e6]
Stacktrace:
[1] throw_boundserror(A::Interpolations.GriddedInterpolation{StaticArrays.SVector{8, Float64}, 1, StaticArrays.SVector{8, Float64}, Interpolations.Gridded{Interpolations.Constant{Interpolations.Nearest, Interpolations.Throw{Interpolations.OnGrid}}}, Tuple{Vector{Float64}}}, I::Tuple{Float64})
@ Base ./abstractarray.jl:691
[2] GriddedInterpolation
@ ~/.julia/packages/Interpolations/y4lLj/src/gridded/indexing.jl:3 [inlined]
[3] get_Ap(JD::Float64; mean::Tuple{}, daily::Bool)
@ SatelliteToolbox ~/.julia/packages/SatelliteToolbox/EKFPG/src/earth/space_indices/wdcfiles.jl:91
[4] top-level scope
@ none:3
[5] eval
@ ./boot.jl:373 [inlined]
[6] eval
@ ./Base.jl:68 [inlined]
[7] (::var"#73#74")(globals::PyObject, locals::PyObject)
@ Main ~/.local/lib/python3.9/site-packages/julia/pyjulia_helper.jl:91
[8] (::PyCall.FuncWrapper{Tuple{PyObject, PyObject}, var"#73#74"})(::PyObject, ::Vararg{PyObject}; kws::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ PyCall ~/.julia/packages/PyCall/7a7w0/src/callback.jl:56
[9] (::PyCall.FuncWrapper{Tuple{PyObject, PyObject}, var"#73#74"})(::PyObject, ::Vararg{PyObject})
@ PyCall ~/.julia/packages/PyCall/7a7w0/src/callback.jl:56
[10] invokelatest(::Any, ::Any, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Base ./essentials.jl:716
[11] invokelatest(::Any, ::Any, ::Vararg{Any})
@ Base ./essentials.jl:714
[12] pyjlwrap_call(f::PyCall.FuncWrapper{Tuple{PyObject, PyObject}, var"#73#74"}, args::Ptr{PyCall.PyObject_struct}, kw_::Ptr{PyCall.PyObject_struct})
@ PyCall ~/.julia/packages/PyCall/7a7w0/src/callback.jl:28
[13] pyjlwrap_call(self_::Ptr{PyCall.PyObject_struct}, args_::Ptr{PyCall.PyObject_struct}, kw_::Ptr{PyCall.PyObject_struct})
@ PyCall ~/.julia/packages/PyCall/7a7w0/src/callback.jl:44>

I tried the same using get_space_index(Ap(),date_to_jd(DateTime(2019,1,1,0,0,0))), however that runs into error as well.

RuntimeError: <PyCall.jlwrap (in a Julia function called from Python)
JULIA: The data for the requested Julian Day is not available!
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:33
[2] get_space_index
@ ~/.julia/packages/SatelliteToolbox/EKFPG/src/earth/space_indices/space_indices.jl:43 [inlined]
[3] get_space_index(#unused#::Val{:Ap}, JD::Float64)
@ SatelliteToolbox ~/.julia/packages/SatelliteToolbox/EKFPG/src/earth/space_indices/space_indices.jl:156
[4] top-level scope
@ none:3
[5] eval
@ ./boot.jl:373 [inlined]
[6] eval
@ ./Base.jl:68 [inlined]
[7] (::var"#77#78")(globals::PyObject, locals::PyObject)
@ Main ~/.local/lib/python3.9/site-packages/julia/pyjulia_helper.jl:91
[8] (::PyCall.FuncWrapper{Tuple{PyObject, PyObject}, var"#77#78"})(::PyObject, ::Vararg{PyObject}; kws::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ PyCall ~/.julia/packages/PyCall/7a7w0/src/callback.jl:56
[9] (::PyCall.FuncWrapper{Tuple{PyObject, PyObject}, var"#77#78"})(::PyObject, ::Vararg{PyObject})
@ PyCall ~/.julia/packages/PyCall/7a7w0/src/callback.jl:56
[10] invokelatest(::Any, ::Any, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Base ./essentials.jl:716
[11] invokelatest(::Any, ::Any, ::Vararg{Any})
@ Base ./essentials.jl:714
[12] pyjlwrap_call(f::PyCall.FuncWrapper{Tuple{PyObject, PyObject}, var"#77#78"}, args::Ptr{PyCall.PyObject_struct}, kw_::Ptr{PyCall.PyObject_struct})
@ PyCall ~/.julia/packages/PyCall/7a7w0/src/callback.jl:28
[13] pyjlwrap_call(self_::Ptr{PyCall.PyObject_struct}, args_::Ptr{PyCall.PyObject_struct}, kw_::Ptr{PyCall.PyObject_struct})
@ PyCall ~/.julia/packages/PyCall/7a7w0/src/callback.jl:44>

Am I doing something wrong? Would be a great if someone can suggest a way out of this.
I am using PyJulia to write Julia codes in IPython environment

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

1 participant