Mon, 12 May 2014 12:41:22 +0300
Auto filename when saving netcdf
generic.py | file | annotate | diff | comparison | revisions |
--- a/generic.py Mon May 12 11:14:44 2014 +0300 +++ b/generic.py Mon May 12 12:41:22 2014 +0300 @@ -186,9 +186,10 @@ channel.update() - def save_as_netcdf(self, filename): + def save_as_netcdf(self, filename = None): """Saves the measurement in the netcdf format as required by the SCC. - Input: filename + Input: filename. If no filename is provided <measurement_id>.nc will + be used. """ params = self.extra_netcdf_parameters needed_parameters = ['Measurement_ID', 'Temperature', 'Pressure'] @@ -198,6 +199,8 @@ if stored_value is None: raise ValueError('A value needs to be specified for %s' % parameter) + if not filename: + filename = "%s.nc" % self.info['Measurement_ID'] dimensions = {'points': 1, 'channels': 1,