From 6b10c2b400fcb31ab02074db91af5f5e7df85e2d Mon Sep 17 00:00:00 2001 From: Zilog80 Date: Mon, 9 Nov 2020 19:58:25 +0100 Subject: [PATCH] Norwegian_Meteo netCDF.nc to gpx --- tools/metno_netcdf_gpx.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/metno_netcdf_gpx.py b/tools/metno_netcdf_gpx.py index e79f37f..51c6831 100644 --- a/tools/metno_netcdf_gpx.py +++ b/tools/metno_netcdf_gpx.py @@ -17,7 +17,7 @@ def print_cdf(dat): ts = dat.variables['time'][:].data sn = dat.variables['serial_number'][:] rs = dat.variables['sounding_system_used'][:].data # rs[]: BUFR 002011 , rs[]%100: r_ar_a 3685 - tls = dat.variables['time_from_launch'] + tls = dat.variables['time_from_launch'][:].data N = len(ts) for n in range(N): print('{0} # SN="{1}" # type={2:d}'.format(datetime.utcfromtimestamp( ts[n] ).strftime('%Y-%m-%dT%H:%M:%SZ'), sn[n], rs[n]) ) @@ -32,7 +32,7 @@ def print_cdf(dat): for k in range(len(alt)): if (alt[k] > -900.0): fgpx.write('{:.2f}'.format(lat[k], lon[k], alt[k]) ) - fgpx.write('\n'.format(datetime.utcfromtimestamp( ts[n]+tls[k].data ).strftime('%Y-%m-%dT%H:%M:%SZ')) ) + fgpx.write('\n'.format(datetime.utcfromtimestamp( ts[n]+tls[k] ).strftime('%Y-%m-%dT%H:%M:%SZ')) ) fgpx.write('\n') fgpx.write('') fgpx.close()