# Passing parameters to Catalyst pipeline/script?

**URL:** https://discourse.paraview.org/t/passing-parameters-to-catalyst-pipeline-script/8931
**Category:** In Situ Support
**Tags:** catalyst, python
**Created:** [February 8, 2022, 11:56am UTC](https://discourse.paraview.org/t/passing-parameters-to-catalyst-pipeline-script/8931 "2022-02-08T11:56:37Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![mirenradia](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/6bbea6/32.png) [@mirenradia](https://discourse.paraview.org/u/mirenradia)
#### Post date: [February 8, 2022, 11:56am UTC](https://discourse.paraview.org/t/passing-parameters-to-catalyst-pipeline-script/8931/1 "2022-02-08T11:56:37Z")

</div>

Is it possible to pass parameters to a Catalyst pipeline/script at runtime? For example, I’d like to be able to adjust the center of rotation of a view based on the size parameters in a simulation.

Of course, I can think of a hacky solution that involves copying the script to create a temporary file that I edit in my simulation code before creating the pipeline but I was wondering if there was a more elegant method.

---

<div class="post-metadata">

### Author: ![mirenradia](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/6bbea6/32.png) [@mirenradia](https://discourse.paraview.org/u/mirenradia)
#### Post date: [October 14, 2022, 11:42am UTC](https://discourse.paraview.org/t/passing-parameters-to-catalyst-pipeline-script/8931/2 "2022-10-14T11:42:50Z")

</div>

Just bumping this topic as I think there should be an answer given that the old [ParaView Catalyst Guide](https://www.paraview.org/paraview-downloads/download.php?submit=Download&version=v5.11&type=data&os=Sources&downloadFile=ParaViewCatalystGuide-5.11.0.pdf) mentions that simulation developers can create “pre-configured ParaView Catalyst pipelines” (Section 2.1).

As a specific example, I’d like to make a general slice visualization Catalyst script which can automatically adjust where to slice (i.e. the center) based on the size of the grid in the simulation (which will vary depending on the simulation parameters/input deck). My Catalyst adaptor is Catalyst 1 based (since it’s an Overlapping AMR dataset). I believe the guide was written before Catalyst V2 scripts so don’t mind creating an old V1 script if that is what is required.

@mwestphal, @nicolas.vuaille, @utkarsh.ayachit, @Francois_Mazen, do you have any ideas?

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [October 14, 2022, 12:27pm UTC](https://discourse.paraview.org/t/passing-parameters-to-catalyst-pipeline-script/8931/3 "2022-10-14T12:27:43Z")

</div>

I am not entirely sure how this can be done with Catalyst 1.

Just for information sake, with Catalyst 2.0 adaptor, there are elegant ways. See [CxxImageDataExample](https://gitlab.kitware.com/paraview/paraview/-/blob/master/Examples/Catalyst2/CxxImageDataExample/catalyst_pipeline.py). You can use arguments (which are passed during initialization and remain unchanged during the execution) or parameters (which are passed per execute call). See the [example](https://gitlab.kitware.com/paraview/paraview/-/blob/master/Examples/Catalyst2/CxxImageDataExample/CatalystAdaptor.h) code for changes needed to the adaptor to pass such args/params.

Alternatively, you can use things like environment variables too, `os.getenv(...)`, if feasible. That may be a workable approach for Catalyst 1.0 too.

---

<div class="post-metadata">

### Author: ![mirenradia](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/6bbea6/32.png) [@mirenradia](https://discourse.paraview.org/u/mirenradia)
#### Post date: [October 14, 2022, 1:18pm UTC](https://discourse.paraview.org/t/passing-parameters-to-catalyst-pipeline-script/8931/4 "2022-10-14T13:18:37Z")

</div>

Thanks for the reply.

I guess environment variables seem like the best solution given I’m stuck with Catalyst 1 for the moment.
