[Kst] [Bug 123399] error reading certain fits files

Theodore Kisner kisner at physics.ucsb.edu
Tue Mar 14 20:46:24 CET 2006


As a long term solution, I don't think we should be using fits_get_colname.  I 
think the most general way to read a table is:

1.  fits_open_table:  open file and move to first HDU containing a table
2.  fits_get_hdu_type:  determine whether ascii or binary
3.  fits_read_atblhdr:  read number of columns / rows and get all names
    OR fits_read_btblhdr
4.  create fieldnames based on column number and column name (if it exists)

This is what I was going to implement before I was interrupted by this commit.  
Perhaps this is too many changes to be backported to 1.2, but I think it is 
the safest way to read all the brain-dead FITS files out there.

-Ted 

On Tuesday 14 March 2006 11:28, Andrew Walker wrote:
| ------- You are receiving this mail because: -------
| You are the assignee for the bug, or are watching the assignee.
|
| http://bugs.kde.org/show_bug.cgi?id=123399
| arwalker sumusltd com changed:
|
|            What    |Removed                     |Added
| ---------------------------------------------------------------------------
|- Status|UNCONFIRMED                 |RESOLVED
|          Resolution|                            |FIXED
|
|
|
| ------- Additional Comments From arwalker sumusltd com  2006-03-14 20:28
| ------- SVN commit 518642 by arwalker:
|
| BUG:123399 Allow for the posibility that column labels are identical.
|
|  M  +12 -3     lfiio.cpp
|
|
| --- trunk/extragear/graphics/kst/src/datasources/lfiio/lfiio.cpp
| #518641:518642 @ -117,19 +117,28  @
|            for( i=0; i<iNumCols; i++ )
|            {
|              iStatus = 0;
| -
| +
|              sprintf( charTemplate, "%d", i+1 );
|              iResult = fits_get_colname( ffits, CASEINSEN, charTemplate,
| charName, &iColNumber, &iStatus ); if( iResult == 0 )
|              {
| +              int iOffset = i;
| +
|                strName = charName;
| -              _fieldList.append( strName );
| +              //
| +              // ensure that we don't add duplicates to the _fieldList...
| +              //
| +              while( _fieldList.findIndex( strName ) != -1 )
| +              {
| +                strName = QString("%1[%2]").arg( charName ). arg( iOffset
| ); +                iOffset++;
| +              }
|              }
|              else
|              {
|                strName.setNum( i );
| -              _fieldList.append( strName );
|              }
| +            _fieldList.append( strName );
|
|              iStatus = 0;
|              iResult = fits_get_coltype( ffits, i+1, &iTypeCode, &lRepeat,
| &lWidth, &iStatus ); _______________________________________________
| Kst mailing list
| Kst at kde.org
| https://mail.kde.org/mailman/listinfo/kst


More information about the Kst mailing list