Skip to content

Commit

Permalink
Add function to aggregate dts data from cable sections.
Browse files Browse the repository at this point in the history
  • Loading branch information
foobarbecue committed Jul 21, 2015
1 parent 323ec4e commit 2c01ba8
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions cblutls.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class Cable():
Polyline files should end in .txt, and distance reference files should end in .dtr.
See cblutls.CableSection class for details of file formats.
'''
def __init__(self, polyline_dirpath, **kwargs):
def __init__(self, polyline_dirpath, dts_data_dirpath=None, **kwargs):
self.sections=[]
for polyline_filepath in glob2.glob(polyline_dirpath + '*.txt'):
self.sections.append(CableSection(
Expand All @@ -74,7 +74,16 @@ def plot_w_mpl(self, ax=None):
def plot_w_mayavi(self):
for section in self.sections:
section.plot_w_mayavi(colorbar=False)
mlab.colorbar()
mlab.colorbar()

def get_dts_data(self):
'''
Combines the dts data from all the cable sections into one dataframe
'''
dd = self.sections[0].dts_data
for section in self.sections[1:]:
dd = dd.combine_first(section.dts_data)
return dd

class CableSection():
'''
Expand Down

0 comments on commit 2c01ba8

Please sign in to comment.