Skip to content

Commit

Permalink
ast: Correction to CLASS encoding in FitsChan
Browse files Browse the repository at this point in the history
Previously, exporting to FITS-CLASS encoding did not properly check the
value of the LONPOLE keyword that would be produced. This could result in
a header being produced without error that could not be read correctly by
CLASS.
  • Loading branch information
David Berry committed Aug 8, 2012
1 parent e761adf commit bce58a1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libraries/ast/fitschan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,8 @@ f - AST_WRITEFITS: Write all cards out to the sink function
* 26-JUN-2012 (DSB):
* Correct call to astKeyFields in SAOTrans (thanks to Bill Joye
* for pointing out this error).
* 8-AUG-2012 (DSB):
* Correct assignment to lonpole within CLASSFromStore.
*class--
*/

Expand Down Expand Up @@ -5819,7 +5821,7 @@ static int CLASSFromStore( AstFitsChan *this, FitsStore *store,
FITS-CLASS imposes a no rotation restriction, it can tolerate lonpole
values of +/- 180 degrees. */
if( ok && ( naxis2 != 1 || naxis3 != 1 ) ) {
lonpole = GetItem( &(store->latpole), 0, 0, s, NULL, method, class, status );
lonpole = GetItem( &(store->lonpole), 0, 0, s, NULL, method, class, status );
if( lonpole != AST__BAD && lonpole != -180.0 && lonpole == 180 ) ok = 0;
if( GetItem( &(store->latpole), 0, 0, s, NULL, method, class, status )
!= AST__BAD ) ok = 0;
Expand Down

0 comments on commit bce58a1

Please sign in to comment.