lsst.pipe.tasks g540474b770+e2881a99e2
Loading...
Searching...
No Matches
lsst.pipe.tasks.ssp.photfit Namespace Reference

Functions

 HG_model (phase, params)
 
 HG1G2_model (phase, params)
 
 HG12_model (phase, params)
 
 HG12star_model (phase, params)
 
 chi2 (params, mag, phase, mag_err, model)
 
 fit (mag, phase, sigma, model=HG12_model, params=[0.1])
 
 fitHG12 (mag, magSigma, phaseAngle, tdist, rdist, fixedG12=None, magSigmaFloor=0.0, nSigmaClip=None)
 
 phase_angle_deg (r_obj_sun, r_obs_sun)
 
 hg_V_mag (H, G, r, delta, phase_deg)
 

Variables

 HG12FitResult
 
list A = [3.332, 1.862]
 
list B = [0.631, 1.218]
 
list C = [0.986, 0.238]
 
 alpha_12 = np.deg2rad([7.5, 30.0, 60, 90, 120, 150])
 
list phi_1_sp = [7.5e-1, 3.3486016e-1, 1.3410560e-1, 5.1104756e-2, 2.1465687e-2, 3.6396989e-3]
 
list phi_1_derivs = [-1.9098593, -9.1328612e-2]
 
list phi_2_sp = [9.25e-1, 6.2884169e-1, 3.1755495e-1, 1.2716367e-1, 2.2373903e-2, 1.6505689e-4]
 
list phi_2_derivs = [-5.7295780e-1, -8.6573138e-8]
 
 alpha_3 = np.deg2rad([0.0, 0.3, 1.0, 2.0, 4.0, 8.0, 12.0, 20.0, 30.0])
 
list phi_3_sp
 
list phi_3_derivs = [-1.0630097, 0]
 
 phi_1 = CubicSpline(alpha_12, phi_1_sp, bc_type=((1, phi_1_derivs[0]), (1, phi_1_derivs[1])))
 
 phi_2 = CubicSpline(alpha_12, phi_2_sp, bc_type=((1, phi_2_derivs[0]), (1, phi_2_derivs[1])))
 
 phi_3 = CubicSpline(alpha_3, phi_3_sp, bc_type=((1, phi_3_derivs[0]), (1, phi_3_derivs[1])))
 

Function Documentation

◆ chi2()

lsst.pipe.tasks.ssp.photfit.chi2 ( params,
mag,
phase,
mag_err,
model )

Definition at line 103 of file photfit.py.

◆ fit()

lsst.pipe.tasks.ssp.photfit.fit ( mag,
phase,
sigma,
model = HG12_model,
params = [0.1] )

Definition at line 108 of file photfit.py.

◆ fitHG12()

lsst.pipe.tasks.ssp.photfit.fitHG12 ( mag,
magSigma,
phaseAngle,
tdist,
rdist,
fixedG12 = None,
magSigmaFloor = 0.0,
nSigmaClip = None )
Fit the HG12 phase curve model (Muinonen et al. 2010).

Fits absolute magnitude H (and optionally the slope parameter
G12) to apparent magnitude observations at known phase angles
and distances.

Parameters
----------
mag : array_like
    Apparent magnitudes.
magSigma : array_like
    Magnitude uncertainties (1-sigma).
phaseAngle : array_like
    Phase angles in degrees.
tdist : array_like
    Topocentric (observer-target) distances in AU.
rdist : array_like
    Heliocentric (sun-target) distances in AU.
fixedG12 : float or None, optional
    If set, fix G12 to this value and only fit H.
    If None (default), both H and G12 are fit.
magSigmaFloor : float, optional
    Systematic error floor (mag) added in quadrature to
    ``magSigma`` before fitting. Default is 0.0.
nSigmaClip : float or None, optional
    If set, perform outlier rejection: an initial robust fit
    (soft_l1 loss) followed by sigma clipping at this
    threshold, then a final linear least-squares refit on the
    clipped data. If None (default), no clipping is performed.

Returns
-------
result : `HG12FitResult`
    Named tuple with fields:

    ``H``
        Best-fit absolute magnitude.
    ``G12``
        Best-fit (or fixed) slope parameter.
    ``H_err``
        Uncertainty on H from the covariance matrix.
    ``G12_err``
        Uncertainty on G12 (NaN if ``fixedG12`` is set).
    ``HG_cov``
        H-G12 covariance (NaN if ``fixedG12`` is set).
    ``chi2dof``
        Reduced chi-squared of the fit.
    ``nobs``
        Number of observations used (after clipping).

    On failure, all float fields are NaN and ``nobs`` is 0.

Definition at line 116 of file photfit.py.

◆ HG12_model()

lsst.pipe.tasks.ssp.photfit.HG12_model ( phase,
params )

Definition at line 85 of file photfit.py.

◆ HG12star_model()

lsst.pipe.tasks.ssp.photfit.HG12star_model ( phase,
params )

Definition at line 96 of file photfit.py.

◆ HG1G2_model()

lsst.pipe.tasks.ssp.photfit.HG1G2_model ( phase,
params )

Definition at line 68 of file photfit.py.

◆ HG_model()

lsst.pipe.tasks.ssp.photfit.HG_model ( phase,
params )

Definition at line 50 of file photfit.py.

◆ hg_V_mag()

lsst.pipe.tasks.ssp.photfit.hg_V_mag ( H,
G,
r,
delta,
phase_deg )
Compute apparent V magnitude from the IAU H–G system.

Parameters
----------
H : float or ndarray
    Absolute magnitude (V-band).
G : float or ndarray
    Slope parameter.
r : float or ndarray
    Heliocentric distance in AU.
delta : float or ndarray
    Observer distance (Δ) in AU.
phase_deg : float or ndarray
    Phase angle in degrees.

Definition at line 326 of file photfit.py.

◆ phase_angle_deg()

lsst.pipe.tasks.ssp.photfit.phase_angle_deg ( r_obj_sun,
r_obs_sun )
Compute phase angle (Sun–Object–Observer) in degrees.

Parameters
----------
r_obj_sun : array, shape (3,) or (3, N)
    Object position vector wrt Sun (Sun → object).
r_obs_sun : array, shape (3,) or (3, N)
    Observer position vector wrt Sun (Sun → observer).

Returns
-------
float or ndarray
    Phase angle(s) in degrees, in [0, 180].

Definition at line 292 of file photfit.py.

Variable Documentation

◆ A

list lsst.pipe.tasks.ssp.photfit.A = [3.332, 1.862]

Definition at line 14 of file photfit.py.

◆ alpha_12

lsst.pipe.tasks.ssp.photfit.alpha_12 = np.deg2rad([7.5, 30.0, 60, 90, 120, 150])

Definition at line 20 of file photfit.py.

◆ alpha_3

lsst.pipe.tasks.ssp.photfit.alpha_3 = np.deg2rad([0.0, 0.3, 1.0, 2.0, 4.0, 8.0, 12.0, 20.0, 30.0])

Definition at line 28 of file photfit.py.

◆ B

list lsst.pipe.tasks.ssp.photfit.B = [0.631, 1.218]

Definition at line 15 of file photfit.py.

◆ C

list lsst.pipe.tasks.ssp.photfit.C = [0.986, 0.238]

Definition at line 16 of file photfit.py.

◆ HG12FitResult

lsst.pipe.tasks.ssp.photfit.HG12FitResult
Initial value:
1= namedtuple(
2 "HG12FitResult",
3 ["H", "G12", "H_err", "G12_err", "HG_cov", "chi2dof", "nobs"],
4)

Definition at line 7 of file photfit.py.

◆ phi_1

lsst.pipe.tasks.ssp.photfit.phi_1 = CubicSpline(alpha_12, phi_1_sp, bc_type=((1, phi_1_derivs[0]), (1, phi_1_derivs[1])))

Definition at line 45 of file photfit.py.

◆ phi_1_derivs

list lsst.pipe.tasks.ssp.photfit.phi_1_derivs = [-1.9098593, -9.1328612e-2]

Definition at line 23 of file photfit.py.

◆ phi_1_sp

list lsst.pipe.tasks.ssp.photfit.phi_1_sp = [7.5e-1, 3.3486016e-1, 1.3410560e-1, 5.1104756e-2, 2.1465687e-2, 3.6396989e-3]

Definition at line 22 of file photfit.py.

◆ phi_2

lsst.pipe.tasks.ssp.photfit.phi_2 = CubicSpline(alpha_12, phi_2_sp, bc_type=((1, phi_2_derivs[0]), (1, phi_2_derivs[1])))

Definition at line 46 of file photfit.py.

◆ phi_2_derivs

list lsst.pipe.tasks.ssp.photfit.phi_2_derivs = [-5.7295780e-1, -8.6573138e-8]

Definition at line 26 of file photfit.py.

◆ phi_2_sp

list lsst.pipe.tasks.ssp.photfit.phi_2_sp = [9.25e-1, 6.2884169e-1, 3.1755495e-1, 1.2716367e-1, 2.2373903e-2, 1.6505689e-4]

Definition at line 25 of file photfit.py.

◆ phi_3

lsst.pipe.tasks.ssp.photfit.phi_3 = CubicSpline(alpha_3, phi_3_sp, bc_type=((1, phi_3_derivs[0]), (1, phi_3_derivs[1])))

Definition at line 47 of file photfit.py.

◆ phi_3_derivs

list lsst.pipe.tasks.ssp.photfit.phi_3_derivs = [-1.0630097, 0]

Definition at line 42 of file photfit.py.

◆ phi_3_sp

list lsst.pipe.tasks.ssp.photfit.phi_3_sp
Initial value:
1= [
2 1.0,
3 8.3381185e-1,
4 5.7735424e-1,
5 4.2144772e-1,
6 2.3174230e-1,
7 1.0348178e-1,
8 6.1733473e-2,
9 1.6107006e-2,
10 0.0,
11]

Definition at line 30 of file photfit.py.