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

Example Change, Travis Change, Doc Change #2338

Merged
merged 15 commits into from
Nov 9, 2017
33 changes: 32 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
language: python

os:
- linux

stage: Initial tests

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

Expand All @@ -25,6 +30,7 @@ python:
- 3.6

# Configure the build environment. Global varibles are defined for all configurations.

env:
global:
- COLUMNS=240
Expand All @@ -35,46 +41,71 @@ env:
- SETUP_CMD='test'
- CONDA_CHANNELS='astropy astropy-ci-extras'
- CONDA_DEPENDENCIES='openjpeg Cython jinja2 scipy matplotlib mock requests beautifulsoup4 sqlalchemy scikit-image pytest-mock pyyaml pandas nomkl'
- PIP_DEPENDENCIES='hypothesis suds-jurko sphinx-gallery pytest-sugar pytest-rerunfailures sunpy-sphinx-theme glymur'
- PIP_DEPENDENCIES='hypothesis suds-jurko sphinx-gallery pytest-sugar pytest-rerunfailures sunpy-sphinx-theme glymur pytest-astropy'
- EVENT_TYPE='pull_request push'


matrix:
- SETUP_CMD='egg_info'

stages:
# Do the install jobs, don't proceed if it fails
- name: Initial tests
# Do the rest of the tests
- name: Comprehensive tests
- name: Cron tests
if: type = cron

matrix:

# Don't wait for allowed failures
fast_finish: true

include:
# We order the jobs, so the longest running tests are in the top
# four positions of the matrix
- os: osx
stage: Cron tests
language: generic
env: PYTHON_VERSION=3.6

- python: 3.6
stage: Comprehensive tests
env: SETUP_CMD='test --online --coverage -V'
EVENT_TYPE='push pull_request cron'

- python: 3.6
stage: Cron tests
env: NUMPY_VERSION='dev' ASTROPY_VERSION='dev'
EVENT_TYPE='push pull_request cron'

- python: 3.6
stage: Initial tests
env: SETUP_CMD='test'

- python: 2.7
stage: Comprehensive tests
env: SETUP_CMD='test'

# Previous numpy is tested on an older python version
- python: 3.5
stage: Cron tests
env: NUMPY_VERSION=$PREVIOUS_NUMPY

- python: 3.6
stage: Comprehensive tests
env: SETUP_CMD='build_docs -w'
EVENT_TYPE='push pull_request cron'
SPHINX_VERSION='<1.6'

# Figure test runs use an env stored in the repo so don't have conda
# requirements
- python: 2.7
stage: Comprehensive tests
env: SETUP_CMD='test --figure' CONDA_DEPENDENCIES=''

- python: 3.5
stage: Comprehensive tests
env: SETUP_CMD='test --figure' CONDA_DEPENDENCIES=''

install:
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ Bug Fixes
- Fix docstring formatting for net.vso.attrs [#2309]]
- Fix coloring of ticks under matplotlib 2.0 default style [#2320]
- Always index arrays with tuples in `ImageAnimator` [#2320]
- Misc Doc fixes [#2317] [#2289]
- Misc Readme Changes [#2281] [#2283]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a useful changelog entry!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

YES THEY ARE

- Fix matplotlib / pandas 0.21 bug in examples [#2336]
- Fixes the off limb enhancement example [#2329]
- Changes to masking hot pixels and picking bright pixels [#2325] [#2319]
- Merged masking and finding brightest pixel examples [#2338]
- Changed TRAVIS cronjobs [#2338]

0.8.2
=====
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/acquiring_data/fido.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Searching for Data Using Fido
-----------------------------

To search for data with Fido, you need to specify attributes to search against.
The full list of allowed attributes can be found in the
`vso.attrs <sunpy.net.vso.attrs>` module.
The (partial) range of allowed attributes are found in the `vso.attrs <sunpy.net.vso.attrs>`
and `jsoc.attrs <sunpy.net.jsoc.attrs>`.
Examples of these attributes are `a.Time <sunpy.net.vso.attrs.Time>`,
`a.Instrument <sunpy.net.vso.attrs.Instrument>`,
`a.Wavelength <sunpy.net.vso.attrs.Wavelength>`, some of these attributes are
Expand Down
32 changes: 0 additions & 32 deletions examples/brightness_pixel_location.py

This file was deleted.

61 changes: 61 additions & 0 deletions examples/finding_masking_bright_pixels.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
"""
=================================
Finding and masking bright pixels
=================================

How to find and overplot the location of the brightest
pixel and then mask any pixels out the area around this region.
"""
from __future__ import print_function, division

import numpy as np
import numpy.ma as ma
import matplotlib.pyplot as plt

import astropy.units as u

import sunpy.map
from sunpy.data.sample import AIA_171_IMAGE

###############################################################################
# We first create the Map using the sample data and import the coordinate
# functionality.
aia = sunpy.map.Map(AIA_171_IMAGE)

###############################################################################
# Now to find the single brightest pixel, we will maximium of the AIA image.
# Note that we transform from pixel space to the world corodiate system.
pixel_pos = np.argwhere(aia.data == aia.data.max())*u.pixel
hpc_max = aia.pixel_to_world(pixel_pos[:, 1], pixel_pos[:, 0])

###############################################################################
# Let's now plot the results. We will overlay the SunPy lon/lat grid.
fig = plt.figure()
ax = plt.subplot(projection=aia)
aia.plot()
ax.plot_coord(hpc_max, 'bx', color='white', marker='x', markersize=15)
plt.show()

###############################################################################
# Now we create a new custom AIAMap with a mask around the brightest pixel.
# We have to build two arrays which include all of the x and y pixel indices.
# These indices are for the entire image.
# We must not forget to add the correct units because we will next pass
# into a SunPy function which all require them.
x, y = np.meshgrid(*[np.arange(v.value) for v in aia.dimensions]) * u.pixel

###############################################################################
# Now we can convert this to helioprojective coordinates and create a new
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this text now seems out of sync with the rest of the example.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought i changed that. Seems not!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well thats still correct to what i do in the code no?

# array which contains the normalized radial position for each pixel adjusted
# for the position of the brightest pixel (using `hpc_max`).
hpc_mask = aia.pixel_to_world(x, y)
r_mask = np.sqrt((hpc_mask.Tx-hpc_max.Tx) ** 2 + (hpc_mask.Ty-hpc_max.Ty) ** 2) / aia.rsun_obs
mask = ma.masked_less_equal(r_mask, 0.1)
scaled_map = sunpy.map.Map(aia.data, aia.meta, mask=mask.mask)

###############################################################################
# Let's now plot the new Map!
fig = plt.figure()
ax = plt.subplot(projection=scaled_map)
scaled_map.plot()
plt.show()
45 changes: 0 additions & 45 deletions examples/masking_hot_pixels.py

This file was deleted.

17 changes: 12 additions & 5 deletions sunpy/timeseries/tests/test_timeseries_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,15 @@
# ==============================================================================

filepath = sunpy.data.test.rootdir

eve_filepath = os.path.join(filepath, 'EVE_L0CS_DIODES_1m_truncated.txt')
fermi_gbm_filepath = os.path.join(filepath, 'gbm.fits')
norh_filepath = os.path.join(filepath, 'tca110810_truncated')
goes_filepath = os.path.join(filepath, 'goes.fits')
lyra_filepath = os.path.join(filepath, 'lyra_20150101-000000_lev3_std_truncated.fits.gz')
rhessi_filepath = os.path.join(filepath, 'hsi_obssumm_20120601_018_truncated.fits.gz')
noaa_ind_filepath = os.path.join(filepath, 'RecentIndices_truncated.txt')
noaa_pre_filepath = os.path.join(filepath, 'predicted-sunspot-radio-flux_truncated.txt')

goes_filepath = os.path.join(filepath, 'go1520120601.fits.gz')

goes_filepath_com = os.path.join(filepath, 'go1520120601.fits.gz')
goes_filepath = os.path.join(filepath, 'go1520110607.fits')
a_list_of_many = glob.glob(os.path.join(filepath, "eve", "*"))

# ==============================================================================
Expand Down Expand Up @@ -102,6 +99,11 @@ def test_implicit_goes(self):
ts_goes = sunpy.timeseries.TimeSeries(goes_filepath)
assert isinstance(ts_goes, sunpy.timeseries.sources.goes.XRSTimeSeries)

def test_implicit_goes_com(self):
# Test a GOES TimeSeries
ts_goes = sunpy.timeseries.TimeSeries(goes_filepath_com)
assert isinstance(ts_goes, sunpy.timeseries.sources.goes.XRSTimeSeries)

def test_implicit_lyra(self):
# Test a LYRA TimeSeries
ts_lyra = sunpy.timeseries.TimeSeries(lyra_filepath)
Expand Down Expand Up @@ -136,6 +138,11 @@ def test_goes(self):
ts_goes = sunpy.timeseries.TimeSeries(goes_filepath, source='XRS')
assert isinstance(ts_goes, sunpy.timeseries.sources.goes.XRSTimeSeries)

def test_goes_com(self):
#Test a GOES TimeSeries
ts_goes = sunpy.timeseries.TimeSeries(goes_filepath_com, source='XRS')
assert isinstance(ts_goes, sunpy.timeseries.sources.goes.XRSTimeSeries)

def test_lyra(self):
#Test a LYRA TimeSeries
ts_lyra = sunpy.timeseries.TimeSeries(lyra_filepath, source='LYRA')
Expand Down