ethraid 2.4.3__tar.gz → 2.4.4__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 (56) hide show
  1. ethraid-2.4.4/LICENSE +21 -0
  2. ethraid-2.4.4/PKG-INFO +130 -0
  3. ethraid-2.4.4/README.md +120 -0
  4. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid/__init__.py +1 -1
  5. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid/compiled/ethraid/helper_functions_astro.c +462 -468
  6. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid/compiled/ethraid/helper_functions_general.c +954 -917
  7. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid/compiled/ethraid/helper_functions_imaging.c +801 -698
  8. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid/compiled/ethraid/helper_functions_rv.c +217 -244
  9. ethraid-2.4.4/ethraid/compiled/helper_functions_astro.cpython-37m-darwin.so +0 -0
  10. ethraid-2.4.4/ethraid/compiled/helper_functions_general.cpython-37m-darwin.so +0 -0
  11. ethraid-2.4.4/ethraid/compiled/helper_functions_imaging.cpython-37m-darwin.so +0 -0
  12. ethraid-2.4.4/ethraid/compiled/helper_functions_rv.cpython-37m-darwin.so +0 -0
  13. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid/data/.DS_Store +0 -0
  14. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid/driver.py +7 -6
  15. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid/helper_functions_astro.pyx +10 -9
  16. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid/helper_functions_general.pyx +20 -86
  17. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid/helper_functions_imaging.pyx +14 -13
  18. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid/helper_functions_rv.pyx +12 -11
  19. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid/plotter.py +17 -22
  20. ethraid-2.4.4/ethraid.egg-info/PKG-INFO +130 -0
  21. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid.egg-info/SOURCES.txt +2 -3
  22. {ethraid-2.4.3 → ethraid-2.4.4}/setup.py +1 -0
  23. ethraid-2.4.3/PKG-INFO +0 -45
  24. ethraid-2.4.3/README.md +0 -37
  25. ethraid-2.4.3/ethraid/compiled/helper_functions_astro.cpython-37m-darwin.so +0 -0
  26. ethraid-2.4.3/ethraid/compiled/helper_functions_general.cpython-37m-darwin.so +0 -0
  27. ethraid-2.4.3/ethraid/compiled/helper_functions_imaging.cpython-37m-darwin.so +0 -0
  28. ethraid-2.4.3/ethraid/compiled/helper_functions_rv.cpython-37m-darwin.so +0 -0
  29. ethraid-2.4.3/ethraid/example_config_files/.DS_Store +0 -0
  30. ethraid-2.4.3/ethraid/example_config_files/config_191939.py +0 -87
  31. ethraid-2.4.3/ethraid.egg-info/PKG-INFO +0 -45
  32. {ethraid-2.4.3 → ethraid-2.4.4}/MANIFEST.in +0 -0
  33. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid/c_kepler/__init__.py +0 -0
  34. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid/c_kepler/_kepler.c +0 -0
  35. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid/c_kepler/_kepler.pyx +0 -0
  36. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid/c_kepler/kepler.c +0 -0
  37. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid/c_kepler/radvel_requirements.txt +0 -0
  38. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid/c_kepler/radvel_setup.py +0 -0
  39. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid/cli.py +0 -0
  40. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid/compiled/_kepler.cpython-37m-darwin.so +0 -0
  41. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid/compiled/ethraid/c_kepler/_kepler.c +0 -0
  42. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid/compiled/ethraid/c_kepler/kepler.c +0 -0
  43. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid/data/TOI1694_832.csv +0 -0
  44. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid/data/bands.csv +0 -0
  45. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid/data/baraffe_table_4.csv +0 -0
  46. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid/data/mamajek.csv +0 -0
  47. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid/data/test_K_band.csv +0 -0
  48. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid/helper_functions_plotting.py +0 -0
  49. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid/kern_profiler_dummy.py +0 -0
  50. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid/load_save.py +0 -0
  51. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid.egg-info/dependency_links.txt +0 -0
  52. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid.egg-info/entry_points.txt +0 -0
  53. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid.egg-info/requires.txt +0 -0
  54. {ethraid-2.4.3 → ethraid-2.4.4}/ethraid.egg-info/top_level.txt +0 -0
  55. {ethraid-2.4.3 → ethraid-2.4.4}/requirements.txt +0 -0
  56. {ethraid-2.4.3 → ethraid-2.4.4}/setup.cfg +0 -0
ethraid-2.4.4/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Judah Van Zandt, Erik Petigura
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
ethraid-2.4.4/PKG-INFO ADDED
@@ -0,0 +1,130 @@
1
+ Metadata-Version: 2.1
2
+ Name: ethraid
3
+ Version: 2.4.4
4
+ Summary: Characterize long-period companions using RV trends, astrometric accelerations, and direct imaging
5
+ Home-page:
6
+ Author: Judah Van Zandt
7
+ Author-email: judahvz@astro.ucla.edu
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+
11
+ # Ethraid
12
+
13
+ Characterize long-period companions with partial orbits.
14
+
15
+ Please cite Van Zandt \& Petigura (2024, Accepted) and the following DOI if you make use of this software in your research.
16
+ [![DOI](https://zenodo.org/badge/355760029.svg)](https://zenodo.org/doi/10.5281/zenodo.10841606)
17
+
18
+ ## Environment
19
+ ### Create new environment with python 3.7
20
+ - *\$ conda create --name ethraid_env python=3.7*
21
+ - *\$ conda activate ethraid_env*
22
+
23
+ ## Download using pip
24
+ - *\$ pip install ethraid*
25
+ - If the installation fails, try upgrading pip: *\$ curl https://bootstrap.pypa.io/get-pip.py | python*
26
+
27
+ ## Download repo from Github
28
+ ### Install dependencies using requirements.txt
29
+ - *\$ pip install -r requirements.txt*
30
+
31
+ ### Build code from top level of repo
32
+ - *\$ cd trends/*
33
+ - *\$ python setup.py build_ext --inplace*
34
+
35
+ ### Run 3 simple test configuration files to ensure all API and CLI functions are working correctly
36
+ - *\$ python test.py*
37
+ - This should only take a few minutes. Desired outcome:
38
+ ```
39
+ Test complete:
40
+ 0 errors encountered running API array calculation
41
+ 0 errors encountered running API array loading
42
+ 0 errors encountered running CLI array calculation
43
+ 0 errors encountered running CLI array loading
44
+ 0 errors encountered running CLI 'all' function
45
+ ```
46
+ - These are only meant to test basic functionality. The output plots and bounds will be meaningless because of the small number of models sampled.
47
+
48
+ ## Create a configuration file from the template provided and provide the required parameters and desired data
49
+ - *\$ cp template_config.py my_config.py*
50
+ - NOTE: ethraid uses AU for all distances and M_Jup for all masses. Access helpful conversion factors using e.g.
51
+
52
+ ```
53
+ from ethraid import Ms2Mj, pc_in_au
54
+ ```
55
+ which respectively convert solar masses to Jupiter masses and parsecs to AU in your config file.
56
+
57
+ ## Example usage
58
+ ### CLI: Run orbit fits, plot results, and print 95\% confidence intervals all at once from the command line. Ethraid's installation includes a configuration file, ```example/config_191939.py```, which may be used to validate its functionality on the system HD 191939.
59
+ - *\$ ethraid all -cf path/to/ethraid/example/config_191939.py* -rfp results/191939/191939_processed.h5 -t 1d 2d
60
+ - Note that the *-rfp* (read file path) flag requires the path to the output directory where the fit results are stored. On a first run, this path *does not exist yet,* but it will be created after the fit and before plotting.
61
+
62
+ ### Alternative: run each command separately
63
+
64
+ #### Run orbit fits using parameters in configuration file
65
+ - *\$ ethraid run -cf path/to/ethraid/example/config_191939.py*
66
+ #### Load and plot saved results
67
+ - *\$ ethraid plot -cf path/to/ethraid/example/config_191939.py -rfp results/191939/191939_processed.h5 -t 1d 2d*
68
+ #### Print 95\% mass and semi-major axis confidence intervals based on derived posterior
69
+ - *\$ ethraid lims -cf path/to/ethraid/example/config_191939.py -rfp results/191939/191939_processed.h5*
70
+
71
+ ### Another alternative: use the api_run.py module to interface easily with the API
72
+
73
+ - Add the following code to the end of the module to run a fit, plot the results, and print a summary to the command line.
74
+
75
+ ```
76
+ if __name__ == "__main__":
77
+
78
+ config_path = 'path/to/ethraid/example/config_191939.py'
79
+ read_file_path = 'results/191939/191939_processed.h5'
80
+
81
+
82
+ plot=True
83
+ verbose = True
84
+
85
+ run(config_path, read_file_path,
86
+ plot=plot, verbose=verbose)
87
+ ```
88
+
89
+ ## Results
90
+ #### Running ethraid from scratch will generate a directory called *results/\{star_name\}/* containing the raw (large, reshapeable) posterior arrays and/or their processed (small, non-reshapeable) counterparts. After plotting, the directory will contain up to three plots: a joint 2D posterior in mass-separation space, as well as the marginalized 1D PDFs and CDFs. Samples of these plots are below.
91
+
92
+ - 2D joint posterior
93
+ <img src="ethraid/example/191939/191939_2d.png" width="450" height="450">
94
+
95
+ - 1D PDFs
96
+ <img src="ethraid/example/191939/191939_pdf_1d.png" width="600" height="400">
97
+
98
+ - 1D CDFs
99
+ <img src="ethraid/example/191939/191939_cdf_1d.png" width="550" height="350">
100
+
101
+
102
+ ## Troubleshooting
103
+
104
+ ### Why are my posteriors splotchy?
105
+ - Try increasing the *num_points* argument. This will increase the number of sampled orbit models with a corresponding rise in run time.
106
+ - Try decreasing the *grid_num* argument. This will lower the resolution of the grid and help smooth over stochastic variation with no increase in run time.
107
+
108
+ ### Why does my RV/astrometry posterior extend down to the low-mass/high-separation regime (the bottom-right corner)? It's not helping to rule out any models!
109
+ - Check your input data values. They may be consistent with 0, meaning that companions producing negligible signals are good fits to the data.
110
+
111
+ ### Why does the astrometry posterior have large overlap with the RVs? It's not helping to rule out any models!
112
+ - Check the range of orbital separations you're probing. Beyond ~25 years (~8.5 AU for a Sun-like star), the RV and astrometry posteriors have the same m-a relation, and thus have the same information content.
113
+
114
+ ### How do I check the &Delta;&mu; value of my desired target in the *Hipparcos-Gaia* Catalog of Accelerations?
115
+
116
+ - Use the built-in API function:
117
+
118
+ ```
119
+ from ethraid.compiled import helper_functions_astro as help_astro
120
+
121
+ help_astro.HGCA_retrieval(hip_id="99175")
122
+ ```
123
+
124
+ Output:
125
+
126
+ ```
127
+ (0.12684636376342961, 0.03385628059095324)
128
+ ```
129
+
130
+ This target has &Delta;&mu; = 0.127 +/- 0.034 mas/yr, a 3.7 &sigma; measurement.
@@ -0,0 +1,120 @@
1
+ # Ethraid
2
+
3
+ Characterize long-period companions with partial orbits.
4
+
5
+ Please cite Van Zandt \& Petigura (2024, Accepted) and the following DOI if you make use of this software in your research.
6
+ [![DOI](https://zenodo.org/badge/355760029.svg)](https://zenodo.org/doi/10.5281/zenodo.10841606)
7
+
8
+ ## Environment
9
+ ### Create new environment with python 3.7
10
+ - *\$ conda create --name ethraid_env python=3.7*
11
+ - *\$ conda activate ethraid_env*
12
+
13
+ ## Download using pip
14
+ - *\$ pip install ethraid*
15
+ - If the installation fails, try upgrading pip: *\$ curl https://bootstrap.pypa.io/get-pip.py | python*
16
+
17
+ ## Download repo from Github
18
+ ### Install dependencies using requirements.txt
19
+ - *\$ pip install -r requirements.txt*
20
+
21
+ ### Build code from top level of repo
22
+ - *\$ cd trends/*
23
+ - *\$ python setup.py build_ext --inplace*
24
+
25
+ ### Run 3 simple test configuration files to ensure all API and CLI functions are working correctly
26
+ - *\$ python test.py*
27
+ - This should only take a few minutes. Desired outcome:
28
+ ```
29
+ Test complete:
30
+ 0 errors encountered running API array calculation
31
+ 0 errors encountered running API array loading
32
+ 0 errors encountered running CLI array calculation
33
+ 0 errors encountered running CLI array loading
34
+ 0 errors encountered running CLI 'all' function
35
+ ```
36
+ - These are only meant to test basic functionality. The output plots and bounds will be meaningless because of the small number of models sampled.
37
+
38
+ ## Create a configuration file from the template provided and provide the required parameters and desired data
39
+ - *\$ cp template_config.py my_config.py*
40
+ - NOTE: ethraid uses AU for all distances and M_Jup for all masses. Access helpful conversion factors using e.g.
41
+
42
+ ```
43
+ from ethraid import Ms2Mj, pc_in_au
44
+ ```
45
+ which respectively convert solar masses to Jupiter masses and parsecs to AU in your config file.
46
+
47
+ ## Example usage
48
+ ### CLI: Run orbit fits, plot results, and print 95\% confidence intervals all at once from the command line. Ethraid's installation includes a configuration file, ```example/config_191939.py```, which may be used to validate its functionality on the system HD 191939.
49
+ - *\$ ethraid all -cf path/to/ethraid/example/config_191939.py* -rfp results/191939/191939_processed.h5 -t 1d 2d
50
+ - Note that the *-rfp* (read file path) flag requires the path to the output directory where the fit results are stored. On a first run, this path *does not exist yet,* but it will be created after the fit and before plotting.
51
+
52
+ ### Alternative: run each command separately
53
+
54
+ #### Run orbit fits using parameters in configuration file
55
+ - *\$ ethraid run -cf path/to/ethraid/example/config_191939.py*
56
+ #### Load and plot saved results
57
+ - *\$ ethraid plot -cf path/to/ethraid/example/config_191939.py -rfp results/191939/191939_processed.h5 -t 1d 2d*
58
+ #### Print 95\% mass and semi-major axis confidence intervals based on derived posterior
59
+ - *\$ ethraid lims -cf path/to/ethraid/example/config_191939.py -rfp results/191939/191939_processed.h5*
60
+
61
+ ### Another alternative: use the api_run.py module to interface easily with the API
62
+
63
+ - Add the following code to the end of the module to run a fit, plot the results, and print a summary to the command line.
64
+
65
+ ```
66
+ if __name__ == "__main__":
67
+
68
+ config_path = 'path/to/ethraid/example/config_191939.py'
69
+ read_file_path = 'results/191939/191939_processed.h5'
70
+
71
+
72
+ plot=True
73
+ verbose = True
74
+
75
+ run(config_path, read_file_path,
76
+ plot=plot, verbose=verbose)
77
+ ```
78
+
79
+ ## Results
80
+ #### Running ethraid from scratch will generate a directory called *results/\{star_name\}/* containing the raw (large, reshapeable) posterior arrays and/or their processed (small, non-reshapeable) counterparts. After plotting, the directory will contain up to three plots: a joint 2D posterior in mass-separation space, as well as the marginalized 1D PDFs and CDFs. Samples of these plots are below.
81
+
82
+ - 2D joint posterior
83
+ <img src="ethraid/example/191939/191939_2d.png" width="450" height="450">
84
+
85
+ - 1D PDFs
86
+ <img src="ethraid/example/191939/191939_pdf_1d.png" width="600" height="400">
87
+
88
+ - 1D CDFs
89
+ <img src="ethraid/example/191939/191939_cdf_1d.png" width="550" height="350">
90
+
91
+
92
+ ## Troubleshooting
93
+
94
+ ### Why are my posteriors splotchy?
95
+ - Try increasing the *num_points* argument. This will increase the number of sampled orbit models with a corresponding rise in run time.
96
+ - Try decreasing the *grid_num* argument. This will lower the resolution of the grid and help smooth over stochastic variation with no increase in run time.
97
+
98
+ ### Why does my RV/astrometry posterior extend down to the low-mass/high-separation regime (the bottom-right corner)? It's not helping to rule out any models!
99
+ - Check your input data values. They may be consistent with 0, meaning that companions producing negligible signals are good fits to the data.
100
+
101
+ ### Why does the astrometry posterior have large overlap with the RVs? It's not helping to rule out any models!
102
+ - Check the range of orbital separations you're probing. Beyond ~25 years (~8.5 AU for a Sun-like star), the RV and astrometry posteriors have the same m-a relation, and thus have the same information content.
103
+
104
+ ### How do I check the &Delta;&mu; value of my desired target in the *Hipparcos-Gaia* Catalog of Accelerations?
105
+
106
+ - Use the built-in API function:
107
+
108
+ ```
109
+ from ethraid.compiled import helper_functions_astro as help_astro
110
+
111
+ help_astro.HGCA_retrieval(hip_id="99175")
112
+ ```
113
+
114
+ Output:
115
+
116
+ ```
117
+ (0.12684636376342961, 0.03385628059095324)
118
+ ```
119
+
120
+ This target has &Delta;&mu; = 0.127 +/- 0.034 mas/yr, a 3.7 &sigma; measurement.
@@ -1,7 +1,7 @@
1
1
  import os
2
2
  from astropy.time import Time
3
3
 
4
- __version__='2.4.3' # Remember to remove random seed
4
+ __version__='2.4.4' # Remember to remove random seed
5
5
 
6
6
  _ROOT = os.path.abspath(os.path.dirname(__file__))
7
7