These are chat archives for astropy/astropy

6th
Jun 2014
Christoph Deil
@cdeil
Jun 06 2014 07:17
I filed an issue proposing to change the check for optional dependencies: astropy/astropy#2603
Stuart Mumford
@Cadair
Jun 06 2014 15:14
hey @VaticanCameos
Pritish Chakraborty
@PritishC
Jun 06 2014 15:19
hello @Cadair
Stuart Mumford
@Cadair
Jun 06 2014 15:19
hey @taldcroft you about?
Pritish Chakraborty
@PritishC
Jun 06 2014 15:20
@taldcroft , I was following your guidelines to make some tests. A little confused at how to test this bit "Test that setting the representation via coord.preferred_representation = CartesianRepresentation gives the same values for x, y, z as coord.cartesian (and so on for other representations)."
I have an ICRS object, icrs. icrs.spherical.components returns its values. However, icrs.representation.components returns a property object.
A little confused on how to extract the actual components from the property object, or if that is even correct. I'm running really slow today, apologies.
Ghost
@ghost~53638049048862e761fa0380
Jun 06 2014 16:31
@VaticanCameos - icrs.representation is returning the ICRS class, so when you ask for components on that you are just getting the property. You can't really do anything with a bare property.
On the first test I was imagining something like:
icrs = SkyCoord(..)  # Spherical
icrs_cart = icrs.frame.cartesian  # CartesianRepresentation object
icrs.representation = 'cartesian'
assert icrs.x == icrs_cart.x  # and same for y and z
Pritish Chakraborty
@PritishC
Jun 06 2014 16:36
Ahh. That makes a lot of sense. Thanks a bunch!
Ghost
@ghost~53638049048862e761fa0380
Jun 06 2014 16:43
Just stepping out for lunch now be back in 1/2 hour.