Skip to content

Commit

Permalink
deploy: 19a7391
Browse files Browse the repository at this point in the history
  • Loading branch information
rcjackson committed May 8, 2024
1 parent 84d4751 commit 3a55db5
Show file tree
Hide file tree
Showing 18 changed files with 42 additions and 39 deletions.
Binary file not shown.
Binary file not shown.
Binary file modified _images/sphx_glr_plot_read_sp2b_001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/sphx_glr_plot_read_sp2b_thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion _modules/pysp2/util/particle_properties.html
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,9 @@ <h1>Source code for pysp2.util.particle_properties</h1><div class="highlight"><p

<span class="n">PkHt_ch1</span> <span class="o">=</span> <span class="n">input_ds</span><span class="p">[</span><span class="s1">&#39;PkHt_ch1&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">values</span>
<span class="n">PkHt_ch5</span> <span class="o">=</span> <span class="n">input_ds</span><span class="p">[</span><span class="s1">&#39;PkHt_ch5&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">values</span>
<span class="n">width</span> <span class="o">=</span> <span class="n">input_ds</span><span class="p">[</span><span class="s1">&#39;PkEnd_ch1&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">values</span> <span class="o">-</span> <span class="n">input_ds</span><span class="p">[</span><span class="s1">&#39;PkStart_ch1&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">values</span>
<span class="n">width_ch1</span> <span class="o">=</span> <span class="n">input_ds</span><span class="p">[</span><span class="s1">&#39;PkEnd_ch1&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">values</span> <span class="o">-</span> <span class="n">input_ds</span><span class="p">[</span><span class="s1">&#39;PkStart_ch1&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">values</span>
<span class="n">width_ch5</span> <span class="o">=</span> <span class="n">input_ds</span><span class="p">[</span><span class="s1">&#39;PkEnd_ch5&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">values</span> <span class="o">-</span> <span class="n">input_ds</span><span class="p">[</span><span class="s1">&#39;PkStart_ch5&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">values</span>
<span class="n">width</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">where</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">isnan</span><span class="p">(</span><span class="n">width_ch1</span><span class="p">),</span><span class="n">width_ch5</span><span class="p">,</span><span class="n">width_ch1</span><span class="p">)</span>
<span class="n">accepted_incand</span> <span class="o">=</span> <span class="n">width</span> <span class="o">&gt;=</span> <span class="n">Globals</span><span class="o">.</span><span class="n">IncanMinWidth</span>
<span class="n">accepted_incand</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">logical_and</span><span class="p">(</span><span class="n">accepted_incand</span><span class="p">,</span>
<span class="n">input_ds</span><span class="p">[</span><span class="s1">&#39;PkHt_ch2&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">values</span> <span class="o">&gt;=</span> <span class="n">Globals</span><span class="o">.</span><span class="n">IncanMinPeakHt1</span><span class="p">)</span>
Expand Down
9 changes: 5 additions & 4 deletions _modules/pysp2/util/peak_fit.html
Original file line number Diff line number Diff line change
Expand Up @@ -863,9 +863,10 @@ <h1>Source code for pysp2.util.peak_fit</h1><div class="highlight"><pre>
<span class="n">num_base_pts_2_avg</span> <span class="o">=</span> <span class="mi">20</span>
<span class="n">data</span> <span class="o">=</span> <span class="n">my_ds</span><span class="p">[</span><span class="s1">&#39;Data_ch&#39;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">channel</span><span class="p">)]</span><span class="o">.</span><span class="n">values</span>
<span class="n">V_maxloc</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">argmax</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">axis</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>
<span class="n">V_minloc</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">argmin</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">axis</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>
<span class="n">invert</span> <span class="o">=</span> <span class="n">V_maxloc</span> <span class="o">&lt;</span> <span class="n">V_minloc</span>
<span class="n">data</span><span class="p">[</span><span class="n">invert</span><span class="p">,</span> <span class="p">:]</span> <span class="o">=</span> <span class="o">-</span><span class="n">data</span><span class="p">[</span><span class="n">invert</span><span class="p">,</span> <span class="p">:]</span>
<span class="c1">#V_minloc = np.argmin(data, axis=1)</span>
<span class="c1">#invert = V_maxloc &lt; V_minloc</span>
<span class="k">if</span> <span class="n">channel</span><span class="o">==</span><span class="mi">3</span><span class="p">:</span>
<span class="n">data</span> <span class="o">=</span> <span class="o">-</span><span class="n">data</span>
<span class="n">base</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">nanmean</span><span class="p">(</span><span class="n">data</span><span class="p">[:,</span> <span class="mi">0</span><span class="p">:</span><span class="n">num_base_pts_2_avg</span><span class="p">],</span> <span class="n">axis</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>
<span class="n">V_max</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">max</span><span class="p">(</span><span class="n">axis</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>
<span class="n">conditions</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">logical_and</span><span class="o">.</span><span class="n">reduce</span><span class="p">(((</span><span class="n">V_max</span> <span class="o">-</span> <span class="n">base</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">1</span><span class="p">,</span> <span class="n">V_maxloc</span> <span class="o">&lt;</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">),</span> <span class="n">V_maxloc</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">))</span>
Expand All @@ -880,7 +881,7 @@ <h1>Source code for pysp2.util.peak_fit</h1><div class="highlight"><pre>
<span class="n">pos_tile</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">tile</span><span class="p">(</span><span class="n">pos</span><span class="p">,</span> <span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="mi">1</span><span class="p">))</span><span class="o">.</span><span class="n">T</span>
<span class="n">counting_up</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">where</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">logical_and</span><span class="p">(</span><span class="n">data</span> <span class="o">&lt;</span> <span class="mi">5</span><span class="p">,</span> <span class="n">counting_up</span> <span class="o">&lt;=</span> <span class="n">pos_tile</span><span class="p">),</span> <span class="n">counting_up</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="n">start</span> <span class="o">=</span> <span class="n">counting_up</span><span class="o">.</span><span class="n">max</span><span class="p">(</span><span class="n">axis</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>
<span class="n">fit_coeffs</span> <span class="o">=</span> <span class="p">{</span><span class="s1">&#39;base&#39;</span><span class="p">:</span> <span class="n">base</span><span class="p">,</span> <span class="s1">&#39;height&#39;</span><span class="p">:</span> <span class="n">height</span><span class="p">,</span> <span class="s1">&#39;pos&#39;</span><span class="p">:</span> <span class="n">pos</span><span class="p">,</span> <span class="s1">&#39;start&#39;</span><span class="p">:</span> <span class="n">start</span><span class="p">,</span> <span class="s1">&#39;inverted&#39;</span><span class="p">:</span> <span class="n">invert</span><span class="p">}</span>
<span class="n">fit_coeffs</span> <span class="o">=</span> <span class="p">{</span><span class="s1">&#39;base&#39;</span><span class="p">:</span> <span class="n">base</span><span class="p">,</span> <span class="s1">&#39;height&#39;</span><span class="p">:</span> <span class="n">height</span><span class="p">,</span> <span class="s1">&#39;pos&#39;</span><span class="p">:</span> <span class="n">pos</span><span class="p">,</span> <span class="s1">&#39;start&#39;</span><span class="p">:</span> <span class="n">start</span><span class="p">}</span>

<span class="k">return</span> <span class="n">fit_coeffs</span>

Expand Down
6 changes: 3 additions & 3 deletions _modules/pysp2/vis/plot_wave.html
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ <h1>Source code for pysp2.vis.plot_wave</h1><div class="highlight"><pre>
<span class="n">pos</span> <span class="o">=</span> <span class="n">spectra</span><span class="p">[</span><span class="s1">&#39;FtPos_ch&#39;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">chn</span><span class="p">)]</span><span class="o">.</span><span class="n">values</span>
<span class="n">base</span> <span class="o">=</span> <span class="n">spectra</span><span class="p">[</span><span class="s1">&#39;Base_ch&#39;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">chn</span><span class="p">)]</span><span class="o">.</span><span class="n">values</span>
<span class="n">width</span> <span class="o">=</span> <span class="n">spectra</span><span class="p">[</span><span class="s1">&#39;PkFWHM_ch&#39;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">chn</span><span class="p">)]</span><span class="o">.</span><span class="n">values</span>
<span class="n">Y</span> <span class="o">=</span> <span class="n">_gaus</span><span class="p">(</span><span class="n">xspace</span><span class="p">,</span> <span class="n">amplitude</span><span class="p">,</span> <span class="n">pos</span><span class="p">,</span> <span class="n">width</span><span class="o">/</span><span class="mf">2.</span><span class="p">,</span> <span class="n">base</span><span class="p">)</span>
<span class="n">Y</span> <span class="o">=</span> <span class="n">_gaus</span><span class="p">(</span><span class="n">xspace</span><span class="p">,</span> <span class="n">amplitude</span><span class="p">,</span> <span class="n">pos</span><span class="p">,</span> <span class="n">width</span><span class="o">/</span><span class="mf">2.35482</span><span class="p">,</span> <span class="n">base</span><span class="p">)</span>
<span class="n">ax</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">xspace</span><span class="p">,</span> <span class="n">Y</span><span class="p">)</span>
<span class="n">ax</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="mf">0.7</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">,</span> <span class="s1">&#39;Fit Pos = </span><span class="si">%3.2f</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="n">pos</span><span class="p">,</span>
<span class="n">transform</span><span class="o">=</span><span class="n">ax</span><span class="o">.</span><span class="n">transAxes</span><span class="p">)</span>
Expand Down Expand Up @@ -494,8 +494,8 @@ <h1>Source code for pysp2.vis.plot_wave</h1><div class="highlight"><pre>
<span class="n">ax</span><span class="o">.</span><span class="n">legend</span><span class="p">(</span><span class="n">legends</span><span class="p">[</span><span class="n">i</span><span class="p">])</span>
<span class="k">if</span> <span class="n">i</span><span class="o">==</span><span class="mi">2</span><span class="p">:</span>
<span class="n">lines</span><span class="o">=</span><span class="n">ax</span><span class="o">.</span><span class="n">get_lines</span><span class="p">()</span>
<span class="n">ax</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">ds</span><span class="p">[</span><span class="s1">&#39;PkSplitPos_ch3&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">isel</span><span class="p">(</span><span class="n">event_index</span><span class="o">=</span><span class="n">record_no</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="s1">&#39;*&#39;</span><span class="p">,</span><span class="n">markersize</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span><span class="n">color</span><span class="o">=</span><span class="n">lines</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">get_color</span><span class="p">())</span>
<span class="n">ax</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">ds</span><span class="p">[</span><span class="s1">&#39;PkSplitPos_ch7&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">isel</span><span class="p">(</span><span class="n">event_index</span><span class="o">=</span><span class="n">record_no</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="s1">&#39;*&#39;</span><span class="p">,</span><span class="n">markersize</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span><span class="n">color</span><span class="o">=</span><span class="n">lines</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">get_color</span><span class="p">())</span>
<span class="n">ax</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">ds</span><span class="p">[</span><span class="s1">&#39;PkSplitPos_ch3&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">isel</span><span class="p">(</span><span class="n">event_index</span><span class="o">=</span><span class="n">record_no</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="s1">&#39;1&#39;</span><span class="p">,</span><span class="n">markersize</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span><span class="n">color</span><span class="o">=</span><span class="n">lines</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">get_color</span><span class="p">())</span>
<span class="n">ax</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">ds</span><span class="p">[</span><span class="s1">&#39;PkSplitPos_ch7&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">isel</span><span class="p">(</span><span class="n">event_index</span><span class="o">=</span><span class="n">record_no</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="s1">&#39;2&#39;</span><span class="p">,</span><span class="n">markersize</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span><span class="n">color</span><span class="o">=</span><span class="n">lines</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">get_color</span><span class="p">())</span>
<span class="k">return</span> <span class="n">display</span>
</pre></div>

Expand Down
8 changes: 4 additions & 4 deletions _sources/sg_execution_times.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Computation times
=================
**00:19.474** total execution time for 3 files **from all galleries**:
**00:19.337** total execution time for 3 files **from all galleries**:

.. container::

Expand All @@ -33,11 +33,11 @@ Computation times
- Time
- Mem (MB)
* - :ref:`sphx_glr_source_auto_examples_plot_psd.py` (``../../examples/plot_psd.py``)
- 00:09.920
- 00:09.813
- 0.0
* - :ref:`sphx_glr_source_auto_examples_plot_read_sp2b.py` (``../../examples/plot_read_sp2b.py``)
- 00:06.703
- 00:06.726
- 0.0
* - :ref:`sphx_glr_source_auto_examples_plot_hk.py` (``../../examples/plot_hk.py``)
- 00:02.851
- 00:02.798
- 0.0
2 changes: 1 addition & 1 deletion _sources/source/auto_examples/plot_hk.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Example for plotting number of particles in housekeeping data
.. rst-class:: sphx-glr-timing

**Total running time of the script:** (0 minutes 2.851 seconds)
**Total running time of the script:** (0 minutes 2.798 seconds)


.. _sphx_glr_download_source_auto_examples_plot_hk.py:
Expand Down
6 changes: 3 additions & 3 deletions _sources/source/auto_examples/plot_psd.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Example on plotting particle concentration data timeseries
Processing record 0
/home/runner/work/PySP2/PySP2/pysp2/util/peak_fit.py:384: OptimizeWarning: Covariance of the parameters could not be estimated
coeff, var_matrix = curve_fit(_gaus, bins_fit, data_fit, p0=p0, method='lm', maxfev=40, ftol=1e-3)
/home/runner/work/PySP2/PySP2/pysp2/util/peak_fit.py:563: OptimizeWarning: Covariance of the parameters could not be estimated
/home/runner/work/PySP2/PySP2/pysp2/util/peak_fit.py:564: OptimizeWarning: Covariance of the parameters could not be estimated
coeff, var_matrix = curve_fit(_gaus, bins_fit, temp1_fit, p0=p0, method='lm', maxfev=50, ftol=1e-3)
Processing record 1000
Processing record 2000
Expand All @@ -49,7 +49,7 @@ Example on plotting particle concentration data timeseries
Processing record 5000
/home/runner/work/PySP2/PySP2/pysp2/util/peak_fit.py:78: RuntimeWarning: Mean of empty slice
ratio = np.nanmean(
5877 records processed in 6.259682655334473 s
5877 records processed in 6.273894309997559 s
/home/runner/work/PySP2/PySP2/pysp2/util/particle_properties.py:38: RuntimeWarning: All-NaN slice encountered
PkHt_ch0 = np.nanmax(np.stack([input_ds['PkHt_ch0'].values, input_ds['FtAmp_ch0'].values]), axis=0)
/home/runner/work/PySP2/PySP2/pysp2/util/particle_properties.py:39: RuntimeWarning: All-NaN slice encountered
Expand Down Expand Up @@ -86,7 +86,7 @@ Example on plotting particle concentration data timeseries
.. rst-class:: sphx-glr-timing

**Total running time of the script:** (0 minutes 9.920 seconds)
**Total running time of the script:** (0 minutes 9.813 seconds)


.. _sphx_glr_download_source_auto_examples_plot_psd.py:
Expand Down
Loading

0 comments on commit 3a55db5

Please sign in to comment.