PyXCSAO
Replicates functionality of IRAF XCSAO
To run:
Import
from pyxcsao.crosscorrelate import PyXCSAO
Initiates instance:
b=PyXCSAO(st_lambda=5000,end_lambda=10000)
---optional parameters: ncols=8192,low_bin=0,top_low=10,top_nrun=125,nrun=255,bell_window=0.05,minvel=-500,maxvel=500
Adds Synthetic grid
First time running: b.add_grid(grid_pickle='phoenix.p',grid_path='phoenix/*0.0/4.5.fits',grid_class='phoenix')
---options: phoenix, phoenixhires, coelho
From a precompiled pickle file:
b.add_grid(grid_pickle='phoenix.p')
Adds data
b.add_spectrum('file.fits',data_class='boss')
---options: boss,lamost,segue,user
Run XCSAO and get parameters
print(b.run_XCSAO())
Optimized for large grids:
print(b.run_XCSAO_optimized())
Plot CCF:
plt.plot(b.lag,b.best_ccf)
Example Code
import glob
import pandas as pd
from pyxcsao.crosscorrelate import PyXCSAO
from astropy.table import Table
import time
cat=Table.read('path.fits')
best=[]
b=PyXCSAO(st_lambda=5000,end_lambda=10000)
b.add_grid(grid_pickle='phoenix_full1.p')
batchsize=500
for j in range(0,len(cat),batchsize):
cat1=cat[j:j+batchsize]
print(j)
for i in range(len(cat1)):
path=cat1['path'][i]
try:
b.add_spectrum(path)
x=b.run_XCSAO_optimized()
best.append(x.copy())
except:
print(path)
df = pd.DataFrame(best)
df.to_csv('batch.csv')
Metadata
Release files for PyXCSAO 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| PyXCSAO-0.2.tar.gz | 8.7 kB | Without provenance | Details for PyXCSAO-0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| PyXCSAO-0.2-py3-none-any.whl | Python 3 | none | any | Details for PyXCSAO-0.2-py3-none-any.whl |
Total release size: 18.3 kB
Release files / PyXCSAO-0.2.tar.gz
| Download URL | PyXCSAO-0.2.tar.gz |
|---|---|
| Size | 8.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
333dcb1d659f01ec886dff50c00f5b140461fd0df3de871186b7e5bcdb1218f4
|
|
BLAKE2b-256 checksum How to use checksums |
457236260bce092a4a54133d53adef257cf5404f261027f0f3aa016aa4474d5e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.7
|
Release files / PyXCSAO-0.2-py3-none-any.whl
| Download URL | PyXCSAO-0.2-py3-none-any.whl |
|---|---|
| Size | 9.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
04d37de2f9f0693bc965dac245de31ae14f6c7e9d42b64b57e3cda6b6b46c92c
|
|
BLAKE2b-256 checksum How to use checksums |
effeb5f543fd5ed76f5ba6234198cea10a03f1f9e7f9d0266415472c8d446365
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.7
|
Security for PyXCSAO 0.2
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.