galpy.orbit.Orbit.from_fit¶
- 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)[source]¶
NAME:
from_fit
PURPOSE:
Initialize an Orbit using a fit to data
INPUT:
init_vxvv - 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 - [:,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= [:,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 to fit the orbit in
Keywords related to the input data:
radec= if True, input vxvv and vxvv are [ra,dec,d,mu_ra, mu_dec,vlos] in [deg,deg,kpc,mas/yr,mas/yr,km/s] (all J2000.0; mu_ra = mu_ra * cos dec); the attributes of the current Orbit are used to convert between these coordinates and Galactocentric coordinates
lb= if True, input vxvv and vxvv are [long,lat,d,mu_ll, mu_bb,vlos] in [deg,deg,kpc,mas/yr,mas/yr,km/s] (mu_ll = mu_ll * cos lat); the attributes of the current Orbit are used to convert between these coordinates and Galactocentric coordinates
customsky= 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
- obs=[X,Y,Z,vx,vy,vz] - (optional) position and velocity of observer
(in kpc and km/s; entries can be Quantity) (default=Object-wide default) Cannot be an Orbit instance with the orbit of the reference point, as w/ the ra etc. functions Y is ignored and always assumed to be zero
lb_to_customsky= 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 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
Keywords related to the orbit integrations:
tintJ= (default: 10) time to integrate orbits for fitting the orbit (can be Quantity)
ntintJ= (default: 1000) number of time-integration points
integrate_method= (default: ‘dopr54_c’) integration method to use
Keywords related to the coordinate transformation:
ro= distance from vantage point to GC (kpc; can be Quantity)
vo= circular velocity at ro (km/s; can be Quantity)
zo= offset toward the NGP of the Sun wrt the plane (kpc; can be Quantity; default = 20.8 pc from Bennett & Bovy 2019)
solarmotion= ‘hogg’ or ‘dehnen’, or ‘schoenrich’, or value in [-U,V,W]; can be Quantity
disp= (False) display the optimizer’s convergence message
OUTPUT:
Orbit instance
HISTORY:
2014-06-17 - Written - Bovy (IAS)
2019-05-22 - Incorporated into new Orbit class as from_fit - Bovy (UofT)