Skip to content

Instantly share code, notes, and snippets.

Thomas Robitaille astrofrog

Block or report user

Report or block astrofrog

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
import cmap_kittens
from import fits
import matplotlib.pyplot as plt
data = fits.getdata('monalisa.fits')[0]
plt.imshow(data, cmap='kittens', origin='lower')
astrofrog /
Created Jul 16, 2019
Example of creating 2d viewers from a single 3d viewer in glue and keeping properties in sync
from glue.core import Data
from glue.config import viewer_tool
from glue.external.echo import keep_in_sync
from glue.viewers.common.tool import Tool
from glue.viewers.scatter.qt.data_viewer import ScatterViewer
from glue_vispy_viewers.scatter.scatter_viewer import VispyScatterViewer
class XYZViewersTool(Tool):
import os
import click
import shutil
@click.option('--notebook', required=True)
@click.option('--template', required=True)
@click.option('--app', required=True)
def make_app(notebook, template, app):
import os
import tarfile
import tempfile
import requests
BUILDS_URL = '{pipeline_id}/_apis/build/builds'
ARTIFACTS_URL = BUILDS_URL + '/{build_id}/artifacts'
View gl-issue.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View weird_arrays.log
In [1]: import numpy as np
In [2]: x = np.arange(1000000)
In [3]: y = x[::2]
In [4]: y.__array_interface__
{'data': (4658720768, False),
'strides': (16,),
from import BaseCartesianData
from glue.core.message import NumericalDataChangedMessage
class IndexedData(BaseCartesianData):
A dataset where some dimensions have been removed via indexing.
def __init__(self, original_data, indices):


The main aim of the astropy-helpers is to make it easier to build, test, and produce documentation in packages. For example, it defines a python test command that can be used to run all the tests, and a python build_docs command that will automatically build the documentation using Sphinx. For more informaiton, see the README.rst file for astropy-helpers.

astrofrog / v3.0.5_vs_v3.1.x.log
Created Oct 29, 2018
Astropy performance changes from v3.0.5 to v3.1.x
View v3.0.5_vs_v3.1.x.log
Benchmarks that have improved:
before after ratio
[df4c75aa] [66ff20b9]
- 28.4±0.03ms 4.85±0.01ms 0.17 coordinates.FrameBenchmarks.time_concatenate_array
- 24.3±0.03ms 3.36±0.03ms 0.14 coordinates.FrameBenchmarks.time_concatenate_scalar
- 1.08±0.01ms 744±2μs 0.69 coordinates.FrameBenchmarks.time_init_array
- 390±0.4μs 82.6±0.6μs 0.21 coordinates.FrameBenchmarks.time_init_nodata
- 905±2μs 556±1μs 0.61 coordinates.FrameBenchmarks.time_init_scalar
- 18.4±0.01ms 1.79±0ms 0.10 coordinates.FrameBenchmarks.time_init_scalar_diff
View 2mass.tbl
\fixlen = T
\primary = 0
\RowsRetrieved = 23938
\QueryTime = 00:00:38.68672
\ORIGIN = 'IPAC Infrared Science Archive (IRSA), Caltech/JPL'
\DATETIME= '2009-04-15 18:46:00'
\DataTag = 'ADS/IRSA.Gator#2009/0415/184600_12519'
\DATABASE= '2MASS All-Sky Point Source Catalog (PSC) (fp_psc)'
\EQUINOX = 'J2000'
\SKYAREA = 'within 1000 arcsec of ra=274.70073 dec=-13.80723 Eq J2000 '
You can’t perform that action at this time.