Tue, 12 Dec 2017 17:24:04 +0200
Licel
atmospheric_lidar/__init__.py | file | annotate | diff | comparison | revisions | |
atmospheric_lidar/licel.py | file | annotate | diff | comparison | revisions |
--- a/atmospheric_lidar/__init__.py Tue Dec 12 12:50:30 2017 +0200 +++ b/atmospheric_lidar/__init__.py Tue Dec 12 17:24:04 2017 +0200 @@ -1,1 +1,1 @@ -__version__ = '0.2.12' \ No newline at end of file +__version__ = '0.2.13' \ No newline at end of file
--- a/atmospheric_lidar/licel.py Tue Dec 12 12:50:30 2017 +0200 +++ b/atmospheric_lidar/licel.py Tue Dec 12 17:24:04 2017 +0200 @@ -4,14 +4,10 @@ import numpy as np import pytz -from .systems.musa import musa_2009_netcdf_parameters -from .systems.musa import musa_netcdf_parameters - from generic import BaseLidarMeasurement, LidarChannel logger = logging.getLogger(__name__) - licel_file_header_format = ['Filename', 'StartDate StartTime EndDate EndTime Altitude Longtitude Latitude ZenithAngle', # Appart from Site that is read manually @@ -29,7 +25,6 @@ self.import_file(filename) self.calculate_physical() - def calculate_physical(self): for channel in self.channels.itervalues(): channel.calculate_physical() @@ -210,7 +205,6 @@ ''' ''' - extra_netcdf_parameters = musa_netcdf_parameters raw_info = {} # Keep the raw info from the files durations = {} # Keep the duration of the files laser_shots = [] @@ -227,7 +221,7 @@ current_file = LicelFile(filename, use_id_as_name=self.use_id_as_name, licel_timezone=self.licel_timezone) self.raw_info[current_file.filename] = current_file.raw_info self.durations[current_file.filename] = current_file.duration() - + file_laser_shots = [] for channel_name, channel in current_file.channels.items(): @@ -235,7 +229,7 @@ self.channels[channel_name] = LicelChannel(channel) self.channels[channel_name].data[current_file.start_time] = channel.data file_laser_shots.append(channel.raw_info['NShots']) - + self.laser_shots.append(file_laser_shots) self.files.append(current_file.filename) @@ -260,39 +254,39 @@ duration_sec = np.diff(raw_start_in_seconds)[0] return duration_sec - + def get_custom_channel_parameters(self): params = [{ - "name": "DAQ_Range", - "dimensions": ('channels',), - "type": 'd', - "values": [self.channels[x].raw_info['Discriminator'] for x in self.channels.keys()] - }, { - "name": "LR_Input", - "dimensions": ('channels',), - "type": 'i', - "values": [self.channels[x].raw_info['LaserUsed'] for x in self.channels.keys()] - }, { - "name": "Laser_Shots", - "dimensions": ('time', 'channels',), - "type": 'i', - "values": self.laser_shots - }, + "name": "DAQ_Range", + "dimensions": ('channels',), + "type": 'd', + "values": [self.channels[x].raw_info['Discriminator'] for x in self.channels.keys()] + }, { + "name": "LR_Input", + "dimensions": ('channels',), + "type": 'i', + "values": [self.channels[x].raw_info['LaserUsed'] for x in self.channels.keys()] + }, { + "name": "Laser_Shots", + "dimensions": ('time', 'channels',), + "type": 'i', + "values": self.laser_shots + }, ] - + return params - + def get_custom_general_parameters(self): params = [{ - "name": "Altitude_meter_asl", - "value": self.raw_info[ self.files[0] ]["Altitude"] - }, { - "name": "Latitude_degrees_north", - "value": self.raw_info[ self.files[0] ]["Latitude"] - }, { - "name": "Longitude_degrees_east", - "value": self.raw_info[ self.files[0] ]["Longtitude"] - }, + "name": "Altitude_meter_asl", + "value": self.raw_info[self.files[0]]["Altitude"] + }, { + "name": "Latitude_degrees_north", + "value": self.raw_info[self.files[0]]["Latitude"] + }, { + "name": "Longitude_degrees_east", + "value": self.raw_info[self.files[0]]["Longtitude"] + }, ] return params @@ -312,7 +306,7 @@ self.rc = [] self.duration = channel_file.duration self.raw_info = channel_file.raw_info - + def append(self, other): if self.info != other.info: raise ValueError('Channel info are different. Data can not be combined.') @@ -326,10 +320,6 @@ return unicode(self).encode('utf-8') -class Licel2009LidarMeasurement(LicelLidarMeasurement): - extra_netcdf_parameters = musa_2009_netcdf_parameters - - def match_lines(f1, f2): list1 = f1.split() list2 = f2.split()