Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions build/lib/pyseidon_dvt/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/python2.7
# encoding: utf-8

from __future__ import division
import os
import sys

local = os.path.dirname(__file__)
sys.path.append(os.path.join(local,'fvcomClass'))
sys.path.append(os.path.join(local,'adcpClass'))
sys.path.append(os.path.join(local,'drifterClass'))
sys.path.append(os.path.join(local,'stationClass'))
sys.path.append(os.path.join(local,'tidegaugeClass'))
sys.path.append(os.path.join(local,'validationClass'))
sys.path.append(os.path.join(local,'utilities'))

#Local import
from utilities import *
from adcpClass import *
from drifterClass import *
from tidegaugeClass import *
from stationClass import *
from fvcomClass import *
from validationClass import *

# Custom error
from pyseidon_dvt.utilities.pyseidon_error import PyseidonError

#Permission info for OpenDap server
#print "OpenDap server connexion info:"

__version__ = '2.0'
__all__ = ["FVCOM", "ADCP", "Drifter", "TideGauge",\
"Validation", "Station", "utilities", "PyseidonError"]
__authors__ = ['Wesley Bowman, Thomas Roc, Jonathan Smith']
__licence__ = 'GNU Affero GPL v3.0'
__copyright__ = 'Copyright (c) 2014 EcoEnergyII'

10 changes: 10 additions & 0 deletions build/lib/pyseidon_dvt/adcpClass/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/python2.7
# encoding: utf-8

#Local import
from adcpClass import ADCP

__authors__ = ['Wesley Bowman, Thomas Roc, Jonathan Smith']
__licence__ = 'GNU Affero GPL v3.0'
__copyright__ = 'Copyright (c) 2014 EcoEnergyII'

67 changes: 67 additions & 0 deletions build/lib/pyseidon_dvt/adcpClass/adcpClass.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/usr/bin/python2.7
# encoding: utf-8
from __future__ import division
import numpy as np
import scipy.io as sio
import h5py

#Local import
from variablesAdcp import _load_adcp
from functionsAdcp import *
from plotsAdcp import *


class ADCP:
"""
**A class/structure for ADCP data**

Functionality structured as follows: ::

_Data. = raw matlab file data
|_Variables. = useable adcp variables and quantities
|_History = Quality Control metadata
testAdcp._|_Utils. = set of useful functions
|_Plots. = plotting functions
|_method_1
| ... = methods and analysis techniques intrinsic to ADCPs
|_method_n

Inputs:
- Only takes a file name as input, ex: testAdcp=ADCP('./path_to_matlab_file/filename')

*Notes*
Only handle fully processed ADCP matlab data previously quality-controlled as well
as formatted through "EnsembleData_FlowFile" matlab script at the mo.

Throughout the package, the following conventions apply:
- Coordinates = decimal degrees East and North
- Directions = in degrees, between -180 and 180 deg., i.e. 0=East, 90=North,
+/-180=West, -90=South
- Depth = 0m is the free surface and depth is negative
"""

def __init__(self, filename, debug=False):
""" Initialize ADCP class."""
self._debug = debug
self._origin_file = filename
if debug:
print '-Debug mode on-'
#TR_comments: find a way to dissociate raw and processed data
self.History = ['Created from ' + filename]
#TR_comments: *_Raw and *_10minavg open with h5py whereas *_davgBS
try:
self.Data = sio.loadmat(filename, struct_as_record=False, squeeze_me=True)
except NotImplementedError:
self.Data = h5py.File(filename, 'r')
#TR_comments: Initialize class structure
self.Variables = _load_adcp(self, self.History, debug=self._debug)
self.Plots = PlotsAdcp(self.Variables, debug=self._debug)
self.Utils = FunctionsAdcp(self.Variables,
self.Plots,
self.History,
debug=self._debug)

##Re-assignement of utility functions as methods
self.dump_profile_data = self.Plots._dump_profile_data_as_csv

return
Loading