Skip to content

Add support for OGIP unit strings - #377

Merged
mdboom merged 1 commit into
astropy:masterfrom
mdboom:unit/ogip
Jan 9, 2014
Merged

mdboom merged 1 commit into
astropy:masterfrom
mdboom:unit/ogip

Conversation

@mdboom

@mdboom mdboom commented Dec 19, 2013

Copy link
Copy Markdown
Contributor

The OGIP unit standard has some subtle differences to the core FITS unit standard. We should implement a new formatter for this standard.

@ghost ghost assigned mdboom Sep 11, 2012
@astrofrog

Copy link
Copy Markdown
Member

@mdboom - does it make sense to delay this for 0.4.0?

@mdboom

mdboom commented Sep 20, 2013

Copy link
Copy Markdown
Contributor Author

Yeah -- it's really just here for completeness. As in, "this is a unit format that's out there, we should support it". But no one has actually asked for it and I have no idea how widely used it is. (The FITS and CDS unit formats have had a number of bug reports, though, so I know someone is using them).

@mdboom

mdboom commented Dec 19, 2013

Copy link
Copy Markdown
Contributor Author

Following the discussion in #1911, this adds support for OGIP format units.

How we actually use this in the FITS parser (how we automatically determine whether to use this or the FITS unit parser, or somehow try both and check for agreement as @hamogu suggests) should probably be left as a follow-on PR. This merely makes OGIP parsing available to us.

Cc: @hamogu, @philhodge

Comment thread astropy/units/format/ogip.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

generic -> OGIP and reference?

@mdboom

mdboom commented Jan 8, 2014

Copy link
Copy Markdown
Contributor Author

This is ready for review. @embray?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One day I'm gonna make a formatter metaclass to handle this sort of boilerplate. But in the meantime it's really not necessary :)

@embray

embray commented Jan 8, 2014

Copy link
Copy Markdown
Member

Looks fine to me. How this integrates with the FITS module depends entirely on how unit support is added in the first place (something I'd really like to get done for 0.4 though).

I think it should try the standard FITS unit format first, and failing that fall back on trying OGIP. There should also be an option to disable OGIP support altogether for applications that know they don't need it and don't want the extra overhead. I might apply that to unit support in general as well. But the default should be the most permissive.

mdboom added a commit that referenced this pull request Jan 9, 2014
Add support for OGIP unit strings
@mdboom
mdboom merged commit f5a46bc into astropy:master Jan 9, 2014
@mdboom
mdboom deleted the unit/ogip branch May 21, 2014 23:58
astrofrog added a commit to astrofrog/astropy that referenced this pull request Jun 12, 2019
jeffjennings pushed a commit to jeffjennings/astropy that referenced this pull request Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants