Skip to content

Commit

Permalink
general improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbhughes committed Aug 2, 2024
1 parent d809388 commit b6b7892
Show file tree
Hide file tree
Showing 18 changed files with 1,193 additions and 1,106 deletions.
26 changes: 13 additions & 13 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
# -- Project information -----------------------------------------------------
from solpolpy import __version__

project = 'solpolpy'
copyright = '2023, PUNCH Science Operations Center'
author = 'PUNCH Science Operations Center'
project = "solpolpy"
copyright = "2023, PUNCH Science Operations Center"
author = "PUNCH Science Operations Center"

# The full version, including alpha/beta/rc tags
release = __version__
Expand All @@ -32,14 +32,14 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.

extensions = ['autoapi.extension',
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'nbsphinx',
'IPython.sphinxext.ipython_console_highlighting']
extensions = ["autoapi.extension",
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"nbsphinx",
"IPython.sphinxext.ipython_console_highlighting"]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand All @@ -54,7 +54,7 @@
#
html_theme = "pydata_sphinx_theme"
html_show_sourcelink = False
html_static_path = ['_static']
html_static_path = ["_static"]
html_theme_options = {
"use_edit_page_button": True,
"icon_links": [
Expand All @@ -63,10 +63,10 @@
"url": "https://github.com/punch-mission/solpolpy",
"icon": "fa-brands fa-github",
"type": "fontawesome",
}
},
],
"show_nav_level": 1,
"show_toc_level": 3
"show_toc_level": 3,
}
html_context = {
# "github_url": "https://github.com", # or your GitHub Enterprise site
Expand All @@ -77,4 +77,4 @@
}


autoapi_dirs = ['../../solpolpy']
autoapi_dirs = ["../../solpolpy"]
12 changes: 10 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "solpolpy"
version = "0.2.0"
version = "0.3.0"
authors = [
{ name="J. Marcus Hughes", email="mhughes@boulder.swri.edu"},
{ name="Matthew J. West", email="mwest@boulder.swri.edu"},
Expand All @@ -11,7 +11,7 @@ authors = [
description = "Solar polarization resolver for any instrument"
readme = "README.md"
license = { file="LICENSE" }
requires-python = ">=3.10"
requires-python = ">=3.11"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
Expand All @@ -34,6 +34,8 @@ test = [
'ruff'
]

dev = ["solpolpy[test]", "pre-commit"]

[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
Expand All @@ -44,6 +46,12 @@ packages = ['solpolpy']
[tool.ruff]
line-length = 120
ignore-init-module-imports = true
#lint.select = ["ALL"]
lint.ignore = ["F403"]

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["E402"]
"tests/*.py" = ['S101']

[tool.isort]
balanced_wrapping = true
Expand Down
11 changes: 6 additions & 5 deletions solpolpy/alpha.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
""" Functions related to constructing an alpha array for transformation"""
"""Functions related to constructing an alpha array for transformation."""

import astropy.units as u
import numpy as np


def radial_north(shape):
"""An alpha array oriented west
"""An alpha array oriented west.
Parameters
----------
Expand All @@ -18,11 +18,12 @@ def radial_north(shape):
alpha array used in calculations
Notes
------
-----
- assumes solar north is up
- assumes polarizer 0 is along solar north axis
- creates radial polarization map
- angles increase in counterclockwise direction
"""
x_size, y_size = shape
x = np.arange(-x_size // 2, x_size // 2)
Expand All @@ -31,5 +32,5 @@ def radial_north(shape):
return np.rot90(np.fliplr(np.arctan2(yy, xx)+np.pi), k=1)*u.radian


ALPHA_FUNCTIONS = {'radial_north': radial_north,
'zeros': np.zeros}
ALPHA_FUNCTIONS = {"radial_north": radial_north,
"zeros": np.zeros}
12 changes: 1 addition & 11 deletions solpolpy/constants.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
"""Constants used in code"""
"""Constants used in code."""
import astropy.units as u

VALID_KINDS = {"mzp": [["Bm", "Bz", "Bp", "alpha"], ["Bm", "Bz", "Bp"]],
"bpb": [["B", "pB", "alpha"], ["B", "pB"]],
"btbr": [["Bt", "Br", "alpha"], ["Bt", "Br"]],
"stokes": [["Bi", "Bq", "Bu"], ["Bi", "Bq", "Bu", "alpha"]],
"bp3": [["B", "pB", "pBp", "alpha"], ["B", "pB", "pBp"]],
"bthp": [["B", "theta", "p"]],
"fourpol": [["B0", "B90", "B45", "B135"]], # fourpol comes before npol to force it instead of npol
"npol": [["B*"]], # star indicates angle in degrees, as many as desired are supported
}

# offset angles come from https://www.sciencedirect.com/science/article/pii/S0019103515003620?via%3Dihub
STEREOA_OFFSET_ANGLE = 45.8 * u.degree
STEREOB_OFFSET_ANGLE = -18 * u.degree
Loading

0 comments on commit b6b7892

Please sign in to comment.