This file contains 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 glob import glob | |
from astropy import table | |
import h5py as hdf | |
from os.path import exists | |
files = glob('*.fit') | |
for f in files[:2]: | |
print f, '.....', | |
if not exists(f.replace('fit', 'hdf5')): |
This file contains 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 glob import glob | |
from astropy import table | |
from astropy.io import fits | |
from os.path import exists | |
files = glob('*.fit') | |
for f in files: | |
print f, '.....', | |
if not exists(f.replace('fit', 'hdf5')): |
This file contains 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 numpy as np | |
data = np.loadtxt('testfile, delimiter=',') | |
data = np.loadtxt('testfile', delimiter=',') | |
data = np.genfromtxt('testfile', delimiter=',') | |
data | |
x = -np.ones(6) | |
x | |
bad = np.isnan(data) | |
bad | |
x[~bad] = data[~bad] |
This file contains 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 numpy | |
import math | |
def sky_median_sig_clip(input_arr, sig_fract, percent_fract, max_iter=100): | |
"""Estimating sky value for a given number of iterations | |
@type input_arr: numpy array | |
@param input_arr: image data array | |
@type sig_fract: float | |
@param sig_fract: fraction of sigma clipping |
This file contains 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 astLib import astImages | |
from astLib import astWCS | |
def mk_thumb_wcs(header,data,ra,dec,window,output): | |
try: | |
wcs = astWCS.WCS(header,mode='pyfits') | |
except: | |
wcs = astWCS.WCS(header,mode='pyfits',extensionName='SCI') |
This file contains 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
#File: get_band_phot.py | |
#Created: Sun 14 Oct 2012 02:54:10 PM CDT | |
#Last Change: Sat Feb 2 14:40:52 2013 | |
#Author: Steven Boada | |
# This script returns a magnitude in the provided | |
# bandpass of the given spectrum. Make sure that | |
# wavelength units are the same for both inputs. | |
# | |
# flux units must be: FLUX / Angstrom | |
# |
This file contains 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
def mk_thumb_wcs(header,data,ra,dec,window,output): | |
try: | |
wcs = astWCS.WCS(header,mode='pyfits') | |
except: | |
wcs = astWCS.WCS(header,mode='pyfits',extensionName='SCI') | |
imdict = astImages.clipImageSectionWCS(data, wcs, ra, dec, | |
window, returnWCS=True) | |
thumb = imdict['data'] #data array |
This file contains 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 __future__ import division | |
from scipy import stats | |
import numpy as np | |
def mklogMass(theta): | |
''' Makes Log10 Mass from a given richness following the simet2016 | |
mass-richness relationship. | |
''' | |
m0, alpha, lambda0 = theta |
This file contains 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 astroplan | |
from astroplan import Observer, FixedTarget | |
from astropy.coordinates import SkyCoord | |
from astropy.time import Time, TimeDelta | |
from astroplan.constraints import AtNightConstraint, AirmassConstraint | |
import pandas as pd | |
import numpy as np | |
def mst2utc(time): | |
''' Converts from MST to UTC ''' |
This file contains 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
def make_RGB(self, newfirm=False, conf='stiff-common.conf'): | |
try: | |
print() | |
check_exe('stiff') | |
except FileNotFoundError: | |
return | |
_conf = os.path.join(pipeline, 'confs', conf) | |
OlderNewer