Skip to content

WCS with lookuptables (tabular) #2362

Closed

Description

@keflavich

It appears that lookup table WCS cannot be created with astropy.wcs at present.

http://astropy.readthedocs.org/en/latest/api/astropy.wcs.Tabprm.html#astropy.wcs.Tabprm says a Tabprm table cannot be directly instantiated.

This is a feature request or a request for documentation if the functionality already exists. I'll help with implementation, but I need some direction. Does anything need to be modified in the C wrapper? Or is it just the python frontend that needs to be made?

Does astropy.wcs presently know how to write a tabular WCS, or do we need to implement that too?

Activity

  1. astrofrog commented on Apr 23, 2014

    @astrofrog
    Member
  2. added this to the Future milestone on Apr 23, 2014
  3. mdboom commented on May 9, 2014

    @mdboom
    Contributor

    Sorry to just see this now.

    The support that is there is read-only, since it looked rather complicated to make an API that would make it easy to create these things, and there was no one clamoring for the feature at the time.

    I recently spoke to Mark Calabretta about tabprm and he says it's a very rarely used feature.

    I'm not against doing this if there's a good use case, though. It will require spelunking down into the C wrappers.

  4. keflavich commented on May 9, 2014

    @keflavich
    ContributorAuthor

    I don't have a pressing need for this, but it is one of the fundamental underlying systems that stopped specutils from going anywhere; the first thing that Wolfgang implemented was a lookuptable spectral axis. I think that makes a lot more sense attached to a WCS axis.

    If we want to support optical/IR spectrographs and IFUs, this is likely to be necessary, but as a radio astronomer I'm willing to put it off.

  5. astrofrog commented on Jun 5, 2014

    @astrofrog
    Member

    I think there is a chicken-and-egg issue here - I think the reason no-one uses it is because it is hard to create them currently. If we allowed an easy way to create this in astropy, I think there would be wide applicability to spectra/spectral cubes especially.

  6. mdboom commented on Jun 5, 2014

    @mdboom
    Contributor

    I'd be happy (given the time) to collaborate with someone on implementing this. It shouldn't be too bad -- the actual calculation and saving to/from FITS is already there as part of wcslib -- the main work here would be providing the wrappers to convert Numpy arrays to/from the tables that wcslib wants.

  7. astrofrog commented on Jun 6, 2014

    @astrofrog
    Member

    Thanks! It sounds like @keflavich mentioned he was interested in helping with the implementation? Maybe it would also be worth posting a message to astropy-dev to see if anyone else is interested in helping (though too many cooks, etc. etc.).

  8. keflavich commented on Jun 6, 2014

    @keflavich
    ContributorAuthor

    I was interested but time has gotten very thin... don't rely on me.

  9. astrofrog commented on Jun 7, 2014

    @astrofrog
    Member

    Ok, then maybe we should see if someone on astropy-dev is interested.

  10. tepickering commented on Oct 23, 2014

    @tepickering
    Contributor

    i just bumped into a use case for this in my own work. has there been any movement on this?

  11. cdeil commented on Jun 29, 2015

    @cdeil
    Member

    In Gammapy having a way to construct a lookup table WCS from Python would also be very useful.

    Currently we have to handle our spectral log energy axis ourselves, without using astropy.wcs ... see SpectralCube and LogEnergyAxis.

  12. parejkoj commented on Oct 4, 2019

    @parejkoj
    Contributor

    This is likely related to #7883 and I think is still an open issue? @nden ?

  13. mcara commented on Nov 21, 2019

    @mcara
    Contributor

    In PR #9641 I implemented support for the -TAB algorithm in FITS WCS defined in WCS Paper III.

  14. mcara commented on Jan 16, 2020

    @mcara
    Contributor

    To those (still) interested: #9641 has been merged and WCS-TAB should now be supported in astropy.wcs. Please give it a try.

  15. pllim commented on Jan 16, 2020

    @pllim
    Member

    Closing as solved. Thanks, @mcara !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions