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 math import * | |
import numpy as np | |
def ga2equ(ga): | |
""" | |
Convert Galactic to Equatorial coordinates (J2000.0) | |
(use at own risk) | |
Input: [l,b] in decimal degrees | |
Returns: [ra,dec] in decimal degrees |
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
In [1]: import numpy as np | |
In [2]: a = np.random.random(1e2) | |
In [3]: timeit a.ptp() | |
100000 loops, best of 3: 8.3 us per loop | |
In [4]: timeit a.max()-a.min() | |
100000 loops, best of 3: 9.31 us per loop |
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
"""Reads the WCS for the raw pixel counts into astropy.wcs""" | |
from astropy.io import fits | |
from astropy.wcs import WCS | |
f = fits.open('tpf_dstn.fits.gz') | |
funny_keywords = {'1CTYP4': 'CTYPE1', | |
'2CTYP4': 'CTYPE2', | |
'1CRPX4': 'CRPIX1', | |
'2CRPX4': 'CRPIX2', | |
'1CRVL4': 'CRVAL1', |
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 coalesce(columns): | |
"""Coalesces masked columns. | |
Parameters | |
---------- | |
columns : iterable of type `MaskedColumn` | |
Returns | |
------- | |
column : coalesced result |
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
"""Creates a plot of a K2 target's centroids, with and without mid-campaign offset. | |
""" | |
import numpy as np | |
import matplotlib.pyplot as pl | |
from matplotlib.ticker import MultipleLocator, FormatStrFormatter | |
import seaborn | |
from astropy.io import fits | |
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
""" | |
Example function to convert the 'QUALITY' column in Kepler/K2 target pixel | |
and lightcurve files into a list of meaningful strings. | |
""" | |
# The meaning of the various flags are described in the Kepler Archive Manual | |
KEPLER_QUALITY_FLAGS = { | |
"1": "Attitude tweak", | |
"2": "Safe mode", | |
"4": "Coarse point", |
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
2015ApJ...803...27P Prognosis of Gles of Relativistic Solar Protons | |
2015ApJ...803L...7L Radial and Azimuthal Oscillations of Halo Coronal Mass Ejections in the Sun | |
2015ApJS..217...10M A Laboratory Study of C<SUB>3</SUB>H<SUP>+</SUP> and the C<SUB>3</SUB>H Radical in Three New Vibrationally Excited <SUP>2</SUP>Σ States Using a Pin-Hole Nozzle Discharge Source | |
2015ApJ...799...31F Modulation of Galactic Cosmic Rays Observed at L1 in Solar Cycle 23 | |
2015ApJ...800...32L Hercules X-1: Using Eclipse to Measure the X-Ray Corona | |
2015ApJ...798...72S Benzene Formation on Interstellar Icy Mantles Containing Propargyl Alcohol | |
2015ApJ...798...36S Observations of Warm Carbon Chain Chemistry in NGC 3576 | |
2015ApJ...799...80G Diffusive Shock Acceleration of High-energy Charged Particles at Fast Interplanetary Shocks: A Parameter Survey | |
2015ApJ...800...87C Whistler Turbulence Forward Cascade versus Inverse Cascade: Three-dimensional Particle-in-cell Simulations | |
2015ApJ...807..164N Properties of Cyclotron Lines in a Line-forming R |
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
"""Computes the arXiv usage rates as a function of journal. | |
This is a rough script used for the sake of providing the numbers for one tweet: | |
https://twitter.com/GeertHub/status/705788341531201537 | |
I may turn this into a webservice that reports on the use of arXiv every month? | |
What do you think? | |
""" | |
import ads | |
import json |
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
"""Compute the median radius of all confirmed Kepler planets.""" | |
import pandas as pd | |
# Fetch the table of confirmed exoplanets from NExSci | |
planets = pd.read_csv('http://exoplanetarchive.ipac.caltech.edu/cgi-bin/nstedAPI/nph-nstedAPI?table=exoplanets&select=*') | |
# Select the Kepler planets | |
kepler_planets = planets[planets.pl_kepflag == 1] | |
# Do your statistics | |
print(kepler_planets.pl_rade.median()) |
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
sudo apt install libresample1 | |
wget http://mirrors.kernel.org/ubuntu/pool/universe/liba/libav/libavutil52_9.18-0ubuntu0.14.04.1_amd64.deb | |
sudo dpkg -i libavutil52_9.18-0ubuntu0.14.04.1_amd64.deb | |
wget http://mirrors.kernel.org/ubuntu/pool/universe/liba/libav/libswscale2_9.18-0ubuntu0.14.04.1_amd64.deb | |
sudo dpkg -i libswscale2_9.18-0ubuntu0.14.04.1_amd64.deb | |
wget https://www.dropbox.com/s/gg2i5wszrqkhzy8/clickshare_01.07.01-79_amd64.deb?dl=0# | |
sudo dpkg -i clickshare_01.07.01-79_amd64.deb |
OlderNewer