@@ -145,13 +145,31 @@ class Nonlinearity(object):
145145 If True, query CRDS and load per-pixel polynomial coefficients from the
146146 ``inverselinearity`` reference and a gain map from the ``gain`` reference.
147147 If False, use the module defaults.
148+ reftype : str, optional
149+ CRDS reference type to use for the polynomial coefficients. Typical
150+ values include ``"inverselinearity"`` when applying nonlinearity and
151+ ``"linearity"`` when removing it.
148152 getdq : bool, optional
149153 If True and ``usecrds=True``, also read the DQ array from the CRDS
150154 inverselinearity file and store it as ``self.dq`` (cropped by ``nborder``).
155+ integralnonlinearity : object or None, optional
156+ Optional integral nonlinearity reference model. If provided, the class
157+ constructs channel-based lookup corrections that are added after the
158+ polynomial correction.
151159 metadata : dict or None, optional
152160 Metadata overrides to apply before CRDS lookup. If provided, values
153161 are merged into the model metadata tree.
154-
162+ saturation : float or None, optional
163+ Optional upper clipping threshold applied before evaluating the
164+ nonlinearity correction.
165+ coeffs : numpy.ndarray or None, optional
166+ Explicit polynomial coefficients to use instead of loading them from
167+ CRDS or using module defaults. Coefficients should be ordered from
168+ lowest to highest polynomial degree.
169+ gain : float or numpy.ndarray or None, optional
170+ Explicit gain value or gain map to use when ``electrons=True`` in
171+ :meth:`apply`.
172+
155173 Attributes
156174 ----------
157175 coeffs : numpy.ndarray
@@ -225,6 +243,34 @@ def __init__(
225243 )
226244
227245 def _get_crds_model (self , getdq = False , metadata = None , image_mod = None , reffiles = None ):
246+ """Load nonlinearity and gain reference data from CRDS.
247+ This method resolves the required reference files, loads the gain map
248+ and nonlinearity coefficients, crops them by ``nborder``, and repairs
249+ invalid coefficient values when needed. If integral nonlinearity is
250+ enabled, the corresponding reference file is also resolved.
251+
252+ Parameters
253+ ----------
254+ getdq : bool, optional
255+ If True, also read the DQ array from the nonlinearity reference
256+ file and propagate repair flags.
257+ metadata : dict or None, optional
258+ Metadata overrides used when selecting CRDS reference files.
259+ image_mod : roman_datamodels.datamodels.ImageModel or None, optional
260+ Existing image model whose metadata may be used to determine the
261+ appropriate reference files. If provided, these values are used
262+ preferentially when available.
263+ reffiles : dict or None, optional
264+ Optional mapping of reference file types to file paths. If
265+ provided, these values are used preferentially (with lower
266+ priority than image_mod) when available.
267+
268+ Returns
269+ -------
270+ None
271+ This method updates object attributes in place.
272+ """
273+
228274 # Inverse linearity reference files are used to apply the
229275 # effect of classical non-linearity when constructing
230276 # L1 files, and linearity reference files are used to
0 commit comments