arvi 0.1.21__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.21 → arvi-0.1.23}/PKG-INFO +1 -1
- {arvi-0.1.21 → arvi-0.1.23}/arvi/config.py +6 -1
- {arvi-0.1.21 → arvi-0.1.23}/arvi/dace_wrapper.py +11 -8
- {arvi-0.1.21 → arvi-0.1.23}/arvi/timeseries.py +30 -20
- {arvi-0.1.21 → arvi-0.1.23}/arvi/utils.py +1 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi.egg-info/PKG-INFO +1 -1
- {arvi-0.1.21 → arvi-0.1.23}/.github/workflows/docs-gh-pages.yml +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/.github/workflows/install.yml +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/.github/workflows/python-publish.yml +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/.gitignore +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/LICENSE +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/README.md +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi/HZ.py +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi/__init__.py +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi/ariadne_wrapper.py +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi/berv.py +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi/binning.py +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi/data/extra/HD86226_PFS1.rdb +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi/data/extra/HD86226_PFS2.rdb +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi/data/extra/metadata.json +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi/data/info.svg +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi/data/obs_affected_ADC_issues.dat +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi/data/obs_affected_blue_cryostat_issues.dat +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi/extra_data.py +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi/gaia_wrapper.py +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi/headers.py +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi/instrument_specific.py +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi/kima_wrapper.py +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi/lbl_wrapper.py +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi/nasaexo_wrapper.py +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi/plots.py +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi/programs.py +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi/reports.py +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi/setup_logger.py +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi/simbad_wrapper.py +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi/spectra.py +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi/stats.py +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi/stellar.py +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi/translations.py +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi.egg-info/SOURCES.txt +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi.egg-info/dependency_links.txt +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi.egg-info/requires.txt +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/arvi.egg-info/top_level.txt +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/docs/API.md +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/docs/detailed.md +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/docs/index.md +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/docs/logo/detective.png +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/docs/logo/logo.png +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/mkdocs.yml +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/pyproject.toml +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/setup.cfg +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/setup.py +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/tests/test_binning.py +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/tests/test_import_object.py +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/tests/test_simbad.py +0 -0
- {arvi-0.1.21 → arvi-0.1.23}/tests/test_stats.py +0 -0
|
@@ -52,9 +52,14 @@ class config:
|
|
|
52
52
|
if name in config.__setters:
|
|
53
53
|
self.__conf[name] = value
|
|
54
54
|
else:
|
|
55
|
+
if 'config' not in self.__user_config:
|
|
56
|
+
self.__user_config.add_section('config')
|
|
55
57
|
self.__user_config.set('config', name, value)
|
|
56
58
|
save_config(self.__user_config)
|
|
57
59
|
# raise NameError(f"unknown configuration name '{name}'")
|
|
58
60
|
|
|
59
61
|
def show(self):
|
|
60
|
-
|
|
62
|
+
if 'config' in self.__user_config:
|
|
63
|
+
pprint(self.__conf | dict(self.__user_config['config']))
|
|
64
|
+
else:
|
|
65
|
+
pprint(self.__conf)
|
|
@@ -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__):
|
|
@@ -788,6 +791,9 @@ class RV:
|
|
|
788
791
|
s.mask = np.full_like(s.time, True, dtype=bool)
|
|
789
792
|
s.instruments = ['CARMENES']
|
|
790
793
|
|
|
794
|
+
# so meta!
|
|
795
|
+
setattr(s, 'CARMENES', s)
|
|
796
|
+
|
|
791
797
|
s._kobe_result = hdul[1].data
|
|
792
798
|
|
|
793
799
|
if tar is not None:
|
|
@@ -1240,6 +1246,9 @@ class RV:
|
|
|
1240
1246
|
mas_yr = units.milliarcsecond / units.year
|
|
1241
1247
|
mas = units.milliarcsecond
|
|
1242
1248
|
|
|
1249
|
+
# store the source of coordinates and parallax, either Gaia or Simbad
|
|
1250
|
+
using = ''
|
|
1251
|
+
|
|
1243
1252
|
try:
|
|
1244
1253
|
if force_simbad:
|
|
1245
1254
|
raise AttributeError
|
|
@@ -1252,8 +1261,7 @@ class RV:
|
|
|
1252
1261
|
logger.error('negative Gaia parallax, falling back to Simbad')
|
|
1253
1262
|
raise AttributeError
|
|
1254
1263
|
|
|
1255
|
-
|
|
1256
|
-
logger.info('using Gaia information to remove secular acceleration')
|
|
1264
|
+
using = 'Gaia'
|
|
1257
1265
|
|
|
1258
1266
|
if epoch is None:
|
|
1259
1267
|
# Gaia DR3 epoch (astropy.time.Time('J2016.0', format='jyear_str').jd)
|
|
@@ -1281,8 +1289,7 @@ class RV:
|
|
|
1281
1289
|
logger.error('no parallax from simbad, cannot remove secular acceleration')
|
|
1282
1290
|
return
|
|
1283
1291
|
|
|
1284
|
-
|
|
1285
|
-
logger.info('using Simbad information to remove secular acceleration')
|
|
1292
|
+
using = 'Simbad'
|
|
1286
1293
|
|
|
1287
1294
|
if epoch is None:
|
|
1288
1295
|
epoch = 55500
|
|
@@ -1300,14 +1307,14 @@ class RV:
|
|
|
1300
1307
|
|
|
1301
1308
|
sa = sa.value
|
|
1302
1309
|
|
|
1303
|
-
if self.verbose:
|
|
1304
|
-
logger.info('removing secular acceleration from RVs')
|
|
1305
|
-
|
|
1306
1310
|
if self.units == 'km/s':
|
|
1307
1311
|
sa /= 1000
|
|
1308
1312
|
|
|
1313
|
+
actually_removed_sa = False
|
|
1314
|
+
|
|
1309
1315
|
if self._child:
|
|
1310
1316
|
self.vrad = self.vrad - sa * (self.time - epoch) / 365.25
|
|
1317
|
+
actually_removed_sa = True
|
|
1311
1318
|
else:
|
|
1312
1319
|
for inst in self.instruments:
|
|
1313
1320
|
s = getattr(self, inst)
|
|
@@ -1317,9 +1324,7 @@ class RV:
|
|
|
1317
1324
|
if np.all(s.pub_reference != ''):
|
|
1318
1325
|
continue
|
|
1319
1326
|
|
|
1320
|
-
if 'HIRES' in inst
|
|
1321
|
-
continue
|
|
1322
|
-
if 'NIRPS' in inst: # never remove it from NIRPS...
|
|
1327
|
+
if 'HIRES' in inst or 'HAMILTON' in inst:
|
|
1323
1328
|
continue
|
|
1324
1329
|
|
|
1325
1330
|
if hasattr(s, '_did_secular_acceleration') and s._did_secular_acceleration:
|
|
@@ -1327,8 +1332,14 @@ class RV:
|
|
|
1327
1332
|
|
|
1328
1333
|
s.vrad = s.vrad - sa * (s.time - epoch) / 365.25
|
|
1329
1334
|
|
|
1335
|
+
actually_removed_sa = True
|
|
1336
|
+
|
|
1330
1337
|
self._build_arrays()
|
|
1331
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
|
+
|
|
1332
1343
|
self._did_secular_acceleration = True
|
|
1333
1344
|
self._did_secular_acceleration_epoch = epoch
|
|
1334
1345
|
self._did_secular_acceleration_simbad = force_simbad
|
|
@@ -1707,11 +1718,11 @@ class RV:
|
|
|
1707
1718
|
for inst in self.instruments:
|
|
1708
1719
|
s = getattr(self, inst)
|
|
1709
1720
|
if s.mask.any():
|
|
1710
|
-
if np.abs(s.mvrad.mean()) < s.mvrad
|
|
1721
|
+
if np.abs(s.mvrad.mean()) < np.ptp(s.mvrad):
|
|
1711
1722
|
s.vrad += self.simbad.rvz_radvel * 1e3
|
|
1712
1723
|
changed = True
|
|
1713
1724
|
else: # all observations are masked, use non-masked arrays
|
|
1714
|
-
if np.abs(s.vrad.mean()) < s.vrad
|
|
1725
|
+
if np.abs(s.vrad.mean()) < np.ptp(s.vrad):
|
|
1715
1726
|
s.vrad += self.simbad.rvz_radvel * 1e3
|
|
1716
1727
|
changed = True
|
|
1717
1728
|
if changed:
|
|
@@ -1988,15 +1999,14 @@ def fit_sine(t, y, yerr=None, period='gls', fix_period=False):
|
|
|
1988
1999
|
if fix_period:
|
|
1989
2000
|
def sine(t, p):
|
|
1990
2001
|
return p[0] * np.sin(2 * np.pi * t / period + p[1]) + p[2]
|
|
1991
|
-
|
|
1992
|
-
p0 = [y.ptp(), 0.0, 0.0]
|
|
2002
|
+
p0 = [np.ptp(y), 0.0, 0.0]
|
|
1993
2003
|
else:
|
|
1994
2004
|
def sine(t, p):
|
|
1995
2005
|
return p[0] * np.sin(2 * np.pi * t / p[1] + p[2]) + p[3]
|
|
1996
|
-
|
|
1997
|
-
p0 = [y.ptp(), period, 0.0, 0.0]
|
|
2006
|
+
p0 = [np.ptp(y), period, 0.0, 0.0]
|
|
1998
2007
|
|
|
1999
|
-
xbest, _ = leastsq(
|
|
2008
|
+
xbest, _ = leastsq(lambda p, t, y, ye: (sine(t, p) - y) / ye, p0,
|
|
2009
|
+
args=(t, y, yerr))
|
|
2000
2010
|
return xbest, partial(sine, p=xbest)
|
|
2001
2011
|
|
|
2002
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
|