forked from rflrob/YildizLabCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
executable file
·54 lines (45 loc) · 1.89 KB
/
__init__.py
File metadata and controls
executable file
·54 lines (45 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#This is the configuration file for the pyfits namespace. This is needed
#because we have the option of using either a numarray or numpy version
#of pyfits.
#This option is controlled by the NUMERIX environment variable. Set NUMERIX
#to 'numarray' for the numarray version of pyfits. Set NUMERIX to 'numpy'
#for the numpy version of pyfits.
#If only one array package is installed, that package's version of pyfits
#will be imported. If both packages are installed the NUMERIX value is
#used to decide between the packages. If no NUMERIX value is set then
#the numpy version of pyfits will be imported.
#Anything else is an exception.
import os
__version__ = '2.2.2'
# Check the environment variables for NUMERIX
try:
numerix = os.environ["NUMERIX"]
except:
numerix = 'numpy'
if (numerix == 'numarray'):
try :
from NA_pyfits import *
import NA_pyfits as core
__doc__ = NA_pyfits.__doc__
except ImportError, e:
raise ImportError, `e` + ". Cannot import numarray version of PyFITS!"
else:
try:
try:
from NP_pyfits import *
import NP_pyfits as core
__doc__ = NP_pyfits.__doc__
except ImportError:
try:
from NA_pyfits import *
import NA_pyfits as core
doc__ = NA_pyfits.__doc__
except ImportError, e:
raise ImportError, `e` + ". Cannot import either numpy or numarray."
except Exception, e:
raise ImportError, `e` + ". No usable array package has been found. Cannot import either numpy or numarray."
_locals = locals().keys()
for n in _locals[::-1]:
if n[0] == '_' or n in ('re', 'os', 'tempfile', 'exceptions', 'operator', 'num', 'ndarray', 'chararray', 'rec', 'objects', 'Memmap', 'maketrans', 'open'):
_locals.remove(n)
__all__ = _locals