RTModel 3.0__tar.gz → 3.3__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.
- {rtmodel-3.0 → rtmodel-3.3}/.github/workflows/build_wheels.yml +2 -2
- {rtmodel-3.0 → rtmodel-3.3}/PKG-INFO +11 -14
- {rtmodel-3.0 → rtmodel-3.3}/README.md +8 -11
- {rtmodel-3.0 → rtmodel-3.3}/RTModel/RTModel.py +37 -10
- {rtmodel-3.0 → rtmodel-3.3}/RTModel/__init__.py +4 -1
- rtmodel-3.3/RTModel/data/SunEphemeris.txt +22130 -0
- {rtmodel-3.0 → rtmodel-3.3}/RTModel/include/LevMarFit.h +18 -11
- {rtmodel-3.0 → rtmodel-3.3}/RTModel/include/bumper.h +5 -0
- {rtmodel-3.0 → rtmodel-3.3}/RTModel/lib/Finalizer.cpp +19 -10
- {rtmodel-3.0 → rtmodel-3.3}/RTModel/lib/InitCond.cpp +182 -12
- {rtmodel-3.0 → rtmodel-3.3}/RTModel/lib/LevMarFit.cpp +381 -90
- {rtmodel-3.0 → rtmodel-3.3}/RTModel/lib/ModelSelector.cpp +660 -115
- {rtmodel-3.0 → rtmodel-3.3}/RTModel/lib/Reader.cpp +80 -44
- {rtmodel-3.0 → rtmodel-3.3}/RTModel/plotmodel/plotmodel.py +50 -7
- {rtmodel-3.0 → rtmodel-3.3}/changelog.md +3 -0
- {rtmodel-3.0 → rtmodel-3.3}/docs/Animation.md +1 -1
- {rtmodel-3.0 → rtmodel-3.3}/docs/Astrophotometric.md +5 -5
- {rtmodel-3.0 → rtmodel-3.3}/docs/DataPreparation.md +8 -2
- {rtmodel-3.0 → rtmodel-3.3}/docs/DataPreprocessing.md +2 -2
- {rtmodel-3.0 → rtmodel-3.3}/docs/FinalAssessment.md +1 -1
- {rtmodel-3.0 → rtmodel-3.3}/docs/Fitting.md +6 -4
- {rtmodel-3.0 → rtmodel-3.3}/docs/InitCond.md +3 -2
- {rtmodel-3.0 → rtmodel-3.3}/docs/ModelCategories.md +69 -1
- {rtmodel-3.0 → rtmodel-3.3}/docs/ModelSelection.md +2 -2
- {rtmodel-3.0 → rtmodel-3.3}/docs/ModelingRun.md +4 -2
- {rtmodel-3.0 → rtmodel-3.3}/docs/PlotModel.md +2 -0
- {rtmodel-3.0 → rtmodel-3.3}/docs/PreliminaryModels.md +7 -1
- {rtmodel-3.0 → rtmodel-3.3}/docs/README.md +8 -8
- {rtmodel-3.0 → rtmodel-3.3}/docs/Satellite.md +1 -1
- rtmodel-3.3/events/event001done.zip +0 -0
- rtmodel-3.3/fVBM.py +11 -0
- {rtmodel-3.0 → rtmodel-3.3}/pyproject.toml +8 -5
- rtmodel-3.0/.github/workflows/run_tests.yml +0 -41
- rtmodel-3.0/events/event001done.zip +0 -0
- rtmodel-3.0/fVBM.py +0 -16
- {rtmodel-3.0 → rtmodel-3.3}/.gitignore +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/CMakeLists.txt +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/LICENSE +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/MANIFEST.in +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/RTModel/data/ESPL.tbl +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/RTModel/data/TemplateLibrary.txt +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/RTModel/lib/LevMar.cpp +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/RTModel/lib/bumper.cpp +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/RTModel/plotmodel/__init__.py +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/RTModel/templates/__init__.py +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/RTModel/templates/templates.py +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/docs/Archive.md +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/docs/AstrometricPlots.md +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/docs/Constraints.md +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/docs/HighResolutionImaging.md +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/docs/LimbDarkening.md +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/docs/TemplateLibraries.md +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/docs/figs/Template.png +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/docs/figs/ani.gif +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/docs/figs/fig.md +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/docs/figs/fig_HRimaging.png +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/docs/figs/fig_astro.png +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/docs/figs/fig_astro_Dec.png +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/docs/figs/fig_astro_RA.png +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/docs/figs/fig_astrophot.png +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/docs/figs/plotchain.png +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/docs/figs/plotmodel_fig1.png +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/docs/figs/plotmodel_fig2.png +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/events/HRevent.zip +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/events/OB190033.zip +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/events/astroevent001.zip +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/events/event001.zip +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/events/event002.zip +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/events/readme.md +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/events/satellite1.txt +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/jupyter/Model_event001.ipynb +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/tests/build_tests/test_built_executables_exist.py +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/tests/end_to_end_tests/test_ps_run.py +0 -0
- {rtmodel-3.0 → rtmodel-3.3}/tests/end_to_end_tests/test_ps_run_resources/example_event.zip +0 -0
|
@@ -15,13 +15,13 @@ jobs:
|
|
|
15
15
|
runs-on: ${{ matrix.os }}
|
|
16
16
|
strategy:
|
|
17
17
|
matrix:
|
|
18
|
-
os: [ubuntu-latest, windows-latest, macos-
|
|
18
|
+
os: [ubuntu-latest, windows-latest, macos-14,macos-15] # was macos-latest
|
|
19
19
|
|
|
20
20
|
steps:
|
|
21
21
|
- uses: actions/checkout@v4
|
|
22
22
|
|
|
23
23
|
- name: Build wheels
|
|
24
|
-
uses: pypa/cibuildwheel@
|
|
24
|
+
uses: pypa/cibuildwheel@v3.4.0
|
|
25
25
|
env: #
|
|
26
26
|
MACOSX_DEPLOYMENT_TARGET: "10.15" #
|
|
27
27
|
CIBW_SKIP: pp*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: RTModel
|
|
3
|
-
Version: 3.
|
|
4
|
-
Summary: RTModel is a tool for microlensing event interpretation
|
|
3
|
+
Version: 3.3
|
|
4
|
+
Summary: RTModel is a tool for microlensing event interpretation
|
|
5
5
|
Keywords: Microlensing analysis and fitting
|
|
6
6
|
Author-Email: Valerio Bozza <valboz@sa.infn.it>
|
|
7
7
|
License: GPL-3.0
|
|
@@ -10,7 +10,7 @@ Classifier: Intended Audience :: Science/Research
|
|
|
10
10
|
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
12
|
Project-URL: Homepage, https://github.com/valboz/RTModel
|
|
13
|
-
Requires-Python: <4,>=3.
|
|
13
|
+
Requires-Python: <4,>=3.8
|
|
14
14
|
Requires-Dist: numpy
|
|
15
15
|
Requires-Dist: pytest
|
|
16
16
|
Requires-Dist: matplotlib
|
|
@@ -24,10 +24,11 @@ Description-Content-Type: text/markdown
|
|
|
24
24
|
- Single-lens-single-source microlensing (i.e. Paczynski)
|
|
25
25
|
- Single-lens-binary-source microlensing (with or without xallarap)
|
|
26
26
|
- Binary-lens-single-source microlensing (including planetary microlensing, parallax and orbital motion)
|
|
27
|
+
- Triple-lens-single-source microlensing (including parallax and circular orbital motion)
|
|
27
28
|
|
|
28
29
|
All models include the finite-size of the source(s).
|
|
29
30
|
|
|
30
|
-
The modeling strategy is based on a grid search in the parameter space for single-lens models, whereas a **template library** for binary-lens models is used including all possible geometries of the source trajectory with respect to the caustics. In addition to this global search, planets are searched where maximal deviations from a Paczynski model occurs.
|
|
31
|
+
The modeling strategy is based on a grid search in the parameter space for single-lens models, whereas a **template library** for binary-lens models is used including all possible geometries of the source trajectory with respect to the caustics. In addition to this global search, planets are searched where maximal deviations from a Paczynski model occurs. Triple-lens models are searched as small perturbations to binary-lens models.
|
|
31
32
|
|
|
32
33
|
The library is in the form of a standard Python package that launches specific subprocesses for different tasks. Model fitting is executed in **parallel** exploiting available processors in the machine. The full modeling may take from one to three hours depending on the event and on the machine speed. The results of modeling are given in the form of a text **assessment file**; in addition, **final models** are made available with their parameters and covariance matrices.
|
|
33
34
|
|
|
@@ -41,27 +42,23 @@ A second subpackage **`RTModel.templates`** helps the user in the visualization
|
|
|
41
42
|
|
|
42
43
|
Any scientific use of `RTModel` should be acknowledged by citing the paper [V.Bozza, A&A 688 (2024) 83](https://ui.adsabs.harvard.edu/abs/2024A%26A...688A..83B/abstract), describing all the algorithms behind the code.
|
|
43
44
|
|
|
44
|
-
We are grateful to Greg Olmschenk, who revised the package installation in order to make it as cross-platform as possible. We also thank all the users who are providing suggestions, reporting bugs or failures: Etienne Bachelet, David Bennett, Jonathan Brashear, Laura Salmeri, Stela Ishitani Silva, Yiannis Tsapras, Sigfried Vanaverbeke, Keto Zhang.
|
|
45
|
+
We are grateful to Greg Olmschenk, who revised the package installation in order to make it as cross-platform as possible. Antonio Consiglio collaborated to the development of the anomaly detection code. We also thank all the users who are providing suggestions, reporting bugs or failures: Etienne Bachelet, David Bennett, Jonathan Brashear, Sophie Budzik, Paolo Rota, Laura Salmeri, Stela Ishitani Silva, Yiannis Tsapras, Sigfried Vanaverbeke, Keto Zhang.
|
|
45
46
|
|
|
46
47
|
## Installation
|
|
47
48
|
|
|
48
|
-
The easiest way to install `RTModel` is through `pip`.
|
|
49
|
-
|
|
50
|
-
First clone this repository.
|
|
51
|
-
|
|
52
|
-
Then go to the repository directory and type
|
|
49
|
+
The easiest way to install `RTModel` is through `pip install`.
|
|
53
50
|
|
|
54
51
|
```
|
|
55
|
-
pip install
|
|
52
|
+
pip install RTModel
|
|
56
53
|
```
|
|
57
54
|
|
|
58
|
-
In alternative, you may
|
|
55
|
+
In alternative, you may clone this repository. Then go to the repository directory and type
|
|
59
56
|
|
|
60
57
|
```
|
|
61
|
-
pip install
|
|
58
|
+
pip install .
|
|
62
59
|
```
|
|
63
60
|
|
|
64
|
-
Currently, `RTModel` works on Linux, Windows and MacOS, requiring Python >= 3.
|
|
61
|
+
Currently, `RTModel` works on Linux, Windows and MacOS, requiring Python >= 3.8.
|
|
65
62
|
A C++ compiler compatible with C++17 standard is needed for installation.
|
|
66
63
|
`RTModel` uses [`VBMicrolensing`](https://github.com/valboz/VBMicrolensing) for all calculations. You are encouraged to cite the relevant papers listed in that repository as well.
|
|
67
64
|
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
- Single-lens-single-source microlensing (i.e. Paczynski)
|
|
4
4
|
- Single-lens-binary-source microlensing (with or without xallarap)
|
|
5
5
|
- Binary-lens-single-source microlensing (including planetary microlensing, parallax and orbital motion)
|
|
6
|
+
- Triple-lens-single-source microlensing (including parallax and circular orbital motion)
|
|
6
7
|
|
|
7
8
|
All models include the finite-size of the source(s).
|
|
8
9
|
|
|
9
|
-
The modeling strategy is based on a grid search in the parameter space for single-lens models, whereas a **template library** for binary-lens models is used including all possible geometries of the source trajectory with respect to the caustics. In addition to this global search, planets are searched where maximal deviations from a Paczynski model occurs.
|
|
10
|
+
The modeling strategy is based on a grid search in the parameter space for single-lens models, whereas a **template library** for binary-lens models is used including all possible geometries of the source trajectory with respect to the caustics. In addition to this global search, planets are searched where maximal deviations from a Paczynski model occurs. Triple-lens models are searched as small perturbations to binary-lens models.
|
|
10
11
|
|
|
11
12
|
The library is in the form of a standard Python package that launches specific subprocesses for different tasks. Model fitting is executed in **parallel** exploiting available processors in the machine. The full modeling may take from one to three hours depending on the event and on the machine speed. The results of modeling are given in the form of a text **assessment file**; in addition, **final models** are made available with their parameters and covariance matrices.
|
|
12
13
|
|
|
@@ -20,27 +21,23 @@ A second subpackage **`RTModel.templates`** helps the user in the visualization
|
|
|
20
21
|
|
|
21
22
|
Any scientific use of `RTModel` should be acknowledged by citing the paper [V.Bozza, A&A 688 (2024) 83](https://ui.adsabs.harvard.edu/abs/2024A%26A...688A..83B/abstract), describing all the algorithms behind the code.
|
|
22
23
|
|
|
23
|
-
We are grateful to Greg Olmschenk, who revised the package installation in order to make it as cross-platform as possible. We also thank all the users who are providing suggestions, reporting bugs or failures: Etienne Bachelet, David Bennett, Jonathan Brashear, Laura Salmeri, Stela Ishitani Silva, Yiannis Tsapras, Sigfried Vanaverbeke, Keto Zhang.
|
|
24
|
+
We are grateful to Greg Olmschenk, who revised the package installation in order to make it as cross-platform as possible. Antonio Consiglio collaborated to the development of the anomaly detection code. We also thank all the users who are providing suggestions, reporting bugs or failures: Etienne Bachelet, David Bennett, Jonathan Brashear, Sophie Budzik, Paolo Rota, Laura Salmeri, Stela Ishitani Silva, Yiannis Tsapras, Sigfried Vanaverbeke, Keto Zhang.
|
|
24
25
|
|
|
25
26
|
## Installation
|
|
26
27
|
|
|
27
|
-
The easiest way to install `RTModel` is through `pip`.
|
|
28
|
-
|
|
29
|
-
First clone this repository.
|
|
30
|
-
|
|
31
|
-
Then go to the repository directory and type
|
|
28
|
+
The easiest way to install `RTModel` is through `pip install`.
|
|
32
29
|
|
|
33
30
|
```
|
|
34
|
-
pip install
|
|
31
|
+
pip install RTModel
|
|
35
32
|
```
|
|
36
33
|
|
|
37
|
-
In alternative, you may
|
|
34
|
+
In alternative, you may clone this repository. Then go to the repository directory and type
|
|
38
35
|
|
|
39
36
|
```
|
|
40
|
-
pip install
|
|
37
|
+
pip install .
|
|
41
38
|
```
|
|
42
39
|
|
|
43
|
-
Currently, `RTModel` works on Linux, Windows and MacOS, requiring Python >= 3.
|
|
40
|
+
Currently, `RTModel` works on Linux, Windows and MacOS, requiring Python >= 3.8.
|
|
44
41
|
A C++ compiler compatible with C++17 standard is needed for installation.
|
|
45
42
|
`RTModel` uses [`VBMicrolensing`](https://github.com/valboz/VBMicrolensing) for all calculations. You are encouraged to cite the relevant papers listed in that repository as well.
|
|
46
43
|
|
|
@@ -37,7 +37,7 @@ class RTModel:
|
|
|
37
37
|
else:
|
|
38
38
|
print("! Invalid path for event: " + self.eventname)
|
|
39
39
|
self.inidir = "ini"
|
|
40
|
-
self.modelcodes = ['PS', 'PX', 'BS', 'BO', 'LS', 'LX', 'LO', 'LK', 'TS', 'TX']
|
|
40
|
+
self.modelcodes = ['PS', 'PX', 'BS', 'BO', 'LS', 'LX', 'LO', 'LK', 'TS', 'TX', 'TO']
|
|
41
41
|
self.endphase = len(self.modelcodes)*2+3
|
|
42
42
|
self.eventinifile = 'event.ini'
|
|
43
43
|
self.nprocessors = os.cpu_count()
|
|
@@ -66,6 +66,9 @@ class RTModel:
|
|
|
66
66
|
[-300,300,5.0],[-4.0,3.0,0.3],[-11.5,11.5,0.5], [-12.56,12.56,0.3]],
|
|
67
67
|
'TX': [[-4.0,3.0,.1],[-16.1,16.1,0.5],[-3.0,3.0,0.1], [-12.56,12.56,0.1],[-11.5,-2.5,0.3],[-4.6,7.6,0.6],
|
|
68
68
|
[-300,300,5.0],[-4.0,3.0,0.3],[-11.5,11.5,0.5], [-12.56,12.56,0.3],[-3.0,3.0,0.03],[-3.0,3.0,0.03]],
|
|
69
|
+
'TO': [[-4.0,3.0,.1],[-16.1,16.1,0.5],[-3.0,3.0,0.1], [-12.56,12.56,0.1],[-11.5,-2.5,0.3],[-4.6,7.6,0.6],
|
|
70
|
+
[-300,300,5.0],[-4.0,3.0,0.3],[-11.5,11.5,0.5], [-12.56,12.56,0.3],[-3.0,3.0,0.03],[-3.0,3.0,0.03],
|
|
71
|
+
[-1.0,1.0,0.01],[-1.0,1.0,0.01],[1.e-7,1.0,0.01]],
|
|
69
72
|
'astrometry': [[-30.0,30.0,1.0],[-30.0,30.0,1.0],[0.05,1.0,0.1],[0.001,30.0,0.2]]
|
|
70
73
|
}
|
|
71
74
|
|
|
@@ -104,10 +107,10 @@ class RTModel:
|
|
|
104
107
|
f.write(str(par[0]) + ' ' + str(par[1]) + ' ' + str(par[2]) + '\n')
|
|
105
108
|
|
|
106
109
|
|
|
107
|
-
def config_Reader(self, tau =
|
|
110
|
+
def config_Reader(self, tau = 1, binning = 4000, otherseasons = 1, renormalize = 1, thresholdoutliers = 10):
|
|
108
111
|
self.Reader_tau= tau # conventional correlation time for consecutive points
|
|
109
112
|
self.Reader_binning = binning # maximum number of points left after re-binning
|
|
110
|
-
self.Reader_otherseasons = otherseasons # How to use other seasons (0
|
|
113
|
+
self.Reader_otherseasons = otherseasons # How to use other seasons (0: Yes, >=1 decrease significance)
|
|
111
114
|
self.Reader_renormalize = renormalize # Re-normalize error bars if non-zero
|
|
112
115
|
self.Reader_thresholdoutliers = thresholdoutliers # Threshold in sigmas for removing outliers
|
|
113
116
|
|
|
@@ -124,6 +127,20 @@ class RTModel:
|
|
|
124
127
|
print(' Pre-processing data...')
|
|
125
128
|
try:
|
|
126
129
|
completedprocess=subprocess.run([self.bindir+self.readerexe,self.eventname], cwd = self.bindir, stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=True, text = True)
|
|
130
|
+
with open(self.eventname + '/FilterToData.txt') as f:
|
|
131
|
+
lines = f.readlines()
|
|
132
|
+
lines = [line.split('.dat')[0] for line in lines]
|
|
133
|
+
sats = [[] for i in range(10)]
|
|
134
|
+
ground = []
|
|
135
|
+
for line in lines:
|
|
136
|
+
if(line[-1].isdigit()):
|
|
137
|
+
sats[int(line[-1])].append(line)
|
|
138
|
+
else:
|
|
139
|
+
ground.append(line)
|
|
140
|
+
print(" Found ground telescopes: ",ground)
|
|
141
|
+
for i in range(10):
|
|
142
|
+
if(len(sats[i])>0):
|
|
143
|
+
print(f" Found satellite {i}: ",sats[i])
|
|
127
144
|
with open(self.eventname + '/LCToFit.txt') as f:
|
|
128
145
|
lines = f.readlines()
|
|
129
146
|
del(lines[0])
|
|
@@ -188,9 +205,10 @@ class RTModel:
|
|
|
188
205
|
peaksearch = False
|
|
189
206
|
with open(initfils[0], 'r') as f:
|
|
190
207
|
npeaks = int(f.readline().split()[0])
|
|
191
|
-
print('Peaks: '
|
|
208
|
+
print('Peaks: ')
|
|
192
209
|
for i in range(0,npeaks):
|
|
193
|
-
|
|
210
|
+
chs=f.readline().split()
|
|
211
|
+
print(f'{float(chs[0]):.4f} [{float(chs[4]):.4f}]')
|
|
194
212
|
imod+=1
|
|
195
213
|
print('\n OK')
|
|
196
214
|
except subprocess.CalledProcessError as e:
|
|
@@ -200,9 +218,9 @@ class RTModel:
|
|
|
200
218
|
print('\033[30;41m! Program stopped here!\033[m')
|
|
201
219
|
self.done = True
|
|
202
220
|
|
|
203
|
-
def config_LevMar(self, nfits = 6, offsetdegeneracy =
|
|
221
|
+
def config_LevMar(self, nfits = 6, offsetdegeneracy = 2, timelimit = 600.0, maxsteps = 50, bumperpower = 2.0, \
|
|
204
222
|
mass_luminosity_exponent = None, mass_radius_exponent = None, lens_mass_luminosity_exponent = None, \
|
|
205
|
-
turn_off_secondary_source = False, turn_off_secondary_lens = False):
|
|
223
|
+
turn_off_secondary_source = False, turn_off_secondary_lens = False, block_tertiary_lens = False, stepchainsave=False):
|
|
206
224
|
self.LevMar_nfits = nfits # Number of models to be calculated from the same initial condition using the bumper method
|
|
207
225
|
self.LevMar_offsetdegeneracy = offsetdegeneracy # Number of models to be fit after applying offset degeneracy to best model found so far
|
|
208
226
|
self.LevMar_maxsteps = maxsteps # Maximum number of steps in each fit
|
|
@@ -213,7 +231,8 @@ class RTModel:
|
|
|
213
231
|
self.LevMar_lens_mass_luminosity_exponent = lens_mass_luminosity_exponent # mass-luminosity exponent for binary lenses
|
|
214
232
|
self.LevMar_turn_off_secondary_lens = turn_off_secondary_lens # Option for dark secondary lenses
|
|
215
233
|
self.LevMar_turn_off_secondary_source = turn_off_secondary_source # Option for dark secondary sources
|
|
216
|
-
self.
|
|
234
|
+
self.LevMar_block_tertiary_lens = block_tertiary_lens # Option for blocked tertiary lens
|
|
235
|
+
self.LevMar_stepchainsave = stepchainsave # If True, step chains are saved
|
|
217
236
|
|
|
218
237
|
def LevMar(self,strmodel, parameters_file = None, parameters = None):
|
|
219
238
|
if(not os.path.exists(self.eventname + '/' + self.inidir)):
|
|
@@ -242,6 +261,8 @@ class RTModel:
|
|
|
242
261
|
f.write('turn_off_secondary_lens = True\n')
|
|
243
262
|
if(self.LevMar_turn_off_secondary_source):
|
|
244
263
|
f.write('turn_off_secondary_source = True\n')
|
|
264
|
+
if(self.LevMar_block_tertiary_lens):
|
|
265
|
+
f.write('block_tertiary_lens = True\n')
|
|
245
266
|
if(parameters_file != None):
|
|
246
267
|
f.write('parametersfile = ' + parameters_file)
|
|
247
268
|
if(self.LevMar_stepchainsave):
|
|
@@ -277,6 +298,8 @@ class RTModel:
|
|
|
277
298
|
f.write('turn_off_secondary_lens = True\n')
|
|
278
299
|
if(self.LevMar_turn_off_secondary_source):
|
|
279
300
|
f.write('turn_off_secondary_source = True\n')
|
|
301
|
+
if(self.LevMar_block_tertiary_lens):
|
|
302
|
+
f.write('block_tertiary_lens = True\n')
|
|
280
303
|
if(self.LevMar_stepchainsave):
|
|
281
304
|
f.write('stepchainsave = True\n')
|
|
282
305
|
stringfits = {'PS' : '- Single-lens-Single-source fits',
|
|
@@ -288,7 +311,8 @@ class RTModel:
|
|
|
288
311
|
'LO' : '- Binary-lens-Single-source fits with orbital motion',
|
|
289
312
|
'LK' : '- Binary-lens-Single-source fits with eccentric orbital motion',
|
|
290
313
|
'TS' : '- Triple-lens-Single-source fits',
|
|
291
|
-
'TX' : '- Triple-lens-Single-source fits with parallax'
|
|
314
|
+
'TX' : '- Triple-lens-Single-source fits with parallax',
|
|
315
|
+
'TO' : '- Triple-lens-Single-source fits with orbital motion'}
|
|
292
316
|
self.set_parameter_ranges()
|
|
293
317
|
print(stringfits[modelcode])
|
|
294
318
|
initcondfile = self.eventname + '/InitCond/' + 'InitCond'+ modelcode + '.txt'
|
|
@@ -379,7 +403,8 @@ class RTModel:
|
|
|
379
403
|
'LO' : '- Selecting models for Binary-lens-Single-source fits with orbital motion',
|
|
380
404
|
'LK' : '- Selecting models for Binary-lens-Single-source fits with eccentric orbital motion',
|
|
381
405
|
'TS' : '- Selecting models for Triple-lens-Single-source fits',
|
|
382
|
-
'TX' : '- Selecting models for Triple-lens-Single-source fits with parallax'
|
|
406
|
+
'TX' : '- Selecting models for Triple-lens-Single-source fits with parallax',
|
|
407
|
+
'TO' : '- Selecting models for Triple-lens-Single-source fits with orbital motion'}
|
|
383
408
|
print(stringmodels[modelcode])
|
|
384
409
|
try:
|
|
385
410
|
completedprocess=subprocess.run([self.bindir+self.modelselectorexe,self.eventname, modelcode], cwd = self.bindir, stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=True, text = True)
|
|
@@ -573,6 +598,8 @@ class RTModel:
|
|
|
573
598
|
self.LevMar_turn_off_secondary_source = True
|
|
574
599
|
elif(chunks[0] == 'turn_off_secondary_lens' and chunks[2] == 'True'):
|
|
575
600
|
self.LevMar_turn_off_secondary_lens = True
|
|
601
|
+
elif(chunks[0] == 'block_tertiary_lens' and chunks[2] == 'True'):
|
|
602
|
+
self.LevMar_block_tertiary_lens = True
|
|
576
603
|
elif(chunks[0] == 'mass_luminosity_exponent'):
|
|
577
604
|
self.LevMar_mass_luminosity_exponent = float(chunks[2])
|
|
578
605
|
elif(chunks[0] == 'mass_radius_exponent'):
|