Skip to content

Commit

Permalink
Merge b5a541f into 51cd6b9
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverba137 committed Jan 8, 2020
2 parents 51cd6b9 + b5a541f commit 39e5945
Show file tree
Hide file tree
Showing 36 changed files with 1,860 additions and 1,634 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -43,6 +43,7 @@ docs/docs
dist
build
eggs
.eggs
parts
bin
var
Expand Down
66 changes: 39 additions & 27 deletions .travis.yml
Expand Up @@ -6,9 +6,6 @@ language: c
os:
- linux

# Setting sudo to false opts in to Travis-CI container-based builds.
sudo: false

# The apt packages below are needed for sphinx builds. A full list of packages
# that can be included can be found here:
#
Expand All @@ -18,12 +15,22 @@ addons:
apt:
packages:
- graphviz
# - texlive-latex-extra
# - dvipng


stage: Comprehensive tests

stages:
# Do the style check and a single test job, don't proceed if it fails
- name: Initial tests
# Test docs, astropy dev, and without optional dependencies
- name: Comprehensive tests
# These will only run when cron is opted in
- name: Cron tests
if: type = cron


env:
global:

# The following versions are the 'default' for tests, unless
# overridden underneath. They are defined here in order to save having
# to repeat them for all configurations.
Expand All @@ -38,7 +45,7 @@ env:
# For this package-template, we include examples of Cython modules,
# so Cython is required for testing. If your package does not include
# Cython code, you can set CONDA_DEPENDENCIES=''
- CONDA_DEPENDENCIES='scipy matplotlib'
- CONDA_DEPENDENCIES='scipy matplotlib pytest-mock'
- CONDA_DEPENDENCIES_DOC='scipy matplotlib sphinx-astropy'

# List other runtime dependencies for the package that are available as
Expand All @@ -50,7 +57,7 @@ env:
# are in astropy-ci-extras. If your package uses either of these,
# add the channels to CONDA_CHANNELS along with any other channels
# you want to use.
- CONDA_CHANNELS='astropy-ci-extras astropy'
- CONDA_CHANNELS='astropy'

# If there are matplotlib or other GUI tests, uncomment the following
# line to use the X virtual framebuffer.
Expand All @@ -61,23 +68,25 @@ env:
# - FLAKE8_OPT='--ignore=E501'
- FLAKE8_OPT=''

matrix:
# Make sure that egg_info works without dependencies
- PYTHON_VERSION=3.7 SETUP_CMD='egg_info'


matrix:

# Don't wait for allowed failures
fast_finish: true

include:
# Try MacOS X
# Make sure that egg_info works without dependencies
- stage: Initial tests
env: PYTHON_VERSION=3.7 SETUP_CMD='egg_info'

# Try MacOS X, usually enough only to run from cron as hardly there are
# issues that are not picked up by a linux worker
- os: osx
env: SETUP_CMD='test'
stage: Cron tests
env: SETUP_CMD='test' EVENT_TYPE='cron'

# Do a coverage test.
- os: linux
stage: Initial tests
env: SETUP_CMD='test --coverage'

# Check for sphinx doc build warnings - we do this first because it
Expand All @@ -86,38 +95,41 @@ matrix:
env: SETUP_CMD='build_docs -w'
CONDA_DEPENDENCIES=$CONDA_DEPENDENCIES_DOC

# Now try Astropy dev with the latest Python and LTS with Python 2.7 and 3.x.
# Now try Astropy dev with the latest Python and LTS with and 3.x.
- os: linux
env: ASTROPY_VERSION=development
EVENT_TYPE='pull_request push cron'
- os: linux
env: ASTROPY_VERSION=lts
env: PYTHON_VERSION=3.6 ASTROPY_VERSION=lts NUMPY_VERSION=1.14 PYTEST_VERSION='<3.7'

# Add a job that runs from cron only and tests against astropy dev and
# numpy dev to give a change for early discovery of issues and feedback
# for both developer teams.
- os: linux
stage: Cron tests
env: ASTROPY_VERSION=development NUMPY_VERSION=development
EVENT_TYPE='cron'

# Try all python versions and Numpy versions. Since we can assume that
# the Numpy developers have taken care of testing Numpy with different
# versions of Python, we can vary Python and Numpy versions at the same
# time.

- os: linux
env: PYTHON_VERSION=3.5 NUMPY_VERSION=1.12 ASTROPY_VERSION=lts
env: PYTHON_VERSION=3.6 NUMPY_VERSION=1.16
- os: linux
env: PYTHON_VERSION=3.6 NUMPY_VERSION=1.13
- os: linux
env: NUMPY_VERSION=1.14

# Try numpy pre-release
- os: linux
env: NUMPY_VERSION=prerelease
EVENT_TYPE='pull_request push cron'
env: NUMPY_VERSION=1.16

# Do a PEP8 test with flake8
- os: linux
stage: Initial tests
env: MAIN_CMD='flake8 pydl --count --show-source --statistics $FLAKE8_OPT' SETUP_CMD=''

allow_failures:
# Do a PEP8 test with flake8
# (allow to fail unless your code completely compliant)
# (do allow to fail unless your code completely compliant)
- os: linux
stage: Initial tests
env: MAIN_CMD='flake8 pydl --count --show-source --statistics $FLAKE8_OPT' SETUP_CMD=''

install:
Expand Down
32 changes: 16 additions & 16 deletions ah_bootstrap.py
Expand Up @@ -48,10 +48,7 @@
from distutils import log
from distutils.debug import DEBUG

try:
from ConfigParser import ConfigParser, RawConfigParser
except ImportError:
from configparser import ConfigParser, RawConfigParser
from configparser import ConfigParser, RawConfigParser

import pkg_resources

Expand Down Expand Up @@ -119,24 +116,27 @@

# We want the Python version as a string, which we can get from the platform module
import platform
python_version = platform.python_version()

if not req.specifier.contains(python_version):
# strip off trailing '+' incase this is a dev install of python
python_version = platform.python_version().strip('+')
# allow pre-releases to count as 'new enough'
if not req.specifier.contains(python_version, True):
if parent_package is None:
print("ERROR: Python {} is required by this package".format(req.specifier))
message = "ERROR: Python {} is required by this package\n".format(req.specifier)
else:
print("ERROR: Python {} is required by {}".format(req.specifier, parent_package))
message = "ERROR: Python {} is required by {}\n".format(req.specifier, parent_package)
sys.stderr.write(message)
sys.exit(1)

if sys.version_info < __minimum_python_version__:

if parent_package is None:
print("ERROR: Python {} or later is required by astropy-helpers".format(
__minimum_python_version__))
message = "ERROR: Python {} or later is required by astropy-helpers\n".format(
__minimum_python_version__)
else:
print("ERROR: Python {} or later is required by astropy-helpers for {}".format(
__minimum_python_version__, parent_package))
message = "ERROR: Python {} or later is required by astropy-helpers for {}\n".format(
__minimum_python_version__, parent_package)

sys.stderr.write(message)
sys.exit(1)

_str_types = (str, bytes)
Expand All @@ -146,14 +146,14 @@
# issues with either missing or misbehaving pacakges (including making sure
# setuptools itself is installed):

# Check that setuptools 1.0 or later is present
# Check that setuptools 30.3 or later is present
from distutils.version import LooseVersion

try:
import setuptools
assert LooseVersion(setuptools.__version__) >= LooseVersion('1.0')
assert LooseVersion(setuptools.__version__) >= LooseVersion('30.3')
except (ImportError, AssertionError):
print("ERROR: setuptools 1.0 or later is required by astropy-helpers")
sys.stderr.write("ERROR: setuptools 30.3 or later is required by astropy-helpers\n")
sys.exit(1)

# typing as a dependency for 1.6.1+ Sphinx causes issues when imported after
Expand Down
8 changes: 0 additions & 8 deletions cextern/README.rst

This file was deleted.

14 changes: 6 additions & 8 deletions docs/conf.py
Expand Up @@ -25,9 +25,10 @@
# Thus, any C-extensions that are needed to build the documentation will *not*
# be accessible, and the documentation will not build correctly.

import datetime
import os
import sys
import datetime
from importlib import import_module

try:
from sphinx_astropy.conf.v1 import * # noqa
Expand All @@ -36,10 +37,7 @@
sys.exit(1)

# Get configuration information from setup.cfg
try:
from ConfigParser import ConfigParser
except ImportError:
from configparser import ConfigParser
from configparser import ConfigParser
conf = ConfigParser()

conf.read([os.path.join(os.path.dirname(__file__), '..', 'setup.cfg')])
Expand Down Expand Up @@ -69,7 +67,7 @@
# -- Project information ------------------------------------------------------

# This does not *have* to match the package name, but typically does
project = setup_cfg['package_name']
project = setup_cfg['name']
author = setup_cfg['author']
copyright = '{0}, {1}'.format(
datetime.datetime.now().year, setup_cfg['author'])
Expand All @@ -78,8 +76,8 @@
# |version| and |release|, also used in various other places throughout the
# built documents.

__import__(setup_cfg['package_name'])
package = sys.modules[setup_cfg['package_name']]
import_module(setup_cfg['name'])
package = sys.modules[setup_cfg['name']]

# The short X.Y version.
version = package.__version__.split('-', 1)[0]
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Expand Up @@ -42,6 +42,7 @@ Other Notes
:maxdepth: 1

templates.rst
window.rst
changes.rst
todo.rst
credits.rst
Expand Down
6 changes: 4 additions & 2 deletions docs/photoop.rst
Expand Up @@ -56,7 +56,7 @@ compare Obsolete Compare the same images in two different data reduct
database Obsolete Experimental database loading code.
flats None Analysis of flat-field files.
hoggpipe Obsolete Another version of "Apache Wheel" processing code.
image None Tools for creating "`corrected frame`_" images. These are flux-calibrated and sky-subtracted images with physical flux units.
image Rudimentary Tools for creating "`corrected frame`_" images. These are flux-calibrated and sky-subtracted images with physical flux units.
ircam Obsolete Tools for processing all-sky "cloud camera" images, used to establish photometricity.
match None Tools for matching SDSS spectra to corresponding photometric objects.
misc None Code with no obvious home in any other category.
Expand Down Expand Up @@ -84,9 +84,11 @@ API

.. automodapi:: pydl.photoop

.. automodapi:: pydl.photoop.image

.. automodapi:: pydl.photoop.photoobj

.. automodapi:: pydl.photoop.sdssio

.. automodapi:: pydl.photoop.window
:skip: warn, sdss_name, sdss_calib, sdss_flagval, set_use_caps
:skip: warn, sdss_name, sdss_calib, sdss_flagval, FITS_polygon
22 changes: 22 additions & 0 deletions docs/window.rst
@@ -0,0 +1,22 @@
====================================
The SDSS Photometric Window Function
====================================

The "window" function is the function that answers the question,
"Is this point (RA, Dec) in an SDSS imaging survey image?" In practice,
it's easiest to think of the window function as a big look-up table.
The determination of the window function is intrinsically intwined with
the "resolve" algorithm, which determines the highest quality ("primary")
SDSS image that covers a region of the sky. For further low-level details,
see the `SDSS documentation`_ of the resolve algorithm.

.. _`SDSS documentation`: https://www.sdss.org/dr14/algorithms/resolve/

In the PyDL package, the :mod:`~pydl.photoop.window` and :mod:`~pydl.pydlutils.mangle`
modules are used to access the window function. In this document we will
concentrate on these questions:

* Is a given point or set of points in the SDSS imaging region?
* If a point *is* in the SDSS imaging, which specific image contains it?

.. All you really need to do is read window_unified.fits with read_fits_polygons.

0 comments on commit 39e5945

Please sign in to comment.