ir_ldr
The package ir_ldr is for measuring the spectral line depth of the APOGEE and WINERED spectra, calculating the line depth ratio (LDR) and finally deriving the effective temperature (T_LDR).
The LDR-Teff relations inside this package are from Jian+19, Taniguchi+18 and Jian+20a (in prep.). Please also refer to Fukue+15.
This package relys on numpy, pandas, matplotlib and scipy; it is based on python 3.
Installation
pip install ir_ldr
Tutorial
The synthetic spectra of a dwarf star (Teff=5000 K, logg=4.5 dex and feh=0 dex; generated from MOOG) in ir_ldr/file/dwarf for an example of T_LDR calculation.
# Load the linelist.
linelist = ir_ldr.load_linelist('yj', 'dwarf-j20a')
# Here we use all the orders of synthetic spectra.
for order in [43, 44, 45, 46, 47, 48, 52, 53, 54, 55, 56, 57]:
# Load the synthetic spectra
spec = pd.read_csv(ir_ldr.__path__[0] + '/file/example_spectra/dwarf/order{}.txt'.format(order),
sep=' +', skiprows=2, engine='python', names=['wav', 'residual'])
wav = spec['wav'].values
residual = spec['residual'].values
# Select the line pairs for a specific order
linelist_sub = linelist[linelist['order'] == order]
if len(linelist_sub) == 0:
continue
linelist_sub.reset_index(drop=True, inplace=True)
# Measure the line depth of low(1)- and high(2)-EP line.
# Here the signal to noise ratio for the target star and telluric standard are
# manually set as 300, but the S_N of synthetic spectra is much higher than that.
d1 = ir_ldr.depth_measure(wav, residual, linelist_sub['linewav1'], suffix=1, S_N=[300, 300])
d2 = ir_ldr.depth_measure(wav, residual, linelist_sub['linewav2'], suffix=2, S_N=[300, 300])
# Calculate the logLDR value.
lgLDR = ir_ldr.cal_ldr(d1, d2, type='lgLDR')
# Combine the Dataframes of one order.
record = ir_ldr.combine_df([linelist_sub, d1, d2, lgLDR])
if order == 43:
record_all = record
else:
record_all = pd.concat([record_all, record], sort=False)
# Calculate T_LDR
LDR = ir_ldr.ldr2tldr_winered_solar(record_all, df_output=True)
And the result (T_LDR, T_LDR_err) is:
LDR[0:2]
>>> (5009.857201559249, 22.35966233607925)
# Note the T_LDR_err is not an accurate estimation here since the S_N is manually set.
Author
Mingjie Jian (ssaajianmingjie@gmail.com)
PhD student, Department of Astronomy, the University of Tokyo
Metadata
Release files for ir-ldr-mingjie 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ir_ldr_mingjie-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for ir_ldr_mingjie-0.1.4-py3-none-any.whl |
Release files / ir_ldr_mingjie-0.1.4-py3-none-any.whl
| Download URL | ir_ldr_mingjie-0.1.4-py3-none-any.whl |
|---|---|
| Size | 163.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
723e7ba3f02ef111e76ec282ee09137d23626fb243069875496aabafdd8be55b
|
|
BLAKE2b-256 checksum How to use checksums |
0013a1272092cd828fb95441b98bdae6a2f165444cee6964d667b6c7b12822a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.5.0.1 requests/2.14.2 setuptools/46.0.0 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.5.4
|
Security for ir-ldr-mingjie 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.