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
// Endian Differences When Interpreting Binary Data in JavaScript | |
// Let's make a request for a binary file | |
var xhr = new XMLHttpRequest(); | |
xhr.open('GET', 'data/m101.fits'); | |
xhr.responseType = 'arraybuffer'; | |
xhr.onload = function() { | |
var buffer = xhr.response; | |
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
import numpy | |
import cv2 | |
original = "original.tif" | |
cropped = "cropped.jpeg" | |
def matcher(): | |
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
{ | |
"metadata": { | |
"name": "Ruse Integration" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
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
{ | |
"_id":ObjectId("522a21647b9f9937fd00006d"), | |
"subject_ids":[ | |
ObjectId("520be919e4bb21ddd3000314") | |
], | |
"annotations":[ | |
{ | |
"0":{ | |
"radio":{ | |
"0":{ |
This file has been truncated, but you can view the full file.
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
{ | |
"metadata": { | |
"name": "Radio Galaxy Zoo Beta" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
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
import sys | |
import numpy as np | |
import rasterio as rio | |
def copy(srcpath, dstpath): | |
with rio.drivers(): | |
with rio.open(srcpath, 'r') as src: | |
metadata = src.meta |
This will change your life. Add this as a git pre-push
hook.
How, you ask?
wget https://gist.github.com/dfm/5828028/raw/772270b65a804678db70012d3406f41c79cb53a5/pre-push
chmod +x pre-push
mv pre-push /path/to/your/favorite/repo/.git/hooks
cd /path/to/your/favorite/repo
git push
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# Converting from 16bit to 8bit | |
gdal_translate -ot Byte -scale 0 65535 0 255 sixteen.tif eight.tif | |
# Converting from 8bit to 16bit | |
gdal_translate -ot Uint16 -scale 0 255 0 65535 eight.tif sixteen.tif |
OlderNewer