validate_sl_output: Validate a SamsaRaLight simulation output object

View source: R/run_sl_advanced.R

validate_sl_outputR Documentation

Validate a SamsaRaLight simulation output object

Description

Performs structural and internal consistency checks on an object returned by run_sl_advanced() or run_sl().

Usage

validate_sl_output(x)

Arguments

x

Object expected to inherit from class "sl_output".

Details

This function is called internally at the end of a simulation to ensure that the returned object is valid and complete before being provided to the user.

The function checks that:

  • The object inherits from class "sl_output".

  • Top-level components $output and $input exist.

  • $output$light contains trees, cells, and sensors.

  • These elements are data.frames.

  • Required identifier and energy columns are present.

  • Energy-related columns are numeric.

If detailed outputs were requested, the presence and structure of $output$monthly_rays and $output$interceptions are also verified when available.

Value

Invisibly returns TRUE if validation passes. Stops with an informative error message otherwise.


SamsaRaLight documentation built on April 16, 2026, 5:08 p.m.