Commit 60672973 authored by Semih Demir's avatar Semih Demir
Browse files

Merge branch 'master' of https://gitlab.seismo.ethz.ch/doetschj/DUG-Seis

Merge with new accquisition.
parents 4c2e7104 1cbcfb68
......@@ -50,11 +50,11 @@ Acquisition:
sampling_frequency: 200000 # in Hz
gain_selection : [10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000]
asdf_settings:
use_float32 : False # select between int32 and float32 as asdf data format
data_folder : 'e:/20190206_sw_test/'
data_folder_tmp : 'e:/20190206_sw_test/tmp/'
save_mV : False # save_mV = true uses float32 and results in much larger asdf file sizes
data_folder : 'e:/20190402_sw_test/'
data_folder_tmp : 'e:/20190402_sw_test/tmp/'
compression : 'gzip-3' # default: 'gzip-3', 'gzip-0' to 'gzip-9' or None
file_length_sec : 60.0 # in seconds
file_length_sec : 30.0 # in seconds
station_naming : [1, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15, 8, 16, 17, 25, 18, 26, 19, 27, 20, 28, 21, 29, 22, 30, 23, 31, 24, 32]
Trigger:
......
......@@ -30,7 +30,7 @@ class Card:
# l_notify_size = c_int32(regs.KILO_B(2 * 1024))
self.l_notify_size = c_int32(param['Acquisition']['bytes_per_transfer'])
self._use_16_bit_mode = param['Acquisition']['hardware_settings']['use_16_bit_mode']
self.use_float32 = param['Acquisition']['asdf_settings']['use_float32']
self.save_mV = param['Acquisition']['asdf_settings']['save_mV']
self.card_nr = card_nr
self.h_card = None
......@@ -100,7 +100,7 @@ class Card:
pass
else:
# some possibilities: int16(no conversion needed), int32, float32, float64
if self.use_float32:
if self.save_mV:
np_data = np.require(np_data, dtype=np.float32, requirements=["C"]) # int32 convert to 32 bit float
for i in range(0, 16):
np_data[i] = np_data[i] * self.scaling_this_card[i]
......
......@@ -101,14 +101,25 @@ def init_card(param, card_nr):
# no clock output
spcm_dwSetParam_i32(h_card, regs.SPC_CLOCKOUT, 0)
# set input range 50, 100, 250, 500, 1000, 2000, 5000, 10000 mV
# read available ranges
range_min = c_int32(0)
range_max = c_int32(0)
for i in range(16):
spcm_dwSetParam_i32(h_card, regs.SPC_AMP0 + i*100, gain_selection_this_card[i])
l_number_of_ranges = c_int32(0)
spcm_dwGetParam_i32(h_card, regs.SPC_READIRCOUNT, byref(l_number_of_ranges))
logging.debug("card {}: nr of available ranges: {}".format(card_nr, l_number_of_ranges.value))
for i in range(l_number_of_ranges.value):
spcm_dwGetParam_i32(h_card, regs.SPC_READRANGEMIN0 + i, byref(range_min))
spcm_dwGetParam_i32(h_card, regs.SPC_READRANGEMAX0 + i, byref(range_max))
logging.info("card {}, channel {}: {}mV to {}mV".format(card_nr, i, range_min.value, range_max.value))
logging.debug("card {}, range nr {}: {}mV to {}mV".format(card_nr, i, range_min.value, range_max.value))
# set input range 50, 100, 250, 500, 1000, 2000, 5000, 10000 mV
selected_range = c_int32(0)
for i in range(16):
spcm_dwSetParam_i32(h_card, regs.SPC_AMP0 + i * 100, gain_selection_this_card[i])
spcm_dwGetParam_i32(h_card, regs.SPC_AMP0 + i * 100, byref(selected_range))
logging.info("card {}, channel {} selected range: {}mV".format(card_nr, i, selected_range.value))
""" define the data buffer """
# we try to use continuous memory if available and big enough
......
......@@ -166,4 +166,97 @@ code
====
np_data = np.require(np_data, dtype=np.float32, requirements=["C"]) # int32 convert to 32 bit
for i in range(0, 16):
np_data[i] = np_data[i] / 10000
\ No newline at end of file
np_data[i] = np_data[i] / 10000
==================================
on the acquisition system 3.4.2019
==================================
2019-04-03 09:35:35,851 INFO DUG-Seis started
2019-04-03 09:35:35,885 INFO Acquisition script started
2019-04-03 09:35:35,885 INFO ==========================
2019-04-03 09:35:35,885 INFO Hardware driver found, running on real hardware
2019-04-03 09:35:35,886 INFO sampling_frequency: 200000
2019-04-03 09:35:35,886 INFO gain_selection: [10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000]
2019-04-03 09:35:35,886 INFO ram_buffer_size: 134217728
2019-04-03 09:35:35,886 INFO timeout: 8000
2019-04-03 09:35:35,887 INFO use_16_bit_mode: False
2019-04-03 09:35:35,887 INFO save_mV: False
2019-04-03 09:35:35,887 INFO data_folder: e:/20190402_sw_test/
2019-04-03 09:35:35,887 INFO data_folder_tmp: e:/20190402_sw_test/tmp/
2019-04-03 09:35:35,888 INFO compression: gzip-3
2019-04-03 09:35:35,888 INFO file_length_sec: 30.0
2019-04-03 09:35:35,888 INFO station_naming: [1, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15, 8, 16, 17, 25, 18, 26, 19, 27, 20, 28, 21, 29, 22, 30, 23, 31, 24, 32]
2019-04-03 09:35:35,888 INFO simulation_mode: False
2019-04-03 09:35:35,888 INFO bytes_per_transfer: 33554432
2019-04-03 09:35:35,888 INFO simulation_amount: 1
2019-04-03 09:35:35,889 INFO init card: 0
- amp off
- teamview login
dtype=np.int32
==============
- file size first: 98 898 KB
- load ~ 63% (3.2025)
dtype=np.float32
================
- save_mV: True
- file size first: 131 435 KB
- load ~ 88% (4.5141)
dtype=np.float32
================
- save_mV: True
- compression: None
- file size first: 787 565 KB
- load ~ 9.9% (0.5075)
dtype=np.int32
==============
- compression: None
- file size first: 787 565 KB
- load ~ 7.7% (0.3942)
dtype=np.int32
==============
- compression: None
- 500k sps
- file size first: 1 968 667 KB
- load ~ 20% (0.411)
dtype=np.int32
==============
- compression: None
- 1000k sps
- file size first: 3 806 060 KB
- load ~ 45% (0.4598)
dtype=np.int32
==============
- compression: gzip-1
- 1000k sps
- file size first: 385 653 KB
- load ~ 141% (1.441)
dtype=np.int32
==============
- compression: gzip-1
- 500k sps
- file size first: 277 292 KB
- load ~ 71% (1.463)
dtype=np.int32
==============
- amp's on
- file size first: 109 988 KB
- load ~ 65% (3.3458)
dtype=np.float32
================
- save_mV: True
- amp's on
- file size first: 142 942 KB
- load ~ 89% (4.5725)
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment