Skip to content

Commit

Permalink
flag whole file if one pol is totally flagged
Browse files Browse the repository at this point in the history
  • Loading branch information
jsdillon committed May 10, 2024
1 parent 2832883 commit da2dc57
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions notebooks/delay_filtered_average_zscore.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"source": [
"# Single File Delay Filtered Average Z-Score\n",
"\n",
"**by Josh Dillon**, last updated July 27, 2023\n",
"**by Josh Dillon**, last updated May 10, 2024\n",
"\n",
"This notebook is designed to calculate a metric used for finding low-level RFI in redundantly-averaged cross-correlations, which are then incoherently averaged across well-sampled baselines.\n",
"\n",
Expand Down Expand Up @@ -132,11 +132,16 @@
"metadata": {},
"outputs": [],
"source": [
"# handle the the case where the smooth_cal flags are all True, trying to maintain consistent data shapes\n",
"# handle the the case where the visibility flags are all True for at least one pol, trying to maintain consistent data shapes\n",
"ALL_FLAGGED = False\n",
"if np.all([flag for flag in cal_flags.values()]):\n",
" print('This file is entirely flagged.')\n",
" ALL_FLAGGED = True"
" ALL_FLAGGED = True\n",
"else:\n",
" for pol in ('Jee', 'Jnn'):\n",
" if len([ant for ant, flag in cal_flags.items() if ant[1] == pol and not np.all(flag)]) <= 1:\n",
" print(f'Effectively all {pol}-polarized antennas are flagged, so flagging the entire file.')\n",
" ALL_FLAGGED = True"
]
},
{
Expand Down

0 comments on commit da2dc57

Please sign in to comment.