- classmethod Orbit.from_fit(init_vxvv, vxvv, vxvv_err=None, pot=None, radec=False, lb=False, customsky=False, lb_to_customsky=None, pmllpmbb_to_customsky=None, tintJ=10, ntintJ=1000, integrate_method='dopr54_c', ro=None, vo=None, zo=None, solarmotion=None, disp=False)¶
Initialize an Orbit using a fit to data.
init_vxvv (numpy.ndarray) – Initial guess for the fit (same representation [e.g.,radec=True] as vxvv data, except when customsky, then init_vxvv is assumed to be ra,dec).
vxvv (numpy.ndarray) – [:,6] array of positions and velocities along the orbit (if not lb=True or radec=True, these need to be in natural units [/ro,/vo], cannot be Quantities).
vxvv_err (numpy.ndarray, optional) – [:,6] array of errors on positions and velocities along the orbit (if None, these are set to 0.01) (if not lb=True or radec=True, these need to be in natural units [/ro,/vo], cannot be Quantities).
pot (Potential, DissipativeForce, or list of such instances, optional) – Gravitational field to integrate orbits in.
radec (bool, optional) – If set, treat input as being in ICRS coordinates [ra,dec,d,mu_ra, mu_dec,vlos] in [deg,deg,kpc,mas/yr,mas/yr,km/s] (mu_ra = mu_ra * cos dec).
lb (bool, optional) – If set, treat input as being in Galactic coordinates (l,b,d,mu_l, mu_b, vlos) in [deg,deg,kpc,mas/yr,mas/yr,km/s) (mu_l = mu_l * cos b).
customsky (bool, optional) – If True, input vxvv and vxvv_err are [custom long,custom lat,d,mu_customll, mu_custombb,vlos] in [deg,deg,kpc,mas/yr,mas/yr,km/s] (mu_ll = mu_ll * cos lat) where custom longitude and custom latitude are a custom set of sky coordinates (e.g., ecliptic) and the proper motions are also expressed in these coordinates; you need to provide the functions lb_to_customsky and pmllpmbb_to_customsky to convert to the custom sky coordinates (these should have the same inputs and outputs as lb_to_radec and pmllpmbb_to_pmrapmdec); the attributes of the current Orbit are used to convert between these coordinates and Galactocentric coordinates.
lb_to_customsky (function, optional) – Function that converts l,b,degree=False to the custom sky coordinates (like lb_to_radec); needs to be given when customsky=True.
pmllpmbb_to_customsky (function, optional) – Function that converts pmll,pmbb,l,b,degree=False to proper motions in the custom sky coordinates (like pmllpmbb_to_pmrapmdec); needs to be given when customsky=True.
tintJ (float, optional) – Time to integrate orbits for fitting the orbit (can be Quantity).
ntintJ (int, optional) – Number of time-integration points.
integrate_method (str, optional) – Integration method to use (default: ‘dopr54_c’; see galpy.orbit.Orbit.integrate).
ro (float or Quantity, optional) – Distance from vantage point to Galactic center (kpc).
vo (float or Quantity, optional) – Circular velocity at ro (km/s; can be Quantity).
zo (float or Quantity, optional) – Offset toward the NGP of the Sun wrt the plane in pc; default = 20.8 pc from Bennett & Bovy 2019).
solarmotion (str, numpy.ndarray or Quantity, optional) – ‘hogg’ or ‘dehnen’, or ‘schoenrich’, or value in [-U,V,W] in km/s.
disp (bool, optional) – Display the optimizer’s convergence message.
An orbit that is the best fit to the given data.
- Return type:
2014-06-17 - Written - Bovy (IAS)
2019-05-22 - Incorporated into new Orbit class as from_fit - Bovy (UofT)