Skip to content
This repository has been archived by the owner on Jun 16, 2018. It is now read-only.

Commit

Permalink
Improvements to syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog committed Aug 5, 2014
1 parent 946dc06 commit 63b50ef
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions wcsaxes/coordinate_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,12 +573,13 @@ def _update_grid_lines(self):

self.grid_lines = []
for iw, w in enumerate(tick_world_coordinates_values):
subset = slice(iw * n_samples, (iw + 1) * n_samples)
if self.coord_index == 0:
xy_world[iw * n_samples:(iw + 1) * n_samples, 0] = np.repeat(w, n_samples)
xy_world[iw * n_samples:(iw + 1) * n_samples, 1] = np.linspace(coord_range[1][0], coord_range[1][1], n_samples)
xy_world[subset, 0] = np.repeat(w, n_samples)
xy_world[subset, 1] = np.linspace(coord_range[1][0], coord_range[1][1], n_samples)
else:
xy_world[iw * n_samples:(iw + 1) * n_samples, 0] = np.linspace(coord_range[0][0], coord_range[0][1], n_samples)
xy_world[iw * n_samples:(iw + 1) * n_samples, 1] = np.repeat(w, n_samples)
xy_world[subset, 0] = np.linspace(coord_range[0][0], coord_range[0][1], n_samples)
xy_world[subset, 1] = np.repeat(w, n_samples)

# We now convert all the world coordinates to pixel coordinates in a
# single go rather than doing this in the gridline to path conversion
Expand All @@ -591,9 +592,8 @@ def _update_grid_lines(self):
xy_world_round = self.transform.transform(pixel)

for iw in range(n_coord):
self.grid_lines.append(self._get_gridline(xy_world[iw * n_samples:(iw + 1) * n_samples],
pixel[iw * n_samples:(iw + 1) * n_samples],
xy_world_round[iw * n_samples:(iw + 1) * n_samples]))
subset = slice(iw * n_samples, (iw + 1) * n_samples)
self.grid_lines.append(self._get_gridline(xy_world[subset], pixel[subset], xy_world_round[subset]))

def _get_gridline(self, xy_world, pixel, xy_world_round):
if self.coord_type == 'scalar':
Expand Down

0 comments on commit 63b50ef

Please sign in to comment.