-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy path__init__.py
81 lines (62 loc) · 1.89 KB
/
__init__.py
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
"""
BASpy is essentially a collection of tools for working with
large climate model data. For the most part it is a wrapper around the
Python package "Iris" although the plan is to do more with Xarray.
Iris
------
Homepage: http://scitools.org.uk/iris/
Reference: http://scitools.org.uk/iris/docs/latest/iris/iris.html
Code: https://github.com/SciTools/iris
Forums: https://groups.google.com/forum/#!forum/scitools-iris
Xarray
------
Homepage: http://xarray.pydata.org/en/stable/
BASpy
------
Created by: Scott Hosking
Contributors: Tom Bracegirdle, Tony Phillips
"""
import os, sys
### BASpy version number
__version__ = "1.1"
### Place to store catalogues and example data
__baspy_path = os.path.expanduser("~/.baspy")
if not os.path.exists(__baspy_path):
os.makedirs(os.path.expanduser(__baspy_path))
### For sharing catalogues between users
__catalogues_url = "http://gws-access.ceda.ac.uk/public/bas_climate/files/baspy/"
__catalogues_dir = "/gws/nopw/j04/bas_climate/public/files/baspy/"
###############
### Setup BASpy
###############
### Optional Libraries
try:
import iris
except ImportError:
# Iris is not installed
pass
try:
import xarray
except ImportError:
# Xarray is not installed
pass
__modules = sys.modules # must come before import baspy.util
### General Libraries
from . import util
from . import region
from . import _catalogue
catalogue = _catalogue.catalogue
get_files = _catalogue.get_files
### Set up wrappers for iris, xarray etc
if 'iris' in __modules:
from . import _iris
eg_cube = _iris.util.eg_cube
eg_cubelist = _iris.util.eg_cubelist
get_cubes = _iris.get_cubes.get_cubes
get_cube = _iris.get_cubes.get_cube
erai = _iris.erai
if 'xarray' in __modules:
from . import _xarray
eg_Dataset = _xarray.util.eg_Dataset
eg_DataArray = _xarray.util.eg_DataArray
open_dataset = _xarray.open_dataset