Skip to content
Snippets Groups Projects
Commit 8abef62d authored by Luise Odenthal's avatar Luise Odenthal
Browse files

stuff from todo list

parent 31d2f3cf
No related branches found
No related tags found
No related merge requests found
...@@ -149,8 +149,9 @@ It creates three sql table on initialisation. ...@@ -149,8 +149,9 @@ It creates three sql table on initialisation.
self.db_cursor = self.db.cursor() self.db_cursor = self.db.cursor()
for tablename, _ in self.tablecolumns.items(): for tablename, _ in self.tablecolumns.items():
if not self.table_exist(tablename): if not self.table_exist(tablename):
raise Exception('{} does not contain a table named {}'.format( raise Exception('{} does not contain\
filename, tablename)) a table named {}'.format(
filename, tablename))
elif self.create(): elif self.create():
# Create database # Create database
self.db = sqlite3.connect( self.db = sqlite3.connect(
...@@ -365,8 +366,9 @@ database ...@@ -365,8 +366,9 @@ database
if not len(image.shape) == 3: if not len(image.shape) == 3:
raise Exception('image should be 3D array') raise Exception('image should be 3D array')
if not image.shape[2] == len(self.channels): if not image.shape[2] == len(self.channels):
raise Exception('image does not have the required number of channels {}'.format( raise Exception('image does not have the\
len(self.channels))) required number of channels {}'.format(
len(self.channels)))
if not isinstance(cmaxminrange, pd.Series): if not isinstance(cmaxminrange, pd.Series):
raise TypeError('cmaxminrange should be a pandas Series') raise TypeError('cmaxminrange should be a pandas Series')
denormed_im = np.zeros(image.shape, dtype=np.float) denormed_im = np.zeros(image.shape, dtype=np.float)
...@@ -382,7 +384,8 @@ database ...@@ -382,7 +384,8 @@ database
cimage += cmin cimage += cmin
denormed_im[:, :, chan_i] = cimage denormed_im[:, :, chan_i] = cimage
if not np.max(cimage) == cmax: if not np.max(cimage) == cmax:
raise Exception('denormalisation failed {}!={}'.format(np.max(cimage), cmax)) raise Exception('denormalisation failed\
{}!={}'.format(np.max(cimage), cmax))
return denormed_im return denormed_im
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment