def trace(X_ref, Y_ref):
	"""
	Calculates the slope and intercept for the trace, given the position  of the direct image in physical pixels.
	These coefficients are for the WFC3 G141 grism.

	See also: https://ui.adsabs.harvard.edu/abs/2009wfc..rept...18K/abstract
	"""
	BEAMA_i = 41 
	BEAMA_f = 248

	DYDX_0_0 = -3.55018E-01 
	DYDX_0_1 = 3.28722E-05
	DYDX_0_2 = -1.44571E-03

	DYDX_1_0 = 1.42852E-02 
	DYDX_1_1 = -7.20713E-06
	DYDX_1_2 = -2.42542E-06
	DYDX_1_3 = 1.18294E-09
	DYDX_1_4 = 1.19634E-08
	DYDX_1_5 = 6.17274E-10


	DYDX_0 = DYDX_0_0 + DYDX_0_1*X_ref + DYDX_0_2*Y_ref
	DYDX_1 = DYDX_1_0 + DYDX_1_1*X_ref + DYDX_1_2*Y_ref + DYDX_1_3*X_ref**2 + DYDX_1_4*X_ref*Y_ref + DYDX_1_5*Y_ref**2
	
	return [DYDX_0, DYDX_1]