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
from astropy.io import fits | |
from scipy import optimize | |
import numpy as np | |
from extract_spectral.trace import GaussianPolynomialTrace, ModelFrame2D, LogLikelihood, LinearLstSqExtraction | |
from DIRECT import solve | |
from astropy.modeling import models | |
#download from | |
data = fits.getdata('IRCQ00467448.fits') | |
#data = fits.getdata('test_data/fors_many_stars.fits').T |
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
from astropy.table import Table | |
from astropy.io import fits | |
import pandas as pd | |
import numpy as np | |
class XShooterEchelle(object): | |
coef_types = ['cen', 'edgup', 'edglo'] |
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 argparse | |
from astropy.io import fits | |
from astropy import wcs | |
import os | |
from glob import glob | |
import pandas as pd | |
parser = argparse.ArgumentParser(description='Convert DECAM photometry to Tables') |
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
from astropy import coordinates as coord | |
from astropy import units as u, constants as const | |
import pandas as pd | |
cats = ['ut150625_g.h5', 'ut150625_r.h5', 'ut150625_u.h5'] | |
gdata = pd.read_hdf(cats[0], 'data') | |
gdata = gdata[gdata.type == 1] | |
gcat = coord.SkyCoord(gdata.RA.values, gdata.Dec.values, unit=u.degree) | |
rdata = pd.read_hdf(cats[1], 'data') |
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
from dalek import assemble_tardis_model | |
from dalek.base.model import SimpleTARDISUncertaintyModel, NormRedSpectrum, LogLikelihood | |
from dalek.base.base import BaseLikelihoodModel | |
from dalek.base.transform import uniform_transform | |
from astropy import units as u, constants as const | |
import os | |
base_dir = '/home/hpc/pr94se/di73qom/projects/tardis/dalek/test_artis_run/artis_fit' | |
artis_filename = os.path.join(base_dir, 'aaflux_057.dat') |
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
from astropy import wcs | |
from scipy import optimize | |
# this doesn't include the precise function names - just look them up on the astropy wcs website | |
def fit_func(crval1, crval2, x, y, ra, dec): | |
w = wcs.WCS(naxis=2) | |
w.wcs.crval = [crval1, crval2] | |
ra_wcs, dec_wcs = w.pix_to_world(x, y) | |
return (ra_wcs - ra)**2 + (dec_wcs - dec)**2 | |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 luigi | |
from glob import glob | |
import os | |
raw_zips = '/1002/*.gz' | |
class ExtractGZ(luigi.Task): | |
document_id = luigi.Parameter() | |
def output(self): |
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
from collections import OrderedDict | |
from astropy import units as u | |
import numpy as np | |
import pandas as pd | |
def read_cmfgen(fname): | |
nu = [] | |
flux = [] | |
current_data = nu |
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
from collections import OrderedDict | |
from astropy import units as u | |
import numpy as np | |
import pandas as pd | |
def read_cmfgen(fname): | |
nu = [] | |
flux = [] | |
current_data = nu |