User Tools

Site Tools


tutorials:sensor-grids

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
tutorials:sensor-grids [2024/12/08 20:24] – created MHtutorials:sensor-grids [2025/06/04 14:12] (current) MH
Line 2: Line 2:
  
 Light distributions, micro-light climate, light above canopy, light extinction coefficients, etc. are key parameters for any canopy simulations. To obtain these, areal or gird like sensor arrangements are required. Both can be generated within GroIMP by only a few lines of code. Light distributions, micro-light climate, light above canopy, light extinction coefficients, etc. are key parameters for any canopy simulations. To obtain these, areal or gird like sensor arrangements are required. Both can be generated within GroIMP by only a few lines of code.
 +
 +For an introduction to //SensorNnodes// have a look at the [[:Tutorials:light-modeling-sensors| Sensors ]] tutorial.
  
 ===== Sensor Grids ===== ===== Sensor Grids =====
Line 60: Line 62:
  
 {{ :tutorials:SensorGrid.png?direct&500 |}} {{ :tutorials:SensorGrid.png?direct&500 |}}
 +
 +Note: The above code works fine as long as the number of sensor nodes is moderate, e.g., below 100. The drawback of the above code it that it connects all sensor nodes to one parent, what, unfortunately, will slow down computation when the number of children is getting too large. If more sensor nodes are required, be advised implementation uses two helper nodes in order to generate an (internal) tree structure instead of sensor nodes. This will nothing change for the user, but will allow easily thousands of sensor nodes if wanted.
 +
 +The 'large number of sensor node save code' would look like given below:
 +<code java>
 +{
 +  float xi, yi, zi;
 +}
 +for (int x=0;x<6; x++) (
 +  [Node
 +  for (int y=0;y<6; y++) (
 +    [Node
 +    for (int z=0;z<3; z++) (
 +      [
 +        {
 +          xi =-2+0.75*x;
 +          yi =-2+0.75*y;
 +          zi =0.5*z; 
 +        }
 +        Null(xi, yi, zi) SensorElement(xi, yi, zi)
 +      ]
 +    ])
 +  ])
 +)
 +</code>
 +
  
 The last thing to do in order to make really use of sensor grid is to obtain the sensed radiation for the sensor nodes and also may want to export them for further/external analysis.  The last thing to do in order to make really use of sensor grid is to obtain the sensed radiation for the sensor nodes and also may want to export them for further/external analysis. 
Line 257: Line 285:
 {{ :tutorials:ArealSensor.png?direct&500 |}} {{ :tutorials:ArealSensor.png?direct&500 |}}
  
-Queering the //SensorElements// and exporting the data follows precisely the way of the sensor grid. One small difference, of course, is that for visible objects the //getSensedIrradiance// function, as it is used for //SensorNodes//, cannot be applied. Instead, the //getAbsorbedPower// function needs to be called.+Querying the //SensorElements// and exporting the data follows precisely the way of the sensor grid. One small difference, of course, is that for visible objects the //getSensedIrradiance// function, as it is used for //SensorNodes//, cannot be applied. Instead, the //getAbsorbedPower// function needs to be called.
  
 Additionally, in this example, a //ColorGradient// is applied to colour the sensor elements according to their absorbed radiation. In order to define the right range for the //ColorGradient// instance, the minimal and maximal absorption values needs to be measured first. This is done whenever the //simulateLight// function is called and printed to the console window. The obtained values needs to be set to the //ColorGradient//, consequently, the colouring will be right from the second run one and needs to be redone whenever ether the dimension or the resolution of the areal sensor is changed. Additionally, in this example, a //ColorGradient// is applied to colour the sensor elements according to their absorbed radiation. In order to define the right range for the //ColorGradient// instance, the minimal and maximal absorption values needs to be measured first. This is done whenever the //simulateLight// function is called and printed to the console window. The obtained values needs to be set to the //ColorGradient//, consequently, the colouring will be right from the second run one and needs to be redone whenever ether the dimension or the resolution of the areal sensor is changed.
tutorials/sensor-grids.1733685882.txt.gz · Last modified: 2024/12/08 20:24 by MH