Cycles class
cycles.Cycles(path, simulation, executable=None)
dataclass
Interface for executing one Cycles simulation and reading its files.
Provides methods to run simulations, read outputs, and inspect soil/weather/operation configurations. Automatically loads the control file upon initialization.
| Parameters: |
|
|---|
| Attributes: |
|
|---|
run(options, silence=False)
Run the Cycles executable for this simulation.
To use the run method, the executable attribute must be set to the path of the Cycles executable. The
options string is passed directly to the command line when invoking Cycles, allowing you to specify any
command-line options supported by Cycles (e.g., -s for spin-up, etc.).
| Parameters: |
|
|---|
| Returns: |
|
|---|
read_output(output_types)
Read one or more output tables into memory.
When reading multiple output tables, the output_types argument can be a list or tuple of table names. Each
table is read into a pandas DataFrame and stored in the output dictionary with its corresponding units.
| Parameters: |
|
|---|
read_operation_file()
Load operation records defined in the control file.
read_soil_file()
Load soil profile layers and metadata from the configured soil file.
read_weather_file(*, start_year=-9999, end_year=9999, subdaily=False)
Read weather forcing data for the configured weather file.
| Parameters: |
|
|---|
generate_reinit_file(doy, *, reinit_name=None)
Generate a reinitialization file from model output.
| Parameters: |
|
|---|
plot_yield(*, ax=None, crop_colors=None, fontsize=None)
Plot grain and forage yields from harvest output.
| Parameters: |
|
|---|
| Returns: |
|
|---|
plot_operations(*, axs=None, fontsize=None)
Plot operation timelines grouped by rotation year.
| Parameters: |
|
|---|
| Returns: |
|
|---|