Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
scipy mandatory
Browse files Browse the repository at this point in the history
scipy prereq
  • Loading branch information
scivision committed Aug 29, 2018
1 parent 596b390 commit 5fd96ef
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ install_requires =
xarray
requests
python-dateutil
scipy>=0.17
cdflib>=0.3.6

[options.extras_require]
Expand All @@ -52,7 +53,6 @@ io =
netcdf4
h5py
fov =
scipy>=0.17
histutils
pymap3d
cameras =
Expand Down
1 change: 0 additions & 1 deletion tests/test_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ def test_read_timereq():

@pytest.mark.filterwarnings('ignore:Not able to verify number of bytes from header')
def test_calread_idl():
pytest.importorskip('scipy')

cal1 = ta.loadcal(cal1fn)

Expand Down
11 changes: 3 additions & 8 deletions themisasi/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import numpy as np
from dateutil.parser import parse
import cdflib
import scipy.io
try:
import h5py
except ImportError:
Expand All @@ -19,10 +20,7 @@
from netCDF4 import Dataset
except ImportError:
Dataset = None
try:
from scipy.io import readsav
except ImportError:
readsav = None


Epoch = cdflib.cdfepoch()

Expand Down Expand Up @@ -180,11 +178,8 @@ def loadcal(fn: Path, imgs: xarray.Dataset=None) -> xarray.Dataset:
x = y = h[f'thg_asf_{site}_c256']
time = datetime.utcfromtimestamp(h[f'thg_asf_{site}_time'][-1])
elif fn.suffix == '.sav':
if readsav is None:
raise ImportError('pip install scipy')

site = fn.name.split('_')[2]
h = readsav(fn, python_dict=True, verbose=False)
h = scipy.io.readsav(fn, python_dict=True, verbose=False)
az = h['skymap']['full_azimuth'][0]
el = h['skymap']['full_elevation'][0]
lat = h['skymap']['site_map_latitude'].item()
Expand Down

0 comments on commit 5fd96ef

Please sign in to comment.