Object parameters

Navigation:  OLE automation >

Object parameters

Previous pageReturn to chapter overviewNext page

In order to optimize a setup or to investigate 'strange effects' it is quite helpful to vary a parameter (e.g. the position of a geometric element) and inspect the change of the detector signals. To do so, you have to go through the following sequence:

 

Set the parameters of the model

Perform the simulation and compute the detector spectra

Read the required data and store them in appropriate tables

Go back and do the next parameter modification

 

The parameters of SPRAY objects that can be controlled by OLE automation are described in this section. Please tell us if you are missing some items here. Usually we can provide additional OLE features quite rapidly.

 

Scatterers:

scatterer_parameter(name:string, parameter:string): float

Using this property you can set or read parameters of scatterers. With name you have to specify the name of the scatterer, with parameter the property you want to pick. You can set, for example, the volume fraction by referring to the parameter 'volume_fraction'.

The following VisualBasic line sets the volume fraction of the scatterer named 'Water spheres' to 3%:

spray.scatterer_parameter("Water spheres","volume_fraction") = 0.03

The notation without underscore is also tolerated:

thevalue = spray.scatterer_parameter("Water spheres","volume fraction")

You can retrieve the absorption and scattering probabilities K and S the following way:

thevalue = scatterer_parameter("Water spheres","K at 1000 nm")

thevalue = scatterer_parameter("Water spheres","S at 4.53 eV")

 

Information about the size distribution

If the scatterer is of type 'Extended Mie scatterer' or 'Fluorescent Mie scatterer' you can get information about the current radius distribution and manipulate it. Get the number of radii using the command

number_of_points = scatterer_parameter("Water spheres","size classes")

 

The 'radius points' are counted 1,2,3, ...

Get the radius of point 7 using the command

radius = scatterer_parameter("Water spheres","radius size class 7")

Get the probability of point 7 using the command

prob = scatterer_parameter("Water spheres","probability size class 7")

 

Changing the size distribution

When you set the number of points of the radius distribution, the internal data array is initialized with zeroes:

scatterer_parameter("Water spheres","size classes") = 10

You should now use a loop and set the radius and the probability for all points:

scatterer_parameter("Water spheres","radius size class 1") = 20E-9

scatterer_parameter("Water spheres","probability size class 1") = 0.23

 

scatterer_parameter("Water spheres","radius size class 2") = 40E-9

scatterer_parameter("Water spheres","probability size class 2") = 0.134

 

scatterer_command(name:string, command : string,  parameter: float)

Use this command to manipulate the size distribution. The following commands are defined up to now:

Normalize the distribution: scatterer_command("Water spheres","Normalize",0)

Shift the radius values of the distribution (by 20 nm, in this example): scatterer_command("Water spheres","shift radius distribution",20e-9)

Multiply the radius values of the distribution (by 1.1, in this example): scatterer_command("Water spheres","multiply radius distribution",1.1)

 

scatterer_load_rt(name : string) : string

Passing a filename to this property causes the scatterer with the specified name to import RT data from the specified file.

Here is an example:

spray.scatterer_load_rt("Water spheres") = "C:\mie\water1.rt"

 

Geometric objects:

object_parameter(name:string, parameter:string): float

Using this general property you can set or read parameters of geometric objects. With name you have to specify the name of the object, parameter determines the property you want to set or read.

Changing the position (x-coordinate) of a mirror named 'Mirror 2', for example, can be done like this:

spray.object_parameter("Mirror 2","x") = 14.3

Please consult the description of the individual geometric objects to see which parameters are available.

 

object_parameter_string(name:string, parameter:string): string

Using this property you can set or read string parameters of geometric objects. With name you have to specify the name of the object, parameter determines the property you want to set or read.

Changing the formula of a user-defined surface shape named 'My shape', for example, can be done like this:

spray.object_parameter_string("My shape","surface_formula") = "0.3+0.3*(sin(0.2*x))"

Please consult the description of the individual geometric objects to see which parameters are available.

 

Views

In connection with automatic video generation or simply for taking some snapshots of the SPRAY scenery, rendered views can be modified by OLE automation as well. The command for doing so is this:

view_parameter(name:string, parameter:string): float

Name specifies the view you want to select, and parameter determines the property you want to read or set. Here are the parameters that you can access:

 'observer_x' : x-coordinate of the observation point

 'observer_y' : y-coordinate of the observation point

 'observer_z' : z-coordinate of the observation point

 'target_x' : x-coordinate of the target

 'target_y' : y-coordinate of the target

 'target_z' : z-coordinate of the target

 'vector_1': Length of vector 1

 'vector_2': Length of vector 2

 'distance': Distance observation point - center pixel array

 'angle': Rotation angle of the pixel array