From e3d36d398565763c9dc9eefb250c763be8aab197 Mon Sep 17 00:00:00 2001 From: Sosnowsky Date: Tue, 11 Feb 2025 13:25:15 +0100 Subject: [PATCH 01/27] First version of paper for joss --- paper.bib | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++ paper.md | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 156 insertions(+) create mode 100644 paper.bib create mode 100644 paper.md diff --git a/paper.bib b/paper.bib new file mode 100644 index 0000000..b159ee0 --- /dev/null +++ b/paper.bib @@ -0,0 +1,77 @@ +@article{losada_three-point_2024, + author = {Losada, J. M. and Helgeland, A. D. and Terry, J. L. and Garcia, O. E.}, + title = "{A three-point velocity estimation method for two-dimensional coarse-grained imaging data}", + journal = {AIP Advances}, + volume = {14}, + number = {9}, + pages = {095102}, + year = {2024}, + month = {09}, +} + +@article{dippolito_convective_2011, + title = {Convective transport by intermittent blob-filaments: {Comparison} of theory and experiment}, + volume = {18}, + number = {6}, + journal = {Physics of Plasmas}, + author = {D'Ippolito, D. A. and Myra, J. R. and Zweben, S. J.}, + year = {2011}, +} + +@article{fiedler_coherent_1988, +title = {Coherent structures in turbulent flows}, +journal = {Progress in Aerospace Sciences}, +volume = {25}, +number = {3}, +pages = {231-269}, +year = {1988}, +issn = {0376-0421}, +doi = {https://doi.org/10.1016/0376-0421(88)90001-2}, +url = {https://www.sciencedirect.com/science/article/pii/0376042188900012}, +author = {H.E. Fiedler}, +} + +@inproceedings{nosov_coherent_2009, +author = {V. V. Nosov and V. M. Grigoriev and P. G. Kovadlo and V. P. Lukin and E. V. Nosov and A. V. Torgaev}, +title = {{Coherent structures in turbulent atmosphere}}, +volume = {7296}, +booktitle = {Fifteenth International Symposium on Atmospheric and Ocean Optics/Atmospheric Physics}, +editor = {Gennadii G. Matvienko and Yurii N. Ponomarev}, +organization = {International Society for Optics and Photonics}, +publisher = {SPIE}, +pages = {729609}, +keywords = {turbulence, spectrum, coherent structure, Benard cell, stochastization scenario}, +year = {2009}, +doi = {10.1117/12.823804}, +URL = {https://doi.org/10.1117/12.823804} +} + +@article{zweben_invited_2017, + title = {Invited {Review} {Article}: {Gas} puff imaging diagnostics of edge plasma turbulence in magnetic fusion devices}, + volume = {88}, + issn = {10897623}, + doi = {10.1063/1.4981873}, + number = {4}, + journal = {Review of Scientific Instruments}, + author = {Zweben, S. J. and Terry, J. L. and Stotler, D. P. and Maqueda, R. J.}, + year = {2017}, + pmid = {28456269}, + pages = {041101}, + file = {Attachment:/home/sosno/Zotero/storage/VGNCMUZA/zweben_rsi_88_041101.pdf:application/pdf}, +} + +@article{offeddu_analysis_2023, + author = {Offeddu, N. and Wüthrich, C. and Han, W. and Theiler, C. and Golfinopoulos, T. and Terry, J. L. and Marmar, E. and Ravetta, A. and Van Parys, G.}, + title = {Analysis techniques for blob properties from gas puff imaging data}, + journal = {Review of Scientific Instruments}, + volume = {94}, + number = {3}, + pages = {033512}, + year = {2023}, + month = {03}, + abstract = {Filamentary structures, also known as blobs, are a prominent feature of turbulence and transport at the edge of magnetically confined plasmas. They cause cross-field particle and energy transport and are, therefore, of interest in tokamak physics and, more generally, nuclear fusion research. Several experimental techniques have been developed to study their properties. Among these, measurements are routinely performed with stationary probes, passive imaging, and, in more recent years, Gas Puff Imaging (GPI). In this work, we present different analysis techniques developed and used on 2D data from the suite of GPI diagnostics in the Tokamak à Configuration Variable, featuring different temporal and spatial resolutions. Although specifically developed to be used on GPI data, these techniques can be employed to analyze 2D turbulence data presenting intermittent, coherent structures. We focus on size, velocity, and appearance frequency evaluation with, among other methods, conditional averaging sampling, individual structure tracking, and a recently developed machine learning algorithm. We describe in detail the implementation of these techniques, compare them against each other, and comment on the scenarios to which these techniques are best applied and on the requirements that the data must fulfill in order to yield meaningful results.}, + issn = {0034-6748}, + doi = {10.1063/5.0133506}, + url = {https://doi.org/10.1063/5.0133506}, + eprint = {https://pubs.aip.org/aip/rsi/article-pdf/doi/10.1063/5.0133506/16796367/033512\_1\_online.pdf}, +} \ No newline at end of file diff --git a/paper.md b/paper.md new file mode 100644 index 0000000..62f4bdb --- /dev/null +++ b/paper.md @@ -0,0 +1,79 @@ +--- +title: 'Blobmodel: A Python package for generating superpositions of pulses in two dimensions' +tags: + - Python + - pulses + - imaging data + - tokamaks + - turbulence +authors: + - name: Juan M. Losada + orcid: 0000-0003-2054-1384 + equal-contrib: true + affiliation: 1 + - name: Gregor Decristoforo + orcid: 0000-0002-7616-0946 + equal-contrib: true # (This is how you can denote equal contributions between multiple authors) + affiliation: 2 +affiliations: + - name: UiT, The Arctic University of Norway + index: 1 + ror: 00hx57361 +date: 10 February 2025 +bibliography: paper.bib + +--- + +# Summary + +`blobmodel` is a Python library for generating synthetic data that mimics the behavior +of moving pulses in a turbulent environment. It creates controlled datasets where the +true motion of each pulse is known, allowing researchers to test and improve tracking +algorithms for analyzing turbulent flows. While originally developed for studying +turbulence in fusion experiments, `blobmodel` can be applied to any field where +turbulence leads to the generation of structures propagating in two dimensions. +The software is open source, easy to use, and designed to support reproducible research. + +# Statement of need + +Understanding and analyzing the motion of structures in turbulent systems is crucial +in many areas of research, including plasma physics `[@dippolito:2011]`, fluid dynamics `[@fiedler:1988]`, and atmospheric +science `[@nosov:2009]`. In experimental studies, imaging diagnostics are often used to capture the +evolution of these structures `[@zweben:2017]`, but extracting reliable velocity information from such +data remains challenging `[@offeddu:2023]`. Many existing analysis methods rely on assumptions about +the underlying dynamics and must be tested against known reference data to ensure +accuracy. + +`blobmodel` addresses this need by providing a framework for generating synthetic +datasets resulting from a superposition of uncorrelated pulses: +$$\begin{equation} + \Phi(x,y,t) = \sum_{k=1}^{K} a_k \varphi\left( \frac{x-v_k(t-t_k)}{\ell_{x, k}}, \frac{(y-y_k)-w_k(t-t_k)}{\ell_{y, k}}\right) , +\end{equation}$$ +where the pulse amplitudes $a_k$, velocity components $v_k$ and $w_k$, arrival times $t_k$, +arrival positions $y_k$ and sizes $\ell_{x, k}$ and $\ell_{y, k}$ are random variables. +Additionally, each pulse may be tilted an angle given by an additional random variable +$\theta_k$ with respect to its centre. + +The framework allows an explicit definition of all relevant process parameters, including: +* All pulse parameters if defined as degenerate random variables. +* All distribution functions of the pulse parameters otherwise. +* Spatial and temporal resolution. +* Degree of pulse overlap. +* Signal length. + +This allows researchers to systematically test and benchmark +tracking algorithms and velocity estimation techniques in a controlled setting. +Originally developed for studying turbulence-driven transport in fusion plasma +experiments, blobmodel is applicable to any system where turbulence leads to the +formation of moving structures in two-dimensional space. By offering an open-source +and easily accessible tool, blobmodel supports the development and validation of +analysis methods used in experimental and computational research. + +The package has been used to generate synthetic data to study and compare the robustness of +velocity estimation techniques on coarse-grained imaging data `@losada:2024`. + +# Acknowledgements + +This work was supported by the UiT Aurora Centre Program, UiT The Arctic University of Norway (2020). + +# References \ No newline at end of file From 4c1f4b73723d8ae5687dfbeff7ef47c222a9237c Mon Sep 17 00:00:00 2001 From: Sosnowsky Date: Tue, 11 Feb 2025 14:37:24 +0100 Subject: [PATCH 02/27] Add pdf workflow --- .github/workflows/draft-pdf.yml | 27 +++++++++++++++++++++++++++ paper.bib => paper/paper.bib | 0 paper.md => paper/paper.md | 0 3 files changed, 27 insertions(+) create mode 100644 .github/workflows/draft-pdf.yml rename paper.bib => paper/paper.bib (100%) rename paper.md => paper/paper.md (100%) diff --git a/.github/workflows/draft-pdf.yml b/.github/workflows/draft-pdf.yml new file mode 100644 index 0000000..eca639b --- /dev/null +++ b/.github/workflows/draft-pdf.yml @@ -0,0 +1,27 @@ +on: + push: + paths: + - paper/** + - .github/workflows/draft-pdf.yml + +jobs: + paper: + runs-on: ubuntu-latest + name: Paper Draft + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Build draft PDF + uses: openjournals/openjournals-draft-action@master + with: + journal: joss + # This should be the path to the paper within your repo. + paper-path: paper.md + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: paper + # This is the output path where Pandoc will write the compiled + # PDF. Note, this should be the same directory as the input + # paper.md + path: paper.pdf \ No newline at end of file diff --git a/paper.bib b/paper/paper.bib similarity index 100% rename from paper.bib rename to paper/paper.bib diff --git a/paper.md b/paper/paper.md similarity index 100% rename from paper.md rename to paper/paper.md From d4acce4c2f0b4eacf945848bcd884836c70c5842 Mon Sep 17 00:00:00 2001 From: Sosnowsky Date: Tue, 11 Feb 2025 14:40:07 +0100 Subject: [PATCH 03/27] Try again --- .github/workflows/draft-pdf.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/draft-pdf.yml b/.github/workflows/draft-pdf.yml index eca639b..ff6102e 100644 --- a/.github/workflows/draft-pdf.yml +++ b/.github/workflows/draft-pdf.yml @@ -16,7 +16,7 @@ jobs: with: journal: joss # This should be the path to the paper within your repo. - paper-path: paper.md + paper-path: paper/paper.md - name: Upload uses: actions/upload-artifact@v4 with: From 5dbc4fc7d65ffeb41f4e365758dbaf028f6362cc Mon Sep 17 00:00:00 2001 From: Sosnowsky Date: Tue, 11 Feb 2025 14:43:06 +0100 Subject: [PATCH 04/27] Fix latex --- paper/paper.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paper/paper.md b/paper/paper.md index 62f4bdb..ba1764e 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -46,9 +46,9 @@ accuracy. `blobmodel` addresses this need by providing a framework for generating synthetic datasets resulting from a superposition of uncorrelated pulses: -$$\begin{equation} +$$ \Phi(x,y,t) = \sum_{k=1}^{K} a_k \varphi\left( \frac{x-v_k(t-t_k)}{\ell_{x, k}}, \frac{(y-y_k)-w_k(t-t_k)}{\ell_{y, k}}\right) , -\end{equation}$$ +$$ where the pulse amplitudes $a_k$, velocity components $v_k$ and $w_k$, arrival times $t_k$, arrival positions $y_k$ and sizes $\ell_{x, k}$ and $\ell_{y, k}$ are random variables. Additionally, each pulse may be tilted an angle given by an additional random variable From b4126c2e70ec435e1acd459f85e52ccb742a094d Mon Sep 17 00:00:00 2001 From: Sosnowsky Date: Tue, 11 Feb 2025 14:47:29 +0100 Subject: [PATCH 05/27] Fix references --- paper/paper.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/paper/paper.md b/paper/paper.md index ba1764e..f70395e 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -37,10 +37,10 @@ The software is open source, easy to use, and designed to support reproducible r # Statement of need Understanding and analyzing the motion of structures in turbulent systems is crucial -in many areas of research, including plasma physics `[@dippolito:2011]`, fluid dynamics `[@fiedler:1988]`, and atmospheric -science `[@nosov:2009]`. In experimental studies, imaging diagnostics are often used to capture the -evolution of these structures `[@zweben:2017]`, but extracting reliable velocity information from such -data remains challenging `[@offeddu:2023]`. Many existing analysis methods rely on assumptions about +in many areas of research, including plasma physics [@dippolito_convective_2011], fluid dynamics [@fiedler_coherent_1988], and atmospheric +science [@nosov_coherent_2009]. In experimental studies, imaging diagnostics are often used to capture the +evolution of these structures [@zweben_invited_2017], but extracting reliable velocity information from such +data remains challenging [@offeddu_analysis_2023]. Many existing analysis methods rely on assumptions about the underlying dynamics and must be tested against known reference data to ensure accuracy. @@ -70,7 +70,7 @@ and easily accessible tool, blobmodel supports the development and validation of analysis methods used in experimental and computational research. The package has been used to generate synthetic data to study and compare the robustness of -velocity estimation techniques on coarse-grained imaging data `@losada:2024`. +velocity estimation techniques on coarse-grained imaging data [@losada_three-point_2024]. # Acknowledgements From b67ba8c74819f7ccc36bacabf636c07ee995a31c Mon Sep 17 00:00:00 2001 From: Sosnowsky Date: Tue, 11 Feb 2025 14:55:53 +0100 Subject: [PATCH 06/27] Also this --- .github/workflows/draft-pdf.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/draft-pdf.yml b/.github/workflows/draft-pdf.yml index ff6102e..2baba30 100644 --- a/.github/workflows/draft-pdf.yml +++ b/.github/workflows/draft-pdf.yml @@ -24,4 +24,4 @@ jobs: # This is the output path where Pandoc will write the compiled # PDF. Note, this should be the same directory as the input # paper.md - path: paper.pdf \ No newline at end of file + path: paper/paper.pdf \ No newline at end of file From 20b043b2ed48ec9cecda868974a04e826f374116 Mon Sep 17 00:00:00 2001 From: Sosnowsky Date: Wed, 12 Feb 2025 14:01:07 +0100 Subject: [PATCH 07/27] Merge gregor --- paper/paper.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/paper/paper.md b/paper/paper.md index f70395e..68d7883 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -1,5 +1,5 @@ --- -title: 'Blobmodel: A Python package for generating superpositions of pulses in two dimensions' +title: 'Blobmodel: A Python package for generating superpositions of pulses in one and two dimensions' tags: - Python - pulses @@ -14,12 +14,12 @@ authors: - name: Gregor Decristoforo orcid: 0000-0002-7616-0946 equal-contrib: true # (This is how you can denote equal contributions between multiple authors) - affiliation: 2 + affiliation: 1 affiliations: - name: UiT, The Arctic University of Norway index: 1 ror: 00hx57361 -date: 10 February 2025 +date: 11 February 2025 bibliography: paper.bib --- @@ -31,7 +31,7 @@ of moving pulses in a turbulent environment. It creates controlled datasets wher true motion of each pulse is known, allowing researchers to test and improve tracking algorithms for analyzing turbulent flows. While originally developed for studying turbulence in fusion experiments, `blobmodel` can be applied to any field where -turbulence leads to the generation of structures propagating in two dimensions. +turbulence leads to the generation of structures propagating in one or two dimensions. The software is open source, easy to use, and designed to support reproducible research. # Statement of need @@ -61,11 +61,13 @@ The framework allows an explicit definition of all relevant process parameters, * Degree of pulse overlap. * Signal length. +For more details visit [blobmodel's documentation](https://blobmodel.readthedocs.io/en/latest/) + This allows researchers to systematically test and benchmark tracking algorithms and velocity estimation techniques in a controlled setting. Originally developed for studying turbulence-driven transport in fusion plasma experiments, blobmodel is applicable to any system where turbulence leads to the -formation of moving structures in two-dimensional space. By offering an open-source +formation of moving structures in one or two-dimensional space. By offering an open-source and easily accessible tool, blobmodel supports the development and validation of analysis methods used in experimental and computational research. @@ -75,5 +77,6 @@ velocity estimation techniques on coarse-grained imaging data [@losada_three-poi # Acknowledgements This work was supported by the UiT Aurora Centre Program, UiT The Arctic University of Norway (2020). +@Juan, ask Odd Erik whether we have to include Equinor since my position was funded by them. -# References \ No newline at end of file +# References From b7883a8a01c219c36e1bb926557fa7243ebc68f2 Mon Sep 17 00:00:00 2001 From: Sosnowsky Date: Wed, 12 Feb 2025 14:22:47 +0100 Subject: [PATCH 08/27] Add references --- paper/paper.bib | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ paper/paper.md | 7 +++++-- 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/paper/paper.bib b/paper/paper.bib index b159ee0..7b6b284 100644 --- a/paper/paper.bib +++ b/paper/paper.bib @@ -74,4 +74,53 @@ @article{offeddu_analysis_2023 doi = {10.1063/5.0133506}, url = {https://doi.org/10.1063/5.0133506}, eprint = {https://pubs.aip.org/aip/rsi/article-pdf/doi/10.1063/5.0133506/16796367/033512\_1\_online.pdf}, +} + +@article{garcia_stochastic_2016, + author = {Garcia, O. E. and Kube, R. and Theodorsen, A. and Pécseli, H. L.}, + title = {Stochastic modelling of intermittent fluctuations in the scrape-off layer: Correlations, distributions, level crossings, and moment estimation}, + journal = {Physics of Plasmas}, + volume = {23}, + number = {5}, + pages = {052308}, + year = {2016}, + month = {05}, + issn = {1070-664X}, + doi = {10.1063/1.4951016}, +} + +@article{militello_two-dimensional_2018, + author = {Militello, F. and Farley, T. and Mukhi, K. and Walkden, N. and Omotani, J. T.}, + title = {A two-dimensional statistical framework connecting thermodynamic profiles with filaments in the scrape off layer and application to experiments}, + journal = {Physics of Plasmas}, + volume = {25}, + number = {5}, + pages = {056112}, + year = {2018}, + month = {05}, + issn = {1070-664X}, + doi = {10.1063/1.5017919}, +} + +@misc{losada_tde_2025, + title={Time delay velocity estimation from a superposition of localized and uncorrelated pulses}, + author={J. M. Losada and O. E. Garcia}, + year={2025}, + eprint={2411.06544}, + archivePrefix={arXiv}, + primaryClass={physics.plasm-ph}, + url={https://arxiv.org/abs/2411.06544}, +} + +@article{militello_relation_2016, +doi = {10.1088/0741-3335/58/12/125004}, +year = {2016}, +month = {oct}, +publisher = {IOP Publishing}, +volume = {58}, +number = {12}, +pages = {125004}, +author = {Militello, F and Omotani, J T}, +title = {On the relation between non-exponential scrape off layer profiles and the dynamics of filaments}, +journal = {Plasma Physics and Controlled Fusion}, } \ No newline at end of file diff --git a/paper/paper.md b/paper/paper.md index 68d7883..7ad81fc 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -45,7 +45,7 @@ the underlying dynamics and must be tested against known reference data to ensur accuracy. `blobmodel` addresses this need by providing a framework for generating synthetic -datasets resulting from a superposition of uncorrelated pulses: +datasets resulting from a superposition of uncorrelated pulses [@militello_two-dimensional_2018, @losada_tde_2025]: $$ \Phi(x,y,t) = \sum_{k=1}^{K} a_k \varphi\left( \frac{x-v_k(t-t_k)}{\ell_{x, k}}, \frac{(y-y_k)-w_k(t-t_k)}{\ell_{y, k}}\right) , $$ @@ -74,9 +74,12 @@ analysis methods used in experimental and computational research. The package has been used to generate synthetic data to study and compare the robustness of velocity estimation techniques on coarse-grained imaging data [@losada_three-point_2024]. +Additionally, theoretically predicted radial profiles from stochastic modelling +[@garcia_stochastic_2016, @militello_relation_2016] agree with those obtained with `blobmodel`. + # Acknowledgements This work was supported by the UiT Aurora Centre Program, UiT The Arctic University of Norway (2020). -@Juan, ask Odd Erik whether we have to include Equinor since my position was funded by them. +TODO: @Juan, ask Odd Erik whether we have to include Equinor since my position was funded by them. # References From f0ec309a0d03e3763c49cdda23c9bba9393d928a Mon Sep 17 00:00:00 2001 From: Sosnowsky Date: Wed, 12 Feb 2025 14:24:24 +0100 Subject: [PATCH 09/27] Add taup --- paper/paper.md | 1 + 1 file changed, 1 insertion(+) diff --git a/paper/paper.md b/paper/paper.md index 7ad81fc..8c92c66 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -57,6 +57,7 @@ $\theta_k$ with respect to its centre. The framework allows an explicit definition of all relevant process parameters, including: * All pulse parameters if defined as degenerate random variables. * All distribution functions of the pulse parameters otherwise. +* Optionally, a drainage term $\tau_\shortparallel$ that models an exponential decay in the pulse amplitude. * Spatial and temporal resolution. * Degree of pulse overlap. * Signal length. From 3d2aad05bdb42c71cf248841773c6b5a0ddec0d9 Mon Sep 17 00:00:00 2001 From: Sosnowsky Date: Wed, 12 Feb 2025 15:23:18 +0100 Subject: [PATCH 10/27] Small fixes --- paper/paper.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/paper/paper.md b/paper/paper.md index 8c92c66..99b2349 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -45,7 +45,7 @@ the underlying dynamics and must be tested against known reference data to ensur accuracy. `blobmodel` addresses this need by providing a framework for generating synthetic -datasets resulting from a superposition of uncorrelated pulses [@militello_two-dimensional_2018, @losada_tde_2025]: +datasets resulting from a superposition of uncorrelated pulses [@militello_two-dimensional_2018; @losada_tde_2025]: $$ \Phi(x,y,t) = \sum_{k=1}^{K} a_k \varphi\left( \frac{x-v_k(t-t_k)}{\ell_{x, k}}, \frac{(y-y_k)-w_k(t-t_k)}{\ell_{y, k}}\right) , $$ @@ -55,14 +55,13 @@ Additionally, each pulse may be tilted an angle given by an additional random va $\theta_k$ with respect to its centre. The framework allows an explicit definition of all relevant process parameters, including: -* All pulse parameters if defined as degenerate random variables. -* All distribution functions of the pulse parameters otherwise. -* Optionally, a drainage term $\tau_\shortparallel$ that models an exponential decay in the pulse amplitude. -* Spatial and temporal resolution. -* Degree of pulse overlap. -* Signal length. -For more details visit [blobmodel's documentation](https://blobmodel.readthedocs.io/en/latest/) +- All pulse parameters if defined as degenerate random variables. +- All distribution functions of the pulse parameters otherwise. +- Optionally, a drainage term $\tau_\shortparallel$ that models an exponential decay in the pulse amplitude. +- Spatial and temporal resolution. +- Degree of pulse overlap. +- Signal length. This allows researchers to systematically test and benchmark tracking algorithms and velocity estimation techniques in a controlled setting. @@ -72,6 +71,8 @@ formation of moving structures in one or two-dimensional space. By offering an o and easily accessible tool, blobmodel supports the development and validation of analysis methods used in experimental and computational research. +For more details visit [blobmodel's documentation](https://blobmodel.readthedocs.io/en/latest/). + The package has been used to generate synthetic data to study and compare the robustness of velocity estimation techniques on coarse-grained imaging data [@losada_three-point_2024]. From 16074741d0884984a52f692b3c7305605fd1fdf0 Mon Sep 17 00:00:00 2001 From: Sosnowsky Date: Wed, 12 Feb 2025 15:23:57 +0100 Subject: [PATCH 11/27] Remove ror --- paper/paper.md | 1 - 1 file changed, 1 deletion(-) diff --git a/paper/paper.md b/paper/paper.md index 99b2349..45047de 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -18,7 +18,6 @@ authors: affiliations: - name: UiT, The Arctic University of Norway index: 1 - ror: 00hx57361 date: 11 February 2025 bibliography: paper.bib From b0c1edd585ac6d6654b5a4c01a3b7142eaedd633 Mon Sep 17 00:00:00 2001 From: Sosnowsky Date: Wed, 12 Feb 2025 15:28:51 +0100 Subject: [PATCH 12/27] One more fix --- paper/paper.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paper/paper.md b/paper/paper.md index 45047de..0127b84 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -76,7 +76,7 @@ The package has been used to generate synthetic data to study and compare the ro velocity estimation techniques on coarse-grained imaging data [@losada_three-point_2024]. Additionally, theoretically predicted radial profiles from stochastic modelling -[@garcia_stochastic_2016, @militello_relation_2016] agree with those obtained with `blobmodel`. +[@garcia_stochastic_2016; @militello_relation_2016] agree with those obtained with `blobmodel`. # Acknowledgements From 634ac593491f4a96fcefaa821560a42f669bdbef Mon Sep 17 00:00:00 2001 From: Sosnowsky Date: Fri, 14 Feb 2025 14:11:49 +0100 Subject: [PATCH 13/27] Update based on OE feedback --- paper/paper.bib | 76 +++++++++++++++++++++++++++++++++++++++++++++++++ paper/paper.md | 44 ++++++++++++++++++++++++---- 2 files changed, 115 insertions(+), 5 deletions(-) diff --git a/paper/paper.bib b/paper/paper.bib index 7b6b284..9082737 100644 --- a/paper/paper.bib +++ b/paper/paper.bib @@ -123,4 +123,80 @@ @article{militello_relation_2016 author = {Militello, F and Omotani, J T}, title = {On the relation between non-exponential scrape off layer profiles and the dynamics of filaments}, journal = {Plasma Physics and Controlled Fusion}, +} + +@article{veltri_mhd_1999, +doi = {10.1088/0741-3335/41/3A/071}, +url = {https://dx.doi.org/10.1088/0741-3335/41/3A/071}, +year = {1999}, +month = {mar}, +publisher = {}, +volume = {41}, +number = {3A}, +pages = {A787}, +author = {Pierluigi Veltri}, +title = {MHD turbulence in the solar wind: self-similarity, intermittency and coherent structures}, +journal = {Plasma Physics and Controlled Fusion}, +} + +@article{lowen_power_1990, + author={Lowen, S.B. and Teich, M.C.}, + journal={IEEE Transactions on Information Theory}, + title={Power-law shot noise}, + year={1990}, + volume={36}, + number={6}, + pages={1302-1318}, + doi={10.1109/18.59930}} + + @article{bak_self_1988, + title = {Self-organized criticality}, + author = {Bak, Per and Tang, Chao and Wiesenfeld, Kurt}, + journal = {Phys. Rev. A}, + volume = {38}, + issue = {1}, + pages = {364--374}, + numpages = {0}, + year = {1988}, + month = {Jul}, + publisher = {American Physical Society}, + doi = {10.1103/PhysRevA.38.364}, + url = {https://link.aps.org/doi/10.1103/PhysRevA.38.364} +} + +@article{kociscak_modeling_2023, + author = {{Kočiščák, S.} and {Kvammen, A.} and {Mann, I.} and {Sørbye, S. H.} and {Theodorsen, A.} and {Zaslavsky, A.}}, + title = {Modeling Solar Orbiter dust detection rates in the inner heliosphere as a Poisson process}, + DOI= "10.1051/0004-6361/202245165", + url= "https://doi.org/10.1051/0004-6361/202245165", + journal = {A&A}, + year = 2023, + volume = 670, + pages = "A140", +} + +@article{losada_stochastic_2023, + author = {Losada, J. M. and Theodorsen, A. and Garcia, O. E.}, + title = {Stochastic modeling of blob-like plasma filaments in the scrape-off layer: Theoretical foundation}, + journal = {Physics of Plasmas}, + volume = {30}, + number = {4}, + pages = {042518}, + year = {2023}, + month = {04}, + issn = {1070-664X}, + doi = {10.1063/5.0144885}, +} + +@article{losada_stochastic_2024, + author = {Losada, J. M. and Paikina, O. and Garcia, O. E.}, + title = {Stochastic modeling of blob-like plasma filaments in the scrape-off layer: Correlated amplitudes and velocities}, + journal = {Physics of Plasmas}, + volume = {31}, + number = {4}, + pages = {042514}, + year = {2024}, + month = {04}, + issn = {1070-664X}, + doi = {10.1063/5.0196938}, } \ No newline at end of file diff --git a/paper/paper.md b/paper/paper.md index 0127b84..104065e 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -27,8 +27,9 @@ bibliography: paper.bib `blobmodel` is a Python library for generating synthetic data that mimics the behavior of moving pulses in a turbulent environment. It creates controlled datasets where the -true motion of each pulse is known, allowing researchers to test and improve tracking -algorithms for analyzing turbulent flows. While originally developed for studying +true motion of each pulse is known, allowing researchers gain further understanding on +the statistical outputs of such systems as well as to test and improve analysis +and tracking algorithms. While originally developed for studying turbulence in fusion experiments, `blobmodel` can be applied to any field where turbulence leads to the generation of structures propagating in one or two dimensions. The software is open source, easy to use, and designed to support reproducible research. @@ -36,13 +37,29 @@ The software is open source, easy to use, and designed to support reproducible r # Statement of need Understanding and analyzing the motion of structures in turbulent systems is crucial -in many areas of research, including plasma physics [@dippolito_convective_2011], fluid dynamics [@fiedler_coherent_1988], and atmospheric -science [@nosov_coherent_2009]. In experimental studies, imaging diagnostics are often used to capture the +in many areas of research, including plasma physics [@dippolito_convective_2011], +fluid dynamics [@fiedler_coherent_1988], and atmospheric science [@nosov_coherent_2009]. + +More widely, the study of the statistical characteristics resulting from the superposition +of uncorrelated propagating pulses is of importance in fields such as astrophysical plasmas [@veltri_mhd_1999], +detection rates of interplanetary dust [@kociscak_modeling_2023], +$1/f$ noise in self-organized critical systems [@bak_self_1988], +shot noise in electronics [@lower_power_1990] + +In experimental studies, imaging diagnostics are often used to capture the evolution of these structures [@zweben_invited_2017], but extracting reliable velocity information from such data remains challenging [@offeddu_analysis_2023]. Many existing analysis methods rely on assumptions about the underlying dynamics and must be tested against known reference data to ensure accuracy. +Several stochastic models have been developed describing a superposition of uncorrelated structures arriving in time +in zero spatial dimensions [@garcia_stochastic_2016]; or propagating in one [@losada_stochastic_2023] +or two [@militello_two-dimensional_2018] spatial dimensions. In the simplest cases, it is possible +to derive analytical expressions for different statistical quantities such as probability density functions, +autocorrelation functions, power spectral densities and spatial dependence of the mean or other higher-order +moments [@garcia_stochastic_2016; @militello_relation_2016; @losada_stochastic_2023]. More general scenarios +require numerical tools [@losada_stochastic_2024], and synthetic realizations of the model. + `blobmodel` addresses this need by providing a framework for generating synthetic datasets resulting from a superposition of uncorrelated pulses [@militello_two-dimensional_2018; @losada_tde_2025]: $$ @@ -78,9 +95,26 @@ velocity estimation techniques on coarse-grained imaging data [@losada_three-poi Additionally, theoretically predicted radial profiles from stochastic modelling [@garcia_stochastic_2016; @militello_relation_2016] agree with those obtained with `blobmodel`. +# Implementation details + +Since the simulation domain has finite spatial extent, pulses may originate or extend beyond its boundaries. +If a pulse has a non-bound shape, such as a Gaussian, its tails can still contribute to the +superposition inside the domain. However, in long simulations, most pulses will exist outside the +domain for the majority of the time, making it computationally inefficient to account for all of them. +To improve efficiency, a `speed_up` flag has been added to `Model.make_realization`. When enabled, the model +ignores pulses whose contribution within the domain falls below a user-defined `error` threshold. +This allows for significant computational savings while maintaining accuracy in the simulation. + +Periodicity in the vertical direction is an optional feature. It is implemented by replicating each pulse +at vertical positions $y_b\pm L_y$, where $y_b$ is the pulse's original position and $L_y$ is the vertical +size of the simulation domain. This ensures that blobs crossing the upper or lower boundaries are correctly +wrapped around, maintaining continuity in the periodic direction. + +This package is fully compatible with `xarray`, with all outputs provided as `xarray` datasets +for easy handling and analysis. + # Acknowledgements This work was supported by the UiT Aurora Centre Program, UiT The Arctic University of Norway (2020). -TODO: @Juan, ask Odd Erik whether we have to include Equinor since my position was funded by them. # References From f643f7e98932ff8405a4dcf3a3810f5769086d88 Mon Sep 17 00:00:00 2001 From: Sosnowsky Date: Fri, 14 Feb 2025 14:15:50 +0100 Subject: [PATCH 14/27] Add xarray cite --- paper/paper.bib | 12 ++++++++++++ paper/paper.md | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/paper/paper.bib b/paper/paper.bib index 9082737..19c8108 100644 --- a/paper/paper.bib +++ b/paper/paper.bib @@ -199,4 +199,16 @@ @article{losada_stochastic_2024 month = {04}, issn = {1070-664X}, doi = {10.1063/5.0196938}, +} + +@article{hoyer_xarray_2017, + title = {xarray: {N-D} labeled arrays and datasets in {Python}}, + author = {Hoyer, S. and J. Hamman}, + journal = {Journal of Open Research Software}, + volume = {5}, + number = {1}, + year = {2017}, + publisher = {Ubiquity Press}, + doi = {10.5334/jors.148}, + url = {https://doi.org/10.5334/jors.148} } \ No newline at end of file diff --git a/paper/paper.md b/paper/paper.md index 104065e..dd50985 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -110,7 +110,7 @@ at vertical positions $y_b\pm L_y$, where $y_b$ is the pulse's original position size of the simulation domain. This ensures that blobs crossing the upper or lower boundaries are correctly wrapped around, maintaining continuity in the periodic direction. -This package is fully compatible with `xarray`, with all outputs provided as `xarray` datasets +This package is fully compatible with `xarray` [@hoyer_xarray_2017], with all outputs provided as `xarray` datasets for easy handling and analysis. # Acknowledgements From 2dd8965bb239d8cc8c8c18a422ae0264ce4774f1 Mon Sep 17 00:00:00 2001 From: Sosnowsky Date: Fri, 4 Apr 2025 09:18:17 +0200 Subject: [PATCH 15/27] Fix bib sources --- paper/paper.bib | 131 ++++++++++++++++++++++++------------------------ paper/paper.md | 2 +- 2 files changed, 66 insertions(+), 67 deletions(-) diff --git a/paper/paper.bib b/paper/paper.bib index 19c8108..b823029 100644 --- a/paper/paper.bib +++ b/paper/paper.bib @@ -7,6 +7,7 @@ @article{losada_three-point_2024 pages = {095102}, year = {2024}, month = {09}, + doi = {10.1063/5.0197251}, } @article{dippolito_convective_2011, @@ -16,34 +17,33 @@ @article{dippolito_convective_2011 journal = {Physics of Plasmas}, author = {D'Ippolito, D. A. and Myra, J. R. and Zweben, S. J.}, year = {2011}, + doi = {10.1063/1.3594609}, } @article{fiedler_coherent_1988, -title = {Coherent structures in turbulent flows}, -journal = {Progress in Aerospace Sciences}, -volume = {25}, -number = {3}, -pages = {231-269}, -year = {1988}, -issn = {0376-0421}, -doi = {https://doi.org/10.1016/0376-0421(88)90001-2}, -url = {https://www.sciencedirect.com/science/article/pii/0376042188900012}, -author = {H.E. Fiedler}, + title = {Coherent structures in turbulent flows}, + journal = {Progress in Aerospace Sciences}, + volume = {25}, + number = {3}, + pages = {231-269}, + year = {1988}, + issn = {0376-0421}, + doi = {10.1016/0376-0421(88)90001-2}, + author = {H.E. Fiedler}, } @inproceedings{nosov_coherent_2009, -author = {V. V. Nosov and V. M. Grigoriev and P. G. Kovadlo and V. P. Lukin and E. V. Nosov and A. V. Torgaev}, -title = {{Coherent structures in turbulent atmosphere}}, -volume = {7296}, -booktitle = {Fifteenth International Symposium on Atmospheric and Ocean Optics/Atmospheric Physics}, -editor = {Gennadii G. Matvienko and Yurii N. Ponomarev}, -organization = {International Society for Optics and Photonics}, -publisher = {SPIE}, -pages = {729609}, -keywords = {turbulence, spectrum, coherent structure, Benard cell, stochastization scenario}, -year = {2009}, -doi = {10.1117/12.823804}, -URL = {https://doi.org/10.1117/12.823804} + author = {V. V. Nosov and V. M. Grigoriev and P. G. Kovadlo and V. P. Lukin and E. V. Nosov and A. V. Torgaev}, + title = {{Coherent structures in turbulent atmosphere}}, + volume = {7296}, + booktitle = {Fifteenth International Symposium on Atmospheric and Ocean Optics/Atmospheric Physics}, + editor = {Gennadii G. Matvienko and Yurii N. Ponomarev}, + organization = {International Society for Optics and Photonics}, + publisher = {SPIE}, + pages = {729609}, + keywords = {turbulence, spectrum, coherent structure, Benard cell, stochastization scenario}, + year = {2009}, + doi = {10.1117/12.823804}, } @article{zweben_invited_2017, @@ -56,8 +56,7 @@ @article{zweben_invited_2017 author = {Zweben, S. J. and Terry, J. L. and Stotler, D. P. and Maqueda, R. J.}, year = {2017}, pmid = {28456269}, - pages = {041101}, - file = {Attachment:/home/sosno/Zotero/storage/VGNCMUZA/zweben_rsi_88_041101.pdf:application/pdf}, + pages = {041101}, } @article{offeddu_analysis_2023, @@ -69,11 +68,8 @@ @article{offeddu_analysis_2023 pages = {033512}, year = {2023}, month = {03}, - abstract = {Filamentary structures, also known as blobs, are a prominent feature of turbulence and transport at the edge of magnetically confined plasmas. They cause cross-field particle and energy transport and are, therefore, of interest in tokamak physics and, more generally, nuclear fusion research. Several experimental techniques have been developed to study their properties. Among these, measurements are routinely performed with stationary probes, passive imaging, and, in more recent years, Gas Puff Imaging (GPI). In this work, we present different analysis techniques developed and used on 2D data from the suite of GPI diagnostics in the Tokamak à Configuration Variable, featuring different temporal and spatial resolutions. Although specifically developed to be used on GPI data, these techniques can be employed to analyze 2D turbulence data presenting intermittent, coherent structures. We focus on size, velocity, and appearance frequency evaluation with, among other methods, conditional averaging sampling, individual structure tracking, and a recently developed machine learning algorithm. We describe in detail the implementation of these techniques, compare them against each other, and comment on the scenarios to which these techniques are best applied and on the requirements that the data must fulfill in order to yield meaningful results.}, issn = {0034-6748}, doi = {10.1063/5.0133506}, - url = {https://doi.org/10.1063/5.0133506}, - eprint = {https://pubs.aip.org/aip/rsi/article-pdf/doi/10.1063/5.0133506/16796367/033512\_1\_online.pdf}, } @article{garcia_stochastic_2016, @@ -102,54 +98,57 @@ @article{militello_two-dimensional_2018 doi = {10.1063/1.5017919}, } -@misc{losada_tde_2025, - title={Time delay velocity estimation from a superposition of localized and uncorrelated pulses}, - author={J. M. Losada and O. E. Garcia}, - year={2025}, - eprint={2411.06544}, - archivePrefix={arXiv}, - primaryClass={physics.plasm-ph}, - url={https://arxiv.org/abs/2411.06544}, +@article{losada_tde_2025, + author = {Losada, J. M. and Garcia, O. E.}, + title = {Time delay velocity estimation from a superposition of localized and uncorrelated pulses}, + journal = {Physics of Plasmas}, + volume = {32}, + number = {4}, + pages = {042505}, + year = {2025}, + month = {04}, + doi = {10.1063/5.0261066}, } @article{militello_relation_2016, -doi = {10.1088/0741-3335/58/12/125004}, -year = {2016}, -month = {oct}, -publisher = {IOP Publishing}, -volume = {58}, -number = {12}, -pages = {125004}, -author = {Militello, F and Omotani, J T}, -title = {On the relation between non-exponential scrape off layer profiles and the dynamics of filaments}, -journal = {Plasma Physics and Controlled Fusion}, + doi = {10.1088/0741-3335/58/12/125004}, + year = {2016}, + month = {oct}, + publisher = {IOP Publishing}, + volume = {58}, + number = {12}, + pages = {125004}, + author = {Militello, F and Omotani, J T}, + title = {On the relation between non-exponential scrape off layer profiles and the dynamics of filaments}, + journal = {Plasma Physics and Controlled Fusion}, } @article{veltri_mhd_1999, -doi = {10.1088/0741-3335/41/3A/071}, -url = {https://dx.doi.org/10.1088/0741-3335/41/3A/071}, -year = {1999}, -month = {mar}, -publisher = {}, -volume = {41}, -number = {3A}, -pages = {A787}, -author = {Pierluigi Veltri}, -title = {MHD turbulence in the solar wind: self-similarity, intermittency and coherent structures}, -journal = {Plasma Physics and Controlled Fusion}, + doi = {10.1088/0741-3335/41/3A/071}, + url = {https://dx.doi.org/10.1088/0741-3335/41/3A/071}, + year = {1999}, + month = {mar}, + publisher = {}, + volume = {41}, + number = {3A}, + pages = {A787}, + author = {Pierluigi Veltri}, + title = {MHD turbulence in the solar wind: self-similarity, intermittency and coherent structures}, + journal = {Plasma Physics and Controlled Fusion}, } @article{lowen_power_1990, - author={Lowen, S.B. and Teich, M.C.}, - journal={IEEE Transactions on Information Theory}, - title={Power-law shot noise}, - year={1990}, - volume={36}, - number={6}, - pages={1302-1318}, - doi={10.1109/18.59930}} - - @article{bak_self_1988, + author={Lowen, S.B. and Teich, M.C.}, + journal={IEEE Transactions on Information Theory}, + title={Power-law shot noise}, + year={1990}, + volume={36}, + number={6}, + pages={1302-1318}, + doi={10.1109/18.59930} +} + +@article{bak_self_1988, title = {Self-organized criticality}, author = {Bak, Per and Tang, Chao and Wiesenfeld, Kurt}, journal = {Phys. Rev. A}, diff --git a/paper/paper.md b/paper/paper.md index dd50985..1f298a0 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -44,7 +44,7 @@ More widely, the study of the statistical characteristics resulting from the sup of uncorrelated propagating pulses is of importance in fields such as astrophysical plasmas [@veltri_mhd_1999], detection rates of interplanetary dust [@kociscak_modeling_2023], $1/f$ noise in self-organized critical systems [@bak_self_1988], -shot noise in electronics [@lower_power_1990] +shot noise in electronics [@lowen_power_1990] In experimental studies, imaging diagnostics are often used to capture the evolution of these structures [@zweben_invited_2017], but extracting reliable velocity information from such From 19b7de6f8c360dddfc021c368ee43ed6aff95c1e Mon Sep 17 00:00:00 2001 From: Sosnowsky Date: Tue, 22 Apr 2025 11:11:34 +0200 Subject: [PATCH 16/27] Add statement of field https://github.com/uit-cosmo/blobmodel/issues/103 --- paper/paper.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/paper/paper.md b/paper/paper.md index 1f298a0..a69f71a 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -85,7 +85,13 @@ Originally developed for studying turbulence-driven transport in fusion plasma experiments, blobmodel is applicable to any system where turbulence leads to the formation of moving structures in one or two-dimensional space. By offering an open-source and easily accessible tool, blobmodel supports the development and validation of -analysis methods used in experimental and computational research. +analysis methods used in experimental and computational research. + +To the authors' knowledge, no other packages exist which provide a comprehensive, +open-source framework for generating synthetic datasets of uncorrelated, propagating +pulses in one or two spatial dimensions, with fully customizable statistical distributions +for pulse parameters and explicit control over spatial and temporal resolution, pulse overlap, +and drainage effects, as implemented in `blobmodel`. For more details visit [blobmodel's documentation](https://blobmodel.readthedocs.io/en/latest/). From cb57e4109355cfc44b6dfa64b5eb638a659b30ce Mon Sep 17 00:00:00 2001 From: Sosnowsky Date: Tue, 22 Apr 2025 11:44:13 +0200 Subject: [PATCH 17/27] Updated docs to new interfaces and created doc tests https://github.com/uit-cosmo/blobmodel/issues/104 --- docs/blob_factory.rst | 6 +- docs/blob_labels.rst | 2 +- docs/blob_shapes.rst | 14 +-- docs/blob_tilt.rst | 4 +- docs/drainage_time.rst | 7 +- docs/getting_started.rst | 2 +- docs/one_dim.rst | 9 +- tests/test_docs.py | 238 +++++++++++++++++++++++++++++++++++++++ 8 files changed, 262 insertions(+), 20 deletions(-) create mode 100644 tests/test_docs.py diff --git a/docs/blob_factory.rst b/docs/blob_factory.rst index 496843a..801622a 100644 --- a/docs/blob_factory.rst +++ b/docs/blob_factory.rst @@ -57,7 +57,7 @@ We chose the defualt distributions for all other blob parameters. We would set u from blobmodel import Model, DefaultBlobFactory - my_blob_factory = DefaultBlobFactory(A_dist="normal", A_parameter=5) + my_blob_factory = DefaultBlobFactory(A_dist=DistributionEnum.normal, A_parameter=5) bm = Model( Nx=200, @@ -66,7 +66,7 @@ We chose the defualt distributions for all other blob parameters. We would set u Ly=10, dt=0.1, T=20, - blob_shape="gauss", + blob_shape=BlobShapeImpl(BlobShapeEnum.gaussian), blob_factory=my_blob_factory, t_drain=100, num_blobs=100, @@ -148,7 +148,7 @@ In this case you can use the ``CustomBlobFactory`` class to define all blob para Ly=2, dt=0.1, T=10, - blob_shape="gauss", + blob_shape=BlobShapeImpl(BlobShapeEnum.gaussian), t_drain=2, periodic_y=True, num_blobs=1000, diff --git a/docs/blob_labels.rst b/docs/blob_labels.rst index 7c7240b..3712ef4 100644 --- a/docs/blob_labels.rst +++ b/docs/blob_labels.rst @@ -26,7 +26,7 @@ Let's take a look at an example: Let's say we want to calculate the individual b dt=0.1, T=20, periodic_y=True, - blob_shape="gauss", + blob_shape=BlobShapeImpl(BlobShapeEnum.gaussian), num_blobs=10, t_drain=1e10, labels="individual", diff --git a/docs/blob_shapes.rst b/docs/blob_shapes.rst index 5df6569..c2cdab7 100644 --- a/docs/blob_shapes.rst +++ b/docs/blob_shapes.rst @@ -61,7 +61,7 @@ An example would look like this: dt=0.1, T=10, num_blobs=10, - blob_shape=BlobShapeImpl("exp", "lorentz"), + blob_shape=BlobShapeImpl(BlobShapeEnum.exp, BlobShapeEnum.lorentz), periodic_y=True, t_drain=1e10, ) @@ -87,13 +87,13 @@ We specify the asymmetry parameter when defining the ``blob_factory``. An exampl .. code-block:: python bf = DefaultBlobFactory( - A_dist="deg", - wx_dist="deg", - spx_dist="deg", - spy_dist="deg", + A_dist=DistributionEnum.deg, + wx_dist=DistributionEnum.deg, + spx_dist=DistributionEnum.deg, + spy_dist=DistributionEnum.deg, shape_param_x_parameter=0.5, shape_param_y_parameter=0.5, - ) + ) bm = Model( Nx=100, @@ -103,7 +103,7 @@ We specify the asymmetry parameter when defining the ``blob_factory``. An exampl dt=0.1, T=10, num_blobs=10, - blob_shape=BlobShapeImpl("2-exp", "2-exp"), + blob_shape=BlobShapeImpl(BlobShapeEnum.double_exp, BlobShapeEnum.double_exp), t_drain=1e10, blob_factory=bf, ) diff --git a/docs/blob_tilt.rst b/docs/blob_tilt.rst index 1f7c16a..d8251cb 100644 --- a/docs/blob_tilt.rst +++ b/docs/blob_tilt.rst @@ -20,8 +20,10 @@ Alternatively, we can force force any tilt angle by setting blob_alignment = Fal .. code-block:: python + vx, vy = 1, 0 + wx, wy = 1, 1 bf = DefaultBlobFactory( - A_dist="deg", + A_dist=DistributionEnum.deg, vy_parameter=vy, vx_parameter=vx, wx_parameter=wx, diff --git a/docs/drainage_time.rst b/docs/drainage_time.rst index b09c11c..2bb3c72 100644 --- a/docs/drainage_time.rst +++ b/docs/drainage_time.rst @@ -13,8 +13,6 @@ Let's take a look at a quick example. Let's assume we want ``t_drain`` to decrea from blobmodel import Model, DefaultBlobFactory import numpy as np - bf = DefaultBlobFactory(A_dist="deg", wx_dist="deg", vx_dist="deg", vy_dist="zeros") - t_drain = np.linspace(2, 1, 100) tmp = Model( @@ -24,11 +22,10 @@ Let's take a look at a quick example. Let's assume we want ``t_drain`` to decrea Ly=0, dt=1, T=1000, - blob_shape="exp", + blob_shape=BlobShapeImpl(BlobShapeEnum.exp), t_drain=t_drain, periodic_y=False, - num_blobs=10000, - blob_factory=bf, + num_blobs=100, ) ds_changing_t_drain = tmp.make_realization() diff --git a/docs/getting_started.rst b/docs/getting_started.rst index fcb180a..7ee98ba 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -23,7 +23,7 @@ In addition, we can specify the blob shape, drainage time and the number of blob dt=0.1, T=20, periodic_y=True, - blob_shape="gauss", + blob_shape=BlobShapeImpl(BlobShapeEnum.gaussian), num_blobs=100, t_drain=1e10, t_init=10, diff --git a/docs/one_dim.rst b/docs/one_dim.rst index 323b776..777f11c 100644 --- a/docs/one_dim.rst +++ b/docs/one_dim.rst @@ -10,7 +10,12 @@ This is achieved by setting the flag ``one_dimensional`` to True. Additionally, from blobmodel import Model, show_model, DefaultBlobFactory - bf = DefaultBlobFactory(A_dist="exp", wx_dist="deg", vx_dist="deg", vy_dist="zeros") + bf = DefaultBlobFactory( + A_dist=DistributionEnum.exp, + wx_dist=DistributionEnum.deg, + vx_dist=DistributionEnum.deg, + vy_dist=DistributionEnum.zeros, + ) bm = Model( Nx=100, @@ -20,7 +25,7 @@ This is achieved by setting the flag ``one_dimensional`` to True. Additionally, dt=0.1, T=10, periodic_y=False, - blob_shape="exp", + blob_shape=BlobShapeImpl(BlobShapeEnum.exp), num_blobs=20, t_drain=10, blob_factory=bf, diff --git a/tests/test_docs.py b/tests/test_docs.py new file mode 100644 index 0000000..5166124 --- /dev/null +++ b/tests/test_docs.py @@ -0,0 +1,238 @@ +from blobmodel import ( + Model, + DefaultBlobFactory, + Blob, + BlobShapeImpl, + DistributionEnum, + BlobShapeEnum, +) +import numpy as np +from unittest.mock import MagicMock +import matplotlib.pyplot as plt + +# The following tests check that the docs examples run, if they fail make sure to change the docs too! + + +def test_getting_started(): + bm = Model( + Nx=10, + Ny=10, + Lx=10, + Ly=10, + dt=0.1, + T=20, + periodic_y=True, + blob_shape=BlobShapeImpl(BlobShapeEnum.gaussian), + num_blobs=100, + t_drain=1e10, + t_init=10, + ) + ds = bm.make_realization(file_name="example.nc") + ds["n"].isel(y=0).mean(dim=("t")).plot() + + +def test_drainage_time(): + t_drain = np.linspace(2, 1, 100) + + tmp = Model( + Nx=100, + Ny=1, + Lx=10, + Ly=0, + dt=1, + T=1000, + blob_shape=BlobShapeImpl(BlobShapeEnum.exp), + t_drain=t_drain, + periodic_y=False, + num_blobs=10, + ) + tmp.make_realization() + + +def test_one_dim(): + bf = DefaultBlobFactory( + A_dist=DistributionEnum.exp, + wx_dist=DistributionEnum.deg, + vx_dist=DistributionEnum.deg, + vy_dist=DistributionEnum.zeros, + ) + + bm = Model( + Nx=100, + Ny=1, + Lx=10, + Ly=0, + dt=0.1, + T=10, + periodic_y=False, + blob_shape=BlobShapeImpl(BlobShapeEnum.exp), + num_blobs=20, + t_drain=10, + blob_factory=bf, + one_dimensional=True, + ) + bm.make_realization(speed_up=True, error=1e-2) + + +def test_blob_shapes(): + from blobmodel import Model, BlobShapeImpl + + bm = Model( + Nx=100, + Ny=100, + Lx=10, + Ly=10, + dt=0.1, + T=10, + num_blobs=10, + blob_shape=BlobShapeImpl(BlobShapeEnum.exp, BlobShapeEnum.lorentz), + periodic_y=True, + t_drain=1e10, + ) + + bf = DefaultBlobFactory( + A_dist=DistributionEnum.deg, + wx_dist=DistributionEnum.deg, + spx_dist=DistributionEnum.deg, + spy_dist=DistributionEnum.deg, + shape_param_x_parameter=0.5, + shape_param_y_parameter=0.5, + ) + bm = Model( + Nx=100, + Ny=100, + Lx=10, + Ly=10, + dt=0.1, + T=10, + num_blobs=10, + blob_shape=BlobShapeImpl(BlobShapeEnum.double_exp, BlobShapeEnum.double_exp), + t_drain=1e10, + blob_factory=bf, + ) + + +def test_blob_tilt(): + vx, vy = 1, 0 + wx, wy = 1, 1 + + bf = DefaultBlobFactory( + A_dist=DistributionEnum.deg, + vy_parameter=vy, + vx_parameter=vx, + wx_parameter=wx, + wy_parameter=wy, + blob_alignment=False, + ) + + theta = np.pi / 2 + bf.set_theta_setter(lambda: theta) + + +def test_labels(): + bm = Model( + Nx=10, + Ny=10, + Lx=20, + Ly=20, + dt=0.1, + T=20, + periodic_y=True, + blob_shape=BlobShapeImpl(BlobShapeEnum.gaussian), + num_blobs=10, + t_drain=1e10, + labels="individual", + label_border=0.75, + ) + + ds = bm.make_realization(speed_up=True, error=1e-2) + + ds["n"].isel(t=-1).plot() + plt.figure() + ds["blob_labels"].isel(t=-1).plot() + + +def test_blob_factory(): + my_blob_factory = DefaultBlobFactory(A_dist=DistributionEnum.normal, A_parameter=5) + + bm = Model( + Nx=10, + Ny=10, + Lx=10, + Ly=10, + dt=0.1, + T=20, + blob_shape=BlobShapeImpl(BlobShapeEnum.gaussian), + blob_factory=my_blob_factory, + t_drain=100, + num_blobs=100, + ) + + ds = bm.make_realization() + + +def test_custom_blob_factory(): + from blobmodel import BlobFactory, AbstractBlobShape + + class CustomBlobFactory(BlobFactory): + def __init__(self) -> None: + pass + + def sample_blobs( + self, + Ly: float, + T: float, + num_blobs: int, + blob_shape: AbstractBlobShape, + t_drain: float, + ) -> list[Blob]: + + # set custom parameter distributions + amp = np.linspace(0.01, 1, num=num_blobs) + width = np.linspace(0.01, 1, num=num_blobs) + vx = np.linspace(0.01, 1, num=num_blobs) + vy = np.linspace(0.01, 1, num=num_blobs) + + posx = np.zeros(num_blobs) + posy = np.random.uniform(low=0.0, high=Ly, size=num_blobs) + t_init = np.random.uniform(low=0, high=T, size=num_blobs) + + # sort blobs by _t_init + t_init = np.sort(t_init) + + return [ + Blob( + blob_id=i, + blob_shape=blob_shape, + amplitude=amp[i], + width_prop=width[i], + width_perp=width[i], + v_x=vx[i], + v_y=vy[i], + pos_x=posx[i], + pos_y=posy[i], + t_init=t_init[i], + t_drain=t_drain, + ) + for i in range(num_blobs) + ] + + def is_one_dimensional(self) -> bool: + return False + + bf = CustomBlobFactory() + tmp = Model( + Nx=10, + Ny=10, + Lx=2, + Ly=2, + dt=0.1, + T=10, + blob_shape=BlobShapeImpl(BlobShapeEnum.gaussian), + t_drain=2, + periodic_y=True, + num_blobs=10, + blob_factory=bf, + ) + + ds = tmp.make_realization() From 9fdf61d1dc3df6990b829bda6e5e620fd5f69d71 Mon Sep 17 00:00:00 2001 From: Sosnowsky Date: Tue, 22 Apr 2025 13:03:19 +0200 Subject: [PATCH 18/27] Update examples to new interface https://github.com/uit-cosmo/blobmodel/issues/104 --- examples/1d_animation.py | 18 +++++++++++++++--- examples/2_sided_exp_pulse.py | 26 +++++++++++++------------- examples/2d_animation.py | 4 ++-- examples/analyse_output.py | 12 ++++++++++-- examples/blob_tilting.py | 17 ++++++++++++----- examples/changing_t_drain.py | 17 ++++++++++++++--- examples/compare_to_analytical_sol.py | 17 ++++++++++++++--- examples/custom_blobfactory.py | 4 +++- examples/save_data.py | 1 - examples/show_labels.py | 6 +----- examples/single_blob.py | 13 ++++++++++--- 11 files changed, 94 insertions(+), 41 deletions(-) diff --git a/examples/1d_animation.py b/examples/1d_animation.py index 3729d29..516ed1d 100644 --- a/examples/1d_animation.py +++ b/examples/1d_animation.py @@ -1,6 +1,18 @@ -from blobmodel import Model, show_model, DefaultBlobFactory +from blobmodel import ( + Model, + show_model, + DefaultBlobFactory, + DistributionEnum, + BlobShapeImpl, + BlobShapeEnum, +) -bf = DefaultBlobFactory(A_dist="deg", wx_dist="deg", vx_dist="deg", vy_dist="zeros") +bf = DefaultBlobFactory( + A_dist=DistributionEnum.exp, + wx_dist=DistributionEnum.deg, + vx_dist=DistributionEnum.deg, + vy_dist=DistributionEnum.zeros, +) bm = Model( Nx=100, @@ -10,7 +22,7 @@ dt=0.1, T=10, periodic_y=False, - blob_shape="exp", + blob_shape=BlobShapeImpl(BlobShapeEnum.exp), num_blobs=20, t_drain=10, blob_factory=bf, diff --git a/examples/2_sided_exp_pulse.py b/examples/2_sided_exp_pulse.py index fd69bab..54b582a 100644 --- a/examples/2_sided_exp_pulse.py +++ b/examples/2_sided_exp_pulse.py @@ -1,22 +1,23 @@ -from blobmodel import Model, show_model, DefaultBlobFactory, BlobShapeImpl +from blobmodel import ( + Model, + show_model, + DefaultBlobFactory, + BlobShapeImpl, + DistributionEnum, + BlobShapeEnum, +) import matplotlib.pyplot as plt -import numpy as np bf = DefaultBlobFactory( - A_dist="deg", - vy_dist="deg", - wx_dist="deg", - spx_dist="deg", - spy_dist="deg", + A_dist=DistributionEnum.deg, + wx_dist=DistributionEnum.deg, + spx_dist=DistributionEnum.deg, + spy_dist=DistributionEnum.deg, shape_param_x_parameter=0.5, shape_param_y_parameter=0.5, - blob_alignment=False, ) -bf.set_theta_setter(lambda: np.random.uniform(-np.pi / 2, np.pi / 2)) -# bf.set_theta_setter(lambda: np.pi/4) - bm = Model( Nx=100, Ny=100, @@ -25,8 +26,7 @@ dt=0.1, T=10, num_blobs=10, - blob_shape=BlobShapeImpl("exp", "2-exp"), - periodic_y=True, + blob_shape=BlobShapeImpl(BlobShapeEnum.double_exp, BlobShapeEnum.double_exp), t_drain=1e10, blob_factory=bf, ) diff --git a/examples/2d_animation.py b/examples/2d_animation.py index 07c8d80..e4c9e2f 100644 --- a/examples/2d_animation.py +++ b/examples/2d_animation.py @@ -1,4 +1,4 @@ -from blobmodel import Model, show_model +from blobmodel import Model, show_model, BlobShapeImpl, BlobShapeEnum # here you can define your custom parameter distributions @@ -10,7 +10,7 @@ dt=0.1, T=20, periodic_y=True, - blob_shape="gauss", + blob_shape=BlobShapeImpl(BlobShapeEnum.gaussian), num_blobs=100, t_drain=1e10, t_init=10, diff --git a/examples/analyse_output.py b/examples/analyse_output.py index 4305497..aae5ea1 100644 --- a/examples/analyse_output.py +++ b/examples/analyse_output.py @@ -1,11 +1,19 @@ -from blobmodel import Model +from blobmodel import Model, BlobShapeImpl, BlobShapeEnum import xarray as xr import matplotlib.pyplot as plt import os + if not os.path.isfile("./example.nc"): bm = Model( - Nx=100, Ny=100, Lx=10, Ly=10, dt=0.1, T=10, blob_shape="exp", num_blobs=1000 + Nx=100, + Ny=100, + Lx=10, + Ly=10, + dt=0.1, + T=10, + blob_shape=BlobShapeImpl(BlobShapeEnum.gaussian), + num_blobs=1000, ) bm.make_realization(file_name="example.nc", speed_up=True, error=1e-2) diff --git a/examples/blob_tilting.py b/examples/blob_tilting.py index acfec7a..1877a6a 100644 --- a/examples/blob_tilting.py +++ b/examples/blob_tilting.py @@ -1,4 +1,11 @@ -from blobmodel import Model, show_model, BlobShapeImpl, DefaultBlobFactory +from blobmodel import ( + Model, + show_model, + BlobShapeImpl, + DefaultBlobFactory, + DistributionEnum, + BlobShapeEnum, +) import numpy as np # To have something to compare we will first make a simulation with aligned blobs moving with velocities @@ -12,7 +19,7 @@ wy = 1 bf = DefaultBlobFactory( - A_dist="deg", + A_dist=DistributionEnum.deg, vy_parameter=vy, vx_parameter=vx, wx_parameter=wx, @@ -30,7 +37,7 @@ dt=0.1, T=20, periodic_y=True, - blob_shape=BlobShapeImpl("rectangle", "rectangle"), + blob_shape=BlobShapeImpl(BlobShapeEnum.rect, BlobShapeEnum.rect), num_blobs=100, t_drain=1e10, blob_factory=bf, @@ -44,7 +51,7 @@ bf = DefaultBlobFactory( - A_dist="deg", + A_dist=DistributionEnum.deg, vy_parameter=vy, vx_parameter=vx, wx_parameter=wx, @@ -67,7 +74,7 @@ dt=0.1, T=20, periodic_y=True, - blob_shape=BlobShapeImpl("rectangle", "rectangle"), + blob_shape=BlobShapeImpl(BlobShapeEnum.rect, BlobShapeEnum.rect), num_blobs=100, t_drain=1e10, blob_factory=bf, diff --git a/examples/changing_t_drain.py b/examples/changing_t_drain.py index 87ab345..269946d 100644 --- a/examples/changing_t_drain.py +++ b/examples/changing_t_drain.py @@ -1,8 +1,19 @@ -from blobmodel import Model, DefaultBlobFactory +from blobmodel import ( + Model, + DefaultBlobFactory, + DistributionEnum, + BlobShapeImpl, + BlobShapeEnum, +) import matplotlib.pyplot as plt import numpy as np -bf = DefaultBlobFactory(A_dist="deg", wx_dist="deg", vx_dist="deg", vy_dist="zeros") +bf = DefaultBlobFactory( + A_dist=DistributionEnum.deg, + wx_dist=DistributionEnum.deg, + vx_dist=DistributionEnum.deg, + vy_dist=DistributionEnum.zeros, +) t_drain = np.linspace(2, 1, 100) @@ -13,7 +24,7 @@ Ly=0, dt=1, T=1000, - blob_shape="exp", + blob_shape=BlobShapeImpl(BlobShapeEnum.exp), t_drain=t_drain, periodic_y=False, num_blobs=10000, diff --git a/examples/compare_to_analytical_sol.py b/examples/compare_to_analytical_sol.py index fe8946b..92f1c01 100644 --- a/examples/compare_to_analytical_sol.py +++ b/examples/compare_to_analytical_sol.py @@ -1,11 +1,22 @@ -from blobmodel import Model, DefaultBlobFactory +from blobmodel import ( + Model, + DefaultBlobFactory, + DistributionEnum, + BlobShapeImpl, + BlobShapeEnum, +) import xarray as xr import matplotlib.pyplot as plt import numpy as np import os # use DefaultBlobFactory to define distribution functions fo random variables -bf = DefaultBlobFactory(A_dist="deg", wx_dist="deg", vx_dist="deg", vy_dist="zeros") +bf = DefaultBlobFactory( + A_dist=DistributionEnum.deg, + wx_dist=DistributionEnum.deg, + vx_dist=DistributionEnum.deg, + vy_dist=DistributionEnum.zeros, +) tmp = Model( Nx=100, @@ -14,7 +25,7 @@ Ly=0, dt=1, T=1000, - blob_shape="exp", + blob_shape=BlobShapeImpl(BlobShapeEnum.exp), t_drain=2, periodic_y=False, num_blobs=10000, diff --git a/examples/custom_blobfactory.py b/examples/custom_blobfactory.py index aecfb1b..cb92b1a 100644 --- a/examples/custom_blobfactory.py +++ b/examples/custom_blobfactory.py @@ -4,6 +4,8 @@ Blob, show_model, AbstractBlobShape, + BlobShapeImpl, + BlobShapeEnum, ) import numpy as np @@ -64,7 +66,7 @@ def is_one_dimensional(self) -> bool: Ly=2, dt=0.1, T=10, - blob_shape="gauss", + blob_shape=BlobShapeImpl(BlobShapeEnum.exp), t_drain=2, periodic_y=True, num_blobs=1000, diff --git a/examples/save_data.py b/examples/save_data.py index 608a75f..88628ad 100644 --- a/examples/save_data.py +++ b/examples/save_data.py @@ -8,7 +8,6 @@ dt=0.1, T=10, periodic_y=False, - blob_shape="gauss", num_blobs=100, ) diff --git a/examples/show_labels.py b/examples/show_labels.py index 1786db6..a96376d 100644 --- a/examples/show_labels.py +++ b/examples/show_labels.py @@ -1,7 +1,4 @@ -from blobmodel import Model, show_model -import numpy as np - -# here you can define your custom parameter distributions +from blobmodel import Model bm = Model( Nx=100, @@ -11,7 +8,6 @@ dt=0.1, T=20, periodic_y=True, - blob_shape="gauss", num_blobs=10, t_drain=1e10, labels="individual", diff --git a/examples/single_blob.py b/examples/single_blob.py index 2d5879c..2478327 100644 --- a/examples/single_blob.py +++ b/examples/single_blob.py @@ -1,7 +1,14 @@ -from blobmodel import Model, show_model, BlobFactory, Blob, AbstractBlobShape +from blobmodel import ( + Model, + show_model, + BlobFactory, + Blob, + AbstractBlobShape, + BlobShapeImpl, + BlobShapeEnum, +) import numpy as np - # here you can define your custom parameter distributions class CustomBlobFactory(BlobFactory): def __init__(self) -> None: @@ -56,7 +63,7 @@ def is_one_dimensional(self) -> bool: dt=0.1, T=10, periodic_y=True, - blob_shape="exp", + blob_shape=BlobShapeImpl(BlobShapeEnum.exp), num_blobs=1, blob_factory=bf, t_drain=1e10, From 03a4763b5fb5dacd86fbce9819934fa737eeae2d Mon Sep 17 00:00:00 2001 From: Sosnowsky Date: Tue, 22 Apr 2025 13:12:10 +0200 Subject: [PATCH 19/27] Upgrade black --- examples/single_blob.py | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/single_blob.py b/examples/single_blob.py index 2478327..dbe1918 100644 --- a/examples/single_blob.py +++ b/examples/single_blob.py @@ -9,6 +9,7 @@ ) import numpy as np + # here you can define your custom parameter distributions class CustomBlobFactory(BlobFactory): def __init__(self) -> None: From dfd913a98c973794bc4b010c5d53606ba770fb9f Mon Sep 17 00:00:00 2001 From: Sosnowsky Date: Tue, 22 Apr 2025 13:41:06 +0200 Subject: [PATCH 20/27] Does this work? --- docs/getting_started.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 7ee98ba..ea8650b 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -11,6 +11,9 @@ We create a grid on which the blobs are discretized with using the ``Model`` cla In addition, we can specify the blob shape, drainage time and the number of blobs when creating a ``Model`` object. For more details about the geometry, take a look at the :ref:`blobmodel-geometry` section. +.. literalinclude:: ../tests/test_docs.py + :language: python + .. code-block:: python from blobmodel import Model From d4f65f8222a1b8a39de4f4b818536dfe25000b6b Mon Sep 17 00:00:00 2001 From: Juan Manuel Losada Date: Tue, 20 May 2025 13:22:14 +0200 Subject: [PATCH 21/27] Update paper/paper.md Co-authored-by: Emily Bourne --- paper/paper.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paper/paper.md b/paper/paper.md index a69f71a..1434bca 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -27,7 +27,7 @@ bibliography: paper.bib `blobmodel` is a Python library for generating synthetic data that mimics the behavior of moving pulses in a turbulent environment. It creates controlled datasets where the -true motion of each pulse is known, allowing researchers gain further understanding on +true motion of each pulse is known, allowing researchers to gain further understanding on the statistical outputs of such systems as well as to test and improve analysis and tracking algorithms. While originally developed for studying turbulence in fusion experiments, `blobmodel` can be applied to any field where From 05fffd0a0a281ec175780320d7088fda79caa8a0 Mon Sep 17 00:00:00 2001 From: Sosnowsky Date: Tue, 20 May 2025 13:28:54 +0200 Subject: [PATCH 22/27] Undo changes to main --- examples/2d_animation.py | 2 +- examples/custom_blobfactory.py | 2 -- examples/save_data.py | 0 3 files changed, 1 insertion(+), 3 deletions(-) delete mode 100644 examples/save_data.py diff --git a/examples/2d_animation.py b/examples/2d_animation.py index 95c13d8..ae343e0 100644 --- a/examples/2d_animation.py +++ b/examples/2d_animation.py @@ -1,4 +1,4 @@ -from blobmodel import Model, show_model, BlobShapeImpl, BlobShapeEnum +from blobmodel import Model, show_model # Example of a simple two-dimensional realization and animation. diff --git a/examples/custom_blobfactory.py b/examples/custom_blobfactory.py index f90b8b3..5e2f943 100644 --- a/examples/custom_blobfactory.py +++ b/examples/custom_blobfactory.py @@ -4,8 +4,6 @@ Blob, show_model, AbstractBlobShape, - BlobShapeImpl, - BlobShapeEnum, ) import numpy as np diff --git a/examples/save_data.py b/examples/save_data.py deleted file mode 100644 index e69de29..0000000 From 0b0369cf4802d680a07490001f0451ea2b66ad06 Mon Sep 17 00:00:00 2001 From: Juan Manuel Losada Date: Tue, 20 May 2025 13:29:30 +0200 Subject: [PATCH 23/27] Update paper/paper.md Co-authored-by: Emily Bourne --- paper/paper.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paper/paper.md b/paper/paper.md index 1434bca..916eddd 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -44,7 +44,7 @@ More widely, the study of the statistical characteristics resulting from the sup of uncorrelated propagating pulses is of importance in fields such as astrophysical plasmas [@veltri_mhd_1999], detection rates of interplanetary dust [@kociscak_modeling_2023], $1/f$ noise in self-organized critical systems [@bak_self_1988], -shot noise in electronics [@lowen_power_1990] +and shot noise in electronics [@lowen_power_1990]. In experimental studies, imaging diagnostics are often used to capture the evolution of these structures [@zweben_invited_2017], but extracting reliable velocity information from such From dfd9fa219169ec6083ca30469fcb81fd8e0782b9 Mon Sep 17 00:00:00 2001 From: Juan Manuel Losada Date: Tue, 20 May 2025 13:29:51 +0200 Subject: [PATCH 24/27] Update paper/paper.md Co-authored-by: Emily Bourne --- paper/paper.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paper/paper.md b/paper/paper.md index 916eddd..eb4be1e 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -67,7 +67,7 @@ $$ $$ where the pulse amplitudes $a_k$, velocity components $v_k$ and $w_k$, arrival times $t_k$, arrival positions $y_k$ and sizes $\ell_{x, k}$ and $\ell_{y, k}$ are random variables. -Additionally, each pulse may be tilted an angle given by an additional random variable +Additionally, each pulse may be tilted on an angle given by an additional random variable $\theta_k$ with respect to its centre. The framework allows an explicit definition of all relevant process parameters, including: From b5941fc96cc405b855f35eee4a5bfa7625902ee7 Mon Sep 17 00:00:00 2001 From: Sosnowsky Date: Tue, 20 May 2025 13:57:15 +0200 Subject: [PATCH 25/27] Address reviewers comments --- paper/paper.bib | 2 +- paper/paper.md | 30 +++++++++++++++++++++--------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/paper/paper.bib b/paper/paper.bib index b823029..d1d5875 100644 --- a/paper/paper.bib +++ b/paper/paper.bib @@ -165,7 +165,7 @@ @article{bak_self_1988 @article{kociscak_modeling_2023, author = {{Kočiščák, S.} and {Kvammen, A.} and {Mann, I.} and {Sørbye, S. H.} and {Theodorsen, A.} and {Zaslavsky, A.}}, - title = {Modeling Solar Orbiter dust detection rates in the inner heliosphere as a Poisson process}, + title = {Modeling Solar Orbiter dust detection rates in the inner heliosphere as a {Poisson} process}, DOI= "10.1051/0004-6361/202245165", url= "https://doi.org/10.1051/0004-6361/202245165", journal = {A&A}, diff --git a/paper/paper.md b/paper/paper.md index eb4be1e..1654702 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -52,8 +52,8 @@ data remains challenging [@offeddu_analysis_2023]. Many existing analysis method the underlying dynamics and must be tested against known reference data to ensure accuracy. -Several stochastic models have been developed describing a superposition of uncorrelated structures arriving in time -in zero spatial dimensions [@garcia_stochastic_2016]; or propagating in one [@losada_stochastic_2023] +Several stochastic models have been developed describing a point process resulting from the superposition of +uncorrelated structures with random arrival times [@garcia_stochastic_2016]; or propagating in one [@losada_stochastic_2023] or two [@militello_two-dimensional_2018] spatial dimensions. In the simplest cases, it is possible to derive analytical expressions for different statistical quantities such as probability density functions, autocorrelation functions, power spectral densities and spatial dependence of the mean or other higher-order @@ -65,19 +65,25 @@ datasets resulting from a superposition of uncorrelated pulses [@militello_two-d $$ \Phi(x,y,t) = \sum_{k=1}^{K} a_k \varphi\left( \frac{x-v_k(t-t_k)}{\ell_{x, k}}, \frac{(y-y_k)-w_k(t-t_k)}{\ell_{y, k}}\right) , $$ -where the pulse amplitudes $a_k$, velocity components $v_k$ and $w_k$, arrival times $t_k$, -arrival positions $y_k$ and sizes $\ell_{x, k}$ and $\ell_{y, k}$ are random variables. -Additionally, each pulse may be tilted on an angle given by an additional random variable -$\theta_k$ with respect to its centre. +where: +- $a_k$ represents the initial pulse amplitude. +- $v_k$ and $w_k$ are the horizontal and vertical velocity components, respectively. +- $t_k$ is the pulse arrival time at the position $x=0$, $y=y_k$. +- $y_k$ is the pulse vertical position at time $t=t_k$. +- $\ell_{x, k}$ and $\ell_{y, k}$ are the horizontal and vertical pulse sizes, respectively. +- $\varphi$ is an unspecified pulse shape. +All these parameters, except for the pulse shape $\varphi$ are assumed to be random variables. +Additionally, each pulse may be tilted on an angle given by an additional random variable $\theta_k$ with respect to its centre. The framework allows an explicit definition of all relevant process parameters, including: - All pulse parameters if defined as degenerate random variables. - All distribution functions of the pulse parameters otherwise. -- Optionally, a drainage term $\tau_\shortparallel$ that models an exponential decay in the pulse amplitude. +- Optionally, a drainage term $\tau_\shortparallel$ that models an exponential decay in the pulse amplitude through an +additional factor $e^{-\frac{t-t_k}{\tau_\shortparallel}}$ in the pulse evolution. - Spatial and temporal resolution. -- Degree of pulse overlap. -- Signal length. +- Degree of pulse overlap by setting different ratios of number of pulses to signal length and domain size. +- Total duration of the process. This allows researchers to systematically test and benchmark tracking algorithms and velocity estimation techniques in a controlled setting. @@ -103,6 +109,12 @@ Additionally, theoretically predicted radial profiles from stochastic modelling # Implementation details +The evolution of the pulses is discretized by the `Blob` class in a three dimensional grid +(two space and one time dimensions) according to the above formula. The discretization grid is provided +by the `Geometry` and the superposition of all pulses is performed my the `Model` class, which also contains functions +for the model initialization. The generation of pulses with pulse parameters following user-specified distribution +functions is performed by the `BlobFactory`. + Since the simulation domain has finite spatial extent, pulses may originate or extend beyond its boundaries. If a pulse has a non-bound shape, such as a Gaussian, its tails can still contribute to the superposition inside the domain. However, in long simulations, most pulses will exist outside the From 1762c19222a08a91c1982d21a0960c9c4df6d477 Mon Sep 17 00:00:00 2001 From: Juan Manuel Losada Date: Tue, 17 Jun 2025 08:09:54 +0200 Subject: [PATCH 26/27] Update paper/paper.md Co-authored-by: Emily Bourne --- paper/paper.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paper/paper.md b/paper/paper.md index 1654702..1c39838 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -111,7 +111,7 @@ Additionally, theoretically predicted radial profiles from stochastic modelling The evolution of the pulses is discretized by the `Blob` class in a three dimensional grid (two space and one time dimensions) according to the above formula. The discretization grid is provided -by the `Geometry` and the superposition of all pulses is performed my the `Model` class, which also contains functions +by the `Geometry` and the superposition of all pulses is performed by the `Model` class, which also contains functions for the model initialization. The generation of pulses with pulse parameters following user-specified distribution functions is performed by the `BlobFactory`. From e77a7c8704bc238275cda2f4f42f410efa1a12d9 Mon Sep 17 00:00:00 2001 From: Sosnowsky Date: Tue, 24 Jun 2025 18:12:02 +0200 Subject: [PATCH 27/27] Does this fix the compiled format? --- paper/paper.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/paper/paper.md b/paper/paper.md index 1c39838..6d5ffcb 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -66,12 +66,14 @@ $$ \Phi(x,y,t) = \sum_{k=1}^{K} a_k \varphi\left( \frac{x-v_k(t-t_k)}{\ell_{x, k}}, \frac{(y-y_k)-w_k(t-t_k)}{\ell_{y, k}}\right) , $$ where: + - $a_k$ represents the initial pulse amplitude. - $v_k$ and $w_k$ are the horizontal and vertical velocity components, respectively. - $t_k$ is the pulse arrival time at the position $x=0$, $y=y_k$. - $y_k$ is the pulse vertical position at time $t=t_k$. - $\ell_{x, k}$ and $\ell_{y, k}$ are the horizontal and vertical pulse sizes, respectively. - $\varphi$ is an unspecified pulse shape. + All these parameters, except for the pulse shape $\varphi$ are assumed to be random variables. Additionally, each pulse may be tilted on an angle given by an additional random variable $\theta_k$ with respect to its centre.