arcwind 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. arcwind-1.0.0/LICENSE +21 -0
  2. arcwind-1.0.0/PKG-INFO +241 -0
  3. arcwind-1.0.0/README.md +199 -0
  4. arcwind-1.0.0/pyproject.toml +55 -0
  5. arcwind-1.0.0/setup.cfg +4 -0
  6. arcwind-1.0.0/src/arcwind/__init__.py +49 -0
  7. arcwind-1.0.0/src/arcwind/_version.py +1 -0
  8. arcwind-1.0.0/src/arcwind/analysis.py +533 -0
  9. arcwind-1.0.0/src/arcwind/cli.py +144 -0
  10. arcwind-1.0.0/src/arcwind/config.py +916 -0
  11. arcwind-1.0.0/src/arcwind/constants.py +17 -0
  12. arcwind-1.0.0/src/arcwind/continuum.py +164 -0
  13. arcwind-1.0.0/src/arcwind/cube.py +514 -0
  14. arcwind-1.0.0/src/arcwind/data/__init__.py +0 -0
  15. arcwind-1.0.0/src/arcwind/data/template.toml +82 -0
  16. arcwind-1.0.0/src/arcwind/derived.py +173 -0
  17. arcwind-1.0.0/src/arcwind/diagnostics.py +228 -0
  18. arcwind-1.0.0/src/arcwind/fitting.py +880 -0
  19. arcwind-1.0.0/src/arcwind/geometry.py +173 -0
  20. arcwind-1.0.0/src/arcwind/io.py +186 -0
  21. arcwind-1.0.0/src/arcwind/laws.py +231 -0
  22. arcwind-1.0.0/src/arcwind/masks.py +128 -0
  23. arcwind-1.0.0/src/arcwind/mass.py +271 -0
  24. arcwind-1.0.0/src/arcwind/mock.py +270 -0
  25. arcwind-1.0.0/src/arcwind/model.py +442 -0
  26. arcwind-1.0.0/src/arcwind/plotting/__init__.py +33 -0
  27. arcwind-1.0.0/src/arcwind/plotting/_style.py +108 -0
  28. arcwind-1.0.0/src/arcwind/plotting/fit.py +415 -0
  29. arcwind-1.0.0/src/arcwind/plotting/maps.py +228 -0
  30. arcwind-1.0.0/src/arcwind/plotting/other.py +138 -0
  31. arcwind-1.0.0/src/arcwind/plotting/pv.py +188 -0
  32. arcwind-1.0.0/src/arcwind/pv.py +81 -0
  33. arcwind-1.0.0/src/arcwind/ringfit.py +433 -0
  34. arcwind-1.0.0/src/arcwind/rotation.py +269 -0
  35. arcwind-1.0.0/src/arcwind/trace.py +426 -0
  36. arcwind-1.0.0/src/arcwind.egg-info/PKG-INFO +241 -0
  37. arcwind-1.0.0/src/arcwind.egg-info/SOURCES.txt +47 -0
  38. arcwind-1.0.0/src/arcwind.egg-info/dependency_links.txt +1 -0
  39. arcwind-1.0.0/src/arcwind.egg-info/entry_points.txt +2 -0
  40. arcwind-1.0.0/src/arcwind.egg-info/requires.txt +25 -0
  41. arcwind-1.0.0/src/arcwind.egg-info/top_level.txt +2 -0
  42. arcwind-1.0.0/tests/test_cli.py +11 -0
  43. arcwind-1.0.0/tests/test_config.py +62 -0
  44. arcwind-1.0.0/tests/test_lobes.py +76 -0
  45. arcwind-1.0.0/tests/test_model.py +83 -0
  46. arcwind-1.0.0/tests/test_pipeline.py +94 -0
  47. arcwind-1.0.0/tests/test_plotting_labels.py +15 -0
  48. arcwind-1.0.0/tests/test_ring_mode.py +77 -0
  49. arcwind-1.0.0/tests/test_rotation.py +68 -0
arcwind-1.0.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Charles J. Law
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
arcwind-1.0.0/PKG-INFO ADDED
@@ -0,0 +1,241 @@
1
+ Metadata-Version: 2.1
2
+ Name: arcwind
3
+ Version: 1.0.0
4
+ Summary: arcwind (Analysis of Resolved Conical Winds In Nascent Disks): geometry and kinematics of protoplanetary disk winds from transverse position-velocity diagrams
5
+ Author: Charles J. Law
6
+ License: MIT
7
+ Project-URL: Documentation, https://claw-astro.github.io/arcwind/
8
+ Project-URL: Source, https://github.com/claw-astro/arcwind
9
+ Project-URL: Issues, https://github.com/claw-astro/arcwind/issues
10
+ Project-URL: Changelog, https://claw-astro.github.io/arcwind/changelog.html
11
+ Keywords: astronomy,protoplanetary disks,disk winds,ALMA,kinematics
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Intended Audience :: Science/Research
19
+ Classifier: Topic :: Scientific/Engineering :: Astronomy
20
+ Classifier: License :: OSI Approved :: MIT License
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: numpy>=1.21
25
+ Requires-Dist: scipy>=1.7
26
+ Requires-Dist: matplotlib>=3.5
27
+ Requires-Dist: tomli>=1.1; python_version < "3.11"
28
+ Provides-Extra: fits
29
+ Requires-Dist: astropy>=5; extra == "fits"
30
+ Provides-Extra: yaml
31
+ Requires-Dist: pyyaml>=6; extra == "yaml"
32
+ Provides-Extra: docs
33
+ Requires-Dist: sphinx>=7; extra == "docs"
34
+ Requires-Dist: furo; extra == "docs"
35
+ Requires-Dist: numpydoc; extra == "docs"
36
+ Provides-Extra: test
37
+ Requires-Dist: pytest>=7; extra == "test"
38
+ Provides-Extra: all
39
+ Requires-Dist: astropy>=5; extra == "all"
40
+ Requires-Dist: pyyaml>=6; extra == "all"
41
+ Requires-Dist: cmasher; extra == "all"
42
+
43
+ <p align="center">
44
+ <picture>
45
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/claw-astro/arcwind/main/docs/_static/logo/arcwind-banner-dark-transparent.svg">
46
+ <img alt="arcwind" src="https://raw.githubusercontent.com/claw-astro/arcwind/main/docs/_static/logo/arcwind-banner-light-transparent.svg" width="420">
47
+ </picture>
48
+ </p>
49
+
50
+ [![tests](https://github.com/claw-astro/arcwind/actions/workflows/tests.yml/badge.svg)](https://github.com/claw-astro/arcwind/actions/workflows/tests.yml)
51
+ [![docs](https://github.com/claw-astro/arcwind/actions/workflows/docs.yml/badge.svg)](https://claw-astro.github.io/arcwind/)
52
+ [![PyPI](https://img.shields.io/pypi/v/arcwind.svg)](https://pypi.org/project/arcwind/)
53
+ [![Python](https://img.shields.io/pypi/pyversions/arcwind.svg)](https://pypi.org/project/arcwind/)
54
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/claw-astro/arcwind/blob/main/LICENSE)
55
+
56
+ **arcwind** (Analysis of Resolved Conical Winds In Nascent Disks) measures the
57
+ geometry and kinematics of protoplanetary disk winds from molecular-line cubes (e.g. ALMA CO). It fits a rotating, expanding
58
+ **conical wind** to the position–velocity (PV) diagrams of many cuts taken
59
+ perpendicular to the wind axis, and returns the cone, the velocity field, the
60
+ specific angular momentum, and the mass and mass-loss rate of the wind.
61
+
62
+ ![Definitions of the conical wind model, drawn for the Elias 2-20 wind](https://raw.githubusercontent.com/claw-astro/arcwind/main/docs/_static/model_definitions.png)
63
+
64
+ ## Statement of need
65
+
66
+ Winds launched from protoplanetary disks are thought to remove mass and angular
67
+ momentum from the disk, and so to drive its accretion, evolution and dispersal.
68
+ ALMA now resolves these winds in molecular lines such as CO, as conical shells
69
+ rising above the disk. Their geometry (opening angle and launch region), velocity
70
+ field, specific angular momentum and mass-loss rate are the quantities that test
71
+ wind models, but measuring them from a line cube takes careful modeling.
72
+
73
+ The established approach (Louvet et al. 2018, for HH 30) fits the rings seen in
74
+ position-velocity diagrams of cuts across the wind, one cut at a time. It assumes
75
+ an edge-on source and complete, well-separated rings. Most disk winds do not meet
76
+ these conditions: they are seen at intermediate inclinations, often only one half
77
+ of each ring is detected, and disk or cloud emission overlaps them. Such
78
+ analyses have so far relied on source-specific scripts.
79
+
80
+ arcwind provides a general, tested and documented implementation. It fits one
81
+ wind model to all cuts at once, at any inclination, which works with partial
82
+ rings and with one or both lobes. It offers a choice of velocity, radial-velocity
83
+ and rotation laws with model comparison and bootstrap uncertainties, masks
84
+ contaminating emission, derives the mass and mass-loss rate, and makes synthetic
85
+ cubes for testing the method and planning observations.
86
+
87
+ arcwind is intended for astronomers analyzing spatially resolved line
88
+ observations of winds and outflows from young stars and their disks (ALMA,
89
+ NOEMA and similar interferometers), and for modelers who want to compare wind
90
+ models with such observations in the same framework. It has been applied to the
91
+ 12CO wind of the Elias 2-20 disk.
92
+
93
+ ## What it does
94
+
95
+ arcwind generalizes the method of
96
+ [Louvet et al. (2018)](https://ui.adsabs.harvard.edu/abs/2018A%26A...618A.120L)
97
+ for the edge-on HH 30 outflow:
98
+
99
+ - **any inclination** — the exact intersection of the cone with every cut is
100
+ computed, so inclined winds can be fitted;
101
+ - **partially detected rings** — e.g. when only the red-shifted half of each ring
102
+ is seen: one model is fitted to all cuts at once;
103
+ - **bipolar winds** — one mirror-symmetric wind fitted to both lobes, or each
104
+ lobe on its own;
105
+ - **flexible models** — constant, power-law or broken power-law velocities (or
106
+ your own law), flow along the cone or a free radial velocity, constant or
107
+ height-dependent angular momentum;
108
+ - **checks and outputs** — noise and disk-rotation checks, bootstrap
109
+ uncertainties, model comparison, mass and mass-loss rates, publication figures,
110
+ and synthetic cubes (Elias 2-20-like and HH 30-like) to test the method.
111
+
112
+ ## Installation
113
+
114
+ ```bash
115
+ pip install arcwind # numpy, scipy, matplotlib
116
+ pip install "arcwind[all]" # + astropy (FITS), pyyaml, cmasher
117
+ ```
118
+
119
+ Or, for a development copy with the tests:
120
+
121
+ ```bash
122
+ git clone https://github.com/claw-astro/arcwind.git
123
+ cd arcwind
124
+ pip install -e ".[all]" # numpy, scipy, matplotlib + astropy, pyyaml, cmasher
125
+ pytest # ~20 s, on synthetic cubes
126
+ ```
127
+
128
+ Python 3.10 or later.
129
+
130
+ ## Quick start
131
+
132
+ Write a configuration and fill in the `[source]` block (cube, distance, stellar
133
+ mass, inclination, position angles):
134
+
135
+ ```bash
136
+ arcwind init mysource.toml
137
+ arcwind check mysource.toml # noise channels and disk rotation sense
138
+ arcwind run mysource.toml # fits, mass, derived quantities, figures
139
+ ```
140
+
141
+ Or step by step in Python:
142
+
143
+ ```python
144
+ from arcwind import WindAnalysis
145
+
146
+ wa = WindAnalysis("mysource.toml")
147
+ first = wa.fit("power-law", n_boot=0) # quick first fit
148
+ final = wa.fit("broken-power-law", guide=first, # traces around it
149
+ start_from=first, iterations=2)
150
+ wa.compare(first, final) # chi2 and BIC
151
+ print(final.summary())
152
+
153
+ mass = wa.mass(final)
154
+ print(wa.derived(final, mass).summary()) # Vp, launch radius, Mdot ...
155
+ wa.plot_cuts(final, others=[first]) # every cut with the model
156
+ ```
157
+
158
+ Every option can be set in the configuration file, on the configuration object,
159
+ or for one call — `arcwind options` lists them all:
160
+
161
+ ```python
162
+ wa.fit(radial="proportional", fixed={"xslope": 0.0}, loss="soft_l1", lobe="both")
163
+ ```
164
+
165
+ No data at hand? `arcwind mock` (or `arcwind mock --preset hh30`) writes a
166
+ synthetic cube and a matching configuration.
167
+
168
+ ## Examples
169
+
170
+ | | |
171
+ |---|---|
172
+ | [`01_quickstart_mock.py`](https://github.com/claw-astro/arcwind/blob/main/examples/01_quickstart_mock.py) | a synthetic wind, fitted and compared with the truth |
173
+ | [`02_elias20_analysis.py`](https://github.com/claw-astro/arcwind/blob/main/examples/02_elias20_analysis.py) | the Elias 2-20 analysis, step by step |
174
+ | [`03_fitting_options.py`](https://github.com/claw-astro/arcwind/blob/main/examples/03_fitting_options.py) | every fitting option, on and off |
175
+ | [`04_custom_velocity_law.py`](https://github.com/claw-astro/arcwind/blob/main/examples/04_custom_velocity_law.py) | your own velocity law |
176
+ | [`05_ring_fits_full_rings.py`](https://github.com/claw-astro/arcwind/blob/main/examples/05_ring_fits_full_rings.py) | per-cut ring fits (Louvet et al. 2018) |
177
+ | [`06_low_level_api.py`](https://github.com/claw-astro/arcwind/blob/main/examples/06_low_level_api.py) | the building blocks |
178
+ | [`07_hh30_like_both_lobes.py`](https://github.com/claw-astro/arcwind/blob/main/examples/07_hh30_like_both_lobes.py) | an HH 30-like bipolar wind |
179
+ | [`08`–`10`](https://github.com/claw-astro/arcwind/tree/main/examples/) | schematic figures of the model |
180
+ | [`11_elias20_cut_range_test.py`](https://github.com/claw-astro/arcwind/blob/main/examples/11_elias20_cut_range_test.py) | Elias 2-20: all cuts vs cuts up to y = 2.0" |
181
+
182
+ ## Documentation
183
+
184
+ The documentation (concepts, the analysis step by step, every fitting option,
185
+ the configuration reference, tutorials and the API) is in [`docs/`](https://github.com/claw-astro/arcwind/tree/main/docs) and
186
+ is published at **https://claw-astro.github.io/arcwind/** (or Read the Docs).
187
+ Build it locally with:
188
+
189
+ ```bash
190
+ pip install -e ".[docs]"
191
+ sphinx-build docs docs/_build/html
192
+ ```
193
+
194
+ ## Repository layout
195
+
196
+ ```
197
+ src/arcwind/ the package
198
+ config.py settings (WindConfig) cube.py cube and PV diagrams
199
+ masks.py contamination masks trace.py trace extraction
200
+ laws.py velocity laws model.py the conical wind
201
+ fitting.py global fit and results ringfit.py per-cut ring fits
202
+ mass.py mass and mass-loss rate derived.py derived quantities
203
+ continuum.py disk center from continuum diagnostics.py noise and rotation checks
204
+ mock.py synthetic cubes analysis.py WindAnalysis (all steps)
205
+ plotting/ figures cli.py the `arcwind` command
206
+ examples/ runnable examples and configurations
207
+ docs/ Sphinx documentation
208
+ tests/ pytest suite
209
+ ```
210
+
211
+ ## Citing
212
+
213
+ If you use arcwind, please cite the software (GitHub: "Cite this repository",
214
+ from [`CITATION.cff`](https://github.com/claw-astro/arcwind/blob/main/CITATION.cff))
215
+ and Louvet et al. (2018, A&A 618, A120), whose method arcwind generalizes.
216
+
217
+ ## Contributing, support and governance
218
+
219
+ Questions, bug reports and contributions are welcome through the
220
+ [issue tracker](https://github.com/claw-astro/arcwind/issues).
221
+
222
+ - [CONTRIBUTING.md](https://github.com/claw-astro/arcwind/blob/main/CONTRIBUTING.md): how to report a problem, set up a
223
+ development copy, and propose a change (tests, style, pull requests).
224
+ - [SUPPORT.md](https://github.com/claw-astro/arcwind/blob/main/SUPPORT.md): where to get help and what response to expect.
225
+ - [GOVERNANCE.md](https://github.com/claw-astro/arcwind/blob/main/GOVERNANCE.md): who maintains the package and how decisions
226
+ and releases are made.
227
+ - [CODE_OF_CONDUCT.md](https://github.com/claw-astro/arcwind/blob/main/CODE_OF_CONDUCT.md): the Code of Conduct.
228
+
229
+ ## Acknowledgments
230
+
231
+ Portions of this package—including initial scaffolding, unit tests, code
232
+ refactoring, figure generation, and documentation—were developed with assistance
233
+ from Claude (Opus 5.5) by Anthropic. All code has been reviewed and tested by the
234
+ maintainers. The human authors reviewed, edited and validated all AI-assisted
235
+ outputs, and made the core design decisions: the scientific method, the wind
236
+ model and its parameterization, the fitting and uncertainty strategy, and the
237
+ structure and interfaces of the package.
238
+
239
+ ## License
240
+
241
+ MIT — see [LICENSE](https://github.com/claw-astro/arcwind/blob/main/LICENSE).
@@ -0,0 +1,199 @@
1
+ <p align="center">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/claw-astro/arcwind/main/docs/_static/logo/arcwind-banner-dark-transparent.svg">
4
+ <img alt="arcwind" src="https://raw.githubusercontent.com/claw-astro/arcwind/main/docs/_static/logo/arcwind-banner-light-transparent.svg" width="420">
5
+ </picture>
6
+ </p>
7
+
8
+ [![tests](https://github.com/claw-astro/arcwind/actions/workflows/tests.yml/badge.svg)](https://github.com/claw-astro/arcwind/actions/workflows/tests.yml)
9
+ [![docs](https://github.com/claw-astro/arcwind/actions/workflows/docs.yml/badge.svg)](https://claw-astro.github.io/arcwind/)
10
+ [![PyPI](https://img.shields.io/pypi/v/arcwind.svg)](https://pypi.org/project/arcwind/)
11
+ [![Python](https://img.shields.io/pypi/pyversions/arcwind.svg)](https://pypi.org/project/arcwind/)
12
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/claw-astro/arcwind/blob/main/LICENSE)
13
+
14
+ **arcwind** (Analysis of Resolved Conical Winds In Nascent Disks) measures the
15
+ geometry and kinematics of protoplanetary disk winds from molecular-line cubes (e.g. ALMA CO). It fits a rotating, expanding
16
+ **conical wind** to the position–velocity (PV) diagrams of many cuts taken
17
+ perpendicular to the wind axis, and returns the cone, the velocity field, the
18
+ specific angular momentum, and the mass and mass-loss rate of the wind.
19
+
20
+ ![Definitions of the conical wind model, drawn for the Elias 2-20 wind](https://raw.githubusercontent.com/claw-astro/arcwind/main/docs/_static/model_definitions.png)
21
+
22
+ ## Statement of need
23
+
24
+ Winds launched from protoplanetary disks are thought to remove mass and angular
25
+ momentum from the disk, and so to drive its accretion, evolution and dispersal.
26
+ ALMA now resolves these winds in molecular lines such as CO, as conical shells
27
+ rising above the disk. Their geometry (opening angle and launch region), velocity
28
+ field, specific angular momentum and mass-loss rate are the quantities that test
29
+ wind models, but measuring them from a line cube takes careful modeling.
30
+
31
+ The established approach (Louvet et al. 2018, for HH 30) fits the rings seen in
32
+ position-velocity diagrams of cuts across the wind, one cut at a time. It assumes
33
+ an edge-on source and complete, well-separated rings. Most disk winds do not meet
34
+ these conditions: they are seen at intermediate inclinations, often only one half
35
+ of each ring is detected, and disk or cloud emission overlaps them. Such
36
+ analyses have so far relied on source-specific scripts.
37
+
38
+ arcwind provides a general, tested and documented implementation. It fits one
39
+ wind model to all cuts at once, at any inclination, which works with partial
40
+ rings and with one or both lobes. It offers a choice of velocity, radial-velocity
41
+ and rotation laws with model comparison and bootstrap uncertainties, masks
42
+ contaminating emission, derives the mass and mass-loss rate, and makes synthetic
43
+ cubes for testing the method and planning observations.
44
+
45
+ arcwind is intended for astronomers analyzing spatially resolved line
46
+ observations of winds and outflows from young stars and their disks (ALMA,
47
+ NOEMA and similar interferometers), and for modelers who want to compare wind
48
+ models with such observations in the same framework. It has been applied to the
49
+ 12CO wind of the Elias 2-20 disk.
50
+
51
+ ## What it does
52
+
53
+ arcwind generalizes the method of
54
+ [Louvet et al. (2018)](https://ui.adsabs.harvard.edu/abs/2018A%26A...618A.120L)
55
+ for the edge-on HH 30 outflow:
56
+
57
+ - **any inclination** — the exact intersection of the cone with every cut is
58
+ computed, so inclined winds can be fitted;
59
+ - **partially detected rings** — e.g. when only the red-shifted half of each ring
60
+ is seen: one model is fitted to all cuts at once;
61
+ - **bipolar winds** — one mirror-symmetric wind fitted to both lobes, or each
62
+ lobe on its own;
63
+ - **flexible models** — constant, power-law or broken power-law velocities (or
64
+ your own law), flow along the cone or a free radial velocity, constant or
65
+ height-dependent angular momentum;
66
+ - **checks and outputs** — noise and disk-rotation checks, bootstrap
67
+ uncertainties, model comparison, mass and mass-loss rates, publication figures,
68
+ and synthetic cubes (Elias 2-20-like and HH 30-like) to test the method.
69
+
70
+ ## Installation
71
+
72
+ ```bash
73
+ pip install arcwind # numpy, scipy, matplotlib
74
+ pip install "arcwind[all]" # + astropy (FITS), pyyaml, cmasher
75
+ ```
76
+
77
+ Or, for a development copy with the tests:
78
+
79
+ ```bash
80
+ git clone https://github.com/claw-astro/arcwind.git
81
+ cd arcwind
82
+ pip install -e ".[all]" # numpy, scipy, matplotlib + astropy, pyyaml, cmasher
83
+ pytest # ~20 s, on synthetic cubes
84
+ ```
85
+
86
+ Python 3.10 or later.
87
+
88
+ ## Quick start
89
+
90
+ Write a configuration and fill in the `[source]` block (cube, distance, stellar
91
+ mass, inclination, position angles):
92
+
93
+ ```bash
94
+ arcwind init mysource.toml
95
+ arcwind check mysource.toml # noise channels and disk rotation sense
96
+ arcwind run mysource.toml # fits, mass, derived quantities, figures
97
+ ```
98
+
99
+ Or step by step in Python:
100
+
101
+ ```python
102
+ from arcwind import WindAnalysis
103
+
104
+ wa = WindAnalysis("mysource.toml")
105
+ first = wa.fit("power-law", n_boot=0) # quick first fit
106
+ final = wa.fit("broken-power-law", guide=first, # traces around it
107
+ start_from=first, iterations=2)
108
+ wa.compare(first, final) # chi2 and BIC
109
+ print(final.summary())
110
+
111
+ mass = wa.mass(final)
112
+ print(wa.derived(final, mass).summary()) # Vp, launch radius, Mdot ...
113
+ wa.plot_cuts(final, others=[first]) # every cut with the model
114
+ ```
115
+
116
+ Every option can be set in the configuration file, on the configuration object,
117
+ or for one call — `arcwind options` lists them all:
118
+
119
+ ```python
120
+ wa.fit(radial="proportional", fixed={"xslope": 0.0}, loss="soft_l1", lobe="both")
121
+ ```
122
+
123
+ No data at hand? `arcwind mock` (or `arcwind mock --preset hh30`) writes a
124
+ synthetic cube and a matching configuration.
125
+
126
+ ## Examples
127
+
128
+ | | |
129
+ |---|---|
130
+ | [`01_quickstart_mock.py`](https://github.com/claw-astro/arcwind/blob/main/examples/01_quickstart_mock.py) | a synthetic wind, fitted and compared with the truth |
131
+ | [`02_elias20_analysis.py`](https://github.com/claw-astro/arcwind/blob/main/examples/02_elias20_analysis.py) | the Elias 2-20 analysis, step by step |
132
+ | [`03_fitting_options.py`](https://github.com/claw-astro/arcwind/blob/main/examples/03_fitting_options.py) | every fitting option, on and off |
133
+ | [`04_custom_velocity_law.py`](https://github.com/claw-astro/arcwind/blob/main/examples/04_custom_velocity_law.py) | your own velocity law |
134
+ | [`05_ring_fits_full_rings.py`](https://github.com/claw-astro/arcwind/blob/main/examples/05_ring_fits_full_rings.py) | per-cut ring fits (Louvet et al. 2018) |
135
+ | [`06_low_level_api.py`](https://github.com/claw-astro/arcwind/blob/main/examples/06_low_level_api.py) | the building blocks |
136
+ | [`07_hh30_like_both_lobes.py`](https://github.com/claw-astro/arcwind/blob/main/examples/07_hh30_like_both_lobes.py) | an HH 30-like bipolar wind |
137
+ | [`08`–`10`](https://github.com/claw-astro/arcwind/tree/main/examples/) | schematic figures of the model |
138
+ | [`11_elias20_cut_range_test.py`](https://github.com/claw-astro/arcwind/blob/main/examples/11_elias20_cut_range_test.py) | Elias 2-20: all cuts vs cuts up to y = 2.0" |
139
+
140
+ ## Documentation
141
+
142
+ The documentation (concepts, the analysis step by step, every fitting option,
143
+ the configuration reference, tutorials and the API) is in [`docs/`](https://github.com/claw-astro/arcwind/tree/main/docs) and
144
+ is published at **https://claw-astro.github.io/arcwind/** (or Read the Docs).
145
+ Build it locally with:
146
+
147
+ ```bash
148
+ pip install -e ".[docs]"
149
+ sphinx-build docs docs/_build/html
150
+ ```
151
+
152
+ ## Repository layout
153
+
154
+ ```
155
+ src/arcwind/ the package
156
+ config.py settings (WindConfig) cube.py cube and PV diagrams
157
+ masks.py contamination masks trace.py trace extraction
158
+ laws.py velocity laws model.py the conical wind
159
+ fitting.py global fit and results ringfit.py per-cut ring fits
160
+ mass.py mass and mass-loss rate derived.py derived quantities
161
+ continuum.py disk center from continuum diagnostics.py noise and rotation checks
162
+ mock.py synthetic cubes analysis.py WindAnalysis (all steps)
163
+ plotting/ figures cli.py the `arcwind` command
164
+ examples/ runnable examples and configurations
165
+ docs/ Sphinx documentation
166
+ tests/ pytest suite
167
+ ```
168
+
169
+ ## Citing
170
+
171
+ If you use arcwind, please cite the software (GitHub: "Cite this repository",
172
+ from [`CITATION.cff`](https://github.com/claw-astro/arcwind/blob/main/CITATION.cff))
173
+ and Louvet et al. (2018, A&A 618, A120), whose method arcwind generalizes.
174
+
175
+ ## Contributing, support and governance
176
+
177
+ Questions, bug reports and contributions are welcome through the
178
+ [issue tracker](https://github.com/claw-astro/arcwind/issues).
179
+
180
+ - [CONTRIBUTING.md](https://github.com/claw-astro/arcwind/blob/main/CONTRIBUTING.md): how to report a problem, set up a
181
+ development copy, and propose a change (tests, style, pull requests).
182
+ - [SUPPORT.md](https://github.com/claw-astro/arcwind/blob/main/SUPPORT.md): where to get help and what response to expect.
183
+ - [GOVERNANCE.md](https://github.com/claw-astro/arcwind/blob/main/GOVERNANCE.md): who maintains the package and how decisions
184
+ and releases are made.
185
+ - [CODE_OF_CONDUCT.md](https://github.com/claw-astro/arcwind/blob/main/CODE_OF_CONDUCT.md): the Code of Conduct.
186
+
187
+ ## Acknowledgments
188
+
189
+ Portions of this package—including initial scaffolding, unit tests, code
190
+ refactoring, figure generation, and documentation—were developed with assistance
191
+ from Claude (Opus 5.5) by Anthropic. All code has been reviewed and tested by the
192
+ maintainers. The human authors reviewed, edited and validated all AI-assisted
193
+ outputs, and made the core design decisions: the scientific method, the wind
194
+ model and its parameterization, the fitting and uncertainty strategy, and the
195
+ structure and interfaces of the package.
196
+
197
+ ## License
198
+
199
+ MIT — see [LICENSE](https://github.com/claw-astro/arcwind/blob/main/LICENSE).
@@ -0,0 +1,55 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "arcwind"
7
+ dynamic = ["version"]
8
+ description = "arcwind (Analysis of Resolved Conical Winds In Nascent Disks): geometry and kinematics of protoplanetary disk winds from transverse position-velocity diagrams"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = {text = "MIT"}
12
+ authors = [{name = "Charles J. Law"}]
13
+ keywords = ["astronomy", "protoplanetary disks", "disk winds", "ALMA", "kinematics"]
14
+ classifiers = [
15
+ "Development Status :: 5 - Production/Stable",
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3.10",
18
+ "Programming Language :: Python :: 3.11",
19
+ "Programming Language :: Python :: 3.12",
20
+ "Programming Language :: Python :: 3.13",
21
+ "Intended Audience :: Science/Research",
22
+ "Topic :: Scientific/Engineering :: Astronomy",
23
+ "License :: OSI Approved :: MIT License",
24
+ ]
25
+ dependencies = ["numpy>=1.21", "scipy>=1.7", "matplotlib>=3.5", "tomli>=1.1; python_version<'3.11'"]
26
+
27
+ [project.optional-dependencies]
28
+ fits = ["astropy>=5"]
29
+ yaml = ["pyyaml>=6"]
30
+ docs = ["sphinx>=7", "furo", "numpydoc"]
31
+ test = ["pytest>=7"]
32
+ all = ["astropy>=5", "pyyaml>=6", "cmasher"]
33
+
34
+ [project.scripts]
35
+ arcwind = "arcwind.cli:main"
36
+
37
+ [project.urls]
38
+ Documentation = "https://claw-astro.github.io/arcwind/"
39
+ Source = "https://github.com/claw-astro/arcwind"
40
+ Issues = "https://github.com/claw-astro/arcwind/issues"
41
+ Changelog = "https://claw-astro.github.io/arcwind/changelog.html"
42
+
43
+ [tool.setuptools.dynamic]
44
+ version = {attr = "arcwind._version.__version__"}
45
+
46
+ [tool.setuptools.packages.find]
47
+ where = ["src"]
48
+
49
+ [tool.setuptools.package-data]
50
+ arcwind = ["data/*.toml"]
51
+
52
+ [tool.pytest.ini_options]
53
+ testpaths = ["tests"]
54
+ addopts = "--doctest-modules --doctest-glob='*.rst' -p no:cacheprovider"
55
+ doctest_optionflags = ["ELLIPSIS", "NORMALIZE_WHITESPACE", "NUMBER"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,49 @@
1
+ """
2
+ arcwind -- geometry and kinematics of disk winds from transverse
3
+ position-velocity diagrams.
4
+
5
+ The method of Louvet et al. (2018, A&A 618, A120) for the edge-on HH 30
6
+ outflow, generalized to any inclination, to partially detected rings and to
7
+ flexible velocity laws: a conical wind is fitted to the traces of many cuts at
8
+ once.
9
+
10
+ Quick start
11
+ -----------
12
+ >>> from arcwind import WindAnalysis
13
+ >>> wa = WindAnalysis("mysource.toml") # doctest: +SKIP
14
+ >>> res = wa.fit() # doctest: +SKIP
15
+ >>> print(res.summary()) # doctest: +SKIP
16
+
17
+ Main classes
18
+ ------------
19
+ :class:`WindConfig` all settings (TOML/YAML/JSON/Python)
20
+ :class:`WindAnalysis` the analysis, step by step or ``run()``
21
+ :class:`WindCube` the resampled cube and its PV diagrams
22
+ :class:`TraceExtractor` traces of the emission in the PV diagrams
23
+ :class:`ConicalWindModel` the model (geometry + velocity laws)
24
+ :class:`GlobalFitter` fit of the model to all cuts; returns :class:`FitResult`
25
+ :class:`RingFitter` independent per-cut ring fits (full rings)
26
+ :class:`MassAnalysis` mass and mass-loss rate
27
+ :func:`fit_disk_center` disk center from a continuum image
28
+ """
29
+ from ._version import __version__
30
+ from .analysis import WindAnalysis
31
+ from .config import WindConfig
32
+ from .continuum import fit_disk_center
33
+ from .cube import WindCube
34
+ from .derived import WindProperties
35
+ from .fitting import FitResult, GlobalFitter, compare_fits
36
+ from .geometry import ViewGeometry
37
+ from .laws import VelocityLaw, available_laws, register_law
38
+ from .mass import MassAnalysis, MassResult
39
+ from .model import ConicalWindModel, ModelCurve
40
+ from .pv import PVDiagram
41
+ from .ringfit import RingFitter
42
+ from .rotation import RotationProfile, rotation_per_cut
43
+ from .trace import Trace, TraceExtractor
44
+
45
+ __all__ = ["__version__", "WindAnalysis", "WindConfig", "WindCube", "PVDiagram", "Trace",
46
+ "TraceExtractor", "ConicalWindModel", "ModelCurve", "ViewGeometry",
47
+ "GlobalFitter", "FitResult", "compare_fits", "RingFitter", "MassAnalysis",
48
+ "MassResult", "WindProperties", "VelocityLaw", "register_law", "available_laws",
49
+ "fit_disk_center", "RotationProfile", "rotation_per_cut"]
@@ -0,0 +1 @@
1
+ __version__ = "1.0.0"