Commit 4a8cf649 authored by POLCHER Jan's avatar POLCHER Jan 🚴🏾
Browse files

Small improvement ti Locations.py and integrated a test of the location method...

Small improvement ti Locations.py and integrated a test of the location method for GRDC station into one of the Iberian test cases.
parent b9ab8b9b
......@@ -74,24 +74,15 @@ class Locations :
# Function to keep only locations which could be placed in the HTU graph
#
def cleanup(self) :
if len(self.ij) > 0 :
self.lid = np.array(self.lid)[np.array(self.ij) >= 0]
self.lon = np.array(self.lon)[np.array(self.ij) >= 0]
self.lat = np.array(self.lat)[np.array(self.ij) >= 0]
self.upstream = np.array(self.upstream)[np.array(self.ij) >= 0]
self.ltype = np.array(self.ltype)[np.array(self.ij) >= 0]
self.ij = np.array(self.ij)[np.array(self.ij) >= 0]
self.ib = np.array(self.ib)[np.array(self.ij) >= 0]
self.cost = np.array(self.cost)[np.array(self.ij) >= 0]
else :
self.lid = np.array(self.lid)
self.lon = np.array(self.lon)
self.lat = np.array(self.lat)
self.upstream = np.array(self.upstream)
self.ltype = np.array(self.ltype)
self.ij = np.array(self.ij)
self.ib = np.array(self.ib)
self.cost = np.array(self.cost)
l = np.where(np.array(self.ij) >= 0)[:]
self.lid = np.array(self.lid)[l]
self.lon = np.array(self.lon)[l]
self.lat = np.array(self.lat)[l]
self.upstream = np.array(self.upstream)[l]
self.ltype = np.array(self.ltype)[l]
self.ij = np.array(self.ij)[l]
self.ib = np.array(self.ib)[l]
self.cost = np.array(self.cost)[l]
return
#
# Get all the unique locations identified in the HTU graph
......
......@@ -5,8 +5,8 @@
#PBS -j oe
#PBS -l nodes=1:ppn=64
#PBS -l walltime=48:00:00
#PBS -l mem=250gb
#PBS -l vmem=250gb
#PBS -l mem=200gb
#PBS -l vmem=200gb
#
cd ${PBS_O_WORKDIR}
export NSLOTS=$(($PBS_NUM_NODES*$PBS_NUM_PPN))
......@@ -17,7 +17,7 @@ source ../../Environment
#
# Clean-up. Weights are kept for future runs.
#
/bin/rm -f DocumentationInterface *graph.nc *.txt check.out
/bin/rm -f DocumentationInterface *graph.nc Out_RoutingReg_*.txt Weight_proc_*.txt check.out
#
# Run the Python code to generate the HTUs and write them into a netCDF file.
#
......@@ -33,7 +33,7 @@ else
echo "================================================="
fi
#
/bin/rm -f *.txt
/bin/rm -f Out_RoutingReg_*.txt Weight_proc_*.txt
#
#
#
......
......@@ -25,3 +25,9 @@ numop = 100
#
GraphFile = MEDCORDEX_Spain_graph.nc
#
# File containing infrastructures to be placed.
# Maximum error in the distance of the station in km^2
MaxDistErr = 25.0
# Maximum error in the upstream area in %
MaxUpstrErr = 10.0
GRDCFile = ../../Stations/Station_Metadata.nc
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