Skip to content

Commit

Permalink
typo in applydreambeam
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanLoh committed Feb 1, 2024
1 parent 6a87dcb commit ec21a0c
Show file tree
Hide file tree
Showing 4 changed files with 566 additions and 236 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.6.5"
__version__ = "2.6.6"
__maintainer__ = "Alan Loh"
__email__ = "[email protected]"

Expand Down
18 changes: 9 additions & 9 deletions nenupy/beamlet/sdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@
from astropy.time import Time
import astropy.units as u
import numpy as np
import logging
log = logging.getLogger(__name__)


# ============================================================= #
Expand Down Expand Up @@ -562,7 +564,12 @@ def plot(self, fig=None, ax=None, polarization=None, figname=None, db=True, **kw
print(f"Warning, no '{polarization}' polarization recorded (selec from {self.polar}).")
pol_idx = 0

dynspec = 10*np.log10(self.data[..., pol_idx]).T if db else self.data[..., pol_idx].T
data = self.data[..., pol_idx]
if np.iscomplexobj(data):
log.warning("Complex array found, only the real part is plotted.")
data = data.real

dynspec = 10*np.log10(data).T if db else data.T

# Make sure everything is correctly set up
if 'cmap' not in kwargs.keys():
Expand Down Expand Up @@ -670,10 +677,6 @@ def plot(self, fig=None, ax=None, polarization=None, figname=None, db=True, **kw
ax.set_title(kwargs['title'])

# Set x axis labels
# ax.xaxis.set_minor_locator(mdates.MinuteLocator(byminute=[15, 30, 45]))
# ax.xaxis.set_major_locator(mdates.HourLocator())
# hourFmt = mdates.DateFormatter("%H", usetex=True)
# ax.xaxis.set_major_formatter(hourFmt)
locator = ax.xaxis.set_major_locator(mdates.AutoDateLocator())
ax.xaxis.set_major_formatter(
mdates.ConciseDateFormatter(locator, show_offset=False)
Expand All @@ -682,11 +685,8 @@ def plot(self, fig=None, ax=None, polarization=None, figname=None, db=True, **kw
# Save or show
if not (ax is None):
return

if figname is None:
plt.show()
elif (figname is None) or (figname == ""):
return
plt.show()
else:
fig.savefig(
figname,
Expand Down
Loading

0 comments on commit ec21a0c

Please sign in to comment.