Collection.VariableCollection

class pcraster.collection.VariableCollection(keys, value=None)

Creating arrayed variables

Parameter:

keys

a list of Index classes

value

all array indices will be initialised with defaultValue. If defaultValue is a callable, the callable return value will be assigned to the collection item. The callable will be called with for each item in the collection with 2 arguments:

name

of this VariableCollection

index

index tuple of item a value is generated for

Example:

PlantSpecies = Index([ “Species1”, “Species2”])

Variable1 = VariableCollection([PlantSpecies], value=0)

class pcraster.collection.ValueTimeoutputTimeseries(varName, model, idMap=None, noHeader=False)

Class to be used in initialisation of collection variables for timeseries output Parameters:

varName

name of the variable, used to generate the timeseries output filename

model

reference to the Dynamic or Static user model class

idMap

sample locations

noHeader

if False only column values will be written to file

class pcraster.collection.ValueFromParameterTable(varName, fileName, dataType=None)

Class to be used for initialisation of collection indices from an external parameter file

Parameter:

varName

name of the collection variable used in the external file

fileName

filename of the external file

dataType

PCRaster data type. Use None when reading maps from disk