ForLoop
- Workspace.ForLoop(self: pyarts.arts._Workspace, forloop_agenda: Optional[Union[pyarts.arts.WorkspaceVariable, pyarts.arts.Agenda]] = self.forloop_agenda, start: Union[pyarts.arts.WorkspaceVariable, pyarts.arts.Index], stop: Union[pyarts.arts.WorkspaceVariable, pyarts.arts.Index], step: Union[pyarts.arts.WorkspaceVariable, pyarts.arts.Index], verbosity: Optional[Union[pyarts.arts.WorkspaceVariable, pyarts.arts.Verbosity]] = self.verbosity) None
A simple for-loop.
This method is handy when you quickly want to test out a calculation with a set of different settings.
It does a for-loop from start to stop in steps of step (who would have guessed that). For each iteration, the agenda
forloop_agenda
is executed. Inside the agenda, the variableforloop_index
is available as index counter.There are no other inputs to
forloop_agenda
, and also no outputs. That means, if you want to get any results out of this loop, you have to save it to files (for example withWriteXMLIndexed()
), since variables used inside the agenda will only be local.Note that this kind of for loop is not parallel.
The method is intended for simple testing, not as a replacement of
ybatchCalc()
. However, it is compatible withybatchCalc()
, in the sense thatybatchCalc()
may occur insideforloop_agenda
.Author(s): Stefan Buehler
- Parameters:
forloop_agenda (Agenda, optional) – The body for a for loop. See
forloop_agenda
, defaults toself.forloop_agenda
[IN]start (Index) – Start value. [IN]
stop (Index) – End value. [IN]
step (Index) – Step size. [IN]
verbosity (Verbosity) – ARTS verbosity. See
verbosity
, defaults toself.verbosity
[IN]