# --- basic properties control: edges length, surfaces
controlGeomProps(geompy, riveGauche, 29149.36918, 35948828.352061)
-#controlGeomProps(geompy, litMineur, 30337.5484919, 3263628.55399)
-#controlGeomProps(geompy, riveDroite, 32012.3432411, 26177085.4601)
controlGeomProps(geompy, litMineur, 30337.548492, 3488480.304388)
controlGeomProps(geompy, riveDroite, 32012.343241, 25998769.23615)
garonne_1.SetAutoColor( 1 )
garonne_1.ExportMED( med_file, 0, SMESH.MED_V2_2, 1, None ,1)
-#controlMeshStats(garonne_1, 1763, 180, 3360)
-#controlSubMeshStats(litMineur_2, 48)
-#controlSubMeshStats(riveDroite_1, 1360)
-#controlSubMeshStats(riveGauche_1, 1952)
controlMeshStats(garonne_1, 3888, 475, 7597)
controlSubMeshStats(litMineur_2, 2384)
controlSubMeshStats(riveDroite_1, 2342)
# --- Z interpolation on the bathymety/altimetry on the mesh nodes
statz = interpolZ(nomCas, fichierMaillage, dicoGroupeRegion, zUndef)
-refstatz = {'riveDroite': (10.88, 32.61), 'riveGauche': (7.72, 71.86, 0.5), 'litMineur': (2.06, 25.41)}
+#print statz
+refstatz = {'riveDroite': (10.88, 32.61, 24.17, 5.12, 17.57, 31.33, 0.2),
+ 'riveGauche': (7.72, 71.86, 24.51, 12.18, 12.90, 60.36, 0.2),
+ 'litMineur': (2.06, 25.41, 13.93, 4.33, 8.47, 21.78)}
controlStatZ(statz, refstatz)
# --- add a field on nodes of type double with z values, named "BOTTOM"
geompy.UnionIDs(SectionsDigue, [40, 35])
geompy.addToStudyInFather( HYDRO_garonne_2, SectionsDigue, 'SectionsDigue' )
-# --- recreate subshapes already exported from HYDRO to get access from Python
-#garonne_2_domaineEtendu_Outer = geompy.CreateGroup(HYDRO_garonne_2, geompy.ShapeType["EDGE"])
-#geompy.UnionIDs(garonne_2_domaineEtendu_Outer, [4, 11, 17, 24, 26, 28, 14, 19, 20, 22, 31, 39, 41, 33, 35, 37])
-#garonne_2_digue_Left_Bank = geompy.CreateGroup(HYDRO_garonne_2, geompy.ShapeType["EDGE"])
-#geompy.UnionIDs(garonne_2_digue_Left_Bank, [43])
-#garonne_2_digue_Outlet = geompy.CreateGroup(HYDRO_garonne_2, geompy.ShapeType["EDGE"])
-#geompy.UnionIDs(garonne_2_digue_Outlet, [46])
-#garonne_2_digue_Inlet = geompy.CreateGroup(HYDRO_garonne_2, geompy.ShapeType["EDGE"])
-#geompy.UnionIDs(garonne_2_digue_Inlet, [50])
-#garonne_2_litMineur_Outer = geompy.CreateGroup(HYDRO_garonne_2, geompy.ShapeType["EDGE"])
-#geompy.UnionIDs(garonne_2_litMineur_Outer, [7, 9])
-#garonne_2_digue_Right_Bank = geompy.CreateGroup(HYDRO_garonne_2, geompy.ShapeType["EDGE"])
-#geompy.UnionIDs(garonne_2_digue_Right_Bank, [48])
-
controlGeomProps(geompy, riveGauche, 39490.835288, 35845737.590926)
controlGeomProps(geompy, digue, 10341.466108, 103090.760662)
controlGeomProps(geompy, litMineur, 30337.548492, 3488480.304388)
isDone = garonne_2.ReorientObject( garonne_2 )
# --- geometrical groups of edges
-#garonne_2_litMineur_Outer_1 = garonne_2.GroupOnGeom(garonne_2_litMineur_Outer,'garonne_2_litMineur_Outer',SMESH.EDGE)
-#garonne_2_domaineEtendu_Outer_1 = garonne_2.GroupOnGeom(garonne_2_domaineEtendu_Outer,'garonne_2_domaineEtendu_Outer',SMESH.EDGE)
-#aval_1 = garonne_2.GroupOnGeom(aval,'aval',SMESH.EDGE)
-#amont_1 = garonne_2.GroupOnGeom(amont,'amont',SMESH.EDGE)
-#bordGaucheDomaine_1 = garonne_2.GroupOnGeom(bordGaucheDomaine,'bordGaucheDomaine',SMESH.EDGE)
-#bordDroiteDomaine_1 = garonne_2.GroupOnGeom(bordDroiteDomaine,'bordDroiteDomaine',SMESH.EDGE)
SectionsGaronne_2 = garonne_2.GroupOnGeom(SectionsGaronne,'SectionsGaronne',SMESH.EDGE)
SectionsDigue_2 = garonne_2.GroupOnGeom(SectionsDigue,'SectionsDigue',SMESH.EDGE)
digue_1 = garonne_2.GroupOnGeom(digue,'digue',SMESH.FACE)
# --- geometrical groups of nodes
-#garonne_2_litMineur_Outer_2 = garonne_2.GroupOnGeom(garonne_2_litMineur_Outer,'garonne_2_litMineur_Outer',SMESH.NODE)
-#garonne_2_domaineEtendu_Outer_2 = garonne_2.GroupOnGeom(garonne_2_domaineEtendu_Outer,'garonne_2_domaineEtendu_Outer',SMESH.NODE)
riveGauche_2 = garonne_2.GroupOnGeom(riveGauche,'riveGauche',SMESH.NODE)
litMineur_3 = garonne_2.GroupOnGeom(litMineur,'litMineur',SMESH.NODE)
riveDroite_2 = garonne_2.GroupOnGeom(riveDroite,'riveDroite',SMESH.NODE)
digue_2 = garonne_2.GroupOnGeom(digue,'digue',SMESH.NODE)
-#aval_2 = garonne_2.GroupOnGeom(aval,'aval',SMESH.NODE)
-#amont_2 = garonne_2.GroupOnGeom(amont,'amont',SMESH.NODE)
-#bordGaucheDomaine_2 = garonne_2.GroupOnGeom(bordGaucheDomaine,'bordGaucheDomaine',SMESH.NODE)
-#bordDroiteDomaine_2 = garonne_2.GroupOnGeom(bordDroiteDomaine,'bordDroiteDomaine',SMESH.NODE)
SectionsGaronne_3 = garonne_2.GroupOnGeom(SectionsGaronne,'SectionsGaronne',SMESH.NODE)
garonne_2.SetAutoColor( 1 )
garonne_2.ExportMED( med_file, 0, SMESH.MED_V2_2, 1, None ,1)
-#controlMeshStats(garonne_2, 5247, 717, 10075)
-#controlSubMeshStats(litMineur_2, 2384)
-#controlSubMeshStats(riveDroite_1, 2348)
-#controlSubMeshStats(riveGauche_1, 5343)
-#controlSubMeshStats(digue_1, 0)
controlMeshStats(garonne_2, 6190, 691, 12201)
controlSubMeshStats(litMineur_2, 2384)
controlSubMeshStats(riveDroite_1, 2400)
# --- Z interpolation on the bathymety/altimetry on the mesh nodes
statz = interpolZ(nomCas, fichierMaillage, dicoGroupeRegion, zUndef)
-refstatz = {'riveDroite': (10.88, 32.61), 'riveGauche': (7.72, 71.86, 0.5), 'litMineur': (2.06, 25.41), 'digue': (14.10,27.09)}
+#print statz
+refstatz = {'riveDroite': (10.88, 32.61, 24.09, 5.13, 17.57, 31.33, 0.2),
+ 'riveGauche': (7.72, 71.39, 21.59, 8.37, 16.71, 35.71, 0.2),
+ 'litMineur': (2.06, 25.41, 13.93, 4.33, 8.47, 21.78),
+ 'digue': (14.10, 27.09, 22.01, 2.56, 18.15, 25.02)}
controlStatZ(statz, refstatz)
# --- add a field on nodes of type double with z values, named "BOTTOM"
# --- Z interpolation on the bathymety/altimetry on the mesh nodes
statz = interpolZ(nomCas, fichierMaillage, dicoGroupeRegion, zUndef)
-refstatz = {'riveDroite': (10.88, 32.61), 'riveGauche': (7.72, 71.86, 0.5), 'litMineur': (2.06, 25.41)}
+#print statz
+refstatz = {'riveDroite': (10.88, 32.61, 24.17, 5.12, 17.57, 31.33, 0.2),
+ 'riveGauche': (7.72, 71.86, 24.51, 12.18, 12.90, 60.36, 0.2),
+ 'litMineur': (2.06, 25.41, 13.93, 4.33, 8.47, 21.78)}
controlStatZ(statz, refstatz)
# --- add a field on nodes of type double with z values, named "BOTTOM"
geompy = geomBuilder.New(theStudy)
-#geomObj_1 = geompy.CreateGroup(HYDRO_etude, geompy.ShapeType["EDGE"])
-#geompy.UnionIDs(geomObj_1, [7, 9])
-#geomObj_3 = geompy.CreateGroup(HYDRO_etude, geompy.ShapeType["EDGE"])
-#geompy.UnionIDs(geomObj_3, [4, 11, 17, 24, 26, 28, 14, 19, 20, 22, 31, 39, 41, 33, 35, 37])
etude_domaine_Outer = geompy.CreateGroup(HYDRO_etude_1, geompy.ShapeType["EDGE"])
geompy.UnionIDs(etude_domaine_Outer, [3, 6, 8, 10])
domaine = geompy.CreateGroup(HYDRO_etude_1, geompy.ShapeType["FACE"])
# --- Z interpolation Z sur la bathymetrie/altimetrie aux noeuds du maillage
statz = interpolZ(nomCas, fichierMaillage, dicoGroupeRegion, zUndef, interpolMethod)
-refstatz = {'domaine': (27.101, 168.257)}
+#print statz
+refstatz = {'domaine': (27.10, 168.28, 91.77, 46.047, 28.637, 161.17)}
controlStatZ(statz, refstatz)
# --- add a field on nodes of type double with z values, named "BOTTOM"
# --- Z interpolation on the bathymety/altimetry on the mesh nodes
statz = interpolZ(nomCas, fichierMaillage, dicoGroupeRegion, zUndef)
-refstatz = {'riveDroite': (99.8278, 100.8), 'riveGauche': (100.0, 100.0), 'litMineur': (80.4541, 100.8)}
+#print statz
+refstatz = {'riveDroite': (99.83, 100.80, 100.09, 0.21, 99.98, 100.64),
+ 'riveGauche': (100.0, 100.0, 100.0, 0.0, 100.0, 100.0),
+ 'litMineur': (80.45, 100.80, 92.85, 4.83, 84.43, 100.0)}
controlStatZ(statz, refstatz)
# --- add a field on nodes of type double with z values, named "BOTTOM"
}
else
{
- DEBTRACE("aZoneInterpolator == NULL");
+ //DEBTRACE("aZoneInterpolator == NULL");
aResAltitude = aMergeAltitude->GetAltitudeForPoint( thePoint );
}
}
Handle(HYDROData_Entity) HYDROData_Entity::GetReferenceObject( const int theTag,
const int theIndex ) const
{
- DEBTRACE("GetReferenceObject " << theTag << " " << theIndex);
+ //DEBTRACE("GetReferenceObject " << theTag << " " << theIndex);
Handle(HYDROData_Entity) aRes;
Handle(TDataStd_ReferenceList) aRefs = getReferenceList( theTag, false );
Handle(TDataStd_ReferenceList) HYDROData_Entity::getReferenceList( const int theTag,
const bool theIsCreate ) const
{
- DEBTRACE("getReferenceList " << theTag << " " << theIsCreate);
+ //DEBTRACE("getReferenceList " << theTag << " " << theIsCreate);
TDF_Label aLabel = theTag == 0 ? myLab : myLab.FindChild( theTag );
Handle(TDataStd_ReferenceList) aRefs;
def controlStatZ(statz,refstatz):
"""
- Compare min and max of z of regions with a reference,
- with a precision of 0.05m by default.
+ Compare min, max, mean, standard deviation, percentile 5 and 95 of z of regions with a reference,
+ with a precision of 0.05m by default and 1.0m for min and max.
"""
for nomreg, valsref in refstatz.iteritems():
vals = statz[nomreg]
- tolerance =0.05
- if len(valsref) > 2:
- tolerance = valsref[2]
- if abs(vals[0] - valsref[0]) > tolerance \
- or abs(vals[1] - valsref[1]) > tolerance:
+ tolerance =0.1
+ if len(valsref) > 6:
+ tolerance = valsref[6]
+ if abs(vals[0] - valsref[0]) > 10*tolerance \
+ or abs(vals[1] - valsref[1]) > 10*tolerance \
+ or abs(vals[2] - valsref[2]) > tolerance \
+ or abs(vals[3] - valsref[3]) > tolerance \
+ or abs(vals[4] - valsref[4]) > 10*tolerance \
+ or abs(vals[5] - valsref[5]) > 10*tolerance :
print nomreg
- print "value: ", vals, " reference: ", valsref, "tolerance: ", tolerance
+ print "value: ", vals
+ print "reference: ", valsref, "tolerance for mean, std dev: ", tolerance, "and ", 10*tolerance, "for other values"
raise ValueError("z interpolation error")
else:
print nomreg
- print "value: ", vals, " reference: ", valsref, "tolerance: ", tolerance, " OK"
+ print "value: ", vals
+ print "reference: ", valsref, "tolerance for mean, std dev: ", tolerance, "and ", 10*tolerance, "for other values: OK"
import MEDLoader
theStudy = salome.myStudy
theStudyId = salome.myStudyId
+import numpy as np
+
# -----------------------------------------------------------------------------
from med import medfile
vx.append(xyz[0])
vy.append(xyz[1])
vz = cas.GetAltitudesForPoints( vx, vy, region, interpolMethod )
- minz = min(vz)
- maxz = max(vz)
- statz[grp.GetName()] = (minz, maxz)
+ minz = np.amin(vz)
+ maxz = np.amax(vz)
+ meanz = np.mean(vz)
+ stdz = np.std(vz)
+ v05z = np.percentile(vz,05)
+ v95z = np.percentile(vz,95)
+
+ statz[grp.GetName()] = (minz, maxz, meanz, stdz, v05z, v95z)
for i,nodeId in enumerate(nodesIds):