Introduction
Introduction Statistics Contact Development Disclaimer Help
tsealvl.py: save number of records in netcdf header - pism-exp-gsw - ice stream…
git clone git://src.adamsgaard.dk/pism-exp-gsw
Log
Files
Refs
README
LICENSE
---
commit fc4196811e3b216ec3988c05b119afc3d76d20f7
parent 09abfd8f39552cf1f0bce7519218e48afb83d25f
Author: Anders Damsgaard <[email protected]>
Date: Fri, 26 Nov 2021 11:43:05 +0100
sealvl.py: save number of records in netcdf header
Diffstat:
M sealvl.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/sealvl.py b/sealvl.py
t@@ -3,9 +3,11 @@ import sys
import numpy as np
import netCDF4 as nc4
+input = np.loadtxt(sys.stdin)
+
f = nc4.Dataset("sealvl.nc", "w", format="NETCDF4")
-f.createDimension("time", None)
+f.createDimension("time", input[:, 0].size)
time = f.createVariable("time", "f4", ("time",))
time.calendar = "365_day"
time.units = "years since 1-1-1"
t@@ -16,7 +18,6 @@ delta_SL.long_name = "Sea Level (variation from present)"
delta_SL.standard_name = "global_average_sea_level_change"
delta_SL.units = "meters"
-input = np.loadtxt(sys.stdin)
time[:] = input[:, 0]
delta_SL[:] = input[:, 1]
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.