Skip to content

pyraf.tools.irafglobals.IrafError: Undefined variable uparm' in string uparm$/imlsectis.par' #393

Closed

Description

@danecross

Hello, I am trying to install iraf a few ways and I seem to be running into an issue with a variable called uparm.

To Reproduce
Steps to reproduce the behavior.

  1. Download iraf-2.18.tar.gz and follow the installation steps. make test passes all tests
  2. install the PESSTO pipeline, using iraf 2.18 installation instructions instead of iraf 2.17
  3. run a program that uses iraf:
PESSTOFASTSPEC -i EFOSC.2023-11-18T01:36:45.172.fits

and get the resulting error

  File "/Users/danecross/miniconda3/envs/pessto/lib/python3.9/site-packages/ntt-3.0.1-py3.9.egg/EGG-INFO/scripts/PESSTOFASTSPEC", line 44, in <module>
    outputfile = ntt.efoscfastspecdef.efoscfastredu(imglist, _listsens, _listarc, _trace, _dispersionline, _cosmic,
  File "/Users/danecross/miniconda3/envs/pessto/lib/python3.9/site-packages/ntt-3.0.1-py3.9.egg/ntt/efoscfastspecdef.py", line 207, in efoscfastredu
    iraf.onedspec.wspectext(
  File "/Users/danecross/miniconda3/envs/pessto/lib/python3.9/site-packages/pyraf/iraftask.py", line 834, in __call__
    return self.run(*args, **kw)
  File "/Users/danecross/miniconda3/envs/pessto/lib/python3.9/site-packages/pyraf/iraftask.py", line 373, in run
    self._run(redirKW, specialKW)
  File "/Users/danecross/miniconda3/envs/pessto/lib/python3.9/site-packages/pyraf/iraftask.py", line 1521, in _run
    self._runCode()
  File "/Users/danecross/miniconda3/envs/pessto/lib/python3.9/site-packages/pyraf/iraftask.py", line 1537, in _runCode
    self._clFunction(*parList, **kw)
  File "<CL script onedspec.wspectext>", line 24, in wspectext
    iraf.sections(Vars.output, option = 'fullname', Stdout=Vars.specout)
  File "/Users/danecross/miniconda3/envs/pessto/lib/python3.9/site-packages/pyraf/iraftask.py", line 834, in __call__
    return self.run(*args, **kw)
  File "/Users/danecross/miniconda3/envs/pessto/lib/python3.9/site-packages/pyraf/iraftask.py", line 374, in run
    self._updateParList(save)
  File "/Users/danecross/miniconda3/envs/pessto/lib/python3.9/site-packages/pyraf/iraftask.py", line 918, in _updateParList
    rv = self.saveParList()
  File "/Users/danecross/miniconda3/envs/pessto/lib/python3.9/site-packages/pyraf/iraftask.py", line 762, in saveParList
    rv = self._currentParList.saveParList(filename, comment)
  File "/Users/danecross/miniconda3/envs/pessto/lib/python3.9/site-packages/pyraf/irafpar.py", line 1109, in saveParList
    absFileName = iraf.Expand(filename)
  File "/Users/danecross/miniconda3/envs/pessto/lib/python3.9/site-packages/pyraf/iraffunctions.py", line 3413, in Expand
    outlist.append(_os.path.expanduser(_expand1(word, noerror=noerror)))
  File "/Users/danecross/miniconda3/envs/pessto/lib/python3.9/site-packages/pyraf/iraffunctions.py", line 3446, in _expand1
    raise IrafError(f"Undefined variable `{varname}' "
pyraf.tools.irafglobals.IrafError: Undefined variable `uparm' in string `uparm$/imlsectis.par'

Expected behavior
A clear and concise description of what you expected to happen.

System details:

  • OS: macOS 14.2
  • Version 2.18

Additional context
I figure one of the culprits is the version of iraf that the pipeline uses, is there something specific with the uparm directory / values that changed between the versions?

Activity

  1. olebole commented on Apr 9, 2024

    @olebole
    Member

    There were no changes with the uparm handling between 2.17.1 and 2.18; maybe @temuller from PESSTO has an idea?
    Maybe you could try out 2.17 or 2.17.1 to see whether it is a degradation?

  2. olebole commented on Apr 10, 2024

    @olebole
    Member

    I just tried to run the example locally, with IRAF 2.18 from Debian unstable, and python3-pyraf 2.2.1 from Debian testing, and it worked quite well (I got a Python tk/matplotlib exception at the very end indicaing a double destroy, but the pipeline passed).

    Therefore, I would assume some problems with your local setup. Specifically, imlsectis is not part of IRAF or PESSTO,
    Can you ensure that your environment is clean here? And could you trace this down to an individual IRAF command create a minimal CL or PyRAF code that directly calls IRAF and shows the problem?

  3. danecross commented on Apr 15, 2024

    @danecross
    Author

    I am running on a Mac M1 with Sonoma 14.2, and I made a clean conda environment, then followed the installation instructions for 2.18. I think the double destroy occurs for me as well, @temuller tells me this is an unrelated problem.

    Here's a minimal example that throws the same error as above for me:

    import re
    from pyraf import iraf
    
    ffn = 'ex_1D_spectrum.fits'
    
    imgasci = re.sub('.fits', '.asci', ffn)
    
    iraf.onedspec(_doprint=0, Stdout=0)
    iraf.onedspec.wspectext(ffn + '[*,1,1]', imgasci, header='no')
    

    with the fits file in question attached here

  4. olebole commented on Apr 15, 2024

    @olebole
    Member

    I can't reproduce it. The code you mention works well for me and produces the ASCII file ex_1D_spectrum.asci.

    As I said, the error somehow mentions a file imlsectis.par; maybe you check your parameter files or IRAF login files for this?

  5. olebole commented on Apr 25, 2024

    @olebole
    Member

    As I am rather sure that this is not a bug, I will move this to the discussions.

  6. locked and limited conversation to collaborators on Apr 25, 2024
  7. converted this issue into a discussion #397 on Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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