Welcome to iraf.net Saturday, May 11 2024 @ 06:39 PM GMT


 Forum Index > Help Desk > Misc New Topic Post Reply
 Covert fits file into imh using rfits
   
devereux
 11/11/2009 08:46PM (Read 10513 times)  
++---
Junior

Status: offline


Registered: 01/24/2008
Posts: 24
Hi,I just re-installed PyRaf following a hard drive failure.Everything seemed to be going swimmingly until I tried to do an rfits - it complained
that it can not open a pixel file.I got the following error message when trying to convert
a fits spectrum that I created using the IRAF task apall into a an IRAF image
(so I could then look at it in specfit).Task rfits is running...File: M84ext5.5sc_sx1.fits -> M84ext5.5sc_sx1.imh MSCOMB175GY[1/1] size=1201
bitpix=-32 scaling=none pixtype=real
Warning: Cannot open pixel file (M84ext5.5sc_sx1.imh)I can plot the fits file in splot and the spectrum looks fine.Any ideas?thanks in anticipationNick

 
Profile Email
 Quote
fitz
 11/11/2009 08:46PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
First, you can use the FITS files directly as you point out. Most likely, you just need to do a MKIRAF to recreate your login.cl file, this is where the 'imdir' environment variable saying where the .pix files are stored in written.If you had a hard drive failure then be sure you've also rerun the IRAF install script which sets things like the global 'imdir' and creates links to various commands. If the disk was restored but with a different partitioning system, the old imdir may no longer be valid and a MKIRAF will fix it.-Mike

 
Profile Email
 Quote
devereux
 11/11/2009 08:46PM  
++---
Junior

Status: offline


Registered: 01/24/2008
Posts: 24
Hi Mike,unfortunately the mkiraf command did not help I get the same error message:Task rfits is running...File: M84ext5.5sc_sx1.fits -> M84ext5.5sc_sx1.imh MSCOMB175GY[1/1] size=1201
bitpix=-32 scaling=none pixtype=real
Warning: Cannot open pixel file (M84ext5.5sc_sx1.imh)
Mike, just to get you in the picture here, I reinstalled PyRaf on a new disk,
the old one is completey gone.The PyRaf install went fine and I have been using it for a few days now
with no issues until today.I'm a bit confused. I want to use specfit, but specfit requires a .imh file.I extracted a spectrum using APALL and it created a .fits file, I can't seem
to make it creat a .imh file if the input file is fits.So, thats how I ended up trying to use rfits to convert the fits to imh.I followed your suggestion of doing a mkiraf in my home directory.This did not change anything as I already said. Besides, the login.cl
file is automatically created when I install PyRaf and I don't remember
having to type MKIRAF the last time I installed PyRaf.But now I have 2 login.cl files, one in my home directory (created by the
most recent MKIRAF command) and the other one is in my iraf directory
created a few days ago when I installed PyRaf.Can you please help me !thanksNick

 
Profile Email
 Quote
fitz
 11/11/2009 08:46PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
[quote:21114d34d1]
I'm a bit confused. I want to use specfit, but specfit requires a .imh file.
[/quote:21114d34d1]SPECFIT is a run-on-the-mill SPP IRAF task, it should accept FITS files just fine unless you're using binaries that pre-date the FITS kernel.[quote:21114d34d1]
I extracted a spectrum using APALL and it created a .fits file, I can't seem
to make it creat a .imh file if the input file is fits.
[/quote:21114d34d1]You can reset your 'imtype' environment variable to be 'imh' to create IMH images, e.g. "cl> reset imtype = 'imh'" before you run APALL. However, you'll likely see the same error message about the imdir until that problem gets fixed.[quote:21114d34d1]
I followed your suggestion of doing a mkiraf in my home directory.This did not change anything as I already said. Besides, the login.cl
file is automatically created when I install PyRaf and I don't remember
having to type MKIRAF the last time I installed PyRaf.
[/quote:21114d34d1]I don't remember PyRAF creating the login.cl, only that it reads it. If your PyRAF install creates the file for you it doesn't mean it properly/at-all set the imdir variable correctly. If you say "show imdir" is the path something that exists on your machine? Can you write to that directory?
[quote:21114d34d1]
But now I have 2 login.cl files, one in my home directory (created by the
most recent MKIRAF command) and the other one is in my iraf directory
created a few days ago when I installed PyRaf.
[/quote:21114d34d1]The one file IRAF cares about is the one in the directory where you start IRAF. If you normally start iraf/pyraf from your 'iraf' directory do the MKIRAF agaiin in there, otherwise if you start things form your home directory with the new file, does it work?-Mike

 
Profile Email
 Quote
devereux
 11/11/2009 08:46PM  
++---
Junior

Status: offline


Registered: 01/24/2008
Posts: 24
Hi Mike,sorry this is becoming such a hastle.
[quote:47f743bf21]If you say "show imdir" is the path something that exists on your machine? Can you write to that directory? [/quote:47f743bf21]the path is --> show imdir
/tmp/Nick/[quote:47f743bf21]The one file IRAF cares about is the one in the directory where you start IRAF. If you normally start iraf/pyraf from your 'iraf' directory do the MKIRAF agaiin in there, otherwise if you start things form your home directory with the new file, does it work?[/quote:47f743bf21]No!
[quote:47f743bf21]You can reset your 'imtype' environment variable to be 'imh' to create IMH images, e.g. "cl> reset imtype = 'imh'" before you run APALL. However, you'll likely see the same error message about the imdir until that problem gets fixed. [/quote:47f743bf21]I tried that and got a longer list of error messages;Task rfits is running...Killing IRAF task `rfits'
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/stsci/pyssg/Python-2.5.1/lib/python2.5/lib-tk/Tkinter.py", line 1403, in __call__
return self.func(*args)
File "/usr/stsci/pyssg/2.5.1/pytools/editpar.py", line 1052, in execute
self.runTask()
File "/usr/stsci/pyssg/2.5.1/pytools/editpar.py", line 1415, in runTask
self._taskParsObj.run(mode='h', _save=1)
File "/usr/stsci/pyssg/2.5.1/pyraf/iraftask.py", line 277, in run
self._run(redirKW, specialKW)
File "/usr/stsci/pyssg/2.5.1/pyraf/iraftask.py", line 719, in _run
"\n" + str(value))
IrafError: Error running IRAF task rfits
IRAF task terminated abnormally
ERROR (1, "T_RFITS: Illegal file/extensions number list")Any ideas?Thanks in anticipationNick

 
Profile Email
 Quote
fitz
 11/11/2009 08:46PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
In general, /tmp is a bad place for an imdir because system reboots usually wipe it out and you'd lose your .pix files. Does using SPECFIT on the FITS image directly work at all?Otherwise, how did you call RFITS in the first place. The error message indicates a problem in how you specified the input FITS file, not that it could write an output IMH image (progress????)-Mike

 
Profile Email
 Quote
devereux
 11/11/2009 08:46PM  
++---
Junior

Status: offline


Registered: 01/24/2008
Posts: 24
Hi Mike,sorry I got a couple of issues mixed upIf I type cl> reset imtype = 'imh'" before I run APALL. i do indeed create a .imh file so that's good.However, the issue with rfits remains. I just tested it again on a different image
and got this long error message;Task rfits is running...Killing IRAF task `rfits'
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/stsci/pyssg/Python-2.5.1/lib/python2.5/lib-tk/Tkinter.py", line 1403, in __call__
return self.func(*args)
File "/usr/stsci/pyssg/2.5.1/pytools/editpar.py", line 1052, in execute
self.runTask()
File "/usr/stsci/pyssg/2.5.1/pytools/editpar.py", line 1415, in runTask
self._taskParsObj.run(mode='h', _save=1)
File "/usr/stsci/pyssg/2.5.1/pyraf/iraftask.py", line 277, in run
self._run(redirKW, specialKW)
File "/usr/stsci/pyssg/2.5.1/pyraf/iraftask.py", line 719, in _run
"\n" + str(value))
IrafError: Error running IRAF task rfits
IRAF task terminated abnormally
ERROR (1, "T_RFITS: Illegal file/extensions number list")Any ideas?thanksNick

 
Profile Email
 Quote
devereux
 11/11/2009 08:46PM  
++---
Junior

Status: offline


Registered: 01/24/2008
Posts: 24
Hi Mike,I did a bit more investigating on the "Cannot open pixel file” error.I get this error with any operation involving .imh filesIn my login.cl I have the following pathset imdir = "/iraf/imdirs/Nick/"however, I can not find this directory. There is an iraf directory listed along with my
home directory. For example when I do an “ls” I get Nick Shared irafHowever, I do not have permission to get into that iraf directory, and I can’t get in even when I use “sudo” Here’s the first few lines of my login.cl
# LOGIN.CL -- User login file for the IRAF command language.# Identify login.cl version (checked in images.cl).
if (defpar ("logver"))
logver = "IRAF V2.13 March 2006"set home = "/Users/Nick/iraf/"
set imdir = "/iraf/imdirs/Nick/"
set uparm = "home$uparm/"
set userid = "Nick"This login.cl used to work on my old hard drive, I just copied it over.
Any ideas on whats going on?ThanksNick

 
Profile Email
 Quote
fitz
 11/11/2009 08:46PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
On my way to the airport so real quick: the iraf install script will create the /iraf/imdirs part of the path and opening an image should create the last bit so long as /iraf/imdirs actually exists. I don't know what your Pyraf installer did but check that /iraf/imdirs exists and is writable, i.e. can you manually create a 'Nick' subdirectory there? Alternatively, you could edit your login.cl to read[code:1:2c32855be6]
reset imdir = "HDR$pix/"[/code:1:2c32855be6]and a 'pix' subdirectory will be created wherever the .imh header is.-Mike

 
Profile Email
 Quote
devereux
 11/11/2009 08:46PM  
++---
Junior

Status: offline


Registered: 01/24/2008
Posts: 24
Hi Mike,what is the "iraf install script" ?Still no joy fixing my problem.I created an imdirs directory did a mkirafnothing seems to be making any difference.So, I'm still stuck.Nick

 
Profile Email
 Quote
devereux
 11/11/2009 08:46PM  
++---
Junior

Status: offline


Registered: 01/24/2008
Posts: 24
Hi Mike,I am having a conceptual difficulty here.I thought that if I installed PyRaf I got all the STSDAS s/w and IRAF.So, why then would I need to run an IRAF install script?I don't get it, but I'm going to need more details.thanksNick

 
Profile Email
 Quote
devereux
 11/11/2009 08:46PM  
++---
Junior

Status: offline


Registered: 01/24/2008
Posts: 24
Mike,I think I really messed things up now.I tracked down some IRAF installation instructions at Mac Singularity.I followed the steps to run the install script, logged in to the 'iraf User' account.I could not open a terminal window to run the install script.The error I got was:"You are not authorized to run this application, the administrator has set your shell to an illegal value".So, I logged out of iraf user, logged in as Nick, deleted the iraf user account
and tried to create another one, but I was denied that because "the account name 'iraf' is not available"So, I'm really stuck now as I have no iraf account nor an I able to create one.I think you had better call me 928 273 9069ThanksNick

 
Profile Email
 Quote
fitz
 11/11/2009 08:46PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Nick,PyRAF simply replaces/extends the functionality of the CL, it still requires an underlying IRAF/STSDAS installation for things that aren't purely Python. Secondly, and 'iraf' user account is not strictly required for installation, you can do this as yourself and simply prepend the word 'sudo' to any installation commands so it'll be done with root privs.The Mac Singularity installers are, I believe, no longer supported (at least, it's been a long while since they were updated). If you want an all-in-one installation, have a look instead at the SciSoft OSX distro (http://web.mac.com/npirzkal/Scisoft/Scisoft.html) or the DMG file available from STScI (http://www.stsci.edu/resources/software_hardware/pyraf/stsci_python/current/download). Take note of the platform requirements in either case, if you still have problems post back.-Mike

 
Profile Email
 Quote
   
Content generated in: 0.40 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 
dog allergies remedies cialis 20 mg chilblain remedies


Privacy Policy
Terms of Use

User Functions

Login