Batch mode

Met.3D can run non-interactively in batch mode to produce screenshots or export data without user interaction. This is useful for automated image generation, e.g. in scripts or on compute servers.

Batch mode is started by passing a configuration file via the --batch command line argument, together with any datasets to load via --datasets:

met3d --batch /path/to/batch_config.batch.conf --datasets /path/to/dataset.pipeline.conf

Met.3D loads the datasets, runs the animation, saves screenshots, and exits. A template configuration file is provided at config/batch_mode.batch.conf.template in the Met.3D installation directory.

See Command line interface for a full overview of command line options.

Note

Met.3D uses OpenGL for rendering and requires an active display connection, even in batch mode. On a headless Linux server (no monitor attached), you need to setup a virtual display. Without a display, Met.3D will fail with an error such as “Could not initialize OpenGL context”.

Batch mode configuration

The configuration file uses INI format with a [BatchMode] section.

animation_type

The animation to run. Two types are available:

  • timeAnimation steps through all time steps of the configured time control within the specified time range.

  • cameraSequenceTimeAnimation same as timeAnimation, but additionally animates the camera using the camera sequence configured in the scene settings (see the Camera Sequencer panel).

synchronization_name

Name of the time control to use for the animation. Must match the name of an existing time control in the loaded session. Default: Synchronization.

session_file

Path to a session file to load before starting the animation. If set, this overwrites the “default session” setting from the application preferences.

start_at_most_recent_init_time_of_datasource

Name of a dataset. The animation will start at the most recent available initialisation time of that dataset and run forward by animation_time_range_s seconds. Leave empty to use the most recent init time of the first loaded dataset.

animation_time_range_s

Duration of the animation in seconds, measured from the start init time. For example, 120 hours = 432000. Default: 432000.

animation_time_step

Time step between animation frames. If set, overwrites the time step stored in the session. Supported suffixes: years, months, days, hours, minutes, seconds. Example: 6 hours.

screenshot_directory

Directory where screenshots will be saved. If set, overwrites the directory stored in the session. Leave empty to use the session value.

screenshot_filename

Filename template for screenshots. The following placeholders are available:

Placeholder

Replaced with

%fn

Frame number, zero-padded (e.g. FN00001)

%t

Current time in UTC ISO 8601 format without colons (e.g. 20240101T120000Z)

%V

Scene view ID (e.g. view_0)

Default: %fn-met3d-image.%t.%V. If set, overwrites the filename template stored in the session.

screenshot_file_extension

Image format for saved screenshots. Supported values: .png, .jpg, .jpeg, .bmp, .webp. Default: .png. If set, overwrites the value stored in the session.

overwrite_existing_image_files

Whether to overwrite existing image files. Set to true or false. Default: true.

quit_when_completed

Whether Met.3D should exit automatically after the animation completes. Set to true or false. Default: true.

Example configuration

[BatchMode]
animation_type = timeAnimation
synchronization_name = Valid time
session_file = /path/to/session.config
animation_time_range_s = 648000
animation_time_step = 3 hours
screenshot_directory = /path/to/output
screenshot_filename = %fn-met3d-image.%t.%V
screenshot_file_extension = .webp
overwrite_existing_image_files = true
quit_when_completed = true