Commit 3feb19b9 authored by POLCHER Jan's avatar POLCHER Jan 🚴🏾
Browse files

Some refinements in the output of the various modules. In particular for the...

Some refinements in the output of the various modules. In particular for the stations we cannot position.
parent 26ad340c
......@@ -15,7 +15,7 @@ MaxDistErr = config.getfloat("OverAll", "MaxDistErr", fallback=25.0)
# Maximum error in the upstream area in %
MaxUpstrErr = config.getfloat("OverAll", "MaxUpstrErr", fallback=10.0)
#
log_master, log_world = getargs.getLogger()
log_master, log_world = getargs.getLogger(__name__)
INFO, DEBUG, ERROR = log_master.info, log_master.debug, log_world.error
INFO_ALL, DEBUG_ALL = log_world.info, log_world.debug
#
......@@ -116,8 +116,25 @@ class HydroGraph :
ij, ib = np.unravel_index(np.nanargmax(cost),cost.shape)
locations.addhtupos(i, ij, ib, np.nanmax(cost))
else :
INFO("Could not locate station number : "+str(lid)+" of type "+locations.ltype[i]+" at "+locations.lname[i])
#
# Only report a missed station is there was a geographical solution on the domain.
if np.count_nonzero(~np.isnan(disterr)) > 0 :
if lid < 9999 :
typename="Structure"
else :
typename="GRDC"
#
INFO("Could not locate "+typename+" number : "+str(lid)+" of type "+\
locations.ltype[i]+" at "+locations.lname[i])
ij = np.nanargmax(disterr)
INFO(typename+" number : "+str(lid)+" best distance match [km] : "+str(dist[ij]/1000.))
if np.count_nonzero(~np.isnan(upstrerr)) > 0 :
ib, ij = np.unravel_index(np.nanargmax(upstrerr),upstrerr.shape)
INFO(typename+" number : "+str(lid)+" smallest upstream error [%] : "+\
str(upstrerr[ib,ij]*MaxUpstrErr+MaxUpstrErr))
else :
INFO(typename+" number : "+str(lid)+" No appropriate HTU with an upstream "+\
"error less than "+str(MaxUpstrErr)+" % ")
#
#
#
def add_variable(self, outnf, procgrid, NCFillValue, part, coord, name, title, units, data, vtyp, orig_type = "float", arrayorder = 'F'):
......
......@@ -8,7 +8,7 @@ import codecs
import getargs
config = getargs.SetupConfig()
#
log_master, log_world = getargs.getLogger()
log_master, log_world = getargs.getLogger(__name__)
INFO, DEBUG, ERROR = log_master.info, log_master.debug, log_world.error
INFO_ALL, DEBUG_ALL = log_world.info, log_world.debug
#
......
......@@ -24,7 +24,7 @@ EarthRadius=config.getfloat("OverAll", "EarthRadius", fallback=6370000.0)
# Logging in MPI : https://groups.google.com/forum/#!topic/mpi4py/SaNzc8bdj6U
#
import getargs
log_master, log_world = getargs.getLogger()
log_master, log_world = getargs.getLogger(__name__)
INFO, DEBUG, ERROR = log_master.info, log_master.debug, log_world.error
INFO_ALL, DEBUG_ALL = log_world.info, log_world.debug
#
......
......@@ -17,7 +17,7 @@ localdir=os.path.dirname(getframeinfo(currentframe()).filename)
sys.path.append(localdir+'/F90subroutines')
import routing_interface
import getargs
log_master, log_world = getargs.getLogger()
log_master, log_world = getargs.getLogger(__name__)
INFO, DEBUG, ERROR = log_master.info, log_master.debug, log_world.error
######################
......
......@@ -31,7 +31,7 @@ import HydroGrid as HG
# Logging in MPI : https://groups.google.com/forum/#!topic/mpi4py/SaNzc8bdj6U
#
import getargs
log_master, log_world = getargs.getLogger()
log_master, log_world = getargs.getLogger(__name__)
INFO, DEBUG, ERROR = log_master.info, log_master.debug, log_world.error
INFO_ALL, DEBUG_ALL = log_world.info, log_world.debug
#
......
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