From 9c59d8d7f6b11ad731152cf69b36a87f117926ec Mon Sep 17 00:00:00 2001
From: Toral Gupta <toral.gupta@ldas-pcdev2.ligo.caltech.edu>
Date: Mon, 12 Jun 2023 12:01:48 -0700
Subject: [PATCH 1/2] Added PSD information

---
 docs/source/algo.rst   | 13 +++++++++----
 docs/source/output.rst | 10 ++++++----
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/docs/source/algo.rst b/docs/source/algo.rst
index 694b99c..7aa8cac 100644
--- a/docs/source/algo.rst
+++ b/docs/source/algo.rst
@@ -69,9 +69,14 @@ Power Spectral Density Estimation
 
 To estimate the power spectral density, we use the :code:`BayesLine` algorithm (Littenberg and Cornish 2015) to estimate the on-source PSD.
 
-Prior to v1.1.0 of BayesWave, the PSD was modeled using cubic splines for smoothly varying broad-band noise and Lorentzians for narrow-band line features in the spectrum. The number of control points in the cubic spline and the number of Lorentzians is again marginalized over using an RJMCMC.
+Prior to v1.1.0 of BayesWave, the PSD was modeled using cubic splines for smoothly varying broad-band noise and Lorentzians for narrow-band line features in the spectrum. The model was described as :math:`S_n(f) = SM(f) + SL(f)`, where :math:`SM` represents the smooth component and :math:`SL` represents the Lorentzian lines. A trans-dimensional Markov Chain Monte Carlo algorithm was employed to model the PSD, allowing for variability in the number of control points in the cubic spline, the number of Lorentzian lines, and their respective locations and values.
 
-From v1.1.0 and beyond, the PSD is modeled using Akima splines.
+From v1.1.0 and beyond, the PSD is modeled using Akima splines to represnt smoothly varying component which tend to suppress oscillations due to their C1 continuity property. The model is now described as
 
-.. todo::
-    More explanation here please
\ No newline at end of file
+.. math::
+
+    S_n(f) = SM(f)(1+SL(f))
+
+In addition to the transdimensional MCMC approacg, the modeling now allows for off-grid placement of frequency knots, meaning that the model can position frequency knots anywhere between minimum and maximum frequency. Lateral shifting of frequency knots and targeted proposals for RJ spline jumps are employed to improve the overall estimation of PSD.
+
+Furthermore, a low latency PSD is also generated using a quick MCMC process.  This low-latency PSD utilizes the median plus outlier as a starting point, which provides a high-quality initial estimate that passes the Anderson-Darling Gaussanity tests, ensuring its reliability and accuracy.
diff --git a/docs/source/output.rst b/docs/source/output.rst
index 1a871f8..85dd769 100644
--- a/docs/source/output.rst
+++ b/docs/source/output.rst
@@ -33,10 +33,12 @@ The file :code:`evidence.dat` contains the evidence for each model. The first co
 
 PSDs
 ==============
-If running with the :code:`bayesLine` option enabled, BayesWave will also return PSDs (and ASDs) designed to be used with parameter estimation (such as Bilby).
+If running with the :code:`bayesLine` option enabled, BayesWave will return PSDs designed to be used with parameter estimation (such as Bilby).
+
+The ouput of PSD lives in :code:`post/<enabled model>`. For example, with :code:`cleanOnly` flag that runs bayesline and glitch cleaning phase, the output PSD would be in :code:`post/clean/` labeled as :code:`glitch_median_PSD_IFO.dat`. The columns are: frequency, median PSD(f), lower 50% CI, upper 50% CI, lower 90% CI, upper 90% CI.
+
+The low latency average start PSD is available labeled :code:`IFO_start_PSD.dat` and the fairdraw start PSD and ASD are also available labeled :code:`IFO_fairdraw_psd.dat` and :code:`IFO_fairdraw_asd.dat` respectively.
 
-.. todo::
-    Someone who does PSD stuff should give more details on the PSD and how to use it with PE
 
 BayesWavePost
 ---------------
@@ -101,4 +103,4 @@ The postprocessing from :code:`BayesWavePost` is read in by :code:`megaplot.py`
 An example output page can be found ...
 
 .. todo::
-    Make a good example output page and then don't touch it
\ No newline at end of file
+    Make a good example output page and then don't touch it
-- 
GitLab


From 84978e602ca5cb8cb437085d8de371d2196f9556 Mon Sep 17 00:00:00 2001
From: Toral Gupta <toral.gupta@ldas-pcdev2.ligo.caltech.edu>
Date: Thu, 31 Aug 2023 09:58:30 -0700
Subject: [PATCH 2/2] modified algorithm overview file

---
 docs/source/algo.rst | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/docs/source/algo.rst b/docs/source/algo.rst
index 7aa8cac..76e53c6 100644
--- a/docs/source/algo.rst
+++ b/docs/source/algo.rst
@@ -77,6 +77,4 @@ From v1.1.0 and beyond, the PSD is modeled using Akima splines to represnt smoot
 
     S_n(f) = SM(f)(1+SL(f))
 
-In addition to the transdimensional MCMC approacg, the modeling now allows for off-grid placement of frequency knots, meaning that the model can position frequency knots anywhere between minimum and maximum frequency. Lateral shifting of frequency knots and targeted proposals for RJ spline jumps are employed to improve the overall estimation of PSD.
-
-Furthermore, a low latency PSD is also generated using a quick MCMC process.  This low-latency PSD utilizes the median plus outlier as a starting point, which provides a high-quality initial estimate that passes the Anderson-Darling Gaussanity tests, ensuring its reliability and accuracy.
+In addition to the transdimensional MCMC approacg, the modeling now allows for off-grid placement of frequency knots, meaning that the model can position frequency knots anywhere between minimum and maximum frequency. Furthermore, a low latency PSD is also generated using a quick MCMC process.
-- 
GitLab