arvi 0.1.28__py3-none-any.whl → 0.1.29__py3-none-any.whl

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.

Potentially problematic release.


This version of arvi might be problematic. Click here for more details.

arvi/plots.py CHANGED
@@ -502,8 +502,8 @@ plot_berv = partialmethod(plot_quantity, quantity='berv')
502
502
 
503
503
 
504
504
  @plot_fast
505
- def gls(self, ax=None, label=None, fap=True, instrument=None,
506
- adjust_means=config.adjust_means_gls,
505
+ def gls(self, ax=None, label=None, instrument=None,
506
+ fap=True, fap_method='baluev', adjust_means=config.adjust_means_gls,
507
507
  picker=True, **kwargs):
508
508
  """
509
509
  Calculate and plot the Generalised Lomb-Scargle periodogram of the radial
@@ -515,11 +515,15 @@ def gls(self, ax=None, label=None, fap=True, instrument=None,
515
515
  created.
516
516
  label (str):
517
517
  The label to use for the plot.
518
- fap (bool):
519
- Whether to show the false alarm probability. Default is True.
520
518
  instrument (str or list):
521
519
  Which instruments' data to include in the periodogram. Default is
522
520
  all instruments.
521
+ fap (bool or float):
522
+ Whether to show the false alarm probability. A value (not a
523
+ percentage) can be provided to display a given FAP. Default is True.
524
+ fap_method (str):
525
+ Method used to estimate the FAP, passed directly to
526
+ `astropy.timeseries.LombScargle`. Default is 'baluev'.
523
527
  adjust_means (bool):
524
528
  Whether to adjust (subtract) the weighted means of each instrument.
525
529
  Default is `config.adjust_means_gls`.
@@ -597,8 +601,14 @@ def gls(self, ax=None, label=None, fap=True, instrument=None,
597
601
  fap_level = 0.01
598
602
  if isinstance(fap, float):
599
603
  fap_level = fap
600
- ax.axhline(gls.false_alarm_level(fap_level),
601
- color='k', alpha=0.2, zorder=-1)
604
+
605
+ fap = gls.false_alarm_level(fap_level, method=fap_method)
606
+
607
+ if fap > 0.05 and fap_method == 'baluev':
608
+ logger.warning('FAP is high (>5%), the analytical estimate may be underestimated. Using the bootstrap method instead.')
609
+ fap = gls.false_alarm_level(fap_level, method='bootstrap')
610
+
611
+ ax.axhline(fap, color='k', alpha=0.2, zorder=-1)
602
612
 
603
613
  ax.set(xlabel='Period [days]', ylabel='Normalized power', ylim=(0, None))
604
614
  ax.minorticks_on()
@@ -640,8 +650,32 @@ def gls(self, ax=None, label=None, fap=True, instrument=None,
640
650
 
641
651
 
642
652
  # @plot_fast
643
- def gls_quantity(self, quantity, ax=None, fap=True, instrument=None,
653
+ def gls_quantity(self, quantity, ax=None, instrument=None,
654
+ fap=True, fap_method='baluev',
644
655
  adjust_means=True, picker=True, **kwargs):
656
+ """
657
+ Calculate and plot the Generalised Lomb-Scargle periodogram of the given
658
+ quantity (e.g. fwhm, rhk, etc.)
659
+
660
+ Args:
661
+ quantity (str):
662
+ The quantity to calculate for which to compute the periodogram.
663
+ ax (matplotlib.axes.Axes):
664
+ The matplotlib axes to plot on. If None, a new figure will be
665
+ created.
666
+ instrument (str or list):
667
+ Which instruments' data to include in the periodogram. Default is
668
+ all instruments.
669
+ fap (bool or float):
670
+ Whether to show the false alarm probability. A value (not a
671
+ percentage) can be provided to display a given FAP. Default is True.
672
+ fap_method (str):
673
+ Method used to estimate the FAP, passed directly to
674
+ `astropy.timeseries.LombScargle`. Default is 'baluev'.
675
+ adjust_means (bool):
676
+ Whether to adjust (subtract) the weighted means of each instrument.
677
+ Default is `config.adjust_means_gls`.
678
+ """
645
679
 
646
680
  if not hasattr(self, quantity):
647
681
  if self.verbose:
@@ -715,8 +749,14 @@ def gls_quantity(self, quantity, ax=None, fap=True, instrument=None,
715
749
  fap_level = 0.01
716
750
  if isinstance(fap, float):
717
751
  fap_level = fap
718
- ax.axhline(gls.false_alarm_level(fap_level),
719
- color='k', alpha=0.2, zorder=-1)
752
+
753
+ fap = gls.false_alarm_level(fap_level, method=fap_method)
754
+
755
+ if fap > 0.05 and fap_method == 'baluev':
756
+ logger.warning('FAP is high (>5%), the analytical estimate may be underestimated. Using the bootstrap method instead.')
757
+ fap = gls.false_alarm_level(fap_level, method='bootstrap')
758
+
759
+ ax.axhline(fap, color='k', alpha=0.2, zorder=-1)
720
760
 
721
761
  ax.set(xlabel='Period [days]', ylabel='Normalized power', ylim=(0, None))
722
762
  ax.minorticks_on()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: arvi
3
- Version: 0.1.28
3
+ Version: 0.1.29
4
4
  Summary: The Automated RV Inspector
5
5
  Author-email: João Faria <joao.faria@unige.ch>
6
6
  License: MIT
@@ -12,7 +12,7 @@ arvi/instrument_specific.py,sha256=-pbm2Vk3iK_1K7nDa1avlJOKHBcXllwILI4lQn-Ze-A,7
12
12
  arvi/kima_wrapper.py,sha256=BvNTVqzM4lMNhLCyBFVh3T84hHfGKAFpgiYiOi4lh0g,2731
13
13
  arvi/lbl_wrapper.py,sha256=_ViGVkpakvuBR_xhu9XJRV5EKHpj5Go6jBZGJZMIS2Y,11850
14
14
  arvi/nasaexo_wrapper.py,sha256=mWt7eHgSZe4MBKCmUvMPTyUPGuiwGTqKugNBvmjOg9s,7306
15
- arvi/plots.py,sha256=vmY2b2tbyDB2JQiKFDbXAVkxY5HTLaQDP-YWmYqJPY0,30089
15
+ arvi/plots.py,sha256=gZzwv1VbWMml3tF0ET8Z56ekA-VHd0nZw11XR-Qo0GA,31950
16
16
  arvi/programs.py,sha256=BW7xBNKLei7NVLLW3_lsVskwzkaIoNRiHK2jn9Tn2ZM,8879
17
17
  arvi/reports.py,sha256=ayPdZ4HZO9iCDdnADQ18gQPJh79o-1UYG7TYkvm9Lrc,4051
18
18
  arvi/setup_logger.py,sha256=pBzaRTn0hntozjbaRVx0JIbWGuENkvYUApa6uB-FsRo,279
@@ -29,8 +29,8 @@ arvi/data/obs_affected_blue_cryostat_issues.dat,sha256=z4AK17xfz8tGTDv1FjRvQFnio
29
29
  arvi/data/extra/HD86226_PFS1.rdb,sha256=vfAozbrKHM_j8dYkCBJsuHyD01KEM1asghe2KInwVao,3475
30
30
  arvi/data/extra/HD86226_PFS2.rdb,sha256=F2P7dB6gVyzCglUjNheB0hIHVClC5RmARrGwbrY1cfo,4114
31
31
  arvi/data/extra/metadata.json,sha256=C69hIw6CohyES6BI9vDWjxwSz7N4VOYX0PCgjXtYFmU,178
32
- arvi-0.1.28.dist-info/LICENSE,sha256=6JfQgl7SpM55t0EHMFNMnNh-AdkpGW25MwMiTnhdWQg,1068
33
- arvi-0.1.28.dist-info/METADATA,sha256=Pg0WUz53Bo5DS_5KkwIHcpauoMP4dLARK92FYcAqMVE,1852
34
- arvi-0.1.28.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
35
- arvi-0.1.28.dist-info/top_level.txt,sha256=4EeiKDVLD45ztuflTGfQ3TU8GVjJg5Y95xS5XjI-utU,5
36
- arvi-0.1.28.dist-info/RECORD,,
32
+ arvi-0.1.29.dist-info/LICENSE,sha256=6JfQgl7SpM55t0EHMFNMnNh-AdkpGW25MwMiTnhdWQg,1068
33
+ arvi-0.1.29.dist-info/METADATA,sha256=aRUdDo4XitNY1xqg7OpHKw1nDGT_mGIyNl4FoEJquYg,1852
34
+ arvi-0.1.29.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
35
+ arvi-0.1.29.dist-info/top_level.txt,sha256=4EeiKDVLD45ztuflTGfQ3TU8GVjJg5Y95xS5XjI-utU,5
36
+ arvi-0.1.29.dist-info/RECORD,,
File without changes
File without changes