<commit_before># reimagined-palm-tree
Spectrograph performance, both in terms of an exposure time calculation for a target SNR, and RMS velocity error for input signal and stellar parameters.

[![astropy](http://img.shields.io/badge/powered%20by-AstroPy-orange.svg?style=flat)](http://www.astropy.org/)

All wavelengths are in ångströms, and all velocities are in m/s if unlabled (If lableled, they are likely to be in km/s).
Also, distances are in parsecs, and star sizes are in solar radii. Usage of astropy.units should limit the need to keep careful track of what is used where.

Required libraries: numpy, astropy

Requires Python 3, notably due to extensive unicode variable names.

##### exptime.py
Calculates exposure time to reach a target SNR, given telescope parameters and target apparent magnitude. Also acts as a library for exptime_batch.py. Depends on rvrms.py

#### exptime_batch.py
Generates exposure times, and creates the target list of stars (eta_list.txt) that dispatch_scheduler (https://github.com/pdn4kd/dispatch_scheduler) needs, given an existing CSV with the relevant properties (targetstars.csv). Relies on the dispatch_scheduler for telescope, site, etc. parameters. To use, put exptime_batch, exptime, and rvrms in the dispatch_scheduler base directory.

As this uses rvrms.py, it suffers from that file's limitations. Also, macroturbulence really should be using observational values where possible.

#### exptime_demo.py
Simple example of calculating exposure times across a range of magnitudes. Demonstrates that you can analytically get an exposure time if you have a target SNR. (Target radial velocities are rather more complex)

##### rvrms.py
Calculates SNR and RV precision, given telescope and stellar parameters. Radial Velocity uncertainty based off of signal in a somewhat idealized spectrograph, and stellar type. Stellar spectra are BT-Settl, if in a somewhat non-standard format. Other equations and data (http://www.personal.psu.edu/tgb15/beattygaudi/table1.dat) from Beatty and Gaudi (2015). DOI: 10.1086/684264

Example spectra are included (named 1700-9800, every 100 K below 7000 K and every 200 K above). Also uses http://www.aanda.org/articles/aa/full/2001/29/aa1316/aa1316.right.html for reference.

Current limitations: Detector properties not that closely based on actual hardware (especially sensitivity vs wavelength), macroturbulence assumed based on effective temperature instead of observations, microturbulence fixed at ~1 km/s; granulation/starspots/other jitter not considered; fixed assumptions made of Teff (200 K steps for RV information, must be between 2600 K and 7600 K inclusive, Stellar spectra in 100 K steps); wavelength ranges (400-2500 nm); spectrograph R values made based on wavelength range.

The spectrograph issues bother pdn4kd greatly, and a way to not have to use the table (with its assumptions on R and wavelength ranges) would be greatly appreciated.

#### rvrms_batch.py
Convert observations found in dispatch_scheduler to radial velocities. Needs additional work due to fragility/assumptions. Requires the dispatch_scheduler repo, and it is primarily used to generate radial velocities from observations done there.<commit_msg>Update information/reqs<commit_after># reimagined-palm-tree
Spectrograph performance, both in terms of an exposure time calculation for a target SNR, and RMS velocity error for input signal and stellar parameters.

[![astropy](http://img.shields.io/badge/powered%20by-AstroPy-orange.svg?style=flat)](http://www.astropy.org/)

All wavelengths are in ångströms, and all velocities are in m/s if unlabled (If lableled, they are likely to be in km/s).
Also, distances are in parsecs, and star sizes are in solar radii. Usage of astropy.units should limit the need to keep careful track of what is used where.

Required libraries: numpy, astropy

Requires Python 3, notably due to extensive unicode variable names.

##### exptime.py
Calculates exposure time to reach a target SNR, given telescope parameters and target apparent magnitude. Also acts as a library for exptime_batch.py. Depends on rvrms.py

#### exptime_batch.py
Generates exposure times, and creates the target list of stars (eta_list.txt) that dispatch_scheduler (https://github.com/pdn4kd/dispatch_scheduler) needs, given an existing CSV with the relevant properties (targetstars.csv). Relies on the dispatch_scheduler for telescope, site, etc. parameters. To use, put exptime_batch, exptime, and rvrms in the dispatch_scheduler base directory.

As this uses rvrms.py, it suffers from that file's limitations. Also, macroturbulence really should be using observational values where possible.

Required Inputs: Effective Temperature, Metallicity, Distance, Radius. Optional: Macroturbulence (estimated from temperature if unavailable), V*sin(i) (assumed to be 2 km/s if unavailable)

#### exptime_demo.py
Simple example of calculating exposure times across a range of magnitudes. Demonstrates that you can analytically get an exposure time if you have a target SNR. (Target radial velocities are rather more complex)

##### rvrms.py
Calculates SNR and RV precision, given telescope and stellar parameters. Radial Velocity uncertainty based off of signal in a somewhat idealized spectrograph, and stellar type. Stellar spectra are BT-Settl, if in a somewhat non-standard format. Other equations and data (http://www.personal.psu.edu/tgb15/beattygaudi/table1.dat) from Beatty and Gaudi (2015). DOI: 10.1086/684264

Example spectra are included (named 1700-9800, every 100 K below 7000 K and every 200 K above). Also uses http://www.aanda.org/articles/aa/full/2001/29/aa1316/aa1316.right.html for reference.

Current limitations: Detector properties not that closely based on actual hardware (especially sensitivity vs wavelength), microturbulence fixed at ~1 km/s; granulation/starspots/other jitter not considered; fixed assumptions made of Teff (200 K steps for RV information, must be between 2600 K and 7600 K inclusive, Stellar spectra in 100 K steps); wavelength ranges (400-2500 nm); spectrograph R values made based on wavelength range.

The spectrograph issues bother pdn4kd greatly, and a way to not have to use the table (with its assumptions on R and wavelength ranges) would be greatly appreciated.

#### rvrms_batch.py
Convert observations found in dispatch_scheduler to radial velocities. Needs additional work due to fragility/assumptions. Requires the dispatch_scheduler repo, and it is primarily used to generate radial velocities from observations done there.
{'fraction_non_alphanumeric': 0.06209948123283491, 'fraction_numerical': 0.023954836740921574, 'mean_word_length': 5.109040074557316, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4240351', 'n_tokens_mistral': 1898, 'n_tokens_neox': 1692, 'n_words': 849}