Skip to content

FITS: Allow multiple leading spaces in value field for RVKC input format - #11301

Merged
saimn merged 2 commits into
astropy:masterfrom
dhomeier:fits-rvkc-blanks
Feb 8, 2021
Merged

saimn merged 2 commits into
astropy:masterfrom
dhomeier:fits-rvkc-blanks

Conversation

@dhomeier

@dhomeier dhomeier commented Feb 5, 2021

Copy link
Copy Markdown
Contributor

Description

This is a bug fix or enhancement for a minor issue that arose in relation to #11260:

The io.fits.Card filters for identifying record-valued key cards were rejecting multiple spaces in the value field after the : , therefore not recognising header cards written by WCSLIB like

DQ1     = 'NAXES:  2'          / Two independent variables
DQ1     = 'AUX.1.COEFF.0:   -0.030369554325293' / TPD: x = c0 + c1*u + c2*v

as RVKC and thus not making them accessible as e.g. header['DQ1.AUX.1.COEFF...'].
Since the syntax does not seem to forbid extra space, and anyway WCSLIB is using it gratuitously in writing its headers, I have extended the re accordingly and modified a few tests for this format.

@github-actions github-actions Bot removed the wcs label Feb 5, 2021
@dhomeier
dhomeier requested review from mcara and saimn February 5, 2021 21:37
@dhomeier dhomeier added the wcs label Feb 5, 2021
@saimn saimn added this to the v4.0.5 milestone Feb 6, 2021
@saimn

saimn commented Feb 6, 2021

Copy link
Copy Markdown
Contributor

Seems reasonable. Please add the changelog entry.

@saimn saimn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, thanks @dhomeier.

@saimn
saimn merged commit 4d2ffc4 into astropy:master Feb 8, 2021
@dhomeier
dhomeier deleted the fits-rvkc-blanks branch February 8, 2021 15:04
astrofrog pushed a commit that referenced this pull request Mar 16, 2021
FITS: Allow multiple leading spaces in value field for RVKC input format
eteq pushed a commit that referenced this pull request Mar 25, 2021
FITS: Allow multiple leading spaces in value field for RVKC input format
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants