Minor update.

Thu, 04 Jan 2018 14:47:36 +0200

author
Iannis <i.binietoglou@impworks.gr>
date
Thu, 04 Jan 2018 14:47:36 +0200
changeset 115
c2ecdcc2bb88
parent 114
d11a94f03753
child 116
d9703af687aa

Minor update.

atmospheric_lidar/diva.py file | annotate | diff | comparison | revisions
atmospheric_lidar/systems/rali/rali_diva_parameters.yaml file | annotate | diff | comparison | revisions
--- a/atmospheric_lidar/diva.py	Thu Jan 04 14:21:17 2018 +0200
+++ b/atmospheric_lidar/diva.py	Thu Jan 04 14:47:36 2018 +0200
@@ -95,6 +95,11 @@
             # Create a separate group for each channel
             for channel_name, channel_parameters in channels.iteritems():
 
+                if channel_name not in self.channels.keys():
+                    raise ValueError('Channle name not one of {0}: {1}'.format(self.channels.keys()), channel_name)
+
+                channel = self.channels[channel_name]
+
                 group_name = "channel_{0}".format(channel_name)  # Give channels groups a standard name
                 g = f.createGroup(group_name)
                 g.long_name = channel_parameters['long_name']
@@ -175,6 +180,11 @@
                 bin_length.long_name = "time duration of each bin"
                 bin_length.units = 'ns'
 
+                pulse_delay = g.createVariable('pulse_delay', datatype='f4')
+                pulse_delay.long_name = "time difference between channel trigger and pulse emission"
+                pulse_delay.units = 'ns'
+                pulse_delay.comment = "Positive indicates pre-trigger channel. Negative a channle trigger delay."
+
                 detector_voltage = g.createVariable('detector_voltage', datatype='f4', dimensions=('profile',), zlib=True)
                 detector_voltage.long_name = 'detector voltage'
                 detector_voltage.units = 'V'
@@ -250,6 +260,10 @@
                 dead_time_model[:] = self._deadtime_model_flag(channel_parameters['dead_time_model'])
                 dead_time[:] = channel_parameters['dead_time']
                 bin_length[:] = channel_parameters['bin_length']
+                pulse_delay[:] = channel_parameters['pulse_delay']
+
+                detector_voltage[:] = channel
+
 
     def _deadtime_model_flag(self, model_str):
         """ Convert dead-time model string to byte flag.
--- a/atmospheric_lidar/systems/rali/rali_diva_parameters.yaml	Thu Jan 04 14:21:17 2018 +0200
+++ b/atmospheric_lidar/systems/rali/rali_diva_parameters.yaml	Thu Jan 04 14:47:36 2018 +0200
@@ -23,7 +23,7 @@
     daq_manufacturer: Licel             # Optional
     daq_model: -                        # Optional
     bin_length: 50                      # ns
-    pulse_delay: 5000                   # ns
+    pulse_delay: 5000                   # ns. Time difference between channel trigger and pulse emission
     laser_repetition_rate: 10           # Hz
     signal_units: mV                    # counts or mV
     emission_wavelength: 1064.17        # nm
@@ -43,7 +43,7 @@
     daq_manufacturer: Licel             # Optional, use - if not applicable
     daq_model: -                        # Optional, use - if not applicable
     bin_length: 50                      # ns
-    pulse_delay: 5000                   # ns
+    pulse_delay: 5000                   # ns. Time difference between channel trigger and pulse emission
     laser_repetition_rate: 10           # Hz
     signal_units: counts                # counts or mV
     emission_wavelength: 532.085        # nm    

mercurial