* Added PI name and email in DIVA global attributes

Fri, 09 Feb 2018 13:23:06 +0200

author
Iannis <i.binietoglou@impworks.gr>
date
Fri, 09 Feb 2018 13:23:06 +0200
changeset 122
1456119a46b5
parent 121
4522191fe936
child 123
0c7d3ef1dd34

* Added PI name and email in DIVA global attributes
* Fixed some bugs and inconsistencies in the NetCDF file structure.

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 18 11:36:45 2018 +0200
+++ b/atmospheric_lidar/diva.py	Fri Feb 09 13:23:06 2018 +0200
@@ -23,8 +23,10 @@
             parameters = yaml.load(f)
 
         global_parameters = parameters['global_parameters']  # Shortcut
+        global_variables = parameters['global_variables']  # Shortcut
         channels = parameters['channels']
 
+
         iso_date = datetime.datetime.utcnow().isoformat()
         python_file_name = os.path.basename(__file__)
 
@@ -37,6 +39,8 @@
             f.references = global_parameters['references']
             f.location = global_parameters['location']
             f.data_version = global_parameters['data_version']
+            f.PI = global_parameters['PI_name']
+            f.PI_email = global_parameters['PI_email']
             f.conversion_date = iso_date
             f.comment = global_parameters['comment']
             f.Conventions = global_parameters['Conventions']
@@ -74,6 +78,12 @@
             altitude.long_name = 'system altitude'
             altitude.units = 'm'
 
+            # Assign top-level variables
+            latitude[:] = global_parameters['latitude']
+            longitude[:] = global_parameters['longitutde']
+            laser_angle[:] = global_parameters['laser_pointing_angle']
+            altitude[:] = global_parameters['system_altitude']
+
             # Optional ancillary group
             ancillary = f.createGroup('ancillary')
             ancillary.featureType = "timeSeries"
@@ -125,10 +135,12 @@
                 laser_rep_rate.long_name = 'nominal laser repetition rate'
                 laser_rep_rate.units = 'Hz'
 
+                # TODO: Emission wavelength ??
+
+
                 emission_energy = g.createVariable('emission_energy', datatype='f8', )  # or dimensions=('profile',)
                 emission_energy.long_name = 'emission energy per pulse'
                 emission_energy.units = 'mJ'
-                emission_energy.standard_name = 'radiation_wavelength'
                 emission_energy.comment = "could be scalar, if value is nominal."
 
                 emission_pol = g.createVariable('emission_polarization', datatype='b')
@@ -217,7 +229,7 @@
                 nd_filter.coordinates = "time"
 
                 trigger_delay = g.createVariable('trigger_delay', datatype='f4')
-                trigger_delay.long_name = "chanenl trigger difference from pulse emission"
+                trigger_delay.long_name = "channel trigger difference from pulse emission"
                 trigger_delay.units = 'ns'
                 trigger_delay.comments = 'Negative values for pre-trigger systems.'
 
@@ -284,7 +296,7 @@
 
                 pulses[:] = channel.laser_shots
 
-                epoch = datetime.datetime(2017, 1, 1, tzinfo=pytz.utc)
+                epoch = datetime.datetime(1970, 1, 1, tzinfo=pytz.utc)
                 seconds_since_epoch = [(t - epoch).total_seconds() for t in channel.time]
                 time[:] = seconds_since_epoch
                 time_bounds[:, 0] = seconds_since_epoch
--- a/atmospheric_lidar/systems/rali/rali_diva_parameters.yaml	Thu Jan 18 11:36:45 2018 +0200
+++ b/atmospheric_lidar/systems/rali/rali_diva_parameters.yaml	Fri Feb 09 13:23:06 2018 +0200
@@ -6,6 +6,8 @@
   Conventions: CF-1.7
   comment: Test file
   location: Magurele, Bucharest, Romania
+  PI_name: Doina Nicolae
+  PI_email: nnicol@inoe.ro
   data_version: 1.0
   history: "{date} {file} Data file created.\n"
 global_variables:

mercurial