misc
Small miscellaneous helpers used in examples and notebooks.
Full API
Small miscellaneous helpers used in examples and notebooks.
The utilities here are lightweight helpers that operate on the simple file structures used across the dorito examples (for example calslope-like objects) and a couple of geometry helpers used when building model inputs.
truncate_files(files, ngroups)
¤
Truncate the ramp of files to only have ngroups. This is use for saturated or highly nonlinear data where you want to discard the top of the ramp.
This modifies the list of file-like objects in-place by trimming the top
groups from the arrays stored under keys like RAMP / SLOPE and
their covariance counterparts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
files
|
list
|
Sequence of file-like objects where attributes such as |
required |
ngroups
|
int
|
Number of groups to preserve at the start of the ramp. |
required |
Source code in src/dorito/misc.py
17 18 19 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 | |
fwhm_to_sigma(fwhm)
¤
Convert FWHM to sigma for a Gaussian distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fwhm
|
float
|
Full width at half maximum. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Corresponding standard deviation (sigma). |
Source code in src/dorito/misc.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |
calc_parang(file)
¤
Return the parallactic/roll angle extracted from a file header.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file
|
mapping - like
|
File-like object with a |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Numeric parallactic/roll angle. |
Source code in src/dorito/misc.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 | |