Skip to content

Instantly share code, notes, and snippets.

View jdnc's full-sized avatar

Madhura Parikh jdnc

View GitHub Profile
@jdnc
jdnc / ipython_nb_irsa_dust_v0
Created June 10, 2013 18:13
ipython notebook demonstrating some functions of irsa_dust v0
{
"metadata": {
"name": "irsa_dust_3"
},
"name": "irsa_dust_3",
"nbformat": 2,
"worksheets": [
{
"cells": [
{
@jdnc
jdnc / core.py
Last active December 18, 2015 08:00
core.py of irsa_dust module. A very 'primitive' version. also utils.py that has some helper functions. only the functions now used in core.py have been retained.
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import types
import functools
import requests
from xml.etree.ElementTree import ElementTree
from astropy.table import Table, Column
import astropy.units as u
from astropy.io import fits
import utils
import astropy.utils.data as aud
@jdnc
jdnc / blogExample.py
Last active December 18, 2015 14:08
example of @pytest.mark.parametrize
@pytest.mark.parametrize(('coordinate', 'radius', 'expected_payload'),
[
("m81", None, dict(locstr="m81")),
("m31", "5d", dict(locstr="m31", regSize=5.0))
])
def test_args_to_payload_instance_1(self, coordinate, radius,
expected_payload):
payload = irsa_dust.core.IrsaDust().args_to_payload(coordinate, radius=radius)
assert payload == expected_payload
{
"metadata": {
"name": "get_votable_fields"
},
"name": "get_votable_fields",
"nbformat": 2,
"worksheets": [
{
"cells": [
{
@jdnc
jdnc / vizier-add-row-examples.json
Created July 8, 2013 14:35
add_row seems to work well when the number of columns is restricted to be the same in all the votables from different catalogs. Here are some common examples with this
{
"metadata": {
"name": "vizier-examples-add-row"
},
"name": "vizier-examples-add-row",
"nbformat": 2,
"worksheets": [
{
"cells": [
{
@jdnc
jdnc / vizier-vstack-errors.json
Created July 8, 2013 14:40
vstack is ideal for combining votables with unequal number of columns but can't get it to work currently...
This file has been truncated, but you can view the full file.
{
"metadata": {
"name": "vizier-examples-vstack"
},
"name": "vizier-examples-vstack",
"nbformat": 2,
"worksheets": [
{
"cells": [
{
{
"metadata": {
"name": "vizier-examples"
},
"name": "vizier-examples",
"nbformat": 2,
"worksheets": [
{
"cells": [
{
<?xml version="1.0"?>
<!DOCTYPE VOTABLE SYSTEM "http://us-vo.org/xml/VOTable.dtd">
<VOTABLE >
<DESCRIPTION>
Obs Summary Query. NRAO : https://archive.nrao.edu/archive/ArchiveQuery?OBS_BANDS=ALL&amp;RECEIVER_ID=ALL&amp;SUBARRAY=ALL&amp;QUERY_MODE=AAT_TOOL&amp;SUBMIT=Submit Query&amp;EQUINOX=J2000&amp;SRAD=1.0'&amp;TELESCOPE=ALL&amp;CENTER_RA=68.29d&amp;SORT_ORDER=Asc&amp;QUERYTYPE=OBSSUMMARY&amp;QUERY_ID=9999&amp;PROTOCOL=VOTable-XML&amp;BACKEND_ID=ALL&amp;TELESCOPE_CONFIG=ALL&amp;SITE_CODE=AOC&amp;WRITELOG=0&amp;OBS_POLAR=ALL&amp;SORT_PARM=Starttime&amp;SORT_PARM2=Starttime&amp;LOCKMODE=PROJECT&amp;DATATYPE=ALL&amp;DBHOST=CHEWBACCA&amp;CENTER_DEC=5.352d&amp;SRC_SEARCH_TYPE=SIMBAD or NED&amp;SORT_ORDER2=Asc&amp;MAX_ROWS=NO LIMIT
</DESCRIPTION>
<RESOURCE type="results">
<INFO name="QUERY_STATUS" value="OK">Successful Search</INFO>
<TABLE >
<FIELD datatype="char" name="Source" ucd="string" arraysize="*" />
{
"metadata": {
"name": "mini-code"
},
"name": "mini-code",
"nbformat": 2,
"worksheets": [
{
"cells": [
{
@jdnc
jdnc / Naive_bayes_starter.json
Created March 22, 2014 23:17
Experimenting with Naive Bayes for neurosynth, just the beginning steps
{
"metadata": {
"name": "Naive Bayes Starter"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{