comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: FITS IO Problem
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: FITS IO Problem [message #70642] Mon, 26 April 2010 15:52 Go to next message
John B is currently offline  John B
Messages: 5
Registered: April 2010
Junior Member
On Apr 25, 12:37 pm, John B <bochan...@gmail.com> wrote:
> On Apr 24, 4:08 pm, Craig Markwardt <craig.markwa...@gmail.com> wrote:
>
>
>
>> On Apr 24, 9:18 am, John B <bochan...@gmail.com> wrote:
>
>>> On Apr 24, 8:09 am, wlandsman <wlands...@gmail.com> wrote:
>
>>>> > Readfits.pro is choking since this isn't a standardfitsfile (NAXIS
>>>> > isn't defined).  Is there another one I can use?
>
>>>> There is a nice (non-IDL) program FITSVerify ( http://heasarc.gsfc.nasa.gov/docs/software/ftools/fitsverify /) to
>>>> check the validity of aFITSfile.   You can also upload yourFITS
>>>> file to the online verifier.
>
>>> Cool.  I submitted it and got this error:
>
>>> File name:  test.fits
>>>                                            Run Number 8232
>
>>>               fitsverify 4.15 (CFITSIO V3.181)
>>>               --------------------------------
>
>>> 2 Header-Data Units in this file.
>
>>> =================== HDU 1: Primary Array ===================
>
>>>    1 | SIMPLE  =                    T /Dummy Created by MWRFITS v1.4a
>>>    2 | BITPIX  =                    8 /Dummy primary header created by
>>> MWRFITS
>>>    3 | NAXIS   =                    0 /No data is associated with this
>>> header
>>>    4 | EXTEND  =                    T /Extensions may (will!) be
>>> present
>>>    5 | END
>
>>>  5 header keywords
>
>>>  Null data array; NAXIS = 0
>
>>> =================== HDU 2: BINARY Table ====================
>
>>> *** Error:   checking data fill: tried to move past end of file
>>> *** Error:   String in row #3, column #3 contains non-ASCII text.
>>>              (Other rows may have errors).
>
>>> I don't know entirely how to interpret this.
>
>>>> Does MWRFITS work with the simple examples provided in the
>>>> documentation?
>
>>> Yes, MWRFITS is working for other applications on my system.
>
>>>> You wouldn't be using GDL (the free IDL clone) rather than IDL, would
>>>> you?      I recently discovered that GDL has a slightly different
>>>> treatment of nested loops than IDL, that led to disastrous
>>>> consequences for a different set ofFITSI/O routines.  
>
>>> Nope... I am using IDL.
>
>>>  --Wayne
>
>> Are you by any chance overwriting an existing file?  To me it looks
>> like you attempted to write a file, but it got stopped after writing
>> the primary extension.  If the bits from the previous existing file
>> are still there, then it would look like a bogus 2ndFITSextension.
>
>> Craig
>
> Hi Craig,
>    No, I am writing a new file each time.
>
> Cheers,
> John

It seems that updating to the latest astrolib version took care of the
problem. Thanks for all your help.

John
Re: FITS IO Problem [message #70655 is a reply to message #70642] Sun, 25 April 2010 09:37 Go to previous messageGo to next message
John B is currently offline  John B
Messages: 5
Registered: April 2010
Junior Member
On Apr 24, 4:08 pm, Craig Markwardt <craig.markwa...@gmail.com> wrote:
> On Apr 24, 9:18 am, John B <bochan...@gmail.com> wrote:
>
>
>
>> On Apr 24, 8:09 am, wlandsman <wlands...@gmail.com> wrote:
>
>>>> Readfits.pro is choking since this isn't a standard fits file (NAXIS
>>>> isn't defined).  Is there another one I can use?
>
>>> There is a nice (non-IDL) program FITSVerify ( http://heasarc.gsfc.nasa.gov/docs/software/ftools/fitsverify /) to
>>> check the validity of a FITS file.   You can also upload your FITS
>>> file to the online verifier.
>
>> Cool.  I submitted it and got this error:
>
>> File name:  test.fits
>>                                            Run Number 8232
>
>>               fitsverify 4.15 (CFITSIO V3.181)
>>               --------------------------------
>
>> 2 Header-Data Units in this file.
>
>> =================== HDU 1: Primary Array ===================
>
>>    1 | SIMPLE  =                    T /Dummy Created by MWRFITS v1.4a
>>    2 | BITPIX  =                    8 /Dummy primary header created by
>> MWRFITS
>>    3 | NAXIS   =                    0 /No data is associated with this
>> header
>>    4 | EXTEND  =                    T /Extensions may (will!) be
>> present
>>    5 | END
>
>>  5 header keywords
>
>>  Null data array; NAXIS = 0
>
>> =================== HDU 2: BINARY Table ====================
>
>> *** Error:   checking data fill: tried to move past end of file
>> *** Error:   String in row #3, column #3 contains non-ASCII text.
>>              (Other rows may have errors).
>
>> I don't know entirely how to interpret this.
>
>>> Does MWRFITS work with the simple examples provided in the
>>> documentation?
>
>> Yes, MWRFITS is working for other applications on my system.
>
>>> You wouldn't be using GDL (the free IDL clone) rather than IDL, would
>>> you?      I recently discovered that GDL has a slightly different
>>> treatment of nested loops than IDL, that led to disastrous
>>> consequences for a different set of FITS I/O routines.  
>
>> Nope... I am using IDL.
>
>>  --Wayne
>
> Are you by any chance overwriting an existing file?  To me it looks
> like you attempted to write a file, but it got stopped after writing
> the primary extension.  If the bits from the previous existing file
> are still there, then it would look like a bogus 2nd FITS extension.
>
> Craig

Hi Craig,
No, I am writing a new file each time.


Cheers,
John
Re: FITS IO Problem [message #70656 is a reply to message #70655] Sat, 24 April 2010 13:08 Go to previous messageGo to next message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Apr 24, 9:18 am, John B <bochan...@gmail.com> wrote:
> On Apr 24, 8:09 am, wlandsman <wlands...@gmail.com> wrote:
>
>>> Readfits.pro is choking since this isn't a standard fits file (NAXIS
>>> isn't defined).  Is there another one I can use?
>
>> There is a nice (non-IDL) program FITSVerify ( http://heasarc.gsfc.nasa.gov/docs/software/ftools/fitsverify /) to
>> check the validity of a FITS file.   You can also upload your FITS
>> file to the online verifier.
>
> Cool.  I submitted it and got this error:
>
> File name:  test.fits
>                                            Run Number 8232
>
>               fitsverify 4.15 (CFITSIO V3.181)
>               --------------------------------
>
> 2 Header-Data Units in this file.
>
> =================== HDU 1: Primary Array ===================
>
>    1 | SIMPLE  =                    T /Dummy Created by MWRFITS v1.4a
>    2 | BITPIX  =                    8 /Dummy primary header created by
> MWRFITS
>    3 | NAXIS   =                    0 /No data is associated with this
> header
>    4 | EXTEND  =                    T /Extensions may (will!) be
> present
>    5 | END
>
>  5 header keywords
>
>  Null data array; NAXIS = 0
>
> =================== HDU 2: BINARY Table ====================
>
> *** Error:   checking data fill: tried to move past end of file
> *** Error:   String in row #3, column #3 contains non-ASCII text.
>              (Other rows may have errors).
>
> I don't know entirely how to interpret this.
>
>
>
>> Does MWRFITS work with the simple examples provided in the
>> documentation?
>
> Yes, MWRFITS is working for other applications on my system.
>
>
>
>> You wouldn't be using GDL (the free IDL clone) rather than IDL, would
>> you?      I recently discovered that GDL has a slightly different
>> treatment of nested loops than IDL, that led to disastrous
>> consequences for a different set of FITS I/O routines.  
>
> Nope... I am using IDL.
>
>  --Wayne

Are you by any chance overwriting an existing file? To me it looks
like you attempted to write a file, but it got stopped after writing
the primary extension. If the bits from the previous existing file
are still there, then it would look like a bogus 2nd FITS extension.

Craig
Re: FITS IO Problem [message #70658 is a reply to message #70656] Sat, 24 April 2010 06:18 Go to previous messageGo to next message
John B is currently offline  John B
Messages: 5
Registered: April 2010
Junior Member
On Apr 24, 8:09 am, wlandsman <wlands...@gmail.com> wrote:
>> Readfits.pro is choking since this isn't a standard fits file (NAXIS
>> isn't defined).  Is there another one I can use?
>
> There is a nice (non-IDL) program FITSVerify ( http://heasarc.gsfc.nasa.gov/docs/software/ftools/fitsverify /) to
> check the validity of a FITS file.   You can also upload your FITS
> file to the online verifier.

Cool. I submitted it and got this error:

File name: test.fits
Run Number 8232

fitsverify 4.15 (CFITSIO V3.181)
--------------------------------


2 Header-Data Units in this file.

=================== HDU 1: Primary Array ===================

1 | SIMPLE = T /Dummy Created by MWRFITS v1.4a
2 | BITPIX = 8 /Dummy primary header created by
MWRFITS
3 | NAXIS = 0 /No data is associated with this
header
4 | EXTEND = T /Extensions may (will!) be
present
5 | END

5 header keywords

Null data array; NAXIS = 0

=================== HDU 2: BINARY Table ====================

*** Error: checking data fill: tried to move past end of file
*** Error: String in row #3, column #3 contains non-ASCII text.
(Other rows may have errors).

I don't know entirely how to interpret this.


>
> Does MWRFITS work with the simple examples provided in the
> documentation?

Yes, MWRFITS is working for other applications on my system.
>
> You wouldn't be using GDL (the free IDL clone) rather than IDL, would
> you?      I recently discovered that GDL has a slightly different
> treatment of nested loops than IDL, that led to disastrous
> consequences for a different set of FITS I/O routines.  

Nope... I am using IDL.

 --Wayne
Re: FITS IO Problem [message #70660 is a reply to message #70658] Sat, 24 April 2010 05:09 Go to previous messageGo to next message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
>
> Readfits.pro is choking since this isn't a standard fits file (NAXIS
> isn't defined).  Is there another one I can use?
>
There is a nice (non-IDL) program FITSVerify (
http://heasarc.gsfc.nasa.gov/docs/software/ftools/fitsverify / ) to
check the validity of a FITS file. You can also upload your FITS
file to the online verifier.

Does MWRFITS work with the simple examples provided in the
documentation?

You wouldn't be using GDL (the free IDL clone) rather than IDL, would
you? I recently discovered that GDL has a slightly different
treatment of nested loops than IDL, that led to disastrous
consequences for a different set of FITS I/O routines. --Wayne
Re: FITS IO Problem [message #70664 is a reply to message #70660] Fri, 23 April 2010 20:05 Go to previous messageGo to next message
John B is currently offline  John B
Messages: 5
Registered: April 2010
Junior Member
On Apr 23, 5:13 pm, wlandsman <wlands...@gmail.com> wrote:
> One possiblity is that you have an incompatible versions of mrdfits
> and fxposit.pro (a procedure it calls to open the FITS file).
> mrdfits.pro was modified in March 2009 to OPENR the file with the /
> SWAP_IF_LITTLE keyword, rather than explcitly performing the byte
> swapping.    (This provides a significant speed improvement.)
> However, if you have a new version of mrdfits.pro but an old version
> of fxposit.pro then the byte swapping would not be perfomed, leading
> to nonsensical values such as you describe.   (I'm not sure why the
> first row would be OK, though)

I updated to the latest version of astrolib (I was using a version in
Schlegel's idlutils), and I still get the same error.


>
> If that is not the problem, then the next step is to figure out
> whether the culprit is mrdfits.pro or mwrfits.pro.     Can other FITS
> I/O programs read the file created by mwrfits.pro?
>

Readfits.pro is choking since this isn't a standard fits file (NAXIS
isn't defined). Is there another one I can use?

J


> --Wayne
>
> On Apr 23, 4:30 pm, John B <bochan...@gmail.com> wrote:
>
>> Hi All,
>
>> I am writing an anonymous structure (52 columns by 21 rows) out to a
>> FITS file, using mwrfits.pro from the astrolib library.  When I take
>> that file and read it back in (from the same machine), I get garbage
>> values throughout the
>> structure.  Nans, infs and just random longs... very confusing.
>> Neither program complains, and until now, both have worked
>> spectacularly.
>
>> I have noticed that the first row is preserved properly, and that I
>> can isolate a single row and write it out, then read it in, and it is
>> ok.
>
>> Any suggestions??
>
>> Thank you!
>
>
Re: FITS IO Problem [message #70666 is a reply to message #70664] Fri, 23 April 2010 14:13 Go to previous messageGo to next message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
One possiblity is that you have an incompatible versions of mrdfits
and fxposit.pro (a procedure it calls to open the FITS file).
mrdfits.pro was modified in March 2009 to OPENR the file with the /
SWAP_IF_LITTLE keyword, rather than explcitly performing the byte
swapping. (This provides a significant speed improvement.)
However, if you have a new version of mrdfits.pro but an old version
of fxposit.pro then the byte swapping would not be perfomed, leading
to nonsensical values such as you describe. (I'm not sure why the
first row would be OK, though)

If that is not the problem, then the next step is to figure out
whether the culprit is mrdfits.pro or mwrfits.pro. Can other FITS
I/O programs read the file created by mwrfits.pro?


--Wayne

On Apr 23, 4:30 pm, John B <bochan...@gmail.com> wrote:
> Hi All,
>
> I am writing an anonymous structure (52 columns by 21 rows) out to a
> FITS file, using mwrfits.pro from the astrolib library.  When I take
> that file and read it back in (from the same machine), I get garbage
> values throughout the
> structure.  Nans, infs and just random longs... very confusing.
> Neither program complains, and until now, both have worked
> spectacularly.
>
> I have noticed that the first row is preserved properly, and that I
> can isolate a single row and write it out, then read it in, and it is
> ok.
>
> Any suggestions??
>
> Thank you!
Re: FITS IO Problem [message #71432 is a reply to message #70660] Mon, 21 June 2010 01:59 Go to previous message
m_schellens is currently offline  m_schellens
Messages: 31
Registered: February 2005
Member
On 24 Apr., 18:09, wlandsman <wlands...@gmail.com> wrote:
>> Readfits.pro is choking since this isn't a standard fits file (NAXIS
>> isn't defined).  Is there another one I can use?
>
> There is a nice (non-IDL) program FITSVerify ( http://heasarc.gsfc.nasa.gov/docs/software/ftools/fitsverify /) to
> check the validity of a FITS file.   You can also upload your FITS
> file to the online verifier.
>
> Does MWRFITS work with the simple examples provided in the
> documentation?
>
> You wouldn't be usingGDL(the free IDL clone) rather than IDL, would
> you?      I recently discovered thatGDLhas a slightly different
> treatment of nested loops than IDL, that led to disastrous
> consequences for a different set of FITS I/O routines.    --Wayne

I just stumbled over this statement now.
I am not aware of any different handling of nested loops.
Could you post an example showing the different behaviour of GDL?
The actual tarball is 0.9rc4
( http://sourceforge.net/projects/gnudatalanguage/files/gdl/0. 9rc4/
gdl-0.9rc4.tar.gz/download)
This version already contains a corrected handling of GOTO in and out
of loops.

Regards,
Marc
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Convert 3D to 1D, apply fuction then convert back to 3D
Next Topic: contour plot query

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 09:21:38 PDT 2025

Total time taken to generate the page: 0.00760 seconds