Skip to content

Instantly share code, notes, and snippets.

@dyf
dyf / flat_jupiter.py
Last active February 23, 2018 06:58
flat jupiter
import matplotlib.pyplot as plt
import imageio
import numpy as np
from scipy.signal import medfilt
# from here
# https://www.nasa.gov/multimedia/imagegallery/image_feature_539.html
im = imageio.imread('jupiter_bottom.jpg')
off = [16,-1]
rtrim = 200
@dyf
dyf / paw_plot.py
Last active August 22, 2018 05:16
paw plot
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.patches as mpatch
from matplotlib.collections import PatchCollection
import matplotlib.colors as mcolors
import matplotlib.colorbar
import matplotlib.gridspec as gridspec
def mega_paw_plot(sdata_list=None, sdata_bg_list=None, cdata_list=None,
cmap=None, clim=None,
from allensdk.core.mouse_connectivity_cache import MouseConnectivityCache
mcc = MouseConnectivityCache(manifest_file="/data/dynamic-brain-workshop/mouse_connectivity_cache/manifest.json",
resolution=10)
tv, _ = mcc.get_template_volume()
fig, ax = plt.subplots(figsize=(10,10))
plt.imshow(tv[:,515,:], cmap='gray')
plt.show()
from allensdk.api.queries.rma_api import RmaApi
import allensdk.core.json_utilities as ju
all_structs = []
root = RmaApi().model_query("Structure", criteria="[graph_id$eq1],[acronym$eqgrey]")[0]
all_structs.append(root)