tkmatrix 0.8.3__tar.gz → 0.8.4__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 (24) hide show
  1. {tkmatrix-0.8.3/tkmatrix.egg-info → tkmatrix-0.8.4}/PKG-INFO +1 -1
  2. {tkmatrix-0.8.3 → tkmatrix-0.8.4}/setup.py +1 -1
  3. {tkmatrix-0.8.3 → tkmatrix-0.8.4}/tkmatrix/custom_algorithms/BlsCustomSearchAlgorithm.py +1 -1
  4. {tkmatrix-0.8.3 → tkmatrix-0.8.4}/tkmatrix/properties.yaml +3 -2
  5. {tkmatrix-0.8.3 → tkmatrix-0.8.4}/tkmatrix/tests/test_tkmatrix.py +18 -18
  6. {tkmatrix-0.8.3 → tkmatrix-0.8.4}/tkmatrix/tkmatrix_class.py +14 -8
  7. {tkmatrix-0.8.3 → tkmatrix-0.8.4/tkmatrix.egg-info}/PKG-INFO +1 -1
  8. {tkmatrix-0.8.3 → tkmatrix-0.8.4}/LICENSE +0 -0
  9. {tkmatrix-0.8.3 → tkmatrix-0.8.4}/MANIFEST.in +0 -0
  10. {tkmatrix-0.8.3 → tkmatrix-0.8.4}/README.md +0 -0
  11. {tkmatrix-0.8.3 → tkmatrix-0.8.4}/setup.cfg +0 -0
  12. {tkmatrix-0.8.3 → tkmatrix-0.8.4}/tkmatrix/__init__.py +0 -0
  13. {tkmatrix-0.8.3 → tkmatrix-0.8.4}/tkmatrix/__main__.py +0 -0
  14. {tkmatrix-0.8.3 → tkmatrix-0.8.4}/tkmatrix/custom_algorithms/__init__.py +0 -0
  15. {tkmatrix-0.8.3 → tkmatrix-0.8.4}/tkmatrix/custom_algorithms/custom_search.py +0 -0
  16. {tkmatrix-0.8.3 → tkmatrix-0.8.4}/tkmatrix/inject_model.py +0 -0
  17. {tkmatrix-0.8.3 → tkmatrix-0.8.4}/tkmatrix/inject_rv_model.py +0 -0
  18. {tkmatrix-0.8.3 → tkmatrix-0.8.4}/tkmatrix/programmatic.py +0 -0
  19. {tkmatrix-0.8.3 → tkmatrix-0.8.4}/tkmatrix/rv.py +0 -0
  20. {tkmatrix-0.8.3 → tkmatrix-0.8.4}/tkmatrix/tests/__init__.py +0 -0
  21. {tkmatrix-0.8.3 → tkmatrix-0.8.4}/tkmatrix.egg-info/SOURCES.txt +0 -0
  22. {tkmatrix-0.8.3 → tkmatrix-0.8.4}/tkmatrix.egg-info/dependency_links.txt +0 -0
  23. {tkmatrix-0.8.3 → tkmatrix-0.8.4}/tkmatrix.egg-info/requires.txt +0 -0
  24. {tkmatrix-0.8.3 → tkmatrix-0.8.4}/tkmatrix.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tkmatrix
3
- Version: 0.8.3
3
+ Version: 0.8.4
4
4
  Summary: ToolKit for Multi-phAse Transits Recovery from Injected eXoplanets
5
5
  Home-page: https://github.com/PlanetHunters/tkmatrix
6
6
  Author: M. Dévora-Pajares & F.J. Pozuelos
@@ -2,7 +2,7 @@ import setuptools
2
2
 
3
3
  with open("README.md", "r") as fh:
4
4
  long_description = fh.read()
5
- version = "0.8.3"
5
+ version = "0.8.4"
6
6
  setuptools.setup(
7
7
  name="tkmatrix",
8
8
  version=version,
@@ -42,7 +42,7 @@ class BlsCustomSearchAlgorithm(CustomSearchAlgorithm):
42
42
  oversampling, star_info,
43
43
  transits_min_count)
44
44
  lc = lightkurve.LightCurve(time=time, flux=flux)
45
- results = lc.to_periodogram(method='bls', period=tls_period_grid)
45
+ results = lc.to_periodogram(method='bls', period=tls_period_grid, frequency_factor=oversampling)
46
46
  max_power_index = np.argmax(results.power)
47
47
  sde = results.power[max_power_index].value / np.nanmedian(results.power).value
48
48
  t0 = results.transit_time_at_max_power.value
@@ -44,7 +44,7 @@ DETREND_METHOD: "biweight"
44
44
  DETREND_WS: 0
45
45
  # Number of CPU processes to be used
46
46
  CPUS:
47
- # Fit method to be used. [tls|bls|grazing]
47
+ # Fit method to be used. [tls|bls|grazing|bls-periodogram]
48
48
  FIT_METHOD: 'tls'
49
49
  # The number of TLS search trials to be run for each period & radius & epoch before considering as not recovered.
50
50
  RUN_LIMIT: 2
@@ -53,7 +53,8 @@ SIGNAL_SELECTION_MODE: 'period-epoch'
53
53
  # The SNR limit for a TLS found signal to be considered as not recovered.
54
54
  SNR_THRESHOLD: 5
55
55
  # The density of the period grid for the TLS search. Increasing this will enhance the TLS accuracy sometimes but it
56
- # adds a high increase of computational cost.
56
+ # adds a high increase of computational cost. When FIT_METHOD: bls-periodogram, OVERSAMPLING represents the
57
+ # frequency_factor and hence, increasing it will reduce the period grid size (as opposite to the standard search).
57
58
  OVERSAMPLING: 1
58
59
  # An array of time tuples to be masked in your curve. E.g: [[1401.25, 1401.60], [1415.2, 1416.0]]
59
60
  INITIAL_MASK:
@@ -16,26 +16,26 @@ class TestsMatrix(unittest.TestCase):
16
16
  inject_dir = None
17
17
  try:
18
18
  inject_dir, period_grid, radius_grid = matrix.inject(1, 5, 5, 1, 3, 3, 1)
19
- self.assertEquals(10, len(os.listdir(inject_dir)))
20
- self.assertEquals([1], matrix.sectors)
19
+ self.assertEqual(10, len(os.listdir(inject_dir)))
20
+ self.assertEqual([1], matrix.sectors)
21
21
  self.assertAlmostEqual(0.47, matrix.mass, 2)
22
22
  self.assertAlmostEqual(0.44, matrix.massmin, 2)
23
23
  self.assertAlmostEqual(0.5, matrix.massmax, 2)
24
24
  self.assertAlmostEqual(0.18, matrix.radius, 2)
25
25
  self.assertAlmostEqual(0.076, matrix.radiusmin, 3)
26
26
  self.assertAlmostEqual(0.284, matrix.radiusmax, 3)
27
- self.assertEquals("TIC 220513363", matrix.object_info.mission_id())
28
- self.assertEquals("TIC 220513363", matrix.id)
27
+ self.assertEqual("TIC 220513363", matrix.object_info.mission_id())
28
+ self.assertEqual("TIC 220513363", matrix.id)
29
29
  self.assertAlmostEqual(0.47, matrix.mstar.value, 2)
30
30
  self.assertAlmostEqual(0.44, matrix.mstar_min.value, 2)
31
31
  self.assertAlmostEqual(0.5, matrix.mstar_max.value, 2)
32
32
  self.assertAlmostEqual(0.18, matrix.rstar.value, 2)
33
33
  self.assertAlmostEqual(0.076, matrix.rstar_min.value, 3)
34
34
  self.assertAlmostEqual(0.284, matrix.rstar_max.value, 3)
35
- self.assertEquals(".", matrix.dir)
35
+ self.assertEqual(".", matrix.dir)
36
36
  matrix.recovery(inject_dir, 5, detrend_ws=0, oversampling=0.1)
37
37
  matrix.plot_results(target, inject_dir)
38
- self.assertEquals(9, len(os.listdir(inject_dir)))
38
+ self.assertEqual(9, len(os.listdir(inject_dir)))
39
39
  finally:
40
40
  if inject_dir is not None:
41
41
  shutil.rmtree(inject_dir, ignore_errors=True)
@@ -48,7 +48,7 @@ class TestsMatrix(unittest.TestCase):
48
48
  inject_dir, period_grid, radius_grid = matrix.inject(1, 5, 5, 1, 3, 3, 1)
49
49
  matrix.recovery(inject_dir, 5, detrend_ws=0, oversampling=0.1)
50
50
  matrix.plot_results(target, inject_dir)
51
- self.assertEquals(10, len(os.listdir(inject_dir)))
51
+ self.assertEqual(10, len(os.listdir(inject_dir)))
52
52
  finally:
53
53
  if inject_dir is not None:
54
54
  shutil.rmtree(inject_dir, ignore_errors=True)
@@ -59,7 +59,7 @@ class TestsMatrix(unittest.TestCase):
59
59
  inject_dir = None
60
60
  try:
61
61
  inject_dir, period_grid, radius_grid = matrix.inject(1, 5, 5.1, 2, 3, 3.1, 2)
62
- self.assertEquals(13, len(os.listdir(inject_dir)))
62
+ self.assertEqual(13, len(os.listdir(inject_dir)))
63
63
  finally:
64
64
  if inject_dir is not None:
65
65
  shutil.rmtree(inject_dir, ignore_errors=True)
@@ -70,7 +70,7 @@ class TestsMatrix(unittest.TestCase):
70
70
  inject_dir = None
71
71
  try:
72
72
  inject_dir, period_grid, radius_grid = matrix.inject(2, 5, 5, 1, 3, 3, 1)
73
- self.assertEquals(11, len(os.listdir(inject_dir)))
73
+ self.assertEqual(11, len(os.listdir(inject_dir)))
74
74
  finally:
75
75
  if inject_dir is not None:
76
76
  shutil.rmtree(inject_dir, ignore_errors=True)
@@ -135,9 +135,9 @@ class TestsMatrix(unittest.TestCase):
135
135
  inject_dir = None
136
136
  try:
137
137
  inject_dir, period_grid, radius_grid = matrix.inject(1, 5, 5, 1, 3, 3, 1)
138
- self.assertEquals(10, len(os.listdir(inject_dir)))
139
- self.assertEquals((0.2, 0.5), matrix.star_info.ld_coefficients)
140
- self.assertEquals(2000, matrix.star_info.teff)
138
+ self.assertEqual(10, len(os.listdir(inject_dir)))
139
+ self.assertEqual((0.2, 0.5), matrix.star_info.ld_coefficients)
140
+ self.assertEqual(2000, matrix.star_info.teff)
141
141
  self.assertAlmostEqual(0.7, matrix.star_info.mass)
142
142
  self.assertAlmostEqual(0.55, matrix.star_info.mass_min)
143
143
  self.assertAlmostEqual(0.75, matrix.star_info.mass_max)
@@ -151,9 +151,9 @@ class TestsMatrix(unittest.TestCase):
151
151
  inject_dir = None
152
152
  try:
153
153
  inject_dir, period_grid, radius_grid = matrix.inject(1, 5, 5, 1, 3, 3, 1)
154
- self.assertEquals(10, len(os.listdir(inject_dir)))
155
- self.assertEquals((0.1258, 0.235), matrix.star_info.ld_coefficients)
156
- self.assertEquals(31000.0, matrix.star_info.teff)
154
+ self.assertEqual(10, len(os.listdir(inject_dir)))
155
+ self.assertEqual((0.1258, 0.235), matrix.star_info.ld_coefficients)
156
+ self.assertEqual(31000.0, matrix.star_info.teff)
157
157
  self.assertAlmostEqual(0.47, matrix.star_info.mass)
158
158
  self.assertAlmostEqual(0.44, matrix.star_info.mass_min)
159
159
  self.assertAlmostEqual(0.5, matrix.star_info.mass_max)
@@ -173,9 +173,9 @@ class TestsMatrix(unittest.TestCase):
173
173
  try:
174
174
  inject_dir, period_grid, radius_grid = matrix.inject(1, 5, 5.1, 2, 3, 3.1, 2, period_grid=period_grid_expected,
175
175
  radius_grid=radius_grid_expected)
176
- self.assertEquals(29, len(os.listdir(inject_dir)))
177
- self.assertEquals(period_grid_expected, period_grid)
178
- self.assertEquals(radius_grid_expected, radius_grid)
176
+ self.assertEqual(29, len(os.listdir(inject_dir)))
177
+ self.assertEqual(period_grid_expected, period_grid)
178
+ self.assertEqual(radius_grid_expected, radius_grid)
179
179
  finally:
180
180
  if inject_dir is not None:
181
181
  shutil.rmtree(inject_dir, ignore_errors=True)
@@ -554,10 +554,12 @@ class MATRIX:
554
554
  fig, ax = plt.subplots(figsize=(2.7 * 5, 5))
555
555
  im = plt.imshow(normed_hist.T, origin='lower', extent=(x[0], x[-1], y[0], y[-1]), interpolation='none',
556
556
  aspect='auto', cmap='viridis', vmin=0, vmax=100, rasterized=True)
557
- plt.colorbar(im, label='Recovery rate (%)')
558
- plt.xlabel('Injected period (days)')
559
- plt.ylabel(r'Injected ' + 'radius' if not is_rv else 'mass' + ' (' + column_units + '$_\oplus$)')
560
- ax.set_title(object_id + " - I&R (" + str(phases) + " " + phases_str + ")")
557
+ cbar = plt.colorbar(im)
558
+ cbar.set_label(label='Recovery rate (%)', size=16)
559
+ cbar.ax.tick_params(labelsize=14)
560
+ plt.xlabel('Injected period (days)', fontsize=18)
561
+ plt.ylabel(r'Injected ' + ('radius' if not is_rv else 'mass') + ' (' + column_units + '$_\oplus$)', fontsize=18)
562
+ ax.set_title(object_id + " - I&R (" + str(phases) + " " + phases_str + ")", fontsize=24)
561
563
  if xticks is not None:
562
564
  plt.xticks(xticks)
563
565
  else:
@@ -567,6 +569,7 @@ class MATRIX:
567
569
  ax.xaxis.set_major_formatter(FormatStrFormatter('%.' + str(period_ticks_decimals) + 'f'))
568
570
  if yticks is not None:
569
571
  plt.xticks(yticks)
572
+ ax.tick_params(axis='both', which='major', labelsize=14)
570
573
  plt.savefig(inject_dir + '/inj-rec' + ('-rv' if is_rv else '') + '.png', bbox_inches='tight', dpi=200)
571
574
  plt.close()
572
575
 
@@ -630,10 +633,12 @@ class MATRIX:
630
633
  fig, ax = plt.subplots(figsize=(2.7 * 5, 5))
631
634
  im = plt.imshow(normed_hist.T, origin='lower', extent=(x1[0], x1[-1], y1[0], y1[-1]), interpolation='none',
632
635
  aspect='auto', cmap='viridis', vmin=-phases, vmax=phases, rasterized=True)
633
- plt.colorbar(im, label='# Found samples diff.')
634
- plt.xlabel('Injected period (days)')
635
- plt.ylabel(r'Injected radius (R$_\oplus$)')
636
- ax.set_title(object_id + " - P/R recovery diff(" + str(phases) + " " + phases_str + ")")
636
+ cbar = plt.colorbar(im)
637
+ cbar.set_label(label='# Found samples diff.', size=16)
638
+ cbar.ax.tick_params(labelsize=14)
639
+ plt.xlabel('Injected period (days)', fontsize=18)
640
+ plt.ylabel(r'Injected radius (R$_\oplus$)', fontsize=18)
641
+ ax.set_title(object_id + " - P/R recovery diff(" + str(phases) + " " + phases_str + ")", fontsize=24)
637
642
  if xticks is not None:
638
643
  plt.xticks(xticks)
639
644
  else:
@@ -643,6 +648,7 @@ class MATRIX:
643
648
  ax.xaxis.set_major_formatter(FormatStrFormatter('%.' + str(period_ticks_decimals) + 'f'))
644
649
  if yticks is not None:
645
650
  plt.xticks(yticks)
651
+ ax.tick_params(axis='both', which='major', labelsize=14)
646
652
  plt.savefig(output_dir + '/inj-rec-diff.png', bbox_inches='tight', dpi=200)
647
653
  plt.close()
648
654
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tkmatrix
3
- Version: 0.8.3
3
+ Version: 0.8.4
4
4
  Summary: ToolKit for Multi-phAse Transits Recovery from Injected eXoplanets
5
5
  Home-page: https://github.com/PlanetHunters/tkmatrix
6
6
  Author: M. Dévora-Pajares & F.J. Pozuelos
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes