Skip to content

Commit

Permalink
fix typos for docs
Browse files Browse the repository at this point in the history
  • Loading branch information
gbrammer committed May 10, 2024
1 parent 2d4eb17 commit a8c879d
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 58 deletions.
4 changes: 2 additions & 2 deletions msaexp/resample_numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ def pixel_integrated_gaussian_numba(x, mu, sigma, dx=None, normalization=1.0):
def compute_igm(z, wobs, scale_tau=1.0):
"""
Calculate
[Inoue+ (2014)](https://ui.adsabs.harvard.edu/abs/2014MNRAS.442.1805I) IGM
transmission, reworked from `~eazy.igm.Inoue14`
`Inoue+ (2014) <(https://ui.adsabs.harvard.edu/abs/2014MNRAS.442.1805I)`_
IGM transmission, reworked from `~eazy.igm.Inoue14`
Parameters
----------
Expand Down
78 changes: 30 additions & 48 deletions msaexp/slit_combine.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def objfun_prof_trace(
ineg : array-like
Array of exposure indices corresponding to the negative
"B" component of the difference
sh : tuple
Shape of the data.
Expand Down Expand Up @@ -532,6 +532,10 @@ def __init__(
position_key : str
Column in the ``info`` table to define the nod positions
- "y_index" = Rounded y offset
- "position_number" = dither number
- "shutter_state" = Shutter state from MPT. Usually robust, but can
get confused when multiple catalog sources fall within the slitlets
diffs : bool
Compute nod differences
Expand Down Expand Up @@ -565,7 +569,8 @@ def __init__(
estimate sky directly from the slit data
undo_pathloss : bool
Remove the pathloss correction if the extensions found in the slit
Undo pipeline pathloss correction (should usually be the
PATHLOSS_UNIFORM correction) if the extensions are found in the slit
model files
trace_with_xpos : bool
Expand All @@ -592,8 +597,7 @@ def __init__(
weight_type : str
Weighting scheme for 2D resampling
- ``ivm`` : Use weights from ``var_rnoise``, like
[jwst.resample](https://github.com/spacetelescope/jwst/blob/4342988027ee0811b57d3641bda4c8486d7da1f5/jwst/resample/resample_utils.py#L168)
- ``ivm`` : Use weights from ``var_rnoise``, like `jwst.resample <(https://github.com/spacetelescope/jwst/blob/4342988027ee0811b57d3641bda4c8486d7da1f5/jwst/resample/resample_utils.py#L168>`_
- ``ivm_bar`` : Use a modified weight
``VAR_RNOISE / BARSHADOW**2``
- ``poisson`` : Weight with ``var_poisson``, msaexp extractions v1 and v2
Expand Down Expand Up @@ -1827,7 +1831,7 @@ def apply_spline_bar_correction(self, verbose=True):
Own bar shadow correction for PRISM derived from empty background shutters
and implemented as a flexible bspline
See `msaexp.utils.get_prism_bar_correction`.
See `~msaexp.utils.get_prism_bar_correction`.
Parameters
----------
Expand Down Expand Up @@ -2418,7 +2422,7 @@ def fit_single_trace(
Initial profile sigma to use (pixels*10)
exp : int
Exposure index (see ``unp``)
Exposure index (see ``self.unp``)
force_positive : bool
Don't consider the negative subtracted parts of the difference
Expand Down Expand Up @@ -2689,7 +2693,7 @@ def plot_profile(self, exp=1, ax=None, fit_result=None, ymax=0.2):
Parameters
----------
exp : int
Exposure index (see ``unp``)
Exposure index (see ``self.unp``)
ax : matplotlib.axes.Axes, optional
Axes object to plot on.
Expand Down Expand Up @@ -2789,12 +2793,12 @@ def pseudo_drizzle(
vnum : array-like
Weighted variance numerator
den : array-like
Weighted denominator
ntot : array-like
Number of exposures that contribute to
Number of exposures that contribute to
the output pixels
"""
Expand Down Expand Up @@ -3525,21 +3529,11 @@ def extract_spectra(
split_uncover : bool
Split sub-pixel dithers from UNCOVER (GO-2561) when defining exposure groups
stuck_threshold, pad_border, position_key, pad_border:
See `msaexp.slit_combine.SlitGroup`
sort_by_sn : bool
Try to process groups in order of decreasing S/N, i.e., to derive the
trace offsets in the prism where it will be best defined and propagate
to other groups with the gratings
position_key : str, optional
Keyword to define the separate nod positions, e.g.,
- "y_index" : Rounded y offset
- "position_number" : dither number
- "shutter_state" : Shutter state from MPT. Usually robust, but can
get confused when multiple catalog sources fall within the slitlets
mask_cross_dispersion : None or [int, int]
Optional cross-dispersion masking, e.g., for stuck-closed shutters or
multiple sources within a slitlet. The specified values are integer
Expand All @@ -3561,8 +3555,17 @@ def extract_spectra(
stuck-closed shutters, though the how effective it is is still under
investigation.
trace_from_yoffset, reference_exposure :
See `msaexp.slit_combine.SlitGroup`
stuck_threshold, pad_border :
See `~msaexp.slit_combine.SlitGroup`
trace_from_yoffset, trace_with_xpos, trace_with_ypos :
See `~msaexp.slit_combine.SlitGroup`
position_key, reference_exposure, nod_offset, diffs :
See `~msaexp.slit_combine.SlitGroup`
undo_pathloss, undo_barshadow :
See `~msaexp.slit_combine.SlitGroup`
trace_niter : int, optional
Number of iterations for the trace fit
Expand All @@ -3578,10 +3581,6 @@ def extract_spectra(
use the center from the first (usually highest S/N prism)
trace.
nod_offset : None, optional
Nod offset value. If not specified, will be calculated
internally.
initial_sigma : float, optional
Initial sigma value. This is 10 times the Gaussian sigma
width, in pixels.
Expand All @@ -3601,30 +3600,13 @@ def extract_spectra(
fit_params_kwargs : None, optional
Fit parameters keyword arguments
diffs : bool, optional
Do nod differences
undo_pathloss : bool, optional
Undo pipeline pathloss correction (should usually be the
PATHLOSS_UNIFORM correction)
undo_barshadow : bool, 2, optional
- ``True`` : undo the pipeline BarShadow correction
- ``2`` : Replace with the internal BarShadow correction
drizzle_kws : dict, optional
Drizzle keyword arguments
get_xobj : bool, optional
Return `msaexp.slit_combine.SlitGroup` objects along with the
HDU product
trace_with_xpos : bool, optional
Trace with xpos value
trace_with_ypos : str, optional
Trace with ypos value
get_background : bool, optional
Get background value
Expand All @@ -3633,12 +3615,12 @@ def extract_spectra(
Returns
-------
- None
If no valid spectra are found
- hdu : dict
Dict of `astropy.io.fits.HDUList` objects for the separate gratings
- xobj : dict
Dictionary of `SlitGroup` objects
None : null
If no valid spectra are found
hdu : dict
Dict of `astropy.io.fits.HDUList` objects for the separate gratings
xobj : dict
Dictionary of `SlitGroup` objects if ``get_xobj``
"""

global CENTER_WIDTH, CENTER_PRIOR, SIGMA_PRIOR, MSA_NOD_ARCSEC
Expand Down
7 changes: 4 additions & 3 deletions msaexp/spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def float_representer(dumper, value):

try:
from .resample_numba import compute_igm

igm_func = compute_igm

except ImportError:
Expand Down Expand Up @@ -1691,7 +1692,7 @@ def fit_redshift_grid(
zgrid : array
Redshifts to fit
others : see `msaexp.spectrum.fit_redshift`
others : see `~msaexp.spectrum.fit_redshift`
Returns
-------
Expand Down Expand Up @@ -2275,14 +2276,14 @@ def plot_spectrum(
``templates, coeffs, flam, eflam, _model, mask, full_chi2``
use_aper_columns : bool, optional
Whether to use aperture columns in the spectrum table.
Whether to use aperture columns in the spectrum table.
Default is False.
label : None or str, optional
Label to add. Default is None.
**kwargs : dict, optional
Additional keyword arguments.
Additional keyword arguments.
Used in 'SpectrumSampler' & 'make_templates'
Returns
Expand Down
6 changes: 1 addition & 5 deletions msaexp/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1333,7 +1333,7 @@ def build_slit_centered_wcs(
Returns
-------
_data : tuple
See `msaexp.utils.build_regular_wavelength_wcs`
See `~msaexp.utils.build_regular_wavelength_wcs`
"""
from gwcs import wcstools
Expand Down Expand Up @@ -1397,8 +1397,6 @@ def build_slit_centered_wcs(
xc = (np.arange(len(prof)) * prof).sum() / prof.sum()
yoff = xc - (force_nypix - 1) / 2 + phase

# print('yoffset: ', yoff, xc)

slit.drizzle_slit_offset = yoff

_xdata = build_regular_wavelength_wcs(
Expand Down Expand Up @@ -1887,8 +1885,6 @@ def combine_2d_with_rejection(
ok &= prof1d > 0

xpix = np.arange(sh[0])
# ytrace = np.nanmedian(ytr)
# print('xxx', ytrace, sh[0]/2)
ytrace = sh[0] / 2.0
x0 = np.arange(sh[0]) - ytrace
y0 = yp - ytrace
Expand Down

0 comments on commit a8c879d

Please sign in to comment.