arvi 0.1.22__tar.gz → 0.1.23__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.
Potentially problematic release.
This version of arvi might be problematic. Click here for more details.
- {arvi-0.1.22 → arvi-0.1.23}/PKG-INFO +1 -1
- {arvi-0.1.22 → arvi-0.1.23}/arvi/dace_wrapper.py +11 -8
- {arvi-0.1.22 → arvi-0.1.23}/arvi/timeseries.py +27 -20
- {arvi-0.1.22 → arvi-0.1.23}/arvi/utils.py +1 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi.egg-info/PKG-INFO +1 -1
- {arvi-0.1.22 → arvi-0.1.23}/.github/workflows/docs-gh-pages.yml +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/.github/workflows/install.yml +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/.github/workflows/python-publish.yml +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/.gitignore +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/LICENSE +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/README.md +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi/HZ.py +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi/__init__.py +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi/ariadne_wrapper.py +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi/berv.py +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi/binning.py +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi/config.py +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi/data/extra/HD86226_PFS1.rdb +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi/data/extra/HD86226_PFS2.rdb +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi/data/extra/metadata.json +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi/data/info.svg +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi/data/obs_affected_ADC_issues.dat +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi/data/obs_affected_blue_cryostat_issues.dat +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi/extra_data.py +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi/gaia_wrapper.py +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi/headers.py +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi/instrument_specific.py +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi/kima_wrapper.py +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi/lbl_wrapper.py +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi/nasaexo_wrapper.py +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi/plots.py +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi/programs.py +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi/reports.py +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi/setup_logger.py +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi/simbad_wrapper.py +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi/spectra.py +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi/stats.py +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi/stellar.py +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi/translations.py +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi.egg-info/SOURCES.txt +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi.egg-info/dependency_links.txt +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi.egg-info/requires.txt +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/arvi.egg-info/top_level.txt +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/docs/API.md +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/docs/detailed.md +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/docs/index.md +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/docs/logo/detective.png +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/docs/logo/logo.png +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/mkdocs.yml +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/pyproject.toml +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/setup.cfg +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/setup.py +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/tests/test_binning.py +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/tests/test_import_object.py +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/tests/test_simbad.py +0 -0
- {arvi-0.1.22 → arvi-0.1.23}/tests/test_stats.py +0 -0
|
@@ -34,10 +34,10 @@ def get_dace_id(star):
|
|
|
34
34
|
|
|
35
35
|
def get_arrays(result, latest_pipeline=True, ESPRESSO_mode='HR11', NIRPS_mode='HE', verbose=True):
|
|
36
36
|
arrays = []
|
|
37
|
-
instruments =
|
|
37
|
+
instruments = [str(i) for i in result.keys()]
|
|
38
38
|
|
|
39
39
|
for inst in instruments:
|
|
40
|
-
pipelines =
|
|
40
|
+
pipelines = [str(p) for p in result[inst].keys()]
|
|
41
41
|
|
|
42
42
|
# select ESPRESSO mode, which is defined at the level of the pipeline
|
|
43
43
|
if 'ESPRESSO' in inst:
|
|
@@ -55,20 +55,23 @@ def get_arrays(result, latest_pipeline=True, ESPRESSO_mode='HR11', NIRPS_mode='H
|
|
|
55
55
|
pipelines = [pipelines[i]]
|
|
56
56
|
|
|
57
57
|
if latest_pipeline:
|
|
58
|
+
if 'NIRPS' in inst and any(['LBL' in p for p in pipelines]):
|
|
59
|
+
# TODO: correctly load both CCF and LBL
|
|
60
|
+
pipelines = [pipelines[1]]
|
|
61
|
+
else:
|
|
62
|
+
pipelines = [pipelines[0]]
|
|
63
|
+
|
|
58
64
|
if verbose and len(pipelines) > 1:
|
|
59
65
|
logger.info(f'selecting latest pipeline ({pipelines[0]}) for {inst}')
|
|
60
66
|
|
|
61
|
-
pipelines = [pipelines[0]]
|
|
62
|
-
|
|
63
67
|
for pipe in pipelines:
|
|
64
|
-
modes =
|
|
68
|
+
modes = [m for m in result[inst][pipe].keys()]
|
|
65
69
|
|
|
66
|
-
|
|
67
70
|
# select NIRPS mode, which is defined at the level of the mode
|
|
68
|
-
if 'NIRPS' in inst:
|
|
71
|
+
if 'NIRPS' in inst and len(modes) > 1:
|
|
69
72
|
if NIRPS_mode in modes:
|
|
70
73
|
if verbose:
|
|
71
|
-
logger.info(f'selecting mode {NIRPS_mode} for NIRPS')
|
|
74
|
+
logger.info(f'selecting mode {NIRPS_mode} for NIRPS - {pipe}')
|
|
72
75
|
i = modes.index(NIRPS_mode)
|
|
73
76
|
modes = [modes[i]]
|
|
74
77
|
else:
|
|
@@ -18,7 +18,7 @@ from .extra_data import get_extra_data
|
|
|
18
18
|
from .stats import wmean, wrms
|
|
19
19
|
from .binning import bin_ccf_mask, binRV
|
|
20
20
|
from .HZ import getHZ_period
|
|
21
|
-
from .utils import strtobool, there_is_internet, timer, chdir
|
|
21
|
+
from .utils import sanitize_path, strtobool, there_is_internet, timer, chdir
|
|
22
22
|
from .utils import lazy_import
|
|
23
23
|
|
|
24
24
|
units = lazy_import('astropy.units')
|
|
@@ -240,7 +240,8 @@ class RV:
|
|
|
240
240
|
else:
|
|
241
241
|
path = None
|
|
242
242
|
try:
|
|
243
|
-
self.__add__(get_extra_data(self.star, instrument=self.instrument,
|
|
243
|
+
self.__add__(get_extra_data(self.star, instrument=self.instrument,
|
|
244
|
+
path=path, verbose=self.verbose),
|
|
244
245
|
inplace=True)
|
|
245
246
|
|
|
246
247
|
except FileNotFoundError:
|
|
@@ -263,7 +264,9 @@ class RV:
|
|
|
263
264
|
if self.do_adjust_means:
|
|
264
265
|
self.adjust_means()
|
|
265
266
|
|
|
266
|
-
|
|
267
|
+
_star_no_space = self.star.replace(' ', '')
|
|
268
|
+
_directory = sanitize_path(_star_no_space)
|
|
269
|
+
self._download_directory = f'{_directory}_downloads'
|
|
267
270
|
|
|
268
271
|
def __add__(self, other, inplace=False):
|
|
269
272
|
# if not isinstance(other, self.__class__):
|
|
@@ -1243,6 +1246,9 @@ class RV:
|
|
|
1243
1246
|
mas_yr = units.milliarcsecond / units.year
|
|
1244
1247
|
mas = units.milliarcsecond
|
|
1245
1248
|
|
|
1249
|
+
# store the source of coordinates and parallax, either Gaia or Simbad
|
|
1250
|
+
using = ''
|
|
1251
|
+
|
|
1246
1252
|
try:
|
|
1247
1253
|
if force_simbad:
|
|
1248
1254
|
raise AttributeError
|
|
@@ -1255,8 +1261,7 @@ class RV:
|
|
|
1255
1261
|
logger.error('negative Gaia parallax, falling back to Simbad')
|
|
1256
1262
|
raise AttributeError
|
|
1257
1263
|
|
|
1258
|
-
|
|
1259
|
-
logger.info('using Gaia information to remove secular acceleration')
|
|
1264
|
+
using = 'Gaia'
|
|
1260
1265
|
|
|
1261
1266
|
if epoch is None:
|
|
1262
1267
|
# Gaia DR3 epoch (astropy.time.Time('J2016.0', format='jyear_str').jd)
|
|
@@ -1284,8 +1289,7 @@ class RV:
|
|
|
1284
1289
|
logger.error('no parallax from simbad, cannot remove secular acceleration')
|
|
1285
1290
|
return
|
|
1286
1291
|
|
|
1287
|
-
|
|
1288
|
-
logger.info('using Simbad information to remove secular acceleration')
|
|
1292
|
+
using = 'Simbad'
|
|
1289
1293
|
|
|
1290
1294
|
if epoch is None:
|
|
1291
1295
|
epoch = 55500
|
|
@@ -1303,14 +1307,14 @@ class RV:
|
|
|
1303
1307
|
|
|
1304
1308
|
sa = sa.value
|
|
1305
1309
|
|
|
1306
|
-
if self.verbose:
|
|
1307
|
-
logger.info('removing secular acceleration from RVs')
|
|
1308
|
-
|
|
1309
1310
|
if self.units == 'km/s':
|
|
1310
1311
|
sa /= 1000
|
|
1311
1312
|
|
|
1313
|
+
actually_removed_sa = False
|
|
1314
|
+
|
|
1312
1315
|
if self._child:
|
|
1313
1316
|
self.vrad = self.vrad - sa * (self.time - epoch) / 365.25
|
|
1317
|
+
actually_removed_sa = True
|
|
1314
1318
|
else:
|
|
1315
1319
|
for inst in self.instruments:
|
|
1316
1320
|
s = getattr(self, inst)
|
|
@@ -1320,9 +1324,7 @@ class RV:
|
|
|
1320
1324
|
if np.all(s.pub_reference != ''):
|
|
1321
1325
|
continue
|
|
1322
1326
|
|
|
1323
|
-
if 'HIRES' in inst
|
|
1324
|
-
continue
|
|
1325
|
-
if 'NIRPS' in inst: # never remove it from NIRPS...
|
|
1327
|
+
if 'HIRES' in inst or 'HAMILTON' in inst:
|
|
1326
1328
|
continue
|
|
1327
1329
|
|
|
1328
1330
|
if hasattr(s, '_did_secular_acceleration') and s._did_secular_acceleration:
|
|
@@ -1330,8 +1332,14 @@ class RV:
|
|
|
1330
1332
|
|
|
1331
1333
|
s.vrad = s.vrad - sa * (s.time - epoch) / 365.25
|
|
1332
1334
|
|
|
1335
|
+
actually_removed_sa = True
|
|
1336
|
+
|
|
1333
1337
|
self._build_arrays()
|
|
1334
1338
|
|
|
1339
|
+
if actually_removed_sa and self.verbose:
|
|
1340
|
+
logger.info(f'using {using} information to remove secular acceleration')
|
|
1341
|
+
logger.info('removing secular acceleration from RVs')
|
|
1342
|
+
|
|
1335
1343
|
self._did_secular_acceleration = True
|
|
1336
1344
|
self._did_secular_acceleration_epoch = epoch
|
|
1337
1345
|
self._did_secular_acceleration_simbad = force_simbad
|
|
@@ -1710,11 +1718,11 @@ class RV:
|
|
|
1710
1718
|
for inst in self.instruments:
|
|
1711
1719
|
s = getattr(self, inst)
|
|
1712
1720
|
if s.mask.any():
|
|
1713
|
-
if np.abs(s.mvrad.mean()) < s.mvrad
|
|
1721
|
+
if np.abs(s.mvrad.mean()) < np.ptp(s.mvrad):
|
|
1714
1722
|
s.vrad += self.simbad.rvz_radvel * 1e3
|
|
1715
1723
|
changed = True
|
|
1716
1724
|
else: # all observations are masked, use non-masked arrays
|
|
1717
|
-
if np.abs(s.vrad.mean()) < s.vrad
|
|
1725
|
+
if np.abs(s.vrad.mean()) < np.ptp(s.vrad):
|
|
1718
1726
|
s.vrad += self.simbad.rvz_radvel * 1e3
|
|
1719
1727
|
changed = True
|
|
1720
1728
|
if changed:
|
|
@@ -1991,15 +1999,14 @@ def fit_sine(t, y, yerr=None, period='gls', fix_period=False):
|
|
|
1991
1999
|
if fix_period:
|
|
1992
2000
|
def sine(t, p):
|
|
1993
2001
|
return p[0] * np.sin(2 * np.pi * t / period + p[1]) + p[2]
|
|
1994
|
-
|
|
1995
|
-
p0 = [y.ptp(), 0.0, 0.0]
|
|
2002
|
+
p0 = [np.ptp(y), 0.0, 0.0]
|
|
1996
2003
|
else:
|
|
1997
2004
|
def sine(t, p):
|
|
1998
2005
|
return p[0] * np.sin(2 * np.pi * t / p[1] + p[2]) + p[3]
|
|
1999
|
-
|
|
2000
|
-
p0 = [y.ptp(), period, 0.0, 0.0]
|
|
2006
|
+
p0 = [np.ptp(y), period, 0.0, 0.0]
|
|
2001
2007
|
|
|
2002
|
-
xbest, _ = leastsq(
|
|
2008
|
+
xbest, _ = leastsq(lambda p, t, y, ye: (sine(t, p) - y) / ye, p0,
|
|
2009
|
+
args=(t, y, yerr))
|
|
2003
2010
|
return xbest, partial(sine, p=xbest)
|
|
2004
2011
|
|
|
2005
2012
|
|
|
@@ -90,6 +90,7 @@ def timer(name=None):
|
|
|
90
90
|
def sanitize_path(path):
|
|
91
91
|
if os.name == 'nt': # on Windows, be careful with ':' in filename
|
|
92
92
|
path = path.replace(':', '_')
|
|
93
|
+
path = path.replace('*', '_')
|
|
93
94
|
return path
|
|
94
95
|
|
|
95
96
|
def pretty_print_table(rows, line_between_rows=True, logger=None):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|