Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Manifest.toml
.CondaPkg
themis_data/thd/l2/fgm/2020/thd_l2_fgm_20200420_v01.cdf
themis_data
omni_data
3 changes: 3 additions & 0 deletions CondaPkg.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[deps]
NetCDF4 = ""

[pip.deps]
pyspedas = "@git+https://github.com/spedas/pyspedas"
7 changes: 7 additions & 0 deletions src/PySPEDAS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,17 @@ const TnamesType = Union{AbstractArray, Tuple}

const pyspedas = pynew()
const pyns = pynew()
const data_quants = pynew()

function __init__()
PythonCall.pycopy!(pyspedas, pyimport("pyspedas"))
PythonCall.pycopy!(pyns, pyimport("numpy").timedelta64(1, "ns"))
try
PythonCall.pycopy!(data_quants, pyimport("pyspedas.tplot_tools").data_quants)
catch
# for older versions
PythonCall.pycopy!(data_quants, pyimport("pytplot").data_quants)
end
return
end

Expand Down
2 changes: 1 addition & 1 deletion src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct TplotVariable{T, N} <: AbstractDataVariable{T, N}
end

function TplotVariable(name)
py = @pyconst(pyimport("pytplot").data_quants)[String(name)]
py = data_quants[String(name)]
data = PyArray(py.data; copy = false)
return TplotVariable(Symbol(name), data, py)
end
Expand Down
Loading