Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc minor fixes #617

Merged
merged 4 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 37 additions & 20 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.mathjax",
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
"sphinx.ext.inheritance_diagram",
"sphinx.ext.viewcode",
"sphinx.ext.autosummary",
"sphinx.ext.mathjax",
"sphinx_automodapi.automodapi",
"sphinx_issues",
"nbsphinx",
Expand All @@ -76,10 +76,7 @@
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
# The suffix of source filenames.
source_suffix = ".rst"

# The master toctree document.
Expand All @@ -90,7 +87,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = 'en'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand All @@ -104,20 +101,47 @@
]

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "sphinx"
pygments_style = "default"


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = "stsci_rtd_theme"
html_theme_path = [stsci_rtd_theme.get_html_theme_path()]
html_theme = "sphinx_rtd_theme"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
# html_theme_options = {}
html_theme_options = {
"collapse_navigation": True,
"sticky_navigation": False,
# "nosidebar": "false",
# "sidebarbgcolor": "#4db8ff",
# "sidebartextcolor": "black",
# "sidebarlinkcolor": "black",
# "headbgcolor": "white",
}

html_logo = '_static/stsci_pri_combo_mark_white.png'

# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []

# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
# html_title = None

# A shorter title for the navigation bar. Default is the same as html_title.
# html_short_title = None

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.

# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
# html_favicon = None

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand Down Expand Up @@ -164,24 +188,17 @@
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
(
master_doc,
"poppy.tex",
"poppy Documentation",
"Space Telescope Science Institute",
"manual",
),
("index", project + ".tex", project + " Documentation", author, "manual")
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [(master_doc, "poppy", "poppy Documentation", [author], 1)]
man_pages = [("index", project.lower(), project + " Documentation", [author], 1)]


# -- Options for Texinfo output ----------------------------------------------
Expand Down
3 changes: 3 additions & 0 deletions poppy/instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,9 @@ def calc_datacube(self, wavelengths, *args, **kwargs):
else:
raise ValueError("Maximum number of wavelengths exceeded. "
"Cannot be more than 10,000.")
# Handle astropy Quantities, if needed
if isinstance(wavelengths, units.Quantity):
wavelengths = wavelengths.to_value(units.meter)

# Set up cube and initialize structure based on PSF at first wavelength
poppy_core._log.info("Starting multiwavelength data cube calculation.")
Expand Down
20 changes: 10 additions & 10 deletions poppy/poppy_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def as_fits(self, what='intensity', includepadding=False, **kwargs):
""" Return a wavefront as a pyFITS HDUList object

Parameters
-----------
----------
what : string
what kind of data to write. Must be one of 'all', 'parts', 'intensity',
'phase' or 'complex'. The default is to write intensity.
Expand Down Expand Up @@ -310,7 +310,7 @@ def writeto(self, filename, overwrite=True, **kwargs):
"""Write a wavefront to a FITS file.

Parameters
-----------
----------
filename : string
filename to use
what : string
Expand Down Expand Up @@ -927,7 +927,7 @@ def invert(self, axis='both'):
passes through a focus.

Parameters
------------
----------
axis : string
either 'both', 'x', or 'y', for which axes to invert

Expand Down Expand Up @@ -1020,7 +1020,7 @@ def propagate_to(self, optic):
wavefront accordingly.

Parameters
-----------
----------
optic : OpticalElement
The optic to propagate to. Used for determining the appropriate optical plane.
"""
Expand Down Expand Up @@ -1066,7 +1066,7 @@ def _propagate_fft(self, optic):
""" Propagate from pupil to image or vice versa using a padded FFT

Parameters
-----------
----------
optic : OpticalElement
The optic to propagate to. Used for determining the appropriate optical plane.

Expand Down Expand Up @@ -1132,7 +1132,7 @@ def _propagate_mft(self, det):
""" Compute from pupil to an image using the Soummer et al. 2007 MFT algorithm

Parameters
-----------
----------
det : OpticalElement, must be of type DETECTOR
The target optical plane to propagate to."""

Expand Down Expand Up @@ -1184,7 +1184,7 @@ def _propagate_mft(self, det):

if not np.isscalar(self.pixelscale.value):
# check for rectangular arrays
if self.pixelscale[0] == self.pixelscale[1]:
if np.isclose(self.pixelscale[0], self.pixelscale[1]):
self.pixelscale = self.pixelscale[0]
# we're in a rectangular array with same scale in both directions, so treat pixelscale as a scalar
else:
Expand Down Expand Up @@ -1484,7 +1484,7 @@ def add_rotation(self, angle=0.0, index=None, *args, **kwargs):
Add a clockwise or counterclockwise rotation around the optical axis

Parameters
-----------
----------
angle : float
Rotation angle, counterclockwise. By default in degrees.
index : int
Expand All @@ -1505,7 +1505,7 @@ def add_inversion(self, index=None, *args, **kwargs):
a flip in the sign of the X and Y axes due to passage through a focus.

Parameters
-----------
----------
index : int
Index into the optical system's planes for where to add the new optic. Defaults to
appending the optic to the end of the plane list.
Expand Down Expand Up @@ -3317,7 +3317,7 @@ class CoordinateInversion(CoordinateTransform):
The actual inversion happens in Wavefront.propagate_to

Parameters
------------
----------
axes : string
either 'both', 'x', or 'y', for which axes to invert
hide : bool
Expand Down
12 changes: 6 additions & 6 deletions poppy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ def radial_profile(hdulist_or_filename=None, ext=0, ee=False, center=None, stdde
the minimum in each radial bin.

Returns
--------
-------
results : tuple
Tuple containing (radius, profile) or (radius, profile, EE) depending on what is requested.
The radius gives the center radius of each bin, while the EE is given inside the whole bin
Expand Down Expand Up @@ -754,7 +754,7 @@ def measure_ee(hdulist_or_filename=None, ext=0, center=None, binsize=None, norma
Default is no normalization (i.e. retain whatever normalization was used in computing the PSF itself)

Returns
--------
-------
encircled_energy: function
A function which will return the encircled energy interpolated to any desired radius.

Expand Down Expand Up @@ -800,7 +800,7 @@ def measure_radius_at_ee(hdulist_or_filename=None, ext=0, center=None, binsize=N
Default is no normalization (i.e. retain whatever normalization was used in computing the PSF itself)

Returns
--------
-------
radius: function
A function which will return the radius of a desired encircled energy.

Expand Down Expand Up @@ -841,7 +841,7 @@ def measure_radial(hdulist_or_filename=None, ext=0, center=None, binsize=None):
size of step for profile. Default is pixel size.

Returns
--------
-------
radial_profile: function
A function which will return the mean PSF value at any desired radius.

Expand Down Expand Up @@ -1175,7 +1175,7 @@ def pad_to_size(array, padded_shape):


See Also
---------
--------
pad_to_oversample, pad_or_crop_to_shape
"""
if len(padded_shape) < 2:
Expand Down Expand Up @@ -1496,7 +1496,7 @@ def spectrum_from_spectral_type(sptype, return_list=False, catalog=None):
convenient access function.

Parameters
-----------
----------
sptype : str
Spectral type, like "G0V"
catalog : str
Expand Down
8 changes: 0 additions & 8 deletions scripts/README.rst

This file was deleted.

Loading