Skip to content

Commit

Permalink
Typo bis in TF stokes selection
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanLoh committed Feb 1, 2024
1 parent ec21a0c commit fcd3ac6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 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.6"
__version__ = "2.6.7"
__maintainer__ = "Alan Loh"
__email__ = "[email protected]"

Expand Down
2 changes: 1 addition & 1 deletion nenupy/beamlet/sdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ def plot(self, fig=None, ax=None, polarization=None, figname=None, db=True, **kw
try:
pol_idx = np.argwhere(np.array(list(map(str, self.polar))) == polarization)[0, 0]
except IndexError:
print(f"Warning, no '{polarization}' polarization recorded (selec from {self.polar}).")
print(f"Warning, no '{polarization}' polarization recorded (select from {self.polar}).")
pol_idx = 0

data = self.data[..., pol_idx]
Expand Down
25 changes: 14 additions & 11 deletions nenupy/io/tf.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,28 +857,31 @@ def get(self, **pipeline_kwargs) -> SData:
# Restore the parameters to their original default values
self.pipeline.parameters = parameters_copy
raise
self.pipeline.parameters = parameters_copy

# If other data product than Stokes are made
if not self.pipeline.contains("compute_stokes"):
if not self.pipeline.contains("Compute Stokes parameters"):
# Make sure there are 3 dimensions (time, frequency, polarization)
# If there are more, the dimensions > 2 are all merged together.
# If there are 2 dimensions, an empty third is added
data = data.reshape(*data.shape[:2], -1)
return SData(
result = SData(
data=data,
time=Time(time_unix, format="unix", precision=7),
freq=frequency_hz * u.Hz,
polar=np.arange(data.shape[2]).astype(str),
polar=["XX", "XY", "YX", "YY"],
)
else:
# If the data are regular Stokes parameters
result = SData(
data=data,
time=Time(time_unix, format="unix", precision=7),
freq=frequency_hz * u.Hz,
polar=self.pipeline.parameters["stokes"],
)

# If the data are regular Stockes parameters
return SData(
data=data,
time=Time(time_unix, format="unix", precision=7),
freq=frequency_hz * u.Hz,
polar=self.pipeline.parameters["stokes"],
)
self.pipeline.parameters = parameters_copy

return result

def select_raw_data(
self,
Expand Down

0 comments on commit fcd3ac6

Please sign in to comment.