-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merged devel-1.0 changes and reorganization into ticket69 branch. Mer…
…ge conflicts defaulted to devel-1.0 blocks
- Loading branch information
Showing
91 changed files
with
201,469 additions
and
867 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,79 @@ | ||
from ._version import __version__ | ||
from ._version import __build__ | ||
from ._global import * | ||
from ._global import * | ||
|
||
import mosaic.utilities | ||
|
||
import mosaic.commonExceptions | ||
import mosaic.errors | ||
# import mosaic.zmqIO | ||
import mosaic.settings | ||
|
||
import mosaic.trajio.metaTrajIO | ||
import mosaic.partition.metaEventPartition | ||
import mosaic.process.metaEventProcessor | ||
import mosaic.filters.metaIOFilter | ||
import mosaic.mdio.metaMDIO | ||
|
||
import mosaic.trajio.qdfTrajIO | ||
import mosaic.trajio.binTrajIO | ||
import mosaic.trajio.abfTrajIO | ||
import mosaic.trajio.tsvTrajIO | ||
|
||
import mosaic.filters.besselLowpassFilter | ||
import mosaic.filters.convolutionFilter | ||
import mosaic.filters.waveletDenoiseFilter | ||
|
||
import mosaic.partition.eventSegment | ||
|
||
import mosaic.process.adept | ||
import mosaic.process.adept2State | ||
import mosaic.process.cusumPlus | ||
import mosaic.process.singleStepEvent | ||
|
||
import mosaic.mdio.sqlite3MDIO | ||
|
||
import mosaic.apps.ConvertTrajIO | ||
import mosaic.apps.SingleChannelAnalysis | ||
|
||
from mosaic.utilities.mosaicLogging import mosaicExceptionHandler | ||
|
||
import sys | ||
|
||
sys.excepthook=mosaicExceptionHandler | ||
|
||
__all__=[] | ||
|
||
__all__.extend(mosaic.utilities.__all__) | ||
|
||
__all__.extend(mosaic.commonExceptions.__all__) | ||
__all__.extend(mosaic.errors.__all__) | ||
# __all__.extend(mosaic.zmqIO.__all__) | ||
__all__.extend(mosaic.settings.__all__) | ||
|
||
__all__.extend(mosaic.trajio.metaTrajIO.__all__) | ||
__all__.extend(mosaic.partition.metaEventPartition.__all__) | ||
__all__.extend(mosaic.process.metaEventProcessor.__all__) | ||
__all__.extend(mosaic.filters.metaIOFilter.__all__) | ||
__all__.extend(mosaic.mdio.metaMDIO.__all__) | ||
|
||
__all__.extend(mosaic.trajio.qdfTrajIO.__all__) | ||
__all__.extend(mosaic.trajio.binTrajIO.__all__) | ||
__all__.extend(mosaic.trajio.abfTrajIO.__all__) | ||
__all__.extend(mosaic.trajio.tsvTrajIO.__all__) | ||
|
||
__all__.extend(mosaic.filters.besselLowpassFilter.__all__) | ||
__all__.extend(mosaic.filters.convolutionFilter.__all__) | ||
__all__.extend(mosaic.filters.waveletDenoiseFilter.__all__) | ||
|
||
__all__.extend(mosaic.partition.eventSegment.__all__) | ||
|
||
__all__.extend(mosaic.process.adept.__all__) | ||
__all__.extend(mosaic.process.adept2State.__all__) | ||
__all__.extend(mosaic.process.cusumPlus.__all__) | ||
__all__.extend(mosaic.process.singleStepEvent.__all__) | ||
|
||
__all__.extend(mosaic.mdio.sqlite3MDIO.__all__) | ||
|
||
__all__.extend(mosaic.apps.ConvertTrajIO.__all__) | ||
__all__.extend(mosaic.apps.SingleChannelAnalysis.__all__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
# Control global settings | ||
DeveloperMode=False | ||
Logging=False | ||
DeveloperMode=False # Turn on developer options. | ||
|
||
CodeProfiling='summary' # Either 'summary' to print a summary at the end of a run, | ||
# 'none' for not timing, or | ||
# 'all' to print timing of every function call profiled. | ||
LogProperties=False # Log all class properties defined with mosaic_property. | ||
LogSizeBytes=int(2<<20) # 2 MB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,21 +5,24 @@ | |
:Author: Arvind Balijepalli <[email protected]> | ||
:License: See LICENSE.TXT | ||
""" | ||
__docformat__ = 'restructuredtext' | ||
|
||
import itertools | ||
import string | ||
|
||
from mosaic.metaTrajIO import EmptyDataPipeError | ||
from mosaic.trajio.metaTrajIO import EmptyDataPipeError | ||
from mosaic.utilities.resource_path import format_path | ||
import numpy | ||
import pandas as pd | ||
|
||
__all__ = ["ConvertTrajIO"] | ||
|
||
class ConvertToCSV(object): | ||
class ConvertTrajIO(object): | ||
""" | ||
Convert data read from a sub-class of metaTrajIO to a comma separated text file | ||
Convert data from a sub-class of metaTrajIO to either a delimited text file or binary file format. | ||
:Parameters: | ||
- `trajDataObj` : a trajIO data object | ||
- `outdir` : the output directory. Default is *None*, which causes the output to be saved in the same directory as the input data. | ||
- `extension` : 'csv' for comma separated values (default), 'tsv' for tab separated values, or 'bin' for 64-bit double precision binary. | ||
""" | ||
def __init__(self, trajDataObj, outdir=None, extension="csv"): | ||
self.trajDataObj=trajDataObj | ||
|
@@ -35,6 +38,12 @@ def __init__(self, trajDataObj, outdir=None, extension="csv"): | |
|
||
self.filePrefix=None | ||
self._creategenerator() | ||
|
||
self._outputFormat={ | ||
"csv" : ('to_csv', {'sep': ',', 'header' : False}), | ||
"tsv" : ('to_csv', {'sep': '\t', 'header' : False}) | ||
} | ||
|
||
|
||
def Convert(self, blockSize): | ||
""" | ||
|
@@ -45,7 +54,15 @@ def Convert(self, blockSize): | |
""" | ||
try: | ||
while(True): | ||
(self.trajDataObj.popdata(blockSize)).tofile(self._filename(), sep=',') | ||
|
||
|
||
if self.extension=="bin": | ||
numpy.array(self.trajDataObj.popdata(blockSize), dtype=numpy.float64).tofile(self._filename(), sep="") | ||
else: | ||
dat=pd.DataFrame(self.trajDataObj.popdata(blockSize)) | ||
f=self._outputFormat[self.extension] | ||
|
||
getattr(dat, f[0])(self._filename(), index=False, **f[1]) | ||
except EmptyDataPipeError: | ||
pass | ||
|
||
|
@@ -73,6 +90,20 @@ def _filename(self): | |
""" | ||
self._creategenerator() | ||
|
||
return self.outDir+'/'+next(self.fileGenerator)+'.'+self.extension | ||
return format_path(self.outDir+'/'+next(self.fileGenerator)+'.'+self.extension) | ||
|
||
|
||
if __name__ == '__main__': | ||
import mosaic.trajio.qdfTrajIO as qdfTrajIO | ||
|
||
for ext in ['bin','csv','tsv']: | ||
q=qdfTrajIO.qdfTrajIO(dirname='data', filter='*qdf', Rfb=9.1e9, Cfb=1.07e-12) | ||
ConvertTrajIO( | ||
q, | ||
outdir='data', | ||
extension=ext | ||
).Convert(100000) | ||
|
||
|
||
print numpy.fromfile('data/SingleChan-0001_1.bin')[:5] | ||
print numpy.hstack(numpy.fromfile('data/SingleChan-0001_1.csv', sep='\n'))[:5] | ||
print numpy.hstack(numpy.fromfile('data/SingleChan-0001_1.tsv', sep='\t'))[:5] |
Oops, something went wrong.