How to create a sensor#

This tutorial demonstrates how to create a sensor.

There are different type of sensors available: irradiance sensor, radiance sensor, camera sensor.

[1]:
from pathlib import Path

from ansys.speos.core import Project, Speos
from ansys.speos.core.sensor import (
    SensorCamera,
    SensorIrradiance,
    SensorRadiance,
)

# If using docker container
assets_data_path = Path("/app") / "assets"
# If using local server
# assets_data_path = Path().resolve().parent.parent / "tests" / "assets"
# If using a different path
# assets_data_path = Path("path/to/downloaded/example/assets")

Create connection with speos rpc server#

[2]:
speos = Speos(host="localhost", port=50098)

Create a new project#

The only way to create a sensor, is to create it from a project.

[3]:
p = Project(speos=speos)
print(p)
{
    "name": "",
    "description": "",
    "metadata": {},
    "part_guid": "",
    "sources": [],
    "sensors": [],
    "simulations": [],
    "materials": [],
    "scenes": []
}

Create#

Create locally.

The mention “local: “ is added when printing the sensor

[4]:
distortion_file_path = str(
    assets_data_path / "CameraInputFiles" / "CameraDistortion_130deg.OPTDistortion"
)
transmittance_file_path = str(
    assets_data_path / "CameraInputFiles" / "CameraTransmittance.spectrum"
)
blue_spectrum_path = str(assets_data_path / "CameraInputFiles" / "CameraSensitivityBlue.spectrum")
green_spectrum_path = str(assets_data_path / "CameraInputFiles" / "CameraSensitivityGreen.spectrum")
red_spectrum_path = str(assets_data_path / "CameraInputFiles" / "CameraSensitivityRed.spectrum")

sensor1 = p.create_sensor(name="Camera.1", feature_type=SensorCamera)
sensor1.set_distortion_file_uri(uri=distortion_file_path)
# Choose photometric mode
sensor1.set_mode_photometric().set_transmittance_file_uri(uri=transmittance_file_path)
# Choose color mode (will imply to give spectrum file for blue, green and red)
sensor1.set_mode_photometric().set_mode_color().set_blue_spectrum_file_uri(uri=blue_spectrum_path)
sensor1.set_mode_photometric().set_mode_color().set_green_spectrum_file_uri(uri=green_spectrum_path)
sensor1.set_mode_photometric().set_mode_color().set_red_spectrum_file_uri(uri=red_spectrum_path)
print(sensor1)
local: {
    "name": "Camera.1",
    "description": "",
    "metadata": {},
    "sensor_guid": "",
    "result_file_name": "",
    "sensor": {
        "camera_sensor_template": {
            "sensor_mode_photometric": {
                "acquisition_integration": 0.01,
                "transmittance_file_uri": "/app/assets/CameraInputFiles/CameraTransmittance.spectrum",
                "gamma_correction": 2.2,
                "png_bits": "PNG_16",
                "color_mode_color": {
                    "red_spectrum_file_uri": "/app/assets/CameraInputFiles/CameraSensitivityRed.spectrum",
                    "green_spectrum_file_uri": "/app/assets/CameraInputFiles/CameraSensitivityGreen.spectrum",
                    "blue_spectrum_file_uri": "/app/assets/CameraInputFiles/CameraSensitivityBlue.spectrum",
                    "balance_mode_none": {}
                },
                "wavelengths_range": {
                    "w_start": 400.0,
                    "w_end": 700.0,
                    "w_sampling": 13
                },
                "acquisition_lag_time": 0.0
            },
            "focal_length": 5.0,
            "imager_distance": 10.0,
            "f_number": 20.0,
            "horz_pixel": 640,
            "vert_pixel": 480,
            "width": 5.0,
            "height": 5.0,
            "distortion_file_uri": "/app/assets/CameraInputFiles/CameraDistortion_130deg.OPTDistortion",
            "distorsion_file_uri": "",
            "axis_system": [
                0.0,
                0.0,
                0.0,
                1.0,
                0.0,
                0.0,
                0.0,
                1.0,
                0.0,
                0.0,
                0.0,
                1.0
            ],
            "layer_type_none": {},
            "trajectory_file_uri": ""
        },
        "name": "Camera.1",
        "description": "",
        "metadata": {}
    }
}

Push it to the server.#

Now that it is committed to the server, the mention “local: “ is no more present when printing the sensor.

[5]:
sensor1.commit()
print(sensor1)
{
    "name": "Camera.1",
    "metadata": {
        "UniqueId": "5ec56b51-0446-4c40-a6fb-7401567d8cae"
    },
    "sensor_guid": "8ec96c55-fa06-461c-95e2-7c6a42b16839",
    "description": "",
    "result_file_name": "",
    "sensor": {
        "camera_sensor_template": {
            "sensor_mode_photometric": {
                "acquisition_integration": 0.01,
                "transmittance_file_uri": "/app/assets/CameraInputFiles/CameraTransmittance.spectrum",
                "gamma_correction": 2.2,
                "png_bits": "PNG_16",
                "color_mode_color": {
                    "red_spectrum_file_uri": "/app/assets/CameraInputFiles/CameraSensitivityRed.spectrum",
                    "green_spectrum_file_uri": "/app/assets/CameraInputFiles/CameraSensitivityGreen.spectrum",
                    "blue_spectrum_file_uri": "/app/assets/CameraInputFiles/CameraSensitivityBlue.spectrum",
                    "balance_mode_none": {}
                },
                "wavelengths_range": {
                    "w_start": 400.0,
                    "w_end": 700.0,
                    "w_sampling": 13
                },
                "acquisition_lag_time": 0.0
            },
            "focal_length": 5.0,
            "imager_distance": 10.0,
            "f_number": 20.0,
            "horz_pixel": 640,
            "vert_pixel": 480,
            "width": 5.0,
            "height": 5.0,
            "distortion_file_uri": "/app/assets/CameraInputFiles/CameraDistortion_130deg.OPTDistortion",
            "distorsion_file_uri": "",
            "axis_system": [
                0.0,
                0.0,
                0.0,
                1.0,
                0.0,
                0.0,
                0.0,
                1.0,
                0.0,
                0.0,
                0.0,
                1.0
            ],
            "layer_type_none": {},
            "trajectory_file_uri": ""
        },
        "name": "Camera.1",
        "description": "",
        "metadata": {}
    }
}

Another example#

Set more characteristics.

Camera feature is created with the same default values as the GUI speos.

If the user would like to modify the camera characteristics, it is possible to do so as below.

[6]:
distortion_file_path = str(
    assets_data_path / "CameraInputFiles" / "CameraDistortion_130deg.OPTDistortion"
)
transmittance_file_path = str(
    assets_data_path / "CameraInputFiles" / "CameraTransmittance.spectrum"
)
blue_spectrum_path = str(assets_data_path / "CameraInputFiles" / "CameraSensitivityBlue.spectrum")
green_spectrum_path = str(assets_data_path / "CameraInputFiles" / "CameraSensitivityGreen.spectrum")
red_spectrum_path = str(assets_data_path / "CameraInputFiles" / "CameraSensitivityRed.spectrum")

sensor2 = p.create_sensor(name="Camera.2", feature_type=SensorCamera)
sensor2.set_distortion_file_uri(uri=distortion_file_path)
sensor2.set_mode_photometric().set_transmittance_file_uri(uri=transmittance_file_path)
sensor2.set_mode_photometric().set_layer_type_source()
sensor2.set_mode_photometric().set_mode_color().set_blue_spectrum_file_uri(uri=blue_spectrum_path)
sensor2.set_mode_photometric().set_mode_color().set_green_spectrum_file_uri(uri=green_spectrum_path)
sensor2.set_mode_photometric().set_mode_color().set_red_spectrum_file_uri(uri=red_spectrum_path)
sensor2.set_focal_length(5.5)
sensor2.set_height(value=6).set_width(value=6)  # dimensions
sensor2.set_axis_system(
    [20, 10, 40, 1, 0, 0, 0, 1, 0, 0, 0, 1]
)  # camera location [Origin, Xvector, Yvector, Zvector]
sensor2.commit()

print(sensor2)
{
    "name": "Camera.2",
    "metadata": {
        "UniqueId": "009a88b0-7b5c-407e-a6a3-8e35b0dab0d9"
    },
    "sensor_guid": "ba3b7eab-cecd-425c-913b-f09c50b96ddc",
    "description": "",
    "result_file_name": "",
    "sensor": {
        "camera_sensor_template": {
            "sensor_mode_photometric": {
                "acquisition_integration": 0.01,
                "transmittance_file_uri": "/app/assets/CameraInputFiles/CameraTransmittance.spectrum",
                "gamma_correction": 2.2,
                "png_bits": "PNG_16",
                "color_mode_color": {
                    "red_spectrum_file_uri": "/app/assets/CameraInputFiles/CameraSensitivityRed.spectrum",
                    "green_spectrum_file_uri": "/app/assets/CameraInputFiles/CameraSensitivityGreen.spectrum",
                    "blue_spectrum_file_uri": "/app/assets/CameraInputFiles/CameraSensitivityBlue.spectrum",
                    "balance_mode_none": {}
                },
                "wavelengths_range": {
                    "w_start": 400.0,
                    "w_end": 700.0,
                    "w_sampling": 13
                },
                "acquisition_lag_time": 0.0
            },
            "focal_length": 5.5,
            "imager_distance": 10.0,
            "f_number": 20.0,
            "horz_pixel": 640,
            "vert_pixel": 480,
            "width": 6.0,
            "height": 6.0,
            "distortion_file_uri": "/app/assets/CameraInputFiles/CameraDistortion_130deg.OPTDistortion",
            "distorsion_file_uri": "",
            "axis_system": [
                20.0,
                10.0,
                40.0,
                1.0,
                0.0,
                0.0,
                0.0,
                1.0,
                0.0,
                0.0,
                0.0,
                1.0
            ],
            "layer_type_source": {},
            "trajectory_file_uri": ""
        },
        "name": "Camera.2",
        "description": "",
        "metadata": {}
    }
}

Read#

Sensor Instance#

A mention “local: “ is added if it is not yet committed to the server

[7]:
print(sensor1)
{
    "name": "Camera.1",
    "metadata": {
        "UniqueId": "5ec56b51-0446-4c40-a6fb-7401567d8cae"
    },
    "sensor_guid": "8ec96c55-fa06-461c-95e2-7c6a42b16839",
    "description": "",
    "result_file_name": "",
    "sensor": {
        "camera_sensor_template": {
            "sensor_mode_photometric": {
                "acquisition_integration": 0.01,
                "transmittance_file_uri": "/app/assets/CameraInputFiles/CameraTransmittance.spectrum",
                "gamma_correction": 2.2,
                "png_bits": "PNG_16",
                "color_mode_color": {
                    "red_spectrum_file_uri": "/app/assets/CameraInputFiles/CameraSensitivityRed.spectrum",
                    "green_spectrum_file_uri": "/app/assets/CameraInputFiles/CameraSensitivityGreen.spectrum",
                    "blue_spectrum_file_uri": "/app/assets/CameraInputFiles/CameraSensitivityBlue.spectrum",
                    "balance_mode_none": {}
                },
                "wavelengths_range": {
                    "w_start": 400.0,
                    "w_end": 700.0,
                    "w_sampling": 13
                },
                "acquisition_lag_time": 0.0
            },
            "focal_length": 5.0,
            "imager_distance": 10.0,
            "f_number": 20.0,
            "horz_pixel": 640,
            "vert_pixel": 480,
            "width": 5.0,
            "height": 5.0,
            "distortion_file_uri": "/app/assets/CameraInputFiles/CameraDistortion_130deg.OPTDistortion",
            "distorsion_file_uri": "",
            "axis_system": [
                0.0,
                0.0,
                0.0,
                1.0,
                0.0,
                0.0,
                0.0,
                1.0,
                0.0,
                0.0,
                0.0,
                1.0
            ],
            "layer_type_none": {},
            "trajectory_file_uri": ""
        },
        "name": "Camera.1",
        "description": "",
        "metadata": {}
    }
}

Project#

Committed feature will appear in the project.

[8]:
print(p)
{
    "sensors": [
        {
            "name": "Camera.1",
            "metadata": {
                "UniqueId": "5ec56b51-0446-4c40-a6fb-7401567d8cae"
            },
            "sensor_guid": "8ec96c55-fa06-461c-95e2-7c6a42b16839",
            "description": "",
            "result_file_name": "",
            "sensor": {
                "camera_sensor_template": {
                    "sensor_mode_photometric": {
                        "acquisition_integration": 0.01,
                        "transmittance_file_uri": "/app/assets/CameraInputFiles/CameraTransmittance.spectrum",
                        "gamma_correction": 2.2,
                        "png_bits": "PNG_16",
                        "color_mode_color": {
                            "red_spectrum_file_uri": "/app/assets/CameraInputFiles/CameraSensitivityRed.spectrum",
                            "green_spectrum_file_uri": "/app/assets/CameraInputFiles/CameraSensitivityGreen.spectrum",
                            "blue_spectrum_file_uri": "/app/assets/CameraInputFiles/CameraSensitivityBlue.spectrum",
                            "balance_mode_none": {}
                        },
                        "wavelengths_range": {
                            "w_start": 400.0,
                            "w_end": 700.0,
                            "w_sampling": 13
                        },
                        "acquisition_lag_time": 0.0
                    },
                    "focal_length": 5.0,
                    "imager_distance": 10.0,
                    "f_number": 20.0,
                    "horz_pixel": 640,
                    "vert_pixel": 480,
                    "width": 5.0,
                    "height": 5.0,
                    "distortion_file_uri": "/app/assets/CameraInputFiles/CameraDistortion_130deg.OPTDistortion",
                    "distorsion_file_uri": "",
                    "axis_system": [
                        0.0,
                        0.0,
                        0.0,
                        1.0,
                        0.0,
                        0.0,
                        0.0,
                        1.0,
                        0.0,
                        0.0,
                        0.0,
                        1.0
                    ],
                    "layer_type_none": {},
                    "trajectory_file_uri": ""
                },
                "name": "Camera.1",
                "description": "",
                "metadata": {}
            }
        },
        {
            "name": "Camera.2",
            "metadata": {
                "UniqueId": "009a88b0-7b5c-407e-a6a3-8e35b0dab0d9"
            },
            "sensor_guid": "ba3b7eab-cecd-425c-913b-f09c50b96ddc",
            "description": "",
            "result_file_name": "",
            "sensor": {
                "camera_sensor_template": {
                    "sensor_mode_photometric": {
                        "acquisition_integration": 0.01,
                        "transmittance_file_uri": "/app/assets/CameraInputFiles/CameraTransmittance.spectrum",
                        "gamma_correction": 2.2,
                        "png_bits": "PNG_16",
                        "color_mode_color": {
                            "red_spectrum_file_uri": "/app/assets/CameraInputFiles/CameraSensitivityRed.spectrum",
                            "green_spectrum_file_uri": "/app/assets/CameraInputFiles/CameraSensitivityGreen.spectrum",
                            "blue_spectrum_file_uri": "/app/assets/CameraInputFiles/CameraSensitivityBlue.spectrum",
                            "balance_mode_none": {}
                        },
                        "wavelengths_range": {
                            "w_start": 400.0,
                            "w_end": 700.0,
                            "w_sampling": 13
                        },
                        "acquisition_lag_time": 0.0
                    },
                    "focal_length": 5.5,
                    "imager_distance": 10.0,
                    "f_number": 20.0,
                    "horz_pixel": 640,
                    "vert_pixel": 480,
                    "width": 6.0,
                    "height": 6.0,
                    "distortion_file_uri": "/app/assets/CameraInputFiles/CameraDistortion_130deg.OPTDistortion",
                    "distorsion_file_uri": "",
                    "axis_system": [
                        20.0,
                        10.0,
                        40.0,
                        1.0,
                        0.0,
                        0.0,
                        0.0,
                        1.0,
                        0.0,
                        0.0,
                        0.0,
                        1.0
                    ],
                    "layer_type_source": {},
                    "trajectory_file_uri": ""
                },
                "name": "Camera.2",
                "description": "",
                "metadata": {}
            }
        }
    ],
    "name": "",
    "description": "",
    "metadata": {},
    "part_guid": "",
    "sources": [],
    "simulations": [],
    "materials": [],
    "scenes": []
}

Update#

Tipp: if you are manipulating a source already committed, don’t forget to commit your changes.

If you don’t, you will still only watch what is committed on the server.

[9]:
# modify f number and axis system
sensor1.set_f_number(value=11).set_axis_system([17, 10, 10, 1, 0, 0, 0, 1, 0, 0, 0, 1])
sensor1.commit()
print(sensor1)
{
    "name": "Camera.1",
    "metadata": {
        "UniqueId": "5ec56b51-0446-4c40-a6fb-7401567d8cae"
    },
    "sensor_guid": "8ec96c55-fa06-461c-95e2-7c6a42b16839",
    "description": "",
    "result_file_name": "",
    "sensor": {
        "camera_sensor_template": {
            "sensor_mode_photometric": {
                "acquisition_integration": 0.01,
                "transmittance_file_uri": "/app/assets/CameraInputFiles/CameraTransmittance.spectrum",
                "gamma_correction": 2.2,
                "png_bits": "PNG_16",
                "color_mode_color": {
                    "red_spectrum_file_uri": "/app/assets/CameraInputFiles/CameraSensitivityRed.spectrum",
                    "green_spectrum_file_uri": "/app/assets/CameraInputFiles/CameraSensitivityGreen.spectrum",
                    "blue_spectrum_file_uri": "/app/assets/CameraInputFiles/CameraSensitivityBlue.spectrum",
                    "balance_mode_none": {}
                },
                "wavelengths_range": {
                    "w_start": 400.0,
                    "w_end": 700.0,
                    "w_sampling": 13
                },
                "acquisition_lag_time": 0.0
            },
            "focal_length": 5.0,
            "imager_distance": 10.0,
            "f_number": 11.0,
            "horz_pixel": 640,
            "vert_pixel": 480,
            "width": 5.0,
            "height": 5.0,
            "distortion_file_uri": "/app/assets/CameraInputFiles/CameraDistortion_130deg.OPTDistortion",
            "distorsion_file_uri": "",
            "axis_system": [
                17.0,
                10.0,
                10.0,
                1.0,
                0.0,
                0.0,
                0.0,
                1.0,
                0.0,
                0.0,
                0.0,
                1.0
            ],
            "layer_type_none": {},
            "trajectory_file_uri": ""
        },
        "name": "Camera.1",
        "description": "",
        "metadata": {}
    }
}

Reset#

Possibility to reset local values from the one available in the server.

[10]:
sensor1.set_mode_geometric()  # set camera in geometric mode but no commit
sensor1.reset()  # reset -> this will apply the server value (photometric mode) to the local value
sensor1.delete()  # delete (to display the local value with the below print)
print(sensor1._sensor_template)
ansys.api.speos.sensor.v1.SensorTemplate
{
    "camera_sensor_template": {
        "sensor_mode_photometric": {
            "acquisition_integration": 0.01,
            "transmittance_file_uri": "/app/assets/CameraInputFiles/CameraTransmittance.spectrum",
            "gamma_correction": 2.2,
            "png_bits": "PNG_16",
            "color_mode_color": {
                "red_spectrum_file_uri": "/app/assets/CameraInputFiles/CameraSensitivityRed.spectrum",
                "green_spectrum_file_uri": "/app/assets/CameraInputFiles/CameraSensitivityGreen.spectrum",
                "blue_spectrum_file_uri": "/app/assets/CameraInputFiles/CameraSensitivityBlue.spectrum",
                "balance_mode_none": {}
            },
            "wavelengths_range": {
                "w_start": 400.0,
                "w_end": 700.0,
                "w_sampling": 13
            },
            "acquisition_lag_time": 0.0
        },
        "focal_length": 5.0,
        "imager_distance": 10.0,
        "f_number": 11.0,
        "horz_pixel": 640,
        "vert_pixel": 480,
        "width": 5.0,
        "height": 5.0,
        "distortion_file_uri": "/app/assets/CameraInputFiles/CameraDistortion_130deg.OPTDistortion",
        "distorsion_file_uri": ""
    },
    "name": "Camera.1",
    "description": "",
    "metadata": {}
}

Delete#

Once the data is deleted from the server, you can still work with local data and maybe commit later.

[11]:
sensor2.delete()
print(sensor2)
local: {
    "name": "Camera.2",
    "description": "",
    "metadata": {},
    "sensor_guid": "",
    "result_file_name": "",
    "sensor": {
        "camera_sensor_template": {
            "sensor_mode_photometric": {
                "acquisition_integration": 0.01,
                "transmittance_file_uri": "/app/assets/CameraInputFiles/CameraTransmittance.spectrum",
                "gamma_correction": 2.2,
                "png_bits": "PNG_16",
                "color_mode_color": {
                    "red_spectrum_file_uri": "/app/assets/CameraInputFiles/CameraSensitivityRed.spectrum",
                    "green_spectrum_file_uri": "/app/assets/CameraInputFiles/CameraSensitivityGreen.spectrum",
                    "blue_spectrum_file_uri": "/app/assets/CameraInputFiles/CameraSensitivityBlue.spectrum",
                    "balance_mode_none": {}
                },
                "wavelengths_range": {
                    "w_start": 400.0,
                    "w_end": 700.0,
                    "w_sampling": 13
                },
                "acquisition_lag_time": 0.0
            },
            "focal_length": 5.5,
            "imager_distance": 10.0,
            "f_number": 20.0,
            "horz_pixel": 640,
            "vert_pixel": 480,
            "width": 6.0,
            "height": 6.0,
            "distortion_file_uri": "/app/assets/CameraInputFiles/CameraDistortion_130deg.OPTDistortion",
            "distorsion_file_uri": "",
            "axis_system": [
                20.0,
                10.0,
                40.0,
                1.0,
                0.0,
                0.0,
                0.0,
                1.0,
                0.0,
                0.0,
                0.0,
                1.0
            ],
            "layer_type_source": {},
            "trajectory_file_uri": ""
        },
        "name": "Camera.2",
        "description": "",
        "metadata": {}
    }
}
[12]:
sensor1.delete()
[12]:
<ansys.speos.core.sensor.SensorCamera at 0x7f73bc953310>

Other sensors#

Irradiance sensor#

[13]:
sensor3 = p.create_sensor(name="Irradiance.1", feature_type=SensorIrradiance)
sensor3.commit()
print(sensor3)
{
    "name": "Irradiance.1",
    "metadata": {
        "UniqueId": "fefa3282-a8aa-48cd-8735-9bf956351caa"
    },
    "sensor_guid": "c50e6f31-c166-4680-b893-ba53db96d022",
    "description": "",
    "result_file_name": "",
    "sensor": {
        "irradiance_sensor_template": {
            "sensor_type_photometric": {},
            "illuminance_type_planar": {},
            "dimensions": {
                "x_start": -50.0,
                "x_end": 50.0,
                "x_sampling": 100,
                "y_start": -50.0,
                "y_end": 50.0,
                "y_sampling": 100
            },
            "axis_system": [
                0.0,
                0.0,
                0.0,
                1.0,
                0.0,
                0.0,
                0.0,
                1.0,
                0.0,
                0.0,
                0.0,
                1.0
            ],
            "layer_type_none": {},
            "ray_file_type": "RayFileNone",
            "integration_direction": []
        },
        "name": "Irradiance.1",
        "description": "",
        "metadata": {}
    }
}
[14]:
sensor3.set_type_colorimetric()
sensor3.set_layer_type_polarization()
sensor3.commit()
print(sensor3)
{
    "name": "Irradiance.1",
    "metadata": {
        "UniqueId": "fefa3282-a8aa-48cd-8735-9bf956351caa"
    },
    "sensor_guid": "c50e6f31-c166-4680-b893-ba53db96d022",
    "description": "",
    "result_file_name": "",
    "sensor": {
        "irradiance_sensor_template": {
            "sensor_type_colorimetric": {
                "wavelengths_range": {
                    "w_start": 400.0,
                    "w_end": 700.0,
                    "w_sampling": 13
                }
            },
            "illuminance_type_planar": {},
            "dimensions": {
                "x_start": -50.0,
                "x_end": 50.0,
                "x_sampling": 100,
                "y_start": -50.0,
                "y_end": 50.0,
                "y_sampling": 100
            },
            "axis_system": [
                0.0,
                0.0,
                0.0,
                1.0,
                0.0,
                0.0,
                0.0,
                1.0,
                0.0,
                0.0,
                0.0,
                1.0
            ],
            "layer_type_polarization": {},
            "ray_file_type": "RayFileNone",
            "integration_direction": []
        },
        "name": "Irradiance.1",
        "description": "",
        "metadata": {}
    }
}
[15]:
sensor3.delete()
[15]:
<ansys.speos.core.sensor.SensorIrradiance at 0x7f73bc980b20>

radiance sensor#

[16]:
sensor4 = p.create_sensor(name="Radiance.1", feature_type=SensorRadiance)
sensor4.commit()
print(sensor4)
{
    "name": "Radiance.1",
    "metadata": {
        "UniqueId": "9caedde4-510d-44a8-895f-827a303d0dcd"
    },
    "sensor_guid": "a5f03a4a-4969-43cf-b10a-eeb71d0c93f4",
    "description": "",
    "result_file_name": "",
    "sensor": {
        "radiance_sensor_template": {
            "sensor_type_photometric": {},
            "focal": 250.0,
            "integration_angle": 5.0,
            "dimensions": {
                "x_start": -50.0,
                "x_end": 50.0,
                "x_sampling": 100,
                "y_start": -50.0,
                "y_end": 50.0,
                "y_sampling": 100
            },
            "axis_system": [
                0.0,
                0.0,
                0.0,
                1.0,
                0.0,
                0.0,
                0.0,
                1.0,
                0.0,
                0.0,
                0.0,
                1.0
            ],
            "layer_type_none": {},
            "observer_point": []
        },
        "name": "Radiance.1",
        "description": "",
        "metadata": {}
    }
}
[17]:
sensor4.set_focal(value=200).set_type_spectral()
sensor4.set_layer_type_source()
sensor4.commit()
print(sensor4)
{
    "name": "Radiance.1",
    "metadata": {
        "UniqueId": "9caedde4-510d-44a8-895f-827a303d0dcd"
    },
    "sensor_guid": "a5f03a4a-4969-43cf-b10a-eeb71d0c93f4",
    "description": "",
    "result_file_name": "",
    "sensor": {
        "radiance_sensor_template": {
            "sensor_type_spectral": {
                "wavelengths_range": {
                    "w_start": 400.0,
                    "w_end": 700.0,
                    "w_sampling": 13
                }
            },
            "focal": 200.0,
            "integration_angle": 5.0,
            "dimensions": {
                "x_start": -50.0,
                "x_end": 50.0,
                "x_sampling": 100,
                "y_start": -50.0,
                "y_end": 50.0,
                "y_sampling": 100
            },
            "axis_system": [
                0.0,
                0.0,
                0.0,
                1.0,
                0.0,
                0.0,
                0.0,
                1.0,
                0.0,
                0.0,
                0.0,
                1.0
            ],
            "layer_type_source": {},
            "observer_point": []
        },
        "name": "Radiance.1",
        "description": "",
        "metadata": {}
    }
}
[18]:
sensor4.delete()
print(sensor4)
local: {
    "name": "Radiance.1",
    "description": "",
    "metadata": {},
    "sensor_guid": "",
    "result_file_name": "",
    "sensor": {
        "radiance_sensor_template": {
            "sensor_type_spectral": {
                "wavelengths_range": {
                    "w_start": 400.0,
                    "w_end": 700.0,
                    "w_sampling": 13
                }
            },
            "focal": 200.0,
            "integration_angle": 5.0,
            "dimensions": {
                "x_start": -50.0,
                "x_end": 50.0,
                "x_sampling": 100,
                "y_start": -50.0,
                "y_end": 50.0,
                "y_sampling": 100
            },
            "axis_system": [
                0.0,
                0.0,
                0.0,
                1.0,
                0.0,
                0.0,
                0.0,
                1.0,
                0.0,
                0.0,
                0.0,
                1.0
            ],
            "layer_type_source": {},
            "observer_point": []
        },
        "name": "Radiance.1",
        "description": "",
        "metadata": {}
    }
}