Comments (2)
@eteq I am using frame.representation_component_names
to get the default names of the frame axes but this includes also distance
. What is the correct way to get the default axes names in a frame?
Also gwcs.CelestialFrame.naxes
is hardcoded as 2. This isn't always correct (e.g. Galactocentric
). Is there a way to get the number of axes in an instance of one of the builtin_frames?
from gwcs.
@nden - if what you want is the names specifically for the default representation (as opposed to the current one for a particular object, which can change at runtime), then this is probably the way to go:
>>> g = coordinates.Galactic()
>>> g.default_representation
astropy.coordinates.representation.SphericalRepresentation
>>> g.representation_info[g.default_representation]
{u'names': (u'l', u'b', u'distance'),
u'units': (Unit("deg"), Unit("deg"), None)}
>>> g.representation_info[g.default_representation]['names']
(u'l', u'b', u'distance')
Internally, that's basically what representation_component_names
does, but it gives you the names for the current representation, which is not necessarily always the default. (But maybe that's actually what you want?)
@nden @mdboom - As for CelestialFrame.naxes
, I would think it should be hardcoded to 3
. All coordinate frame objects by design are 3-dimensional: they use the representation heirarchy, and currently those are all 3D. UnitSphericalRepresentation
is a bit subtle in that it seems to be 2D, but in fact it's interpreted as points on the unit sphere. So you can do this:
>>> s = UnitSphericalRepresentation(10*u.deg, 42*u.deg)
>>> s.to_cartesian()
<CartesianRepresentation (x, y, z) [dimensionless]
(0.73185479, 0.12904574, 0.66913061)>
And you can see that it's actually 3D.
from gwcs.
Related Issues (20)
- Tests fail with `AttributeError: module 'numpy' has no attribute 'asscalar'. Did you mean: 'isscalar'?` HOT 3
- Remove `gwcs_types.py`
- The print(wcs.tofits_sip()) failed in your example in https://gwcs.readthedocs.io/en/latest/#a-step-by-step-example-of-constructing-an-imaging-gwcs-object HOT 2
- Remove maxversion pin of scipy HOT 1
- Documentation refers to deprecated asdf.fits_embed HOT 1
- Splitting the celestial axes of a transform causes errors HOT 1
- Deprecate the pre-APE 14 API HOT 3
- docs mention saving to AsdfInFits which is not available in asdf 3.0 HOT 4
- Consider adding a description in the docs about manifest changes in #469 HOT 1
- WCS API and serialization
- `WCS.pixel_to_world` does not have the same broadcasting behaviour as `astropy.wcs.WCS`
- ``pkg_resources.get_distribution`` is deprecated
- Why is the `WCS` repr the forward transform repr? HOT 1
- GWCS for Magellanic Stream HOT 2
- docs -- double link to asdf example
- Bug in APE-14 description of WCS HOT 4
- Bug in treatment of pixel_bounds
- AstropyDeprecationWarning: The class "Fits" has been renamed to "FITS" in version 7.0 HOT 6
- scipy 1.14.0 causing sip roundtrip test failure on mac m1
- UnitConversionError when using pixel_to_world HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gwcs.