FIEStool - Frequently Asked Questions
Over the time we've been collecting some questions about FIEStool. If you
have problems trying to run it after the install procedure, please check here
for a solution.
Python/IRAF/PyRAF errors
Q: I get an error complaining about 'Header' object not having an attribute
An user reported an error message which ends like this:
05:28:11 *** (0) File "/home/me/FIEStool/tasks.py", line 194, in run
05:28:11 *** (0) if data[0].header.has_key('NAXIS2'):
05:28:11 *** (0) AttributeError: 'Header' object has no attribute
This is due to a change
in the Python language. While we don't support running FIEStool running Python 3,
the maintainers of PyFITS
decided
for their version 3 of the library to remove has_key from the
dictionary-like interface provided by the Header objects, which leads
to this error.
We released FIEStool 1.3.3 to adapt the code to those changes.
Q: Reducing the data, I get the following message: Unknown parameter requested: "bpm" for task: "fit1d" in pkg: "imfit"
The error looks like this:
22:39:26 *** (0) An unknown error occured in "normflat" :
22:39:26 *** (0) Traceback (most recent call last):
22:39:26 *** (0) File "./taskManager.py", line 51, in runTask
22:39:26 *** (0) task().run(*args, **kwds)
22:39:26 *** (0) File "/home/paolo/FIEStool/tasks.py", line 1504, in run
22:39:26 *** (0) irafWrappers.fit1d(tempframe3, tempframe4)
22:39:26 *** (0) File "/home/paolo/FIEStool/irafWrappers.py", line 290, in fit1d
22:39:26 *** (0) ParList = _getparlistname('fit1d')
22:39:26 *** (0) File "/usr/local/lib/python2.7/dist-packages/pyraf/iraftask.py", line 767, in __call__
22:39:26 *** (0) return self.run(*args, **kw)
22:39:26 *** (0) File "/usr/local/lib/python2.7/dist-packages/pyraf/iraftask.py", line 359, in run
22:39:26 *** (0) self._run(redirKW, specialKW)
22:39:26 *** (0) File "/usr/local/lib/python2.7/dist-packages/pyraf/iraftask.py", line 808, in _run
22:39:26 *** (0) irafexecute.IrafExecute(self, pyraf.iraf.getVarDict(), **redirKW)
22:39:26 *** (0) File "/usr/local/lib/python2.7/dist-packages/pyraf/irafexecute.py", line 362, in IrafExecute
22:39:26 *** (0) raise exc
22:39:26 *** (0) IrafError: Unknown parameter requested: "bpm" for task: "fit1d" in pkg: "imfit"
The reason for this error is an IRAF parameters file that comes with
FIEStool. It was generated for a version of IRAF older than the one
you've got installed, and it's missing a parameter.
The fix is very simple, and we produced FIEStool 1.3.2.3 just to include
it. If you don't want to re-download the whole FIEStool just for this,
please find the following file:
FIEStool/taskconf/CalibCalc/fit1d.par
And add this line to it:
bpm,s,h,"",,,'Bad pixel mask(s)'
General questions
Q: I have downloaded the dependencies, how do I install them?
Usually Python packages come with a setup.py script. The usual way
to run it is
$ python setup.py install
That should install things under your system-wide Python module repository.
If you prefer to keep things tidy and install non-packaged software under a
different place, then try:
$ python setup.py install --prefix=/some/other/place
The setup.py script usually install things under
PREFIX/lib/pythonX.Y/site-packages/, being "X.Y" the
version. So if you specify /usr/local as a prefix and
your Python claims to be version 2.5.1, the install path for your modules
will be /usr/local/lib/python2.5/site-packages/.
Be careful. Python knows a number a places where to search for modules, and
if you put them somewhere else you won't be able to readily import them.
In that case, you'll need to add the extra path to your environment. E.g.,
on csh:
setenv PYTHONPATH /opt/mysoft/lib/python2.5/site-packages
Q: I have installed all the dependencies, but FIEStool keeps complaining
about not being able to import them. I can import the required modules
from the command line, though
In short: You're probably using different versions of Python.
You can have a number of different Python environments on your computer,
either different versions (e.g., Python 2.3 vs. 2.5) or customized ones.
I assume here that you type "python" to use Python from the
command line, and that you used that one to install the dependencies. Maybe
FIEStool is picking up a different one. What you should do first is to
locate the directory where FIEStool.py is sitting on, then check
what Python is FIEStool using:
$ head FIEStool.py
That will print the first few lines of code. The first one will probably
read like this:
#!/usr/bin/python
Then you should check which Python version are you using:
$ which python
/usr/bin/python
In my case both are the same, but maybe not in yours. If they are
different, then please modify the first line of FIEStool.py so
that it matches yours.
NB: in newer versions of FIEStool, our version may
read like this:
#!/usr/bin/env python
In that case, we should be running already the default python
executable in your system
Q: I have the exact problem you're talking about in the previous point,
but I don't (have permissions/want to modify the code)
Don't worry. Assuming that you invoke your particular version of Python
using the "mypython" command, you can just run FIEStool like
this:
$ mypython /path/to/FIEStool.py
It may be a bit cumbersome, but it will work.
Optionally, you can make a shell alias or desktop link to call FIEStool like this
Q: What is this Tkinter FIEStool keeps complaining about? It's
not on your requirement list!
TkInter is the default graphics environment for Python. It is based on
Tcl/Tk and comes bundled with Python's source distribution. That means
it should be already installed on your computer along with Python itself.
It is not a core Python feature, though, meaning that Python can
happily run without it, and so some distributors (e.g., some Linux
packagers) tend to put TkInter in a separate package.
We can't just keep track of every distributor's choice or naming of
package, so please don't ask us how to install TkInter on your computer if
it's not there.
Anyway, we can tell you that on Debian distributions
(and Debian derived, like Ubuntu), the package is called python-tk
for the default version.
In Red Hat it should be called something along the lines of
python-tkinter or python2-tkinter.
In Gentoo you don't have such thing as a "package", but
you'll probably need to specify that you want tcltk support when
building Python.
OS X questions
Some FIEStool users want to use it from their Apple computers, under OS X.
Some of them have problems running FIEStool, but there's nothing on FIEStool
platform-dependant, except for Python itself so, no, there's not going to
be (or a need for) a "FIEStool for OSX"
The problems come usually from the dependencies themselves: they may be
difficult to install on OSX.
We haven't produced (yet) instructions on installing FIEStool on Apple
computers, but most OSX users that have asked for our help had previously
installed (or were planning to install) the ESO Scisoft software bundle
on their computers.
We don't endorse or support Scisoft, but it happens to include all the
software you need to run FIEStool, so it could be worth trying using
them together.
|