Skip to content

Instantly share code, notes, and snippets.

View keflavich's full-sized avatar

Adam Ginsburg keflavich

View GitHub Profile
import numpy as np
from astropy.io import fits
import reproject
from astropy import wcs
base_header = fits.getheader('moments/G0_13CO21_downsampled_mom0.fits')
base_wcs = wcs.WCS(base_header).celestial
new_header = base_wcs.to_header()
import numpy as np
from astropy.io import fits
import reproject
from astropy import wcs
base_header = fits.getheader('G000_13CO21_SEDIGISM_DR1c_spatialdownsample_4x_downsampled_2kms.fits')
base_wcs = wcs.WCS(base_header)
new_header = base_wcs.to_header()
import os
from astropy import constants, units as u, table, stats, coordinates, wcs, log, coordinates as coord, convolution, modeling, time; from astropy.io import fits, ascii
import reproject
import glob
from reproject.mosaicking import find_optimal_celestial_wcs
from reproject.mosaicking import reproject_and_coadd
from reproject import reproject_interp
import requests
from bs4 import BeautifulSoup
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@keflavich
keflavich / measure_paa_from_coelho.py
Created July 11, 2020 21:12
Measure Paschen Alpha line strengths from the Coelho models
import glob
from astropy import table
import requests
import tarfile
import os
url = "http://specmodels.iag.usp.br/fits_search/compress/s_coelho14_sed.tgz"
fn = os.path.basename(url)
if not os.path.exists(fn):
resp = requests.get(url)
import numpy as np
from glue.core import Data, DataCollection
from glue.app.qt.application import GlueApplication
try:
from glue.viewers.image.qt.data_viewer import ImageViewer
except ImportError:
from glue.viewers.image.qt.viewer_widget import ImageWidget as ImageViewer
from glue.core.coordinates import coordinates_from_wcs
import numpy as np
from astroquery.vizier import Vizier
import pylab as pl
from astropy import constants, units as u, table, stats, coordinates, wcs, log, coordinates as coord, convolution, modeling, time; from astropy.io import fits, ascii
Vizier.ROW_LIMIT = 3e5
rslt = Vizier.query_constraints(catalog="II/246", GLAT='<5 & >-5', Kmag='<7', GLON='<45 | >315')[0]
crds = coordinates.SkyCoord(rslt['RAJ2000'], rslt['DEJ2000'], frame='fk5', unit=(u.deg, u.deg)).galactic
gridy,gridx = np.mgrid[-5:5:0.333, -45:45:0.333]
@keflavich
keflavich / load_and_show_data-july-scans.ipynb
Last active August 4, 2020 19:06
HI observations with barycorr
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@keflavich
keflavich / load_and_show_data.ipynb
Created June 14, 2020 20:38
HI RTL-SDR integrations
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.