meteoJS/modelviewer/resource . Resource
Source: modelviewer/
Class to describe a data resource like a modelplot or a sounding data. The resource must be defined uniquely by several variables (like model, runtime, …). You should not define the resource by several variables of the same collection.
new Resource([options])
Parameter
Name | Type | Optional | Description |
---|---|---|---|
options |
|
Yes |
Options. |
Properties
_offset (undefined or integer)
_run (undefined or Date)
datetime (Date or undefined)
Resource is valid for this datetime. If undefined, than the resource is not only valid at one datetime.
offset (integer or undefined)
Offset.
run (Date or undefined)
Runtime.
variables Array of module:meteoJS/modelviewer/variable.Variable
Variable objects, which define this resource. Like model, run, offset,…
Methods
getVariableByVariableCollection(variableCollection) → module:meteoJS/modelviewer/variable.Variable
Returns the variable-object that is part of the definition of this resource and contains to the passed collection. If you define the resource by several variables of the same variable collection, it is not defined which variable is returned.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
variableCollection |
module:meteoJS/modelviewer/variableCollection.VariableCollection |
|
VariableCollection. |
isDefinedBy([exactlyMatch], ...variables) → boolean
Returns if the passed Variable-objects all define this resource.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
exactlyMatch |
boolean |
Yes |
Only return true, if the passed variables exactly define the resource. |
variables |
|
Variables. Value can be repeated. |
- Returns
-
boolean
All passed variables defines the resource.
isDefinedByVariableOf(variableCollection) → boolean
Returns if a Variable-object of the passed collection defines this resource.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
variableCollection |
module:meteoJS/modelviewer/variableCollection.VariableCollection |
|
VariableCollection. |
- Returns
-
boolean
A variable of the collection defines the resource.