Commit 415a8308 authored by POLCHER Jan's avatar POLCHER Jan 🚴🏾
Browse files

Added some extra information into the station diagnostic files.

parent 92774145
......@@ -296,7 +296,7 @@ class PlacedLocations :
land = nc.variables["land"][:,:]
self.nbpt = int(np.sum(land))
#
self.lnglat = {varn: nc.variables[varn][:] for varn in ["lon", "lat"]}
self.lnglat = {varn: nc.variables[varn][:] for varn in ["lon", "lat", "Areas"]}
#
# Grid points
self.nbpt_glo = nc.variables["nbpt_glo"][:]
......
......@@ -149,14 +149,16 @@ nc.createDimension('x', L.gridshape[1])
nc.createDimension('y', L.gridshape[0])
nc.setncattr("RoutingGraph_File", GraphFile)
nc.setncattr("GRDCObservation_File", GRDCFile)
nc.setncattr("GraphNbHTU",L.nbasmax)
# Lon and Lat variables
D = {"lon": ["degrees east", "Longitude", "X"],
"lat": ["degrees north","Latitude", "Y"]}
D = {"lon": ["grid box centre degrees east", "Longitude", "X"],
"lat": ["grid box centre degrees north","Latitude", "Y"],
"Areas": ["Mesh areas","Area", "Y,X"]}
NCFillValue = 1.0e20
for vname in ["lon", "lat"]:
for vname in ["lon", "lat", "Areas"]:
var = nc.createVariable(vname, float, ('y','x'), fill_value=NCFillValue)
var[:] = L.lnglat[vname][:]
var.units="grid box centre "+D[vname][0]
var.units=D[vname][0]
var.title=D[vname][1]
var.axis=D[vname][2]
# Create variables only if the GRDC station has been placed on the graph
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment