lfit-rs 0.2.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.
- lfit_rs-0.2.0/.github/workflows/python_publish.yml +83 -0
- lfit_rs-0.2.0/.gitignore +1 -0
- lfit_rs-0.2.0/Cargo.lock +319 -0
- lfit_rs-0.2.0/Cargo.toml +21 -0
- lfit_rs-0.2.0/LICENSE +11 -0
- lfit_rs-0.2.0/PKG-INFO +5 -0
- lfit_rs-0.2.0/README.md +91 -0
- lfit_rs-0.2.0/pyproject.toml +14 -0
- lfit_rs-0.2.0/python/lfit_rs/__init__.py +7 -0
- lfit_rs-0.2.0/python/lfit_rs/cv.py +297 -0
- lfit_rs-0.2.0/setup.cfg +8 -0
- lfit_rs-0.2.0/src/blink.rs +196 -0
- lfit_rs-0.2.0/src/brightspot.rs +446 -0
- lfit_rs-0.2.0/src/disc.rs +214 -0
- lfit_rs-0.2.0/src/donor.rs +276 -0
- lfit_rs-0.2.0/src/lib.rs +32 -0
- lfit_rs-0.2.0/src/solve_triads.rs +160 -0
- lfit_rs-0.2.0/src/whitedwarf.rs +318 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# This workflow will upload a Python Package to PyPI when a release is created
|
|
2
|
+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
|
|
3
|
+
|
|
4
|
+
# This workflow uses actions that are not certified by GitHub.
|
|
5
|
+
# They are provided by a third-party and are governed by
|
|
6
|
+
# separate terms of service, privacy policy, and support
|
|
7
|
+
# documentation.
|
|
8
|
+
|
|
9
|
+
name: Build and publish Rust Python extension Package
|
|
10
|
+
|
|
11
|
+
on:
|
|
12
|
+
release:
|
|
13
|
+
types: [published]
|
|
14
|
+
workflow_dispatch:
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
build-wheels:
|
|
18
|
+
name: Build wheels on ${{ matrix.os }}
|
|
19
|
+
runs-on: ${{ matrix.os }}
|
|
20
|
+
|
|
21
|
+
strategy:
|
|
22
|
+
matrix:
|
|
23
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
24
|
+
|
|
25
|
+
steps:
|
|
26
|
+
- uses: actions/checkout@v4
|
|
27
|
+
|
|
28
|
+
- name: Build wheels
|
|
29
|
+
uses: PyO3/maturin-action@v1
|
|
30
|
+
with:
|
|
31
|
+
command: build
|
|
32
|
+
args: --release --out dist
|
|
33
|
+
|
|
34
|
+
- name: Upload wheels
|
|
35
|
+
uses: actions/upload-artifact@v4
|
|
36
|
+
with:
|
|
37
|
+
name: wheels-${{ matrix.os }}
|
|
38
|
+
path: dist
|
|
39
|
+
|
|
40
|
+
build-sdist:
|
|
41
|
+
name: Build source distribution
|
|
42
|
+
runs-on: ubuntu-latest
|
|
43
|
+
|
|
44
|
+
steps:
|
|
45
|
+
- uses: actions/checkout@v4
|
|
46
|
+
|
|
47
|
+
- name: Build sdist
|
|
48
|
+
uses: PyO3/maturin-action@v1
|
|
49
|
+
with:
|
|
50
|
+
command: sdist
|
|
51
|
+
args: --out dist
|
|
52
|
+
|
|
53
|
+
- name: Upload sdist
|
|
54
|
+
uses: actions/upload-artifact@v4
|
|
55
|
+
with:
|
|
56
|
+
name: sdist
|
|
57
|
+
path: dist
|
|
58
|
+
|
|
59
|
+
pypi-publish:
|
|
60
|
+
runs-on: ubuntu-latest
|
|
61
|
+
needs: [build-wheels, build-sdist]
|
|
62
|
+
|
|
63
|
+
permissions:
|
|
64
|
+
contents: read
|
|
65
|
+
id-token: write
|
|
66
|
+
|
|
67
|
+
steps:
|
|
68
|
+
- name: Download all artifacts
|
|
69
|
+
uses: actions/download-artifact@v4
|
|
70
|
+
with:
|
|
71
|
+
path: dist
|
|
72
|
+
|
|
73
|
+
- name: Collect all distributions
|
|
74
|
+
run: |
|
|
75
|
+
mkdir -p final_dist
|
|
76
|
+
find dist -type f -name "*.whl" -exec mv {} final_dist \;
|
|
77
|
+
find dist -type f -name "*.tar.gz" -exec mv {} final_dist \;
|
|
78
|
+
|
|
79
|
+
- name: Publish to PyPI
|
|
80
|
+
uses: PyO3/maturin-action@v1
|
|
81
|
+
with:
|
|
82
|
+
command: upload
|
|
83
|
+
args: --non-interactive final_dist/*
|
lfit_rs-0.2.0/.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/target
|
lfit_rs-0.2.0/Cargo.lock
ADDED
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 4
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "autocfg"
|
|
7
|
+
version = "1.5.1"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
|
|
10
|
+
|
|
11
|
+
[[package]]
|
|
12
|
+
name = "bulirsch"
|
|
13
|
+
version = "0.1.12"
|
|
14
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
15
|
+
checksum = "cdbb964461d0f1217e0dcfd69c2879c4318524c6650d149b410b962bbf0f7c87"
|
|
16
|
+
dependencies = [
|
|
17
|
+
"ndarray 0.16.1",
|
|
18
|
+
"num-traits",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
[[package]]
|
|
22
|
+
name = "crossbeam-deque"
|
|
23
|
+
version = "0.8.7"
|
|
24
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
25
|
+
checksum = "5181e0de7b61eb03a81e347d6dd8797bae9da5146707b51077e2d71a54ec0ceb"
|
|
26
|
+
dependencies = [
|
|
27
|
+
"crossbeam-epoch",
|
|
28
|
+
"crossbeam-utils",
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
[[package]]
|
|
32
|
+
name = "crossbeam-epoch"
|
|
33
|
+
version = "0.9.20"
|
|
34
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
35
|
+
checksum = "2d6914041f254d6e9176c01941b21115dcfb7089e55135a35411081bd106ef3f"
|
|
36
|
+
dependencies = [
|
|
37
|
+
"crossbeam-utils",
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
[[package]]
|
|
41
|
+
name = "crossbeam-utils"
|
|
42
|
+
version = "0.8.22"
|
|
43
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
44
|
+
checksum = "61803da095bee82a81bb1a452ecc25d3b2f1416d1897eb86430c6159ef717c17"
|
|
45
|
+
|
|
46
|
+
[[package]]
|
|
47
|
+
name = "either"
|
|
48
|
+
version = "1.17.0"
|
|
49
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
50
|
+
checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d"
|
|
51
|
+
|
|
52
|
+
[[package]]
|
|
53
|
+
name = "heck"
|
|
54
|
+
version = "0.5.0"
|
|
55
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
56
|
+
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
57
|
+
|
|
58
|
+
[[package]]
|
|
59
|
+
name = "lfit_rs"
|
|
60
|
+
version = "0.1.0"
|
|
61
|
+
dependencies = [
|
|
62
|
+
"numpy",
|
|
63
|
+
"pyo3",
|
|
64
|
+
"rayon",
|
|
65
|
+
"roche-rs",
|
|
66
|
+
]
|
|
67
|
+
|
|
68
|
+
[[package]]
|
|
69
|
+
name = "libc"
|
|
70
|
+
version = "0.2.189"
|
|
71
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
72
|
+
checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
|
|
73
|
+
|
|
74
|
+
[[package]]
|
|
75
|
+
name = "matrixmultiply"
|
|
76
|
+
version = "0.3.11"
|
|
77
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
78
|
+
checksum = "3f607c237553f086e7043417a51df26b2eb899d3caff94e6a67592ff992fedc7"
|
|
79
|
+
dependencies = [
|
|
80
|
+
"autocfg",
|
|
81
|
+
"rawpointer",
|
|
82
|
+
]
|
|
83
|
+
|
|
84
|
+
[[package]]
|
|
85
|
+
name = "ndarray"
|
|
86
|
+
version = "0.16.1"
|
|
87
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
88
|
+
checksum = "882ed72dce9365842bf196bdeedf5055305f11fc8c03dee7bb0194a6cad34841"
|
|
89
|
+
dependencies = [
|
|
90
|
+
"matrixmultiply",
|
|
91
|
+
"num-complex",
|
|
92
|
+
"num-integer",
|
|
93
|
+
"num-traits",
|
|
94
|
+
"portable-atomic",
|
|
95
|
+
"portable-atomic-util",
|
|
96
|
+
"rawpointer",
|
|
97
|
+
]
|
|
98
|
+
|
|
99
|
+
[[package]]
|
|
100
|
+
name = "ndarray"
|
|
101
|
+
version = "0.17.2"
|
|
102
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
103
|
+
checksum = "520080814a7a6b4a6e9070823bb24b4531daac8c4627e08ba5de8c5ef2f2752d"
|
|
104
|
+
dependencies = [
|
|
105
|
+
"matrixmultiply",
|
|
106
|
+
"num-complex",
|
|
107
|
+
"num-integer",
|
|
108
|
+
"num-traits",
|
|
109
|
+
"portable-atomic",
|
|
110
|
+
"portable-atomic-util",
|
|
111
|
+
"rawpointer",
|
|
112
|
+
]
|
|
113
|
+
|
|
114
|
+
[[package]]
|
|
115
|
+
name = "num-complex"
|
|
116
|
+
version = "0.4.6"
|
|
117
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
118
|
+
checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495"
|
|
119
|
+
dependencies = [
|
|
120
|
+
"num-traits",
|
|
121
|
+
]
|
|
122
|
+
|
|
123
|
+
[[package]]
|
|
124
|
+
name = "num-integer"
|
|
125
|
+
version = "0.1.47"
|
|
126
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
127
|
+
checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b"
|
|
128
|
+
dependencies = [
|
|
129
|
+
"num-traits",
|
|
130
|
+
]
|
|
131
|
+
|
|
132
|
+
[[package]]
|
|
133
|
+
name = "num-traits"
|
|
134
|
+
version = "0.2.19"
|
|
135
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
136
|
+
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
|
|
137
|
+
dependencies = [
|
|
138
|
+
"autocfg",
|
|
139
|
+
]
|
|
140
|
+
|
|
141
|
+
[[package]]
|
|
142
|
+
name = "numpy"
|
|
143
|
+
version = "0.28.0"
|
|
144
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
145
|
+
checksum = "778da78c64ddc928ebf5ad9df5edf0789410ff3bdbf3619aed51cd789a6af1e2"
|
|
146
|
+
dependencies = [
|
|
147
|
+
"libc",
|
|
148
|
+
"ndarray 0.17.2",
|
|
149
|
+
"num-complex",
|
|
150
|
+
"num-integer",
|
|
151
|
+
"num-traits",
|
|
152
|
+
"pyo3",
|
|
153
|
+
"pyo3-build-config",
|
|
154
|
+
"rustc-hash",
|
|
155
|
+
]
|
|
156
|
+
|
|
157
|
+
[[package]]
|
|
158
|
+
name = "once_cell"
|
|
159
|
+
version = "1.21.4"
|
|
160
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
161
|
+
checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
|
|
162
|
+
|
|
163
|
+
[[package]]
|
|
164
|
+
name = "portable-atomic"
|
|
165
|
+
version = "1.15.0"
|
|
166
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
167
|
+
checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"
|
|
168
|
+
|
|
169
|
+
[[package]]
|
|
170
|
+
name = "portable-atomic-util"
|
|
171
|
+
version = "0.2.7"
|
|
172
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
173
|
+
checksum = "c2a106d1259c23fac8e543272398ae0e3c0b8d33c88ed73d0cc71b0f1d902618"
|
|
174
|
+
dependencies = [
|
|
175
|
+
"portable-atomic",
|
|
176
|
+
]
|
|
177
|
+
|
|
178
|
+
[[package]]
|
|
179
|
+
name = "proc-macro2"
|
|
180
|
+
version = "1.0.107"
|
|
181
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
182
|
+
checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
|
|
183
|
+
dependencies = [
|
|
184
|
+
"unicode-ident",
|
|
185
|
+
]
|
|
186
|
+
|
|
187
|
+
[[package]]
|
|
188
|
+
name = "pyo3"
|
|
189
|
+
version = "0.28.3"
|
|
190
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
191
|
+
checksum = "91fd8e38a3b50ed1167fb981cd6fd60147e091784c427b8f7183a7ee32c31c12"
|
|
192
|
+
dependencies = [
|
|
193
|
+
"libc",
|
|
194
|
+
"once_cell",
|
|
195
|
+
"portable-atomic",
|
|
196
|
+
"pyo3-build-config",
|
|
197
|
+
"pyo3-ffi",
|
|
198
|
+
"pyo3-macros",
|
|
199
|
+
]
|
|
200
|
+
|
|
201
|
+
[[package]]
|
|
202
|
+
name = "pyo3-build-config"
|
|
203
|
+
version = "0.28.3"
|
|
204
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
205
|
+
checksum = "e368e7ddfdeb98c9bca7f8383be1648fd84ab466bf2bc015e94008db6d35611e"
|
|
206
|
+
dependencies = [
|
|
207
|
+
"target-lexicon",
|
|
208
|
+
]
|
|
209
|
+
|
|
210
|
+
[[package]]
|
|
211
|
+
name = "pyo3-ffi"
|
|
212
|
+
version = "0.28.3"
|
|
213
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
214
|
+
checksum = "7f29e10af80b1f7ccaf7f69eace800a03ecd13e883acfacc1e5d0988605f651e"
|
|
215
|
+
dependencies = [
|
|
216
|
+
"libc",
|
|
217
|
+
"pyo3-build-config",
|
|
218
|
+
]
|
|
219
|
+
|
|
220
|
+
[[package]]
|
|
221
|
+
name = "pyo3-macros"
|
|
222
|
+
version = "0.28.3"
|
|
223
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
224
|
+
checksum = "df6e520eff47c45997d2fc7dd8214b25dd1310918bbb2642156ef66a67f29813"
|
|
225
|
+
dependencies = [
|
|
226
|
+
"proc-macro2",
|
|
227
|
+
"pyo3-macros-backend",
|
|
228
|
+
"quote",
|
|
229
|
+
"syn",
|
|
230
|
+
]
|
|
231
|
+
|
|
232
|
+
[[package]]
|
|
233
|
+
name = "pyo3-macros-backend"
|
|
234
|
+
version = "0.28.3"
|
|
235
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
236
|
+
checksum = "c4cdc218d835738f81c2338f822078af45b4afdf8b2e33cbb5916f108b813acb"
|
|
237
|
+
dependencies = [
|
|
238
|
+
"heck",
|
|
239
|
+
"proc-macro2",
|
|
240
|
+
"pyo3-build-config",
|
|
241
|
+
"quote",
|
|
242
|
+
"syn",
|
|
243
|
+
]
|
|
244
|
+
|
|
245
|
+
[[package]]
|
|
246
|
+
name = "quote"
|
|
247
|
+
version = "1.0.47"
|
|
248
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
249
|
+
checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
|
|
250
|
+
dependencies = [
|
|
251
|
+
"proc-macro2",
|
|
252
|
+
]
|
|
253
|
+
|
|
254
|
+
[[package]]
|
|
255
|
+
name = "rawpointer"
|
|
256
|
+
version = "0.2.1"
|
|
257
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
258
|
+
checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3"
|
|
259
|
+
|
|
260
|
+
[[package]]
|
|
261
|
+
name = "rayon"
|
|
262
|
+
version = "1.12.0"
|
|
263
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
264
|
+
checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d"
|
|
265
|
+
dependencies = [
|
|
266
|
+
"either",
|
|
267
|
+
"rayon-core",
|
|
268
|
+
]
|
|
269
|
+
|
|
270
|
+
[[package]]
|
|
271
|
+
name = "rayon-core"
|
|
272
|
+
version = "1.13.0"
|
|
273
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
274
|
+
checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91"
|
|
275
|
+
dependencies = [
|
|
276
|
+
"crossbeam-deque",
|
|
277
|
+
"crossbeam-utils",
|
|
278
|
+
]
|
|
279
|
+
|
|
280
|
+
[[package]]
|
|
281
|
+
name = "roche-rs"
|
|
282
|
+
version = "0.5.4"
|
|
283
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
284
|
+
checksum = "c1bc3c4baadbf1c0a9df34a66f0b7d584d1d0d40a135c7b72ee8952214917ffa"
|
|
285
|
+
dependencies = [
|
|
286
|
+
"bulirsch",
|
|
287
|
+
"ndarray 0.16.1",
|
|
288
|
+
"numpy",
|
|
289
|
+
"pyo3",
|
|
290
|
+
]
|
|
291
|
+
|
|
292
|
+
[[package]]
|
|
293
|
+
name = "rustc-hash"
|
|
294
|
+
version = "2.1.3"
|
|
295
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
296
|
+
checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d"
|
|
297
|
+
|
|
298
|
+
[[package]]
|
|
299
|
+
name = "syn"
|
|
300
|
+
version = "2.0.119"
|
|
301
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
302
|
+
checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
|
|
303
|
+
dependencies = [
|
|
304
|
+
"proc-macro2",
|
|
305
|
+
"quote",
|
|
306
|
+
"unicode-ident",
|
|
307
|
+
]
|
|
308
|
+
|
|
309
|
+
[[package]]
|
|
310
|
+
name = "target-lexicon"
|
|
311
|
+
version = "0.13.5"
|
|
312
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
313
|
+
checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
|
|
314
|
+
|
|
315
|
+
[[package]]
|
|
316
|
+
name = "unicode-ident"
|
|
317
|
+
version = "1.0.24"
|
|
318
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
319
|
+
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
|
lfit_rs-0.2.0/Cargo.toml
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "lfit_rs"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
edition = "2024"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
[lib]
|
|
9
|
+
name = "lfit_rs"
|
|
10
|
+
# "cdylib" is necessary to produce a shared library for Python to import from.
|
|
11
|
+
crate-type = ["cdylib"]
|
|
12
|
+
|
|
13
|
+
[dependencies]
|
|
14
|
+
numpy = "0.28.0"
|
|
15
|
+
rayon = "1.11.0"
|
|
16
|
+
roche-rs = "0.5.4"
|
|
17
|
+
|
|
18
|
+
[dependencies.pyo3]
|
|
19
|
+
version = "0.28.2"
|
|
20
|
+
# "abi3-py38" tells pyo3 (and maturin) to build using the stable ABI with minimum Python version 3.8
|
|
21
|
+
features = ["abi3-py38"]
|
lfit_rs-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
MIT License
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2017, Stuart Littlefair
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
7
|
+
|
|
8
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
9
|
+
|
|
10
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
11
|
+
|
lfit_rs-0.2.0/PKG-INFO
ADDED
lfit_rs-0.2.0/README.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# LFIT_RS
|
|
2
|
+
|
|
3
|
+
LFIT is a python library for fitting the lightcurves of eclipsing Dwarf
|
|
4
|
+
Nova. It leans *very* heavily on Tom Marsh's library for the Roche
|
|
5
|
+
geometry and it's dependencies.
|
|
6
|
+
|
|
7
|
+
This is a Rust translation of the original LFIT code, which is substantially
|
|
8
|
+
easier to install than the original C++ version, and no slower.
|
|
9
|
+
|
|
10
|
+
It is designed to be simpler to use than Tom's lightcurve fitting code
|
|
11
|
+
[lcurve](https://github.com/trm-astro/lcurve) and also faster, since
|
|
12
|
+
it uses a much simpler model for the white dwarf component (uniform disk, linear
|
|
13
|
+
limb-darkening) and implements fewer features (no gravitational lensing, no
|
|
14
|
+
starspots etc.)
|
|
15
|
+
|
|
16
|
+
However, it shares a lot of DNA with [lcurve](https://github.com/trm-astro/lcurve),
|
|
17
|
+
using the same underlying libraries and the same model for the bright spot.
|
|
18
|
+
|
|
19
|
+
# INSTALLATION
|
|
20
|
+
|
|
21
|
+
Installation should be as simple as
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
pip install lfit_rs
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
# Usage
|
|
28
|
+
|
|
29
|
+
The most common usage is pattern is to create a `CV` object:
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
import lfit_rs
|
|
33
|
+
|
|
34
|
+
cv = lfit_rs.CV(pars, nel_disc=1000, nlat_donor=20)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The parameters are a list of 14 or 18 parameters - depending on whether the simple or complex bright spot model are used. For an explanation of the parameters, see below.
|
|
38
|
+
|
|
39
|
+
Once a `CV` object is created, we can calculate the flux at a list of orbital phases using:
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
phi = np.linspace(-0.2, 0.2, 500)
|
|
43
|
+
flux = cv.calcFlux(pars, phi)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
If you wish to change the parameters, you should not create a new `CV` object, but instead pass the new parameters to `calcFlux` and the CV parameters will be updated automatically:
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
new_pars = [...]
|
|
50
|
+
flux = cv.calcFlux(new_pars, phi)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
`lfit_rs.CV.calcFlux` also takes an optional `width` argument. If the optional
|
|
54
|
+
width argument is provided, the flux is calculated at five points over a bin
|
|
55
|
+
of this width centered on the given phase and the average flux in this bin is
|
|
56
|
+
returned. This is important to use when you have low time resolution, and the
|
|
57
|
+
flux may change rapidly over the course of a time bin.
|
|
58
|
+
|
|
59
|
+
## Model parameters
|
|
60
|
+
For a fuller description of the model parameters, see [Savoury (2011)](https://ui.adsabs.harvard.edu/abs/2011MNRAS.415.2025S/abstract). The bright spot is modelled as two linear strips passing through the intersection of the gas stream and disc. One strip is isotropic, while the other beams in a given direction. Both strips occupy the same physical space.
|
|
61
|
+
|
|
62
|
+
In brief, the CV parameters are (in order):
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
1. wdFlux - white dwarf flux at maximum light
|
|
66
|
+
2. dFlux - disc flux at maximum light
|
|
67
|
+
3. sFlux - bright spot flux at maximum light
|
|
68
|
+
4. rsFlux - donor flux at maximum light
|
|
69
|
+
5. q - mass ratio
|
|
70
|
+
6. dphi - full width of white dwarf at mid ingress/egress
|
|
71
|
+
7. rdisc - radius of accretion disc (scaled by distance to inner lagrangian point XL1)
|
|
72
|
+
8. ulimb - linear limb darkening parameter for white dwarf
|
|
73
|
+
9. rwd - white dwarf radius (scaled to XL1)
|
|
74
|
+
10. scale - bright spot scale (scaled to XL1)
|
|
75
|
+
11. az - the azimuth of the bright spot strip (w.r.t to line of centres between stars)
|
|
76
|
+
12. fis - the fraction of the bright spot's flux which radiates isotropically
|
|
77
|
+
13. dexp - the exponent which governs how the brightness of the disc falls off with radius
|
|
78
|
+
14. phi0 - a phase offset
|
|
79
|
+
|
|
80
|
+
the next four parameters are only used for complex bright spot models
|
|
81
|
+
|
|
82
|
+
15. exp1 - the `Y` exponent in [Savoury (2011)](https://ui.adsabs.harvard.edu/abs/2011MNRAS.415.2025S/abstract), which governs how rapidly the bright spot flux increases with distance along the strip
|
|
83
|
+
16. exp2 - the `Z` exponent in [Savoury (2011)](https://ui.adsabs.harvard.edu/abs/2011MNRAS.415.2025S/abstract), which governs how rapidly the bright spot flux falls with distance along the strip.
|
|
84
|
+
17. tilt - a parameter that allows the bright spot strip to beam in a different direction than the perpendicular to the strip itself. The tilt sets the beaming angle w.r.t to the disc plane.`tilt=90` beams light in the plane of the disc.
|
|
85
|
+
18. yaw - the bright spot yaw also affects the bright spot strip beaming angle. The yaw is added to the bright spot azimuth to set the beaming angle in the plane of the disc.
|
|
86
|
+
|
|
87
|
+
## Differences from the C++ LFIT version
|
|
88
|
+
|
|
89
|
+
This translation yields identical results to the C++ version within machine precision with **one** exception. The CVs normally modelled with LFIT usually have minimal contribution from the donor star, and so the grid-based donor flux calculation slowed things down for no advantage.
|
|
90
|
+
|
|
91
|
+
By default, `lfit_rs` uses the analytical formula of Kopal 1959 for ellipsoidal variability. If the donor does contribute to your lightcurve, and you are interested in the donor flux itself, this formula is not sufficiently accurate and you should set `nlat_donor` to a value ~ 20 to use the tiled donor model.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["maturin>=1.9.4,<2.0"]
|
|
3
|
+
build-backend = "maturin"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "lfit_rs"
|
|
7
|
+
version = "0.2.0"
|
|
8
|
+
requires-python = ">=3.8"
|
|
9
|
+
|
|
10
|
+
[tool.maturin]
|
|
11
|
+
python-source = "python"
|
|
12
|
+
module-name = "lfit_rs.rust"
|
|
13
|
+
#features = ["pyo3/extension-module"]
|
|
14
|
+
#cargo-extra-args = "--features extension-module"
|