base
Interfaces and helpers for fitting beam models to maps.
Beam-fitting functions follow the fit_{MODEL}_map naming convention and
the FitMap interface defined below. See individual fitting functions
for details of each beam model.
FitMap
Bases: Protocol
Source code in lat_beams/fitting/map/base.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |
__call__(imap, ivar, posmap, guess, map_units='pW', **kwargs)
Fit a beam model to a map.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
imap
|
Float[ndmap, 'ny nx']
|
Input beam map. |
required |
ivar
|
Float[ndmap, 'ny nx']
|
Inverse-variance map for |
required |
posmap
|
Float[ndmap, '2 ny nx']
|
Position map in radians. The first component is |
required |
guess
|
AxisManager
|
Initial parameter values useful for starting the fit. See
:func: |
required |
map_units
|
str
|
Units of the input map. |
"pW"
|
**kwargs
|
object
|
Additional arguments for the specific fitting function. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
fit_params |
Optional[AxisManager]
|
Fitted model parameters. Returns |
model |
Optional[Float[ndmap, 'ny nx']]
|
Model evaluated with the fitted parameters. Returns |
Source code in lat_beams/fitting/map/base.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |
make_guess(amp=1, fwhm_xi=2 / 60, fwhm_eta=2 / 60, xi0=0, eta0=0, phi=0, off=0)
Make an initial beam-fitting parameter guess.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
amp
|
float
|
Initial beam amplitude. |
1
|
fwhm_xi
|
float
|
Initial FWHM in |
2 / 60
|
fwhm_eta
|
float
|
Initial FWHM in |
2 / 60
|
xi0
|
float
|
Initial beam center in |
0
|
eta0
|
float
|
Initial beam center in |
0
|
phi
|
float
|
Initial beam rotation angle. |
0
|
off
|
float
|
Initial DC offset. |
0
|
Returns:
| Name | Type | Description |
|---|---|---|
guess |
AxisManager
|
|
Source code in lat_beams/fitting/map/base.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | |