Skip to content

Commit

Permalink
Update pipeline.py
Browse files Browse the repository at this point in the history
Reviewed docstrings
  • Loading branch information
gbrammer authored May 3, 2024
1 parent b585c0e commit f0463f2
Showing 1 changed file with 12 additions and 23 deletions.
35 changes: 12 additions & 23 deletions msaexp/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ def download_msa_meta_files(files=None, do_download=True):
msa : list
List of MSA files downloaded from MAST.
Note: This documentation is mainly AI-generated and will be reviewed.
"""
import mastquery.utils

Expand Down Expand Up @@ -638,7 +637,6 @@ def slit_index(self, key):
The index of ``key`` in ``self.slitlets`` if it exists,
otherwise None.
Note: This documentation is mainly AI-generated and will be reviewed.
"""
if key not in self.slitlets:
return None
Expand All @@ -662,7 +660,6 @@ def initialize_from_cals(self, key="phot", verbose=True):
-------
None
Note: This documentation is mainly AI-generated and will be reviewed.
"""
import jwst.datamodels

Expand Down Expand Up @@ -977,7 +974,7 @@ def save_slit_data(self, step="phot", verbose=True):
Parameters
----------
step : str
The step of the pipeline at which the slit data is saved.
The step of the pipeline from which the slit data is saved.
verbose : bool, optional
If True, print verbose output. Default is True.
Expand All @@ -987,7 +984,6 @@ def save_slit_data(self, step="phot", verbose=True):
bool
True if the slit data is saved successfully.
Note: This documentation is mainly AI-generated and will be reviewed
"""
from jwst.datamodels import SlitModel

Expand Down Expand Up @@ -1194,7 +1190,6 @@ def set_background_slits(self, find_by_id=False):
bool
True if the initialization is successful.
Note: This documentation is mainly AI-generated and will be reviewed
"""
# Get from slitlet_ids
# indices = [self.slitlets[k]['slitlet_id'] for k in self.slitlets]
Expand Down Expand Up @@ -1276,7 +1271,6 @@ def fit_profile(
tuple
A tuple containing the fitted profile width and offset.
Note: This documentation is mainly AI-generated and will be reviewed.
"""
from photutils.psf import IntegratedGaussianPRF
from scipy.optimize import minimize
Expand Down Expand Up @@ -1314,7 +1308,6 @@ def fit_profile(
ytr = slitlet["ytrace"] * 2 - yd

def _objfun_fit_profile(params, data, ret):
# TODO: should the values for "data" be explained in detail? (K.V.)
"""
Loss function for fitting profile parameters.
Expand All @@ -1326,21 +1319,25 @@ def _objfun_fit_profile(params, data, ret):
data : tuple
A tuple containing the data needed for the fitting.
- xx0 : unused
- yp : y pixel
- ytr : trace
- sh : shape
_clean : cleaned array
_ivar : inverse variance weight
bad : mask
ret : int
The return value (see 'Returns').
Returns
-------
array-like or float
The desired output based on the value of `ret`:
- 0: return the chi values
- 0: return the full chi array
- 1: return the chi squared value
- 2: return the loss value
- other: return the fitted profile
Note: This documentation is mainly AI-generated
and will be reviewed.
"""
from scipy.special import huber

Expand Down Expand Up @@ -1427,7 +1424,7 @@ def get_background_slits(
Parameters
----------
key : str
The key of the slitlet
The key identifier of the slitlet
step : str, optional
The step in the pipeline to get the slitlets from. Default is "bkg"
Expand All @@ -1441,7 +1438,6 @@ def get_background_slits(
slits : list
List of `jwst.datamodels.slit.SlitModel` objects
Note: This documentation is mainly AI-generated and will be reviewed.
"""
if step not in self.pipe:
return None
Expand Down Expand Up @@ -1483,7 +1479,6 @@ def drizzle_2d(self, key, drizzle_params={}, **kwargs):
`jwst.datamodels.ModelContainer`
The drizzled 2D spectra.
Note: This documentation is mainly AI-generated and will be reviewed.
"""
from jwst.datamodels import ModelContainer
from jwst.resample.resample_spec import ResampleSpecData
Expand Down Expand Up @@ -1514,7 +1509,6 @@ def get_slit_traces(self, verbose=True):
-------
None
Note: This documentation is mainly AI-generated and will be reviewed.
"""

msg = "msaexp.get_slit_traces: Run"
Expand Down Expand Up @@ -1660,9 +1654,8 @@ def extract_spectrum(
The combined table of all extracted spectra.
fig: object
The matplotlib figure object.
The `matplotlib` figure object.
Note: This documentation is mainly AI-generated and will be reviewed.
"""
from photutils.psf import IntegratedGaussianPRF
import eazy.utils
Expand Down Expand Up @@ -2166,7 +2159,6 @@ def extract_all_slits(self, keys=None, verbose=True, close=True, **kwargs):
-------
None
Note: This documentation is mainly AI-generated and will be reviewed.
"""
slitlets = self.slitlets

Expand Down Expand Up @@ -2343,7 +2335,6 @@ def parse_slit_info(self, write=True):
info : dict
A dictionary containing the parsed information from the YAML file.
Note: This documentation is mainly AI-generated and will be reviewed.
"""
import yaml

Expand Down Expand Up @@ -2442,7 +2433,6 @@ def full_pipeline(
-------
None
Note: This documentation is mainly AI-generated and will be reviewed.
"""

if load_saved is not None:
Expand Down Expand Up @@ -2506,7 +2496,7 @@ def make_summary_tables(root="msaexp", zout=None):
The root directory where the data is stored. Default is "msaexp".
zout : astropy.table.Table
Optional table containing redshift information. Default is None.
Optional table containing photometric redshift information. Default is None.
Returns:
--------
Expand All @@ -2517,7 +2507,6 @@ def make_summary_tables(root="msaexp", zout=None):
Combined astropy table containing all the extracted source information.
Note: This documentation is mainly AI-generated and will be reviewed.
"""
import yaml
import astropy.table
Expand Down

0 comments on commit f0463f2

Please sign in to comment.