-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsvc_base.py
48 lines (38 loc) · 1.17 KB
/
svc_base.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
#!/usr/bin/env python
# SVC_BASE -- Base Class for the spectral data service.
__authors__ = 'Mike Fitzpatrick <fitz@noao.edu>'
__version__ = 'v1.0.0'
# Base service class.
class Service(object):
'''Base service class.
'''
def __init__(self, release=None):
self.release = release
pass
def query(self, id, fields, catalog, cond):
'''Return a CSV string of query results on the dataset.
'''
pass
def dataPath(self, id, fmt=None):
'''Return the path to the spectrum data file.
'''
pass
def previewPath(self, id):
'''Return the path to the spectrum preview plot.
'''
pass
def getData(self, fname):
'''Return the data in the named file as a numpy array.
'''
pass
def expandIDList(self, id_list):
'''Expand/convert the input id_list we get from the service call as
a string, to an array of valid identifiers for the dataset.
'''
pass
def readFile(self, fname):
'''Return the bytes in the named file.
'''
with open(fname, 'rb') as fd:
_bytes = fd.read()
return _bytes