Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
# Demo a brightened luminance-only inversion on 8-bit images
from skimage import io
import numpy as np
from sys import argv
# RGB <-> YCoCg-R almost straight from Wikipedia
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Free Idea: Enhancing Astronaut Photography of Earth

Beta version. May contain bad ideas.

By a free idea I mean something that I think is probably fun and probably possible but that I don’t have the combination of time, skill, energy, patience, etc. to do myself. I hope someone does this. I hope someone reads this and does just the specific part that they’re interested in. I’m trying to get the idea out there without giving the impression that it’s my project. It’s just an idea.

To do the whole thing as laid out here I think you’d need at least an intermediate understanding of convolutional neural networks for image processing, access to a GPU, some sense of geography and astronomy (to gut-check your intermediate results), and a reasonable internet connection to download the images.

The idea

import himawari.HimawariScene as hsd
from sys import argv
import rasterio as rio
import numpy as np
scaleup = 64
scene = hsd.HimawariScene(argv[1])
rad = scene.radiances()
# python pca_multiband.py input.jpeg output.tif
# n-band image -> PCA -> n-band TIFF image
# with lots of hackety assumptions
# (e.g., output is same type as input)
from sys import argv
import rasterio as rio
import numpy as np
from sklearn import decomposition
@celoyd
celoyd / iss-neffer.py
Last active August 12, 2024 17:59
Download Nikon raw images from https://eol.jsc.nasa.gov/
# python neffer.py 55 111879
# mission ^^ ^^^^^^ frame
# will write to iss055e111878.nef.
# This code is public domain; please improve & adapt it.
import requests
from sys import argv, exit
from random import uniform
from time import sleep
@celoyd
celoyd / rs.md
Last active November 13, 2019 22:58
Robosat workshop guide
#!/usr/bin/env python
# simple visualization of the Co/Cg plane of an image
# https://en.wikipedia.org/wiki/YCoCg
from skimage import io
import numpy as np
from sys import argv
src = io.imread(argv[1])

{Well|Okay} {i will|i'll|I am going to|let me|i'm going to} {make it|ensure it is} as {quick and|fast and} short {as possible|possibly can|as it can be},

{Few months|Couple of months|Month or two|Few days} back while visiting one of {hacked|compromised} {websites|web sites|web-sites}, your {computer|pc|personal computer} {was|was in fact} {infected|taken over} by our {Virus|Trojan|Malware|Viruses} {and it|also it|plus it|and it also} {hacked|broken into|broken in to} {all your|all of your|your entire|your complete} network devices such as your {smartphone|smart phone|mobile phone|cell phone|phone}, {ever since|since that time|since then|ever since that time} its {collecting|gathering} {great deal of|good deal of|lots of|large amount of|massive amount of} {details|information|important information} {about you|about yourself} {using your|utilizing your} {computer|pc|personal computer} {and your|as well as your|plus your|including your} {smartphone|cell phone|mobile phone|phone|smart phone} , {we got|we've got

when() {
local zone="$1";
case "$zone" in
("SF") zone="America/Los_Angeles";;
("CO") zone="America/Denver";;
("Montreal") zone="America/Montreal";;
("DC") zone="America/New_York";;
("BLR") zone="Asia/Kolkata";;
esac;
psql -At -c "select date_trunc('second', now() at time zone '$zone')";