Skip to content

Commit

Permalink
Small typos
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanLoh committed Dec 1, 2023
1 parent b3ce572 commit e1b6bf5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
2 changes: 1 addition & 1 deletion nenupy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
__copyright__ = "Copyright 2023, nenupy"
__credits__ = ["Alan Loh"]
__license__ = "MIT"
__version__ = "2.5.4"
__version__ = "2.5.5"
__maintainer__ = "Alan Loh"
__email__ = "alan.loh@obspm.fr"

Expand Down
30 changes: 17 additions & 13 deletions nenupy/astro/sky.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
from matplotlib import patheffects
from matplotlib.colorbar import ColorbarBase
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
import warnings
from matplotlib.cm import get_cmap
from matplotlib.ticker import LinearLocator
from matplotlib.colors import Normalize
Expand Down Expand Up @@ -340,19 +341,22 @@ def plot(self, **kwargs):
bbox_transform=ax.transAxes,
borderpad=0,
)
cb = ColorbarBase(
cax,
cmap=get_cmap(name=cmap),
orientation='vertical',
norm=Normalize(
vmin=vmin,
vmax=vmax
),
ticks=LinearLocator()
)
cb.solids.set_edgecolor("face")
cb.set_label(colorbar_label)
cb.formatter.set_powerlimits((0, 0))
with warnings.catch_warnings():
# Catche Deprecation warning of get_map (ginore because we are mpl<3.7)
warnings.simplefilter("ignore")
cb = ColorbarBase(
cax,
cmap=get_cmap(name=cmap),
orientation='vertical',
norm=Normalize(
vmin=vmin,
vmax=vmax
),
ticks=LinearLocator()
)
cb.solids.set_edgecolor("face")
cb.set_label(colorbar_label)
cb.formatter.set_powerlimits((0, 0))

# Overplot
# if kwargs.get("circle", None) is not None:
Expand Down
8 changes: 4 additions & 4 deletions nenupy/schedule/contamination.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def compute_weight_moc(self, sources: List[str], thresholds: np.ndarray = np.log
for f_idx in range(self.frequency.size):
for t_idx in range(self.time.size):
source_in_grating_lobes[f_idx, t_idx] = np.any(
moc[f_idx, t_idx].contains(
moc[f_idx, t_idx].contains_lonlat(
sky_positions[:, t_idx].ra,
sky_positions[:, t_idx].dec
)
Expand Down Expand Up @@ -432,7 +432,7 @@ def sources_in_lobes(self, sources: List[str]) -> SourceInLobes:
for f_idx in range(self.frequency.size):
for t_idx in range(self.time.size):
source_in_grating_lobes[f_idx, t_idx] = np.sum(
self.moc[f_idx, t_idx].contains( # contains_lonlat
self.moc[f_idx, t_idx].contains_lonlat( # contains_lonlat
sky_positions[:, t_idx].ra,
sky_positions[:, t_idx].dec
)
Expand Down Expand Up @@ -466,13 +466,13 @@ def plot(self,

if "moc" in self._src_display:
# Plot the array factor moc and the GSM moc
self.sky[t_idx, f_idx, 0].plot(
return self.sky[t_idx, f_idx, 0].plot(
moc=[self.moc[f_idx, t_idx], self._src_display["moc"][f_idx]],
**kwargs
)
else:
# Plot the array factor MOC and highlight the source positions
self.sky[t_idx, f_idx, 0].plot(
return self.sky[t_idx, f_idx, 0].plot(
moc=self.moc[f_idx, t_idx],
text=self._src_display["names"][t_idx],
scatter=self._src_display["positions"][t_idx],
Expand Down

0 comments on commit e1b6bf5

Please sign in to comment.