Skip to content

Commit

Permalink
ast: Provide defaults for keywords CNPIX1/2 when reading a DSS header
Browse files Browse the repository at this point in the history
Requested by Bill Joye.
  • Loading branch information
David Berry committed Aug 10, 2012
1 parent 42e1edd commit b0ac6b0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
4 changes: 3 additions & 1 deletion libraries/ast/ast.news
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ environment-independent.
Main Changes in this Version
----------------------------

A bug has been fixed in astRebinSeq<X> which could result in
- A bug has been fixed in astRebinSeq<X> which could result in
incorrect normalisation of the final binned data and variance values.

- When reading a FrameSet from a FITS-DSS header, the keywords CNPIX1 and
CNPIX2 now default to zero if absent. Previously an error was reported.

Main Changes in V7.0.5
----------------------
Expand Down
11 changes: 9 additions & 2 deletions libraries/ast/fitschan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,9 @@ f - AST_WRITEFITS: Write all cards out to the sink function
* for pointing out this error).
* 8-AUG-2012 (DSB):
* Correct assignment to lonpole within CLASSFromStore.
* 10-AUG-2012 (DSB):
* Default DSS keywords CNPIX1 and CNPIX2 to zero if they are
* absent, rather than reporting an error.
*class--
*/

Expand Down Expand Up @@ -8472,9 +8475,13 @@ static void DSSToStore( AstFitsChan *this, FitsStore *store,
/* Check the inherited status. */
if( !astOK ) return;

/* Get the optional DSS keywords, supplying defaults for any missing keywords. */
cnpix1 = 0.0;
cnpix2 = 0.0;
GetValue( this, "CNPIX1", AST__FLOAT, &cnpix1, 0, 1, method, class, status );
GetValue( this, "CNPIX2", AST__FLOAT, &cnpix2, 0, 1, method, class, status );

/* Get the required DSS keywords. Report an error if any are missing. */
GetValue( this, "CNPIX1", AST__FLOAT, &cnpix1, 1, 1, method, class, status );
GetValue( this, "CNPIX2", AST__FLOAT, &cnpix2, 1, 1, method, class, status );
GetValue( this, "PPO3", AST__FLOAT, &ppo3, 1, 1, method, class, status );
GetValue( this, "PPO6", AST__FLOAT, &ppo6, 1, 1, method, class, status );
GetValue( this, "XPIXELSZ", AST__FLOAT, &xpixelsz, 1, 1, method, class, status );
Expand Down
3 changes: 3 additions & 0 deletions libraries/ast/sun_master.tex
Original file line number Diff line number Diff line change
Expand Up @@ -22732,6 +22732,9 @@ \subsection{\xlabel{changes}\xlabel{list_of_most_recent_changes}Changes
\item A bug has been fixed in astRebinSeq<X> which could result in
incorrect normalisation of the final binned data and variance values.

\item When reading a FrameSet from a FITS-DSS header, the keywords CNPIX1
and CNPIX2 now default to zero if absent. Previously an error was reported.

\end{enumerate}


Expand Down

0 comments on commit b0ac6b0

Please sign in to comment.