6.1.2.12. thyrsis.spatialitemeshdataprovider module

class thyrsis.spatialitemeshdataprovider.SpatialiteMeshConstDataProvider(uri='', providerOptions=<qgis._core.QgsDataProvider.ProviderOptions object>, flags=None)

Bases: thyrsis.meshlayer.meshdataprovider.MeshDataProvider

Spatialite const mesh data provider

PROVIDER_KEY = 'thyrsis_const_provider'
conversionFactor(units=None)

conversion from the set units to any units, if units is not specify, return in SI units

Parameters

units (string) – units

Returns

factor

Return type

float

classmethod createProvider(uri, providerOptions)
classmethod description()

Returns the spatialite mesh provider description

elementValues()

return values at elements

Returns

values at nodes

Return type

ndarray

extent()

Return extent

Returns

extent

Return type

QgsRectangle

maxValue(index=None)

Return max mesh value

Parameters

index (dict) – node index

Returns

max value

Return type

float

minValue(index=None)

Return max mesh value

Parameters

index (dict) – node index

Returns

max value

Return type

float

name()

Return provider key

Returns

key

Return type

string

nodeCoord(zColumn='0')

return a list of coordinates

Parameters

zColumn (string) – formula for column height or altitude

Returns

return a list of coordinates

Return type

ndarray

nodeValues()

return values at nodes

Returns

values at nodes

Return type

ndarray

classmethod providerKey()

Returns the spatialite mesh provider key

resultColumn()

Return current column

Returns

current column

Return type

string

sourceUnits = {'altitude': 'm', 'altitude_mur': 'm', 'epaisseur_zns': 'm', 'epaisseur_zs': 'm', 'permeabilite_x': 'm/s', 'potentiel': 'm', 'potentiel_reference': 'm', 'v_norme': 'm/s'}
triangles()

return a list of triangles described by node indices

Returns

triangles

Return type

list

update_values()

Update mesh values

valueAtElement()

Return if the mesh is element based

Returns

state

Return type

bool

valuesAt(point)

return a list of values at a given point, interpolate values if needed

Parameters

point (tuple) – point xy

Returns

value

Return type

float

class thyrsis.spatialitemeshdataprovider.SpatialiteMeshDataProvider(uri='', providerOptions=<qgis._core.QgsDataProvider.ProviderOptions object>, flags=None)

Bases: thyrsis.meshlayer.meshdataprovider.MeshDataProvider

Spatialite mesh data provider

PROVIDER_KEY = 'thyrsis_provider'
altitudeAt(point)

return altitude given point, interpolate values if needed

Parameters

point (tuple) – point xy

Returns

value

Return type

float

availableColumns()

returns a list (display name, colummn name) for available results

Returns

available column

Return type

list

availableUnits()

Return available units

Returns

available units

Return type

dict

columnChanged
conn()

Return database connection

Retunr

db connection

Return type

sqlite3.Connection

contours()

Return a map with the contour (name, group) as key and an array of vertices as values, contours are 3D

Returns

contours

Return type

dict

conversionFactor(units=None)

conversion from the set units to any units, if units is not specify, return in SI units

Parameters

units (string) – units

classmethod createProvider(uri, providerOptions)
database()

Return db path

Returns

db path

Return type

string

classmethod description()

Returns the spatialite mesh provider description

displayName = {'concentration': 'Concentration', 'concentration2': 'Concentration second milieu', 'potentiel': 'Potentiel', 'potentiel2': 'Potentiel second milieu', 'probability': 'Probabilité', 'probability2': 'Probabilité second milieu', 'saturation': 'Saturation', 'saturation2': 'Saturation second milieu', 'vitesse_darcy_norme': 'Vitesse de Darcy', 'vitesse_darcy_norme2': 'Vitesse de Darcy second milieu'}
elementValues()

return values at elements

Returns

values at nodes

Return type

ndarray

extent()

Return extent

Returns

extent

Return type

QgsRectangle

getDatabasePath()
mass_balance()

compute mass balance

Return sat

sat values

Rtype sat

list

Return out

out values

Rtype out

list

Return insat

insat values

Rtype insat

list

maxValue(index=None)

Return max mesh value

Parameters

index (dict) – node index

Returns

max value

Return type

float

measuresAt(point, withinDistance=0.5)

returns a map of measures in the vicinity of the considered point the map as the mesure type as key and [(date, value, uncertainty)] as values

Parameters
  • point (tuple) – point xy

  • withinDistance (float) – snap distance

Returns

measures

Return type

dict

minValue(index=None)

Return min mesh value

Parameters

index (dict) – node index

Returns

min value

Return type

float

name()

Return provider key

Returns

key

Return type

string

nodeCoord(zColumn='0')

return a list of coordinates

Parameters

zColumn (string) – formula for column height or altitude

Returns

return a list of coordinates

Return type

ndarray

nodeValues()

return values at nodes

Returns

values at nodes

Return type

ndarray

classmethod providerKey()

Returns the spatialite mesh provider key

removeColumn(columnName)

Use to remove npy files when re-run simulation otherwise mesh form previous simulation will be available like probability map

Parameters

columnName (string) – columnName

resultColumn()

Return current column

Returns

current column

Return type

string

scatters()

return a map with the contour name as key and an point as value

Returns

scatters

Return type

list

setResultColumn(columnName)

Set the current column

Parameters

columnName (string) – columnName

setUnits(units)

Set units

Parameters

units (string) – units

settings()

Return Thyrsis settings

Returns

Thyrsis settings

Return type

Settings

sourceUnits = {'concentration': 'kg/m³', 'concentration2': 'kg/m³', 'potentiel': 'm', 'potentiel2': 'm', 'probability': '-', 'probability2': '-', 'saturation': '-', 'saturation2': '-', 'vitesse_darcy_norme': 'm/s', 'vitesse_darcy_norme2': 'm/s'}
triangles()

return a list of triangles described by node indices

Returns

triangles

Return type

list

units()

Return current units

Returns

units

Return type

string

unitsChanged
valueAtElement()

Return if the mesh is element based

Returns

state

Return type

bool

valuesAt(point, svalue=False)

return a list of values at a given point, interpolate values if needed, returns sigma values if required and available

Parameters
  • point (tuple) – point xy

  • svalue (bool) – sigma values flag

Returns

value

Return type

float