tkmatrix 0.8.7__tar.gz → 0.9.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 (24) hide show
  1. {tkmatrix-0.8.7/tkmatrix.egg-info → tkmatrix-0.9.0}/PKG-INFO +1 -1
  2. {tkmatrix-0.8.7 → tkmatrix-0.9.0}/setup.py +2 -2
  3. {tkmatrix-0.8.7 → tkmatrix-0.9.0}/tkmatrix/__main__.py +2 -4
  4. {tkmatrix-0.8.7 → tkmatrix-0.9.0}/tkmatrix/tkmatrix_class.py +8 -58
  5. {tkmatrix-0.8.7 → tkmatrix-0.9.0/tkmatrix.egg-info}/PKG-INFO +1 -1
  6. {tkmatrix-0.8.7 → tkmatrix-0.9.0}/tkmatrix.egg-info/requires.txt +1 -1
  7. {tkmatrix-0.8.7 → tkmatrix-0.9.0}/LICENSE +0 -0
  8. {tkmatrix-0.8.7 → tkmatrix-0.9.0}/MANIFEST.in +0 -0
  9. {tkmatrix-0.8.7 → tkmatrix-0.9.0}/README.md +0 -0
  10. {tkmatrix-0.8.7 → tkmatrix-0.9.0}/setup.cfg +0 -0
  11. {tkmatrix-0.8.7 → tkmatrix-0.9.0}/tkmatrix/__init__.py +0 -0
  12. {tkmatrix-0.8.7 → tkmatrix-0.9.0}/tkmatrix/custom_algorithms/BlsCustomSearchAlgorithm.py +0 -0
  13. {tkmatrix-0.8.7 → tkmatrix-0.9.0}/tkmatrix/custom_algorithms/__init__.py +0 -0
  14. {tkmatrix-0.8.7 → tkmatrix-0.9.0}/tkmatrix/custom_algorithms/custom_search.py +0 -0
  15. {tkmatrix-0.8.7 → tkmatrix-0.9.0}/tkmatrix/inject_model.py +0 -0
  16. {tkmatrix-0.8.7 → tkmatrix-0.9.0}/tkmatrix/inject_rv_model.py +0 -0
  17. {tkmatrix-0.8.7 → tkmatrix-0.9.0}/tkmatrix/programmatic.py +0 -0
  18. {tkmatrix-0.8.7 → tkmatrix-0.9.0}/tkmatrix/properties.yaml +0 -0
  19. {tkmatrix-0.8.7 → tkmatrix-0.9.0}/tkmatrix/rv.py +0 -0
  20. {tkmatrix-0.8.7 → tkmatrix-0.9.0}/tkmatrix/tests/__init__.py +0 -0
  21. {tkmatrix-0.8.7 → tkmatrix-0.9.0}/tkmatrix/tests/test_tkmatrix.py +0 -0
  22. {tkmatrix-0.8.7 → tkmatrix-0.9.0}/tkmatrix.egg-info/SOURCES.txt +0 -0
  23. {tkmatrix-0.8.7 → tkmatrix-0.9.0}/tkmatrix.egg-info/dependency_links.txt +0 -0
  24. {tkmatrix-0.8.7 → tkmatrix-0.9.0}/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.7
3
+ Version: 0.9.0
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.7"
5
+ version = "0.9.0"
6
6
  setuptools.setup(
7
7
  name="tkmatrix",
8
8
  version=version,
@@ -25,7 +25,7 @@ setuptools.setup(
25
25
  'configparser==5.0.1',
26
26
  "corner==2.1.0",
27
27
  "ellc==1.8.5",
28
- "lcbuilder==0.16.2",
28
+ "lcbuilder==0.18.0",
29
29
  "mock==4.0.3",
30
30
  'pyparsing==2.4.7', # Matplotlib dependency
31
31
  "seaborn==0.11.1",
@@ -144,8 +144,7 @@ if __name__ == '__main__':
144
144
  ir.recovery_rv(inject_dir, rv['INITIAL_MASK'] if 'INITIAL_MASK' in rv else None,
145
145
  rv['SNR_THRESHOLD'], rv['RUN_LIMIT'],
146
146
  rv['MAX_PERIOD_SEARCH'], rv['OVERSAMPLING'] if 'OVERSAMPLING' in rv else 1)
147
- ir.plot_results(target, inject_dir, period_grid, mass_grid, period_grid_geom=rv["PERIOD_GRID_GEOM"],
148
- radius_grid_geom=rv["MASS_GRID_GEOM"], is_rv=True)
147
+ ir.plot_results(target, inject_dir, is_rv=True)
149
148
  inject_dir, period_grid, radius_grid = ir.inject(matrix_user_properties["PHASES"],
150
149
  matrix_user_properties["MIN_PERIOD"], matrix_user_properties["MAX_PERIOD"],
151
150
  matrix_user_properties["STEPS_PERIOD"],
@@ -163,6 +162,5 @@ if __name__ == '__main__':
163
162
  custom_search, matrix_user_properties["MAX_PERIOD_SEARCH"], matrix_user_properties["OVERSAMPLING"],
164
163
  matrix_user_properties["SIGNAL_SELECTION_MODE"],
165
164
  use_search_cache=matrix_user_properties["USE_SEARCH_CACHE"])
166
- ir.plot_results(target, inject_dir, period_grid, radius_grid, period_grid_geom=matrix_user_properties["PERIOD_GRID_GEOM"],
167
- radius_grid_geom=matrix_user_properties["RADIUS_GRID_GEOM"])
165
+ ir.plot_results(target, inject_dir)
168
166
  print("Execution time: " + str(datetime.datetime.now() - start_time))
@@ -497,8 +497,7 @@ class MATRIX:
497
497
  os.remove(inject_dir + file)
498
498
 
499
499
  @staticmethod
500
- def plot_results(object_id, inject_dir, period_grid=None, radius_grid=None, binning=1, xticks=None, yticks=None,
501
- period_grid_geom="lin", radius_grid_geom="lin", is_rv=False, planets_df=None):
500
+ def plot_results(object_id, inject_dir, binning=1, xticks=None, yticks=None, is_rv=False, planets_df=None):
502
501
  """
503
502
  Generates a heat map with the found/not found results for the period/radius grids
504
503
 
@@ -509,8 +508,6 @@ class MATRIX:
509
508
  :param binning: the binning to be applied to the grids
510
509
  :param xticks: the fixed ticks to be used for the period grid
511
510
  :param yticks: the fixed ticks to be used for the radius grid
512
- :param period_grid_geom: [lin|log]
513
- :param radius_grid_geom: [lin|log]
514
511
  :param is_rv: whether to load the rv results or the photometry ones
515
512
  :param planets_df: pandas dataframe with radius, period, name, radius_err_up, radius_err_bottom
516
513
  """
@@ -521,33 +518,10 @@ class MATRIX:
521
518
  usecols=['period', column, 'found', 'sde'])
522
519
  min_period = df["period"].min()
523
520
  max_period = df["period"].max()
524
- min_rad = df[column].min()
525
- max_rad = df[column].max()
526
521
  phases = len(df[df["period"] == df["period"].min()][df[column] == df[column].min()])
527
522
  phases_str = "phase" if phases == 1 else "phases"
528
- bin_nums = int(np.ceil(len(df["period"].unique()) / binning))
529
- if period_grid is None:
530
- if period_grid_geom == 'lin':
531
- step_period = (max_period - min_period) / (len(df["period"].unique()) - 1)
532
- step_period = step_period * binning
533
- if step_period <= 0:
534
- step_period = 0.1
535
- period_grid = np.linspace(min_period, max_period, bin_nums)\
536
- if max_period - min_period > 0 else np.full((1), min_period)
537
- else:
538
- period_grid = np.logspace(np.log10(min_period), np.log10(max_period), bin_nums)
539
- if radius_grid is None:
540
- bin_nums = int(np.ceil(len(df[column].unique()) / binning))
541
- if radius_grid_geom == 'lin':
542
- step_radius = (max_rad - min_rad) / (len(df[column].unique()) - 1)
543
- step_radius = step_radius * binning
544
- if step_radius <= 0:
545
- step_radius = 0.1
546
- radius_grid = np.round(np.linspace(min_rad, max_rad, bin_nums), 2)\
547
- if max_rad - min_rad > 0 else np.full((1), min_rad)
548
- else:
549
- radius_grid = np.round(np.logspace(np.log10(min_rad), np.log10(max_rad), 2), bin_nums)
550
- f = len(period_grid) / len(radius_grid)
523
+ period_grid = df['period'].unique()
524
+ radius_grid = df[column].unique()
551
525
  bins = [period_grid, radius_grid]
552
526
  h1, x, y = np.histogram2d(df['period'][df['found'] == 1], df[column][df['found'] == 1], bins=bins)
553
527
  h2, x, y = np.histogram2d(df['period'][df['found'] == 0], df[column][df['found'] == 0], bins=bins)
@@ -573,15 +547,14 @@ class MATRIX:
573
547
  ax.tick_params(axis='both', which='major', labelsize=14)
574
548
  if planets_df is not None:
575
549
  for index, row in planets_df.iterrows():
576
- ax.errorbar([row['period']], [row['radius']],
577
- yerr=[np.full(1, row['radius_err_bottom']), np.full(1, row['radius_err_up'])],
550
+ ax.errorbar([row['period']], [row[column]],
551
+ yerr=[np.full(1, row[column + '_err_bottom']), np.full(1, row[column + '_err_up'])],
578
552
  fmt='o', color='firebrick', markersize=12)
579
553
  plt.savefig(inject_dir + '/inj-rec' + ('-rv' if is_rv else '') + '.png', bbox_inches='tight', dpi=200)
580
554
  plt.close()
581
555
 
582
556
  @staticmethod
583
- def plot_diff(object_id, inject_dir1, inject_dir2, output_dir, binning=1, xticks=None, yticks=None,
584
- period_grid_geom="lin", radius_grid_geom="lin"):
557
+ def plot_diff(object_id, inject_dir1, inject_dir2, output_dir, binning=1, xticks=None, yticks=None):
585
558
  """
586
559
  Plots the difference between two results directories.
587
560
 
@@ -592,8 +565,6 @@ class MATRIX:
592
565
  :param binning: the binning to be applied to both axes
593
566
  :param xticks: the fixed ticks for the period bar
594
567
  :param yticks: the fixed ticks for the radius bar
595
- :param period_grid_geom: [lin|log]
596
- :param radius_grid_geom: [ling|log]
597
568
  """
598
569
  df1 = pd.read_csv(inject_dir1 + '/a_tls_report.csv', float_precision='round_trip', sep=',',
599
570
  usecols=['period', 'radius', 'found', 'sde'])
@@ -601,31 +572,10 @@ class MATRIX:
601
572
  usecols=['period', 'radius', 'found', 'sde'])
602
573
  min_period = df1["period"].min()
603
574
  max_period = df1["period"].max()
604
- min_rad = df1["radius"].min()
605
- max_rad = df1["radius"].max()
606
575
  phases = len(df1[df1["period"] == df1["period"].min()][df1["radius"] == df1["radius"].min()])
607
576
  phases_str = "phase" if phases == 1 else "phases"
608
- bin_nums = int(np.ceil(len(df1["period"].unique()) / binning))
609
- if period_grid_geom == 'lin':
610
- step_period = (max_period - min_period) / (len(df1["period"].unique()) - 1)
611
- step_period = step_period * binning
612
- if step_period <= 0:
613
- step_period = 0.1
614
- period_grid = np.linspace(min_period, max_period, bin_nums)\
615
- if max_period - min_period > 0 else np.full((1), min_period)
616
- else:
617
- period_grid = np.logspace(np.log10(min_period), np.log10(max_period), bin_nums)
618
- bin_nums = int(np.ceil(len(df1["radius"].unique()) / binning))
619
- if radius_grid_geom == 'lin':
620
- step_radius = (max_rad - min_rad) / (len(df1["radius"].unique()) - 1)
621
- step_radius = step_radius * binning
622
- if step_radius <= 0:
623
- step_radius = 0.1
624
- radius_grid = np.round(np.linspace(min_rad, max_rad, bin_nums), 2)\
625
- if max_rad - min_rad > 0 else np.full((1), min_rad)
626
- else:
627
- radius_grid = np.round(np.logspace(np.log10(min_rad), np.log10(max_rad), 2), bin_nums)
628
- f = len(period_grid) / len(radius_grid)
577
+ period_grid = df1['period'].unique()
578
+ radius_grid = df1['radius'].unique()
629
579
  bins = [period_grid, radius_grid]
630
580
  h11, x1, y1 = np.histogram2d(df1['period'][df1['found'] == 1], df1['radius'][df1['found'] == 1], bins=bins)
631
581
  h12, x1, y1 = np.histogram2d(df1['period'][df1['found'] == 0], df1['radius'][df1['found'] == 0], bins=bins)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tkmatrix
3
- Version: 0.8.7
3
+ Version: 0.9.0
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
@@ -3,7 +3,7 @@ beautifulsoup4==4.9.3
3
3
  configparser==5.0.1
4
4
  corner==2.1.0
5
5
  ellc==1.8.5
6
- lcbuilder==0.16.2
6
+ lcbuilder==0.18.0
7
7
  mock==4.0.3
8
8
  pyparsing==2.4.7
9
9
  seaborn==0.11.1
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes