diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 00000000..4d59d989 --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,34 @@ +# .readthedocs.yml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Build documentation in the docs/ directory with Sphinx +sphinx: + builder: html + configuration: docs/conf.py + fail_on_warning: true + +# Optionally build your docs in additional formats such as PDF and ePub +formats: all + +build: + image: latest + +# Optionally set the version of Python and requirements required to build your docs +python: + version: 3.7 + install: + - requirements: docs/rtd-pip-requirements + - method: pip + path: . + extra_requirements: + - docs + - method: setuptools + path: . + system_packages: false + +submodules: + include: all \ No newline at end of file diff --git a/CHANGES.rst b/CHANGES.rst index e99b759d..1dae3948 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,7 @@ version 0.8.2a (unreleased) - add check for ds9 in alias as well as well as path - python2->3 class and printing updates - removed dependence on astropy_helpers +- added autoscale option to the ds9 load_fits that will zoom-to-fit and zscale by default version 0.8.1 (2018-12-14) -------------------------- diff --git a/docs/conf.py b/docs/conf.py index e0ffbb22..03f84417 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -97,6 +97,10 @@ def _warn_node(self, msg, node, **kwargs): os.path.abspath(os.path.join(os.path.dirname(__file__), 'local/python2_local_links.inv'))) + +# suppress epub errors for static file formats (.ico) on rtd +suppress_warnings = ['epub.unknown_project_files'] + # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. diff --git a/imexam/ds9_viewer.py b/imexam/ds9_viewer.py index dd153f59..d10af1a8 100644 --- a/imexam/ds9_viewer.py +++ b/imexam/ds9_viewer.py @@ -1118,7 +1118,7 @@ def embed(self): """Embed the viewer in a notebook.""" print("Not Implemented for DS9") - def load_fits(self, fname, extver=None, mecube=False): + def load_fits(self, fname, extver=None, mecube=False, autoscale=True): """convenience function to load fits image to current frame. Parameters @@ -1135,6 +1135,10 @@ def load_fits(self, fname, extver=None, mecube=False): mecube: bool, optional If mecube is True, load the fits file as a cube into ds9 + autoscale: bool + If true, the image will be autoscaled to zoom-to-fit as well + as flux autoscaled upon load + Notes ----- To tell ds9 to open a file whose name or path includes spaces, @@ -1192,6 +1196,9 @@ def load_fits(self, fname, extver=None, mecube=False): self._viewer[frame]['user_array'] = None else: self.view(fname[extver].data) + if autoscale: + self.zoom() + self.scale() def load_region(self, filename): """Load regions from a file which uses ds9 standard formatting.