Skip to content

Commit

Permalink
Modifying P_SN after incoherent time averaging in the single_baseline…
Browse files Browse the repository at this point in the history
…_postprocessing notebook
  • Loading branch information
JianrongTan committed Feb 8, 2025
1 parent 56ac0fe commit 5ddb1ce
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 @@ -1813,7 +1813,11 @@
" # Update P_N and P_SN for incoherent time average\n",
" P_N = uvp.get_stats('P_N', key) * (coherent_avg_correction_factor)**.5\n",
" uvp.set_stats('P_N', key, P_N)\n",
" P_SN = uvp.get_stats('P_SN', key) * (coherent_avg_correction_factor)**.5\n",
" P_S = np.mean([uvp2.get_data(key).real for j, uvp2 in enumerate(uvps_time_avg) if i != j], axis=0) \n",
" P_SN = np.sqrt((np.sqrt(2) * np.where(P_S > 0, P_S, 0) * P_N + P_N**2)) \n",
" # Apply P_SN Correction for Gaussian statistics\n",
" P_SN = (P_SN**2 - 1./ np.sqrt(np.pi) / (len(uvps_time_avg) - 1) * P_N**2)**.5 \n",
" P_SN[~np.isfinite(P_SN)] = np.inf\n",
" uvp.set_stats('P_SN', key, P_SN)"
]
},
Expand Down Expand Up @@ -2229,7 +2233,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.6"
"version": "3.11.4"
},
"toc": {
"base_numbering": 1,
Expand Down

0 comments on commit 5ddb1ce

Please sign in to comment.