#6944μ μΌλΆ μ½λ μΌμ΄μ€ ν
μ€νΈλ μ€μ ννμ΄ UnitSpherical
μλλ₯Ό κ°λ νλ μμ λν λͺ κ°μ§ λ¬Έμ κ° μλ λμμ 보μ¬μ£Όμμ΅λλ€. μ΄κ²μ΄ μ¬μ€μμ΄ λ°νμ‘μ΅λλ€. μλ μ¬λ‘λ λ¬Έμ λ₯Ό 보μ¬μ€λλ€.
λν #6944κ° λ³ν©λλ©΄ μ΄ λ²κ·Έμ λν ν΄κ²° λ°©λ²μ΄ μλ λͺ κ°μ§ μμΉκ° μμ΅λλ€. μ΄ λ²κ·Έλ κ·Έ μμ
μ°¨μ μ±
μ μ κ±°ν΄μΌ ν΄κ²° λ κ²½μ° (κ²μ coordinates
λν μλΈ ν¨ν€μ§ #7028
κ·Έλ€μ μ°Ύμ).
μ΄κ²μ μλν©λλ€:
>>> f = ICRS(1*u.deg, 2*u.deg)
>>> f.cartesian
<CartesianRepresentation (x, y, z) [dimensionless]
( 0.99923861, 0.01744177, 0.0348995)>
κ·Έλ¬λ λ€μ λ κ²½μ°λ κ·Έλ μ§ μμ΅λλ€.
>>> f = ICRS(1*u.deg, 2*u.deg,
pm_dec=1*u.mas/u.yr, pm_ra_cosdec=2*u.mas/u.yr, radial_velocity=10*u.km/u.s)
>>> f.represent_as('cartesian', in_frame_units=True)
UnitConversionError: 'mas / (rad yr)' (frequency) and 'km / s' (speed) are not convertible
>>> f = ICRS(1*u.deg, 2*u.deg,
pm_dec=1*u.mas/u.yr, pm_ra_cosdec=2*u.mas/u.yr)
>>> g = f.transform_to(GCRS)
>>> g.cartesian
UnitConversionError: '1 / s' (frequency) and 'km / s' (speed) are not convertible
λ λ²μ§Έ μ€ν¨ μ¬λ‘μμ f.cartesian
κ° μλνμ§λ§ GCRSλ‘μ λ³νμμ 무μΈκ°κ° μ€ν¨νκΈ° μμνλ€λ κ²μ μλ§λ μ μ©ν λ¨μμΌ κ²μ
λλ€. μ΄κ²λ€μ λ―Έλ¬νκ² λ€λ₯Έ λ¬Έμ μΌ μ μμ§λ§ ν¨κ» ν΄κ²°ν΄μΌ ν λ§νΌ μΆ©λΆν κ°κΉμ΅λλ€.
@adrn λλ @mhvk , μ¬κΈ°μ λ¬΄μ¨ μΌμ΄ μΌμ΄λκ³ μλμ§ μκ³ μμ΅λκΉ? μ μ΄λ μμ λ³ν λ¨κ³κ° λ€μ μλͺ» μ μλμ΄ μλ€κ³ μ£Όμ₯ν μ μμ§λ§ λ¨μκ° μ½κ° μ΄μνλλΌλ λ°μΉ΄λ₯΄νΈ ννμ μ¬μ ν μ»μ μ μμ΄μΌ ν©λλ€...
μλ νμΈμ @eteq λ
μ΄ λ¬Έμ λ₯Ό ν΄κ²°νλ €κ³ νμ΅λλ€. νμ§λ§ μμμ κ²½μ°,
>>> f = ICRS(1*u.deg, 2*u.deg,
pm_dec=1*u.mas/u.yr, pm_ra_cosdec=2*u.mas/u.yr, radial_velocity=10*u.km/u.s)
>>> f.represent_as('cartesian', in_frame_units=True)
μμ μλ distance
κ° μμ§λ§ radial_velocity
μμ΅λλ€. λλ κ·Έκ²μ΄ μ νν 무μμ μλ―Ένλμ§ μ΄ν΄νμ§ λͺ»νμ΅λλ€. λν νλ μμ 거리λ₯Ό λλ©΄ μλ²½νκ² μλν©λλ€!
λ¬Έμ λ₯Ό μ΄ν΄νκ² ν΄ μ£Όμκ² μ΅λκΉ? νΌλμ€λ¬μμ§λλ€.
@shreyasbapat https://github.com/astropy/astropy/pull/9064μμ μ΄ λ¬Έμ κ° ν΄κ²°λλμ§ νμΈν΄ μ£Όμκ² μ΅λκΉ? (νΈμ§: κ·Έλ μ§ μλ€)
>>> f = ICRS(1*u.deg, 2*u.deg,
pm_dec=1*u.mas/u.yr, pm_ra_cosdec=2*u.mas/u.yr, radial_velocity=10*u.km/u.s)
>>> f.represent_as('cartesian', in_frame_units=True)
UnitConversionError: 'mas / (rad yr)' (frequency) and 'km / s' (speed) are not convertible
λλ μ΄κ²μ΄ ν΄κ²°ν μ μλ€κ³ μκ°ν©λλ€. κ±°λ¦¬κ° μμΌλ©΄ κ³ μ μ΄λμ κ³΅κ° μλλ‘ λ³ννκ±°λ κ³΅κ° μλλ₯Ό κ° μ΄λμΌλ‘ λ³νν μ μμ΅λλ€. λ°λΌμ μ΄ κ²½μ° μ€λ₯ λ©μμ§κ° λ λͺ ννμ§ νμΈνκΈ°λ§ νλ©΄ λλ€κ³ μκ°ν©λλ€(RVκ° μμ§λ§ κ±°λ¦¬κ° μλ κ²½μ° νΈλ¦¬κ±°λ¨).
>>> f = ICRS(1*u.deg, 2*u.deg,
pm_dec=1*u.mas/u.yr, pm_ra_cosdec=2*u.mas/u.yr)
>>> g = f.transform_to(GCRS)
>>> repr(g)
# error
>>> g.data
<CartesianRepresentation (x, y, z) [dimensionless]
(0.99923901, 0.01742676, 0.03489572)
(has differentials w.r.t.: 's')>
g.data.differentials
<CartesianDifferential (d_x, d_y, d_z) in 1 / s
(6.07736084e-13, -1.85772092e-11, -8.12625661e-12)>
μ΄κ²μ ν¨μ¬ λ λ―Έλ¬ν©λλ€. μ μ ν λͺ¨μ
μ΄ μμΌλ©΄ g
λ UnitSpherical
. μ΄λ μλ―Έκ° μμΌλ©° μ¬κΈ°μμλ λ§μ°¬κ°μ§μ΄λ―λ‘ λ³νμ λ¬Έμ κ° μμ΅λλ€. μμ μ±μ μν΄ λ¨μ ꡬμ νμνλ©΄ μλν©λλ€.
g.represent_as('unitspherical')
Out[24]:
<UnitSphericalRepresentation (lon, lat) in rad
(0.01743826, 0.0349028)
(has differentials w.r.t.: 's')>
In [25]: g.represent_as('unitspherical').differentials['s']
Out[25]:
<UnitSphericalDifferential (d_lon, d_lat) in rad / s
(-1.85963079e-11, -8.13120751e-12)>
κ·Έλ¬λ κ·ΈλΌμλ λΆκ΅¬νκ³ g.cartesian
λ μλν΄μΌ ν©λλ€. μ¬κΈ°μ λ¬Έμ λ μ§κ΅ μλκ° km/s
λΌκ³ μ£Όμ₯νλ©΄μ νλ μμ΄ μ¬μ©μμκ² μ μ ν λ¨μλ₯Ό κ²°μ νλ€λ κ²μ
λλ€(λ¬Όλ‘ μ΄κ²μ λ€μ ννμ μ’ν λ¨μκ° κ²°μ λλ€λ μ€λ λΆλ§μ λν΄...): https://github.com/astropy/astropy/blob/c3dc7b38303b3615945aa36a11ebf7bd31d5cc0a/astropy/coordinates/baseframe.py#L1744 -L1753
λ¨μ μ체λ λ€μμμ κ°μ Έμ΅λλ€.
g.representation_info
{astropy.coordinates.representation.CartesianRepresentation: {'names': ['x',
'y',
'z'],
'units': [None, None, None]},
astropy.coordinates.representation.UnitSphericalRepresentation: {'names': ('ra',
'dec'),
'units': (Unit("deg"), Unit("deg"))},
astropy.coordinates.representation.RadialRepresentation: {'names': ['distance'],
'units': [None]},
astropy.coordinates.representation.SphericalRepresentation: {'names': ('ra',
'dec',
'distance'),
'units': (Unit("deg"), Unit("deg"), None)},
astropy.coordinates.representation.PhysicsSphericalRepresentation: {'names': ['phi',
'theta',
'r'],
'units': [Unit("deg"), Unit("deg"), None]},
astropy.coordinates.representation.CylindricalRepresentation: {'names': ['rho',
'phi',
'z'],
'units': [None, Unit("deg"), None]},
astropy.coordinates.representation.CartesianDifferential: {'names': ('v_x',
'v_y',
'v_z'),
'units': (Unit("km / s"), Unit("km / s"), Unit("km / s"))},
astropy.coordinates.representation.UnitSphericalDifferential: {'names': ('pm_ra',
'pm_dec'),
'units': (Unit("mas / yr"), Unit("mas / yr"))},
astropy.coordinates.representation.SphericalDifferential: {'names': ('pm_ra',
'pm_dec',
'radial_velocity'),
'units': (Unit("mas / yr"), Unit("mas / yr"), Unit("km / s"))},
astropy.coordinates.representation.UnitSphericalCosLatDifferential: {'names': ('pm_ra_cosdec',
'pm_dec'),
'units': (Unit("mas / yr"), Unit("mas / yr"))},
astropy.coordinates.representation.SphericalCosLatDifferential: {'names': ('pm_ra_cosdec',
'pm_dec',
'radial_velocity'),
'units': (Unit("mas / yr"), Unit("mas / yr"), Unit("km / s"))},
astropy.coordinates.representation.RadialDifferential: {'names': ['d_distance'],
'units': [None]},
astropy.coordinates.representation.PhysicsSphericalDifferential: {'names': ['d_phi',
'd_theta',
'd_r'],
'units': [None, None, None]},
astropy.coordinates.representation.CylindricalDifferential: {'names': ['d_rho',
'd_phi',
'd_z'],
'units': [None, None, None]}}
μ¬κΈ°μ CartesianDifferential
κ° μλͺ»λ μ μΌν κ²μμ μ μ μμ΅λλ€. μ΄λ μ νΈνλ λ¨μκ° μ ν μ€μ λμ΄ μκΈ° λλ¬Έμ
λλ€.
μ΄κ²μ μλ§λ #9086μ μμ μ΄ μ½κ°μ μμ μΌλ‘ OKλΌλ κ²μ μλ―Έν©λλ€. μμ²λ λ¨μλ‘ μ΄λ νλ €κ³ μλ ν΄μΌ νμ§λ§ μ€ν¨νλλΌλ μκ΄νμ§ μμ΅λλ€.