Skip to content

Commit

Permalink
handle case where only reversed baseline is in FR_SPECTRA_FILE
Browse files Browse the repository at this point in the history
  • Loading branch information
jsdillon committed Feb 2, 2024
1 parent 3703547 commit b044d1c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions notebooks/single_baseline_postprocessing_and_pspec.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -496,8 +496,12 @@
" metadata = h5f[\"metadata\"]\n",
" bl_to_index_map = {tuple(ap): int(index) for index, antpairs in metadata[\"baseline_groups\"].items() for ap in antpairs}\n",
" spectrum_freqs = metadata[\"frequencies_MHz\"][()] * 1e6\n",
" m_modes = metadata[\"erh_mode_integer_index\"][()] \n",
" mmode_spectrum = h5f[\"erh_mode_power_spectrum\"][:, :, bl_to_index_map[ANTPAIR]]"
" m_modes = metadata[\"erh_mode_integer_index\"][()]\n",
" if ANTPAIR in bl_to_index_map:\n",
" mmode_spectrum = h5f[\"erh_mode_power_spectrum\"][:, :, bl_to_index_map[ANTPAIR]]\n",
" else:\n",
" # If ANTPAIR is not in the FR_SPECTRA_FILE, but the reverse is, also reverse the spectrum\n",
" mmode_spectrum = np.flip(h5f[\"erh_mode_power_spectrum\"][:, :, bl_to_index_map[ANTPAIR[::-1]]], axis=0)"
]
},
{
Expand Down

0 comments on commit b044d1c

Please sign in to comment.