View

Use view to open a grid file or fieldbag file in JCMview.

Open A Grid File

Pass the path to an existing grid.jcm file:

import jcmsuite

jcmsuite.view("examples/mie2d/grid.jcm")

view starts JCMview in detached mode and returns None after it starts the viewer process. The grid file must already exist.

Use Geo when you need to generate grid.jcm before you open it.

Open A Fieldbag File

Pass the path to an existing fieldbag file to inspect field data:

jcmsuite.view("project_results/fieldbag.jcm")

The fieldbag file must already exist.

Runtime Conditions

view requires a working JCMsuite context with the JCMview binary. It raises InvalidConfigurationError when the input file does not exist. It raises RuntimeContextError when JCMview is unavailable.

The viewer requires a graphical environment. A viewer launch can fail or have no visible effect in a headless session or an SSH-only session.

See these complete runnable tutorials: