Exposed AvPowerSpectra explicitly. Comment improvements. Line breakages, etc. Added 10s and infinite to TimeWeighting types.

This commit is contained in:
Anne de Jong 2019-03-28 21:26:11 +01:00
parent 86211b8505
commit 23fc4c9259
5 changed files with 54 additions and 6 deletions

View File

@ -34,3 +34,37 @@ additional documentation (the math behind it). This will be published
in a sister repository in a later stage. in a sister repository in a later stage.
If you have any question(s), please feel free to contact us: info@ascee.nl. If you have any question(s), please feel free to contact us: info@ascee.nl.
## Installation
### Compilation
#### Archlinux
Compiling the code on Archlinux requires the following packages to be available:
- openblas-lapack (AUR)
- Python 3.7
- Numpy (Python-numpy)
- Cython
#### Ubuntu / Linux Mint
*Only tested with Linux Mint 18.04*, we require the following packages for
compilation:
- build-essential
- cython
- python3-numpy
- libopenblas
- libclalsadrv-dev
- libopenblas-base
- libopenblas-dev
### Dependencies
#### Ubuntu / Linux Mint
*Only tested with Linux Mint 18.04*. The following Dependencies are required
for Ubuntu:

View File

@ -0,0 +1,8 @@
from .lasp_atomic import *
from .lasp_avstream import *
from .lasp_common import *
from .lasp_measurement import *
from .lasp_octavefilter import *
from .lasp_slm import *
from .lasp_weighcal import *
from .wrappers import *

View File

@ -7,6 +7,7 @@ Common definitions used throughout the code.
""" """
__all__ = ['P_REF', 'FreqWeighting', 'TimeWeighting', 'getTime', 'calfile', __all__ = ['P_REF', 'FreqWeighting', 'TimeWeighting', 'getTime', 'calfile',
'getFreq',
'W_REF', 'U_REF', 'I_REF'] 'W_REF', 'U_REF', 'I_REF']
# Reference sound pressure level # Reference sound pressure level
@ -53,9 +54,11 @@ class TimeWeighting:
none = (None, 'Raw (no time weighting)') none = (None, 'Raw (no time weighting)')
uufast = (1e-4, '0.1 ms') uufast = (1e-4, '0.1 ms')
ufast = (30e-3, '30 ms') ufast = (30e-3, '30 ms')
fast = (0.125, 'Fast') fast = (0.125, 'Fast (0.125 s)')
slow = (1.0, 'Slow') slow = (1.0, 'Slow (1.0 s)')
types = (none, uufast, ufast, fast, slow) tens = (10, '10 s')
infinite = (np.Inf, 'Infinite')
types = (none, uufast, ufast, fast, slow, tens, infinite)
default = 2 default = 2
@staticmethod @staticmethod

View File

@ -1,8 +1,10 @@
""" """
This file contains the Cython wrapper functions to This file contains the Cython wrapper functions to C implementations.
""" """
include "config.pxi" include "config.pxi"
__all__ = ['AvPowerSpectra']
setTracerLevel(15) setTracerLevel(15)
cdef extern from "cblas.h": cdef extern from "cblas.h":
int openblas_get_num_threads() int openblas_get_num_threads()

View File

@ -5,7 +5,7 @@ Created on Tue Aug 14 12:49:27 2018
@author: J.A. de Jong - ASCEE @author: J.A. de Jong - ASCEE
Description: calibrate device using measurement Description: apply calibration to measurement files.
""" """
import numpy as np import numpy as np
@ -28,7 +28,8 @@ parser.add_argument('--gain-setting', '-g',
parser.add_argument( parser.add_argument(
'fn', help='File name of calibration measurement', type=str) 'fn', help='File name of calibration measurement', type=str)
parser.add_argument('--channel', help='Channel of the device to calibrate, default = 0', parser.add_argument('--channel', help='Channel of the device to calibrate, '
+ 'default = 0',
type=int, default=0) type=int, default=0)
parser.add_argument('--spl', '-s', help='Applied sound pressure level to the' parser.add_argument('--spl', '-s', help='Applied sound pressure level to the'