Skip to content

Better SoFiA-2 error messages in Stimela #811

@paoloserra

Description

@paoloserra

I ran SoFiA-2 in Stimela (CARACal) on a cube with 10 channels. My S+C settings included smoothing with a spectral boxcar kernel of width 15 channels i.e., more channels than in the cube. That is silly, but it was the default (in CARACal) and so I didn't realise I was about to get in troubles.

Stimela gave the error appended below. The error is not very useful because it does not say what the problem is.

If I run SoFiA-2 with the same settings but outside Stimela I get a more useful error (also appended below).

It would be great to capture the full SoFiA-2 error message in Stimela.

Error message inside Stimela

# ____________________________________________________________________________
# 
#  Running S+C finder
# ____________________________________________________________________________
# 
#   Using the following parameters:
#   - Kernels
#     - spatial:        [0, 3, 6]
#     - spectral:       [0, 3, 7, 15]
#   - Flux threshold:   4.0 * rms
#   - Noise statistic:  median absolute deviation
#   - Flux range:       negative
# 
# Traceback (most recent call last):
#   File "/stimela_mount/code/run.py", line 74, in <module>
#     subprocess.check_call(shlex.split(_runc))
#   File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
#     raise CalledProcessError(retcode, cmd)
# subprocess.CalledProcessError: Command '['sofia', 'sofia_parameters.par']' returned non-zero exit status 7.
2026-03-06 07:27:57 CARACal.Stimela.make_SoFiA-2_mask-field0-iter1 ERROR: /usr/bin/singularity run --workdir /scratch/usd/pserra/Astro/caracal_devel/reduction/.stimela_workdir-17727784154736578 --contain returns error code 1
2026-03-06 07:27:57 CARACal.Stimela.make_SoFiA-2_mask-field0-iter1 ERROR: job failed at 2026-03-06 07:27:57.442357 after 0:00:04.249195
2026-03-06 07:27:57 CARACal.Stimela.make_SoFiA-2_mask-field0-iter1 ERROR: Traceback (most recent call last):
2026-03-06 07:27:57 CARACal.Stimela.make_SoFiA-2_mask-field0-iter1 ERROR:   File "/scratch/usd/pserra/Astro/caracal_devel/reduction/caracal-venv-py310/lib/python3.10/site-packages/stimela/recipe.py", line 825, in run
2026-03-06 07:27:57 CARACal.Stimela.make_SoFiA-2_mask-field0-iter1 ERROR:     job.run_job()
2026-03-06 07:27:57 CARACal.Stimela.make_SoFiA-2_mask-field0-iter1 ERROR:   File "/scratch/usd/pserra/Astro/caracal_devel/reduction/caracal-venv-py310/lib/python3.10/site-packages/stimela/recipe.py", line 495, in run_job
2026-03-06 07:27:57 CARACal.Stimela.make_SoFiA-2_mask-field0-iter1 ERROR:     self.job.run(output_wrangler=self.apply_output_wranglers)
2026-03-06 07:27:57 CARACal.Stimela.make_SoFiA-2_mask-field0-iter1 ERROR:   File "/scratch/usd/pserra/Astro/caracal_devel/reduction/caracal-venv-py310/lib/python3.10/site-packages/stimela/singularity.py", line 145, in run
2026-03-06 07:27:57 CARACal.Stimela.make_SoFiA-2_mask-field0-iter1 ERROR:     utils.xrun(
2026-03-06 07:27:57 CARACal.Stimela.make_SoFiA-2_mask-field0-iter1 ERROR:   File "/scratch/usd/pserra/Astro/caracal_devel/reduction/caracal-venv-py310/lib/python3.10/site-packages/stimela/utils/xrun_poll.py", line 285, in xrun
2026-03-06 07:27:57 CARACal.Stimela.make_SoFiA-2_mask-field0-iter1 ERROR:     raise StimelaCabRuntimeError(
2026-03-06 07:27:57 CARACal.Stimela.make_SoFiA-2_mask-field0-iter1 ERROR: stimela.exceptions.StimelaCabRuntimeError: /usr/bin/singularity run --workdir /scratch/usd/pserra/Astro/caracal_devel/reduction/.stimela_workdir-17727784154736578 --contain returns error code 1

Error message outside Stimela

 Running S+C finder
____________________________________________________________________________

  Using the following parameters:
  - Kernels
    - spatial:        0, 3, 6
    - spectral:       0, 3, 7, 15
  - Flux threshold:   5.0 * rms
  - Noise statistic:  median absolute deviation
  - Flux range:       negative


ERROR: Illegal spectral kernel size encountered.
       Terminating with error code 7.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions