Skip to content

Commit

Permalink
Merge e3fe96b into 18dca95
Browse files Browse the repository at this point in the history
  • Loading branch information
keflavich committed Jan 7, 2015
2 parents 18dca95 + e3fe96b commit bcb5ac7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ install:
- source activate test

# CORE DEPENDENCIES
- if [[ $SETUP_CMD != egg_info ]]; then $CONDA_INSTALL numpy=$NUMPY_VERSION pytest pip Cython; fi
- if [[ $SETUP_CMD != egg_info ]]; then $CONDA_INSTALL numpy=$NUMPY_VERSION pytest pip Cython jinja2; fi
- if [[ $SETUP_CMD != egg_info ]]; then $PIP_INSTALL pytest-xdist; fi

# ASTROPY
Expand Down
7 changes: 5 additions & 2 deletions pvextractor/geometry/poly_slices.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ def extract_poly_slice(cube, polygons):
polygon.x, polygon.y)

if area > 0:
total_slice[:, i] += cube[:, ymin, xmin] * area
total_area[:, i] += area
dataslice = cube[:, ymin, xmin]
good_values = np.isfinite(dataslice)
if np.any(good_values):
total_slice[good_values, i] += dataslice[good_values] * area
total_area[good_values, i] += area

total_slice[total_area == 0.] = np.nan
total_slice[total_area > 0.] /= total_area[total_area > 0.]
Expand Down
1 change: 0 additions & 1 deletion pvextractor/tests/test_slicer.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
LONPOLE = 180.0 / [deg] Native longitude of celestial pole
LATPOLE = 30.5765277962 / [deg] Native latitude of celestial pole
RESTFRQ = 1420405718.41 / [Hz] Line rest frequency
EQUINOX = 2000.0 / [yr] Equinox of equatorial coordinates
SPECSYS = 'BARYCENT' / Reference frame of spectral coordinates
MJD-OBS = 50982.687794 / [d] MJD of observation matching DATE-OBS
DATE-OBS= '1998-06-18T16:30:25.4' / ISO-8601 observation date matching MJD-OBS
Expand Down

0 comments on commit bcb5ac7

Please sign in to comment.