arvi 0.1.8__py3-none-any.whl → 0.1.11__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/HZ.py +95 -0
- arvi/__init__.py +6 -0
- arvi/binning.py +17 -0
- arvi/config.py +1 -0
- arvi/dace_wrapper.py +64 -48
- arvi/data/extra/HD86226_PFS1.rdb +50 -0
- arvi/data/extra/HD86226_PFS2.rdb +59 -0
- arvi/data/extra/metadata.json +10 -0
- arvi/extra_data.py +71 -0
- arvi/plots.py +190 -30
- arvi/simbad_wrapper.py +23 -6
- arvi/stats.py +32 -2
- arvi/timeseries.py +342 -70
- arvi/utils.py +53 -3
- {arvi-0.1.8.dist-info → arvi-0.1.11.dist-info}/METADATA +1 -1
- arvi-0.1.11.dist-info/RECORD +29 -0
- {arvi-0.1.8.dist-info → arvi-0.1.11.dist-info}/WHEEL +1 -1
- arvi-0.1.8.dist-info/RECORD +0 -24
- {arvi-0.1.8.dist-info → arvi-0.1.11.dist-info}/LICENSE +0 -0
- {arvi-0.1.8.dist-info → arvi-0.1.11.dist-info}/top_level.txt +0 -0
arvi/utils.py
CHANGED
|
@@ -8,12 +8,20 @@ except ImportError:
|
|
|
8
8
|
except ImportError as e:
|
|
9
9
|
raise e
|
|
10
10
|
|
|
11
|
+
import subprocess
|
|
11
12
|
import logging
|
|
12
13
|
from glob import glob
|
|
13
|
-
|
|
14
|
+
import numpy as np
|
|
15
|
+
|
|
16
|
+
try:
|
|
17
|
+
from tqdm import tqdm, trange
|
|
18
|
+
except ImportError:
|
|
19
|
+
tqdm = lambda x, *args, **kwargs: x
|
|
20
|
+
trange = lambda *args, **kwargs: range(*args, **kwargs)
|
|
14
21
|
|
|
15
22
|
|
|
16
23
|
def create_directory(directory):
|
|
24
|
+
""" Create a directory if it does not exist """
|
|
17
25
|
if not os.path.isdir(directory):
|
|
18
26
|
os.makedirs(directory)
|
|
19
27
|
|
|
@@ -53,6 +61,30 @@ def all_logging_disabled():
|
|
|
53
61
|
finally:
|
|
54
62
|
logging.disable(previous_level)
|
|
55
63
|
|
|
64
|
+
def strtobool(val):
|
|
65
|
+
"""Convert a string representation of truth to true (1) or false (0).
|
|
66
|
+
|
|
67
|
+
True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
|
|
68
|
+
are 'n', 'no', 'f', 'false', 'off', and '0'. Raises ValueError if
|
|
69
|
+
'val' is anything else.
|
|
70
|
+
"""
|
|
71
|
+
val = val.lower()
|
|
72
|
+
if val in ('y', 'yes', 't', 'true', 'on', '1'):
|
|
73
|
+
return 1
|
|
74
|
+
elif val in ('n', 'no', 'f', 'false', 'off', '0'):
|
|
75
|
+
return 0
|
|
76
|
+
else:
|
|
77
|
+
raise ValueError("invalid truth value {!r}".format(val))
|
|
78
|
+
|
|
79
|
+
def there_is_internet(timeout=1):
|
|
80
|
+
from socket import create_connection
|
|
81
|
+
try:
|
|
82
|
+
create_connection(('8.8.8.8', 53), timeout=timeout)
|
|
83
|
+
return True
|
|
84
|
+
except OSError:
|
|
85
|
+
pass
|
|
86
|
+
return False
|
|
87
|
+
|
|
56
88
|
def find_data_file(file):
|
|
57
89
|
here = os.path.dirname(os.path.abspath(__file__))
|
|
58
90
|
data_file = os.path.join(here, '..', 'data', file)
|
|
@@ -73,10 +105,28 @@ def ESPRESSO_ADC_issues():
|
|
|
73
105
|
adc_file = find_data_file('obs_affected_ADC_issues.dat')
|
|
74
106
|
lines = [line.strip() for line in open(adc_file).readlines()]
|
|
75
107
|
file_roots = [line.split()[1] for line in lines if not line.startswith('#')]
|
|
76
|
-
return array(file_roots)
|
|
108
|
+
return np.array(file_roots)
|
|
77
109
|
|
|
78
110
|
def ESPRESSO_cryostat_issues():
|
|
79
111
|
cryostat_file = find_data_file('obs_affected_blue_cryostat_issues.dat')
|
|
80
112
|
lines = [line.strip() for line in open(cryostat_file).readlines()]
|
|
81
113
|
file_roots = [line.split()[1] for line in lines if not line.startswith('#')]
|
|
82
|
-
return array(file_roots)
|
|
114
|
+
return np.array(file_roots)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def get_max_berv_span(self, n=None):
|
|
118
|
+
"""
|
|
119
|
+
Return the indices of the n observations which maximize the BERV span.
|
|
120
|
+
If n is None, return all indices sorted by BERV span.
|
|
121
|
+
"""
|
|
122
|
+
berv_argsort = np.argsort(self.berv)
|
|
123
|
+
|
|
124
|
+
# if n is None:
|
|
125
|
+
# n = self.N // 2
|
|
126
|
+
inds = []
|
|
127
|
+
for b1, b2 in zip(berv_argsort[:self.N // 2], berv_argsort[::-1]):
|
|
128
|
+
inds.append(b1)
|
|
129
|
+
inds.append(b2)
|
|
130
|
+
return np.array(inds[:n])
|
|
131
|
+
|
|
132
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
arvi/HZ.py,sha256=btqDFTxHeQlmvXOQKrjOpP8YFtmFjGhSZwsYYehLOaM,2885
|
|
2
|
+
arvi/__init__.py,sha256=XjBsNGlwuLftPK50u7SOmYKpmOpt9X5AIqA9LdZ8GyU,344
|
|
3
|
+
arvi/binning.py,sha256=G1nZvH2ev02quDPZCReygLkH7tX6B3hFAOoOYTfhLec,15249
|
|
4
|
+
arvi/config.py,sha256=XqLmIsPl9dJvco1ngANG5W868BexfuJJEaRkuKZsAK8,43
|
|
5
|
+
arvi/dace_wrapper.py,sha256=bfNzHKQUryCkZsJdEJImJY3oLIwVjflJOFQRRJ4RoAE,10125
|
|
6
|
+
arvi/extra_data.py,sha256=WEEaYeLh52Zdv0uyHO72Ys5MWS3naTAP4wJV2BJ1mbk,2551
|
|
7
|
+
arvi/instrument_specific.py,sha256=gDNu6xM0nL3AItAxipTdg3dIGaGGi7tNWE5nnad5MxM,2873
|
|
8
|
+
arvi/lbl_wrapper.py,sha256=_ViGVkpakvuBR_xhu9XJRV5EKHpj5Go6jBZGJZMIS2Y,11850
|
|
9
|
+
arvi/nasaexo_wrapper.py,sha256=xrdF4KKXmlZAqu4IQtdcqfOeUXJXoui5M-eZpnVXNlk,7311
|
|
10
|
+
arvi/plots.py,sha256=J1FR-7NgWL0zdjtD0Sumj6ZHLXSRC_EtnpXkTguxQ-s,17549
|
|
11
|
+
arvi/programs.py,sha256=OHmOW1BJUUg7xmzpTDzyAunxiGZ77QpVIN4Z9HxmE4M,3556
|
|
12
|
+
arvi/reports.py,sha256=yrdajC-zz5_kH1Ucc6cU70DK-5dpG0Xyeru-EITKpNo,3355
|
|
13
|
+
arvi/setup_logger.py,sha256=pBzaRTn0hntozjbaRVx0JIbWGuENkvYUApa6uB-FsRo,279
|
|
14
|
+
arvi/simbad_wrapper.py,sha256=F_VOHBI-KqT9q06sO2n2F1Ov6Un_1gAMP3ItBMqx-Yw,5284
|
|
15
|
+
arvi/stats.py,sha256=MQiyLvdiAFxIC29uajTy8kuxD-b2Y6mraL4AfWkRJkM,2576
|
|
16
|
+
arvi/timeseries.py,sha256=IvpjJqRL97bOwm4RpAGqvevkySj0Odjzx6vPtvlKzSI,52294
|
|
17
|
+
arvi/translations.py,sha256=eyUJei8wlsyBecTz8E_ntpP35-Mre2Tzm_mUMMGaZWY,150
|
|
18
|
+
arvi/utils.py,sha256=ay3GouZYqn66zF43KgSs8Ngsfb4YInKZEmk70YqVDoA,3676
|
|
19
|
+
arvi/data/info.svg,sha256=0IMI6W-eFoTD8acnury79WJJakpBwLa4qKS4JWpsXiI,489
|
|
20
|
+
arvi/data/obs_affected_ADC_issues.dat,sha256=pbwzvRBjS8KsLrKi1Cdgfihvo3hK3FUN8Csdysw-vAw,10653
|
|
21
|
+
arvi/data/obs_affected_blue_cryostat_issues.dat,sha256=z4AK17xfz8tGTDv1FjRvQFnio4XA6PNNfDXuicewHk4,1771
|
|
22
|
+
arvi/data/extra/HD86226_PFS1.rdb,sha256=vfAozbrKHM_j8dYkCBJsuHyD01KEM1asghe2KInwVao,3475
|
|
23
|
+
arvi/data/extra/HD86226_PFS2.rdb,sha256=F2P7dB6gVyzCglUjNheB0hIHVClC5RmARrGwbrY1cfo,4114
|
|
24
|
+
arvi/data/extra/metadata.json,sha256=C69hIw6CohyES6BI9vDWjxwSz7N4VOYX0PCgjXtYFmU,178
|
|
25
|
+
arvi-0.1.11.dist-info/LICENSE,sha256=6JfQgl7SpM55t0EHMFNMnNh-AdkpGW25MwMiTnhdWQg,1068
|
|
26
|
+
arvi-0.1.11.dist-info/METADATA,sha256=cb2feqRY6mVlakZeoO86IYmPQzFLTWP8IboRNaBKVrw,1306
|
|
27
|
+
arvi-0.1.11.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
28
|
+
arvi-0.1.11.dist-info/top_level.txt,sha256=4EeiKDVLD45ztuflTGfQ3TU8GVjJg5Y95xS5XjI-utU,5
|
|
29
|
+
arvi-0.1.11.dist-info/RECORD,,
|
arvi-0.1.8.dist-info/RECORD
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
arvi/__init__.py,sha256=ArHfJ-BkFZeYWW20EaBUAzsxanci3-sI1M12IvtIVa4,223
|
|
2
|
-
arvi/binning.py,sha256=rGTisXmVRzo-7PxLKOEF1DxHBVH8X-kZTYqbN_2IXmw,14693
|
|
3
|
-
arvi/config.py,sha256=VM23kaAuyOWp9clfCIztJEnT5BWbG7o8see0UEqDeK0,20
|
|
4
|
-
arvi/dace_wrapper.py,sha256=Db6qnrIQbf-x8mbJFYfRNHzjAaJmvYSSC-j9IyNAsts,9390
|
|
5
|
-
arvi/instrument_specific.py,sha256=gDNu6xM0nL3AItAxipTdg3dIGaGGi7tNWE5nnad5MxM,2873
|
|
6
|
-
arvi/lbl_wrapper.py,sha256=_ViGVkpakvuBR_xhu9XJRV5EKHpj5Go6jBZGJZMIS2Y,11850
|
|
7
|
-
arvi/nasaexo_wrapper.py,sha256=xrdF4KKXmlZAqu4IQtdcqfOeUXJXoui5M-eZpnVXNlk,7311
|
|
8
|
-
arvi/plots.py,sha256=9tgleBrpNhQqRTmRx_sZTqSm2DKO08NZzMPhj9rh4WY,11405
|
|
9
|
-
arvi/programs.py,sha256=OHmOW1BJUUg7xmzpTDzyAunxiGZ77QpVIN4Z9HxmE4M,3556
|
|
10
|
-
arvi/reports.py,sha256=yrdajC-zz5_kH1Ucc6cU70DK-5dpG0Xyeru-EITKpNo,3355
|
|
11
|
-
arvi/setup_logger.py,sha256=pBzaRTn0hntozjbaRVx0JIbWGuENkvYUApa6uB-FsRo,279
|
|
12
|
-
arvi/simbad_wrapper.py,sha256=OEJOZOjIBLkEbJhJK91h18i2WswfMnYqR15A-wPAbmQ,4675
|
|
13
|
-
arvi/stats.py,sha256=qcTrfDXpw5tvPQci9r4ODkI5aSC-U0sOHX55i4Ipww0,1515
|
|
14
|
-
arvi/timeseries.py,sha256=it4WJJypIvi9RbGcOGGykb02Z-217xaXzYwFh9153tQ,41213
|
|
15
|
-
arvi/translations.py,sha256=eyUJei8wlsyBecTz8E_ntpP35-Mre2Tzm_mUMMGaZWY,150
|
|
16
|
-
arvi/utils.py,sha256=izQcImnc3aRyhHwCyOlRxKxrMKBfMvc3CnssehhvX6c,2271
|
|
17
|
-
arvi/data/info.svg,sha256=0IMI6W-eFoTD8acnury79WJJakpBwLa4qKS4JWpsXiI,489
|
|
18
|
-
arvi/data/obs_affected_ADC_issues.dat,sha256=pbwzvRBjS8KsLrKi1Cdgfihvo3hK3FUN8Csdysw-vAw,10653
|
|
19
|
-
arvi/data/obs_affected_blue_cryostat_issues.dat,sha256=z4AK17xfz8tGTDv1FjRvQFnio4XA6PNNfDXuicewHk4,1771
|
|
20
|
-
arvi-0.1.8.dist-info/LICENSE,sha256=6JfQgl7SpM55t0EHMFNMnNh-AdkpGW25MwMiTnhdWQg,1068
|
|
21
|
-
arvi-0.1.8.dist-info/METADATA,sha256=glmaHwWQqBB9ehRyZhLreP1Y9lRB_YSpnhAx7m4Mpk0,1305
|
|
22
|
-
arvi-0.1.8.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
23
|
-
arvi-0.1.8.dist-info/top_level.txt,sha256=4EeiKDVLD45ztuflTGfQ3TU8GVjJg5Y95xS5XjI-utU,5
|
|
24
|
-
arvi-0.1.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|