Astropy: 속도 및 "λ‹¨μœ„" ν‘œν˜„μ΄ μžˆλŠ” ν”„λ ˆμž„μ΄ 직ꡐ둜 λ³€ν™˜λ˜μ§€ μ•ŠμŒ

에 λ§Œλ“  2017λ…„ 12μ›” 23일  Β·  3μ½”λ©˜νŠΈ  Β·  좜처: astropy/astropy

#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 , μ—¬κΈ°μ„œ 무슨 일이 μΌμ–΄λ‚˜κ³  μžˆλŠ”μ§€ μ•Œκ³  μžˆμŠ΅λ‹ˆκΉŒ? 적어도 μœ„μ˜ λ³€ν™˜ 단계가 λ‹€μ†Œ 잘λͺ» μ •μ˜λ˜μ–΄ μžˆλ‹€κ³  μ£Όμž₯ν•  수 μžˆμ§€λ§Œ λ‹¨μœ„κ°€ μ•½κ°„ μ΄μƒν•˜λ”λΌλ„ 데카λ₯΄νŠΈ ν‘œν˜„μ„ μ—¬μ „νžˆ 얻을 수 μžˆμ–΄μ•Ό ν•©λ‹ˆλ‹€...

Bug coordinates

λͺ¨λ“  3 λŒ“κΈ€

μ•ˆλ…•ν•˜μ„Έμš” @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μ—μ„œ 이 λ¬Έμ œκ°€ ν•΄κ²°λ˜λŠ”μ§€ 확인해 μ£Όμ‹œκ² μŠ΅λ‹ˆκΉŒ? (νŽΈμ§‘: 그렇지 μ•Šλ‹€)

9086μ—μ„œ 이 λ¬Έμ œκ°€ μƒκ°λ‚¬μŠ΅λ‹ˆλ‹€. 두 가지 경우:

거리가 μ—†μ§€λ§Œ RVκ°€ μžˆλŠ” 경우

>>> 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κ°€ μžˆμ§€λ§Œ 거리가 μ—†λŠ” 경우 트리거됨).

μ’Œν‘œ λ³€ν™˜μœΌλ‘œ λ„μž…λœ 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λΌλŠ” 것을 μ˜λ―Έν•©λ‹ˆλ‹€. μš”μ²­λœ λ‹¨μœ„λ‘œ 이동 ν•˜λ €κ³  μ‹œλ„ ν•΄μ•Ό ν•˜μ§€λ§Œ μ‹€νŒ¨ν•˜λ”λΌλ„ μƒκ΄€ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

이 νŽ˜μ΄μ§€κ°€ 도움이 λ˜μ—ˆλ‚˜μš”?
0 / 5 - 0 λ“±κΈ‰