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

Fixed a couple of int/float bugs in internal modules/scripts. #69

Merged
merged 3 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.2.dev0
3.0.2
2 changes: 1 addition & 1 deletion aipy/healpix.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
self.set_data(data)
def lm_indices(self):
"""Return the L and M indices of the coefficients contained in Alm, in the order that they are returned by get_data()."""
return np.array([self._alm.getlm(self._lmax, i) for i in range(self.size)])
return np.array([self._alm.getlm(self._lmax, i) for i in range(self.size())])

Check warning on line 178 in aipy/healpix.py

View check run for this annotation

Codecov / codecov/patch

aipy/healpix.py#L178

Added line #L178 was not covered by tests
def get_data(self):
"""Return all of the coefficients contained in Alm, in the order indexed by lm_indices()."""
return self.data
Expand Down
6 changes: 3 additions & 3 deletions scripts/plot_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ def imshow(self, *args, **kwargs):
if opts.osys == 'eq': opts.cen = 180
else: opts.cen = 0
map = Basemap(projection=opts.projection,lat_0=0,lon_0=opts.cen, rsphere=1.)
lons,lats,x,y = map.makegrid(360/opts.res,180/opts.res, returnxy=True)
lons,lats,x,y = map.makegrid(int(360/opts.res),int(180/opts.res), returnxy=True)
# Mask off parts of the image to be plotted that are outside of the map
lt = lats[:,0]
ln1 = np.ones_like(lt) * (lons[lons.shape[0]/2,0])
ln2 = np.ones_like(lt) * (lons[lons.shape[0]/2,-1])
ln1 = np.ones_like(lt) * (lons[lons.shape[0]//2,0])
ln2 = np.ones_like(lt) * (lons[lons.shape[0]//2,-1])
x1,y1 = map(ln1,lt); x2,y2 = map(ln2,lt)
x = np.ma.array(x)
for c,(i,j) in enumerate(zip(x1,x2)): x[c] = np.ma.masked_outside(x[c], i, j)
Expand Down
Loading