This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
stars.name, | |
obs.id, | |
fit_gridchi_1.vcorr, | |
fit_gridchi_1.teff, | |
fit_gridchi_1.logg, | |
fit_gridchi_1.feh, | |
fit_gridchi_1.chi, | |
fit_minuit_1.teff, | |
fit_minuit_1.logg, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lines ~ 200k | |
levels ~ 20k | |
update | |
lines | |
set | |
level_id_upper = | |
(select level_id from levels | |
where lines.atom=levels.atom and | |
lines.ion=levels.ion and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [1]: from IPython.parallel import Client | |
In [2]: rc = Client() | |
In [3]: myrec = random.random((10,3)) | |
In [4]: myrec | |
Out[4]: | |
array([[ 0.83451781, 0.86186735, 0.11552798], | |
[ 0.4613526 , 0.01918926, 0.97660991], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This module provides a basic and probably temporary WCS solution until astropy has a wcs built-in | |
#This is all built upon @nden's work on the models class | |
from astropy import models | |
import numpy as np | |
class BaseSpectrum1DWCSError(Exception): | |
pass | |
class BaseSpectrum1DWCS(models.Model): | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ virtualenvs virtualenv-2.7 --no-site-packages tardis_release | |
New python executable in tardis_release/bin/python | |
Installing setuptools............done. | |
Installing pip...............done. | |
➜ virtualenvs source tardis_release/bin/activate | |
(tardis_release)➜ virtualenvs cd tardis_release | |
bin include lib | |
(tardis_release)➜ ~VIRTUAL_ENV pip install astropy | |
Downloading/unpacking astropy | |
Downloading astropy-0.2.4.tar.gz (4.7MB): 4.7MB downloaded |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ERROR: AttributeError: 'Spectrum1DLookupWCS' object has no attribute '_param_dim' [astropy.modeling.core] | |
--------------------------------------------------------------------------- | |
AttributeError Traceback (most recent call last) | |
<ipython-input-3-01a2fdaa6cd5> in <module>() | |
----> 1 specwcs.Spectrum1DLookupWCS(np.arange(3000, 6000) * u.Angstrom) | |
/Users/wkerzend/scripts/python/specutils/specutils/wcs/specwcs.py in __init__(self, lookup_table, unit, lookup_table_interpolation_kind) | |
60 self.lookup_table_parameter = lookup_table * unit | |
61 elif unit is None: # lookup_table is already unit'd | |
---> 62 self.lookup_table_parameter = lookup_table |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
import os | |
import shutil | |
pdflatex_bin = 'pdflatex' | |
bibtex_bin = 'bibtex' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MultiSpecWCS(Model): | |
def __init__(self, single_wcs=[list of 1d WCSs]): | |
self.single_wcs = single_wcs | |
def __call__(self, x, y): | |
assert type(x) == int # we need to make sure that the user does not expect to interpolate between two adjacent spectra |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
base_url = 'http://henke.lbl.gov/cgi-bin/pert_cgi.pl' | |
def get_photo_absorption_cross_section(element_code, energy): | |
data = requests.get(base_url, data=dict( | |
Element=element_code, Energy=energy)) | |
bs = BeautifulSoup(data.text) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class IRCSEchelle(Model): | |
inputs = () | |
outputs = ('polygon_array', ) | |
slit_width = Parameter(default=5.) | |
slit_length = Parameter(default=10.) | |
def evaluate(self, slit_width, slit_length, ...): | |
parray = run_idl_code(slit_width, slit_length) | |
return parray |
OlderNewer