Skip to content

Commit

Permalink
Merge pull request #37 from healpy/hd17
Browse files Browse the repository at this point in the history
Implementation of HD2017 dust model
  • Loading branch information
zonca committed Apr 4, 2020
2 parents 79399ad + 74a62fe commit 3babad9
Show file tree
Hide file tree
Showing 6 changed files with 499 additions and 38 deletions.
68 changes: 35 additions & 33 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,31 +33,34 @@
try:
from sphinx_astropy.conf.v1 import * # noqa
except ImportError:
print('ERROR: the documentation requires the sphinx-astropy package to be installed')
print(
"ERROR: the documentation requires the sphinx-astropy package to be installed"
)
sys.exit(1)

# Get configuration information from setup.cfg
from configparser import ConfigParser

conf = ConfigParser()

conf.read([os.path.join(os.path.dirname(__file__), '..', 'setup.cfg')])
setup_cfg = dict(conf.items('metadata'))
conf.read([os.path.join(os.path.dirname(__file__), "..", "setup.cfg")])
setup_cfg = dict(conf.items("metadata"))

# -- General configuration ----------------------------------------------------

# By default, highlight as Python 3.
highlight_language = 'python3'
highlight_language = "python3"

# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.2'
# needs_sphinx = '1.2'

# To perform a Sphinx version check that needs to be more specific than
# major.minor, call `check_sphinx_version("x.y.z")` here.
# check_sphinx_version("1.2.1")

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns.append('_templates')
exclude_patterns.append("_templates")

# This is added to the end of RST files - a good place to put substitutions to
# be used globally.
Expand All @@ -67,20 +70,19 @@
# -- Project information ------------------------------------------------------

# This does not *have* to match the package name, but typically does
project = setup_cfg['name']
author = setup_cfg['author']
copyright = '{0}, {1}'.format(
datetime.datetime.now().year, setup_cfg['author'])
project = setup_cfg["name"]
author = setup_cfg["author"]
copyright = "{0}, {1}".format(datetime.datetime.now().year, setup_cfg["author"])

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.

import_module(setup_cfg['name'])
package = sys.modules[setup_cfg['name']]
import_module("pysm")
package = sys.modules["pysm"]

# The short X.Y version.
version = package.__version__.split('-', 1)[0]
version = package.__version__.split("-", 1)[0]
# The full version, including alpha/beta/rc tags.
release = package.__version__

Expand All @@ -97,75 +99,75 @@

# Add any paths that contain custom themes here, relative to this directory.
# To use a different custom theme, add the directory containing the theme.
#html_theme_path = []
# html_theme_path = []

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes. To override the custom theme, set this to the
# name of a builtin theme or the name of a custom theme in html_theme_path.
#html_theme = None
# html_theme = None


html_theme_options = {
'logotext1': 'pysm', # white, semi-bold
'logotext2': '', # orange, light
'logotext3': ':docs' # white, light
}
"logotext1": "pysm", # white, semi-bold
"logotext2": "", # orange, light
"logotext3": ":docs", # white, light
}


# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# html_sidebars = {}

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

# 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 = ''
# html_favicon = ''

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = ''
# html_last_updated_fmt = ''

# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
html_title = '{0} v{1}'.format(project, release)
html_title = "{0} v{1}".format(project, release)

# Output file base name for HTML help builder.
htmlhelp_basename = project + 'doc'
htmlhelp_basename = project + "doc"


# -- Options for LaTeX output -------------------------------------------------

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [('index', project + '.tex', project + u' Documentation',
author, 'manual')]
latex_documents = [
("index", project + ".tex", project + u" 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 = [('index', project.lower(), project + u' Documentation',
[author], 1)]
man_pages = [("index", project.lower(), project + u" Documentation", [author], 1)]


# -- Options for the edit_on_github extension ---------------------------------

if setup_cfg.get('edit_on_github').lower() == 'true':
if setup_cfg.get("edit_on_github").lower() == "true":

extensions += ['sphinx_astropy.ext.edit_on_github']
extensions += ["sphinx_astropy.ext.edit_on_github"]

edit_on_github_project = setup_cfg['github_project']
edit_on_github_project = setup_cfg["github_project"]
edit_on_github_branch = "master"

edit_on_github_source_root = ""
edit_on_github_doc_root = "docs"

# -- Resolving issue number to links in changelog -----------------------------
github_issues_url = 'https://github.com/{0}/issues/'.format(setup_cfg['github_project'])
github_issues_url = "https://github.com/{0}/issues/".format(setup_cfg["github_project"])

# -- Turn on nitpicky mode for sphinx (to warn about references not found) ----
#
Expand Down
15 changes: 15 additions & 0 deletions pysm/data/presets.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,21 @@ map_mbb_temperature = "pysm_2/dust_temp.fits"
unit_mbb_temperature = "K"
freq_ref_I = "545 GHz"
freq_ref_P = "353 GHz"
[d7]
class = "HensleyDraine2017"
map_I = "pysm_2/dust_t_new.fits"
map_Q = "pysm_2/dust_q_new.fits"
map_U = "pysm_2/dust_u_new.fits"
unit_I = "uK_RJ"
unit_Q = "uK_RJ"
unit_U = "uK_RJ"
freq_ref_I = "545 GHz"
freq_ref_P = "353 GHz"
rnd_uval = true
nside_uval = 256
seed = 4632
f_car = 1.0
f_fe = 0.44
[s0]
class = "PowerLaw"
map_I = "pysm_2/synch_t_new.fits"
Expand Down
2 changes: 1 addition & 1 deletion pysm/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# flake8: noqa

from .dust import ModifiedBlackBody, DecorrelatedModifiedBlackBody
from .dust import ModifiedBlackBody, DecorrelatedModifiedBlackBody, HensleyDraine2017
from .power_law import PowerLaw, CurvedPowerLaw
from .template import Model, read_map, apply_smoothing_and_coord_transform
from .spdust import SpDust, SpDustPol
Expand Down
Loading

0 comments on commit 3babad9

Please sign in to comment.