This file contains hidden or 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 re | |
import csv | |
import numpy as np | |
import operator | |
from astropy.io import fits as pyfits | |
''' | |
To create the full collated data for GZ: Quench: | |
>>> import quench_collate as qc |
This file contains hidden or 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
#!/bin/sh | |
for img in *.jpg; do | |
filename=${img%.*} | |
newfilename=${img%.*}_cropped | |
convert "$filename.jpg" -crop 100x100+162+162 "$newfilename.jpg" | |
done | |
# Probably needs to be run on subsets of images if using the full GZ set due to memory limitation | |
# Include at least one black image (badimage_cropped.jpg) so subset has a comparison |
This file contains hidden or 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
parseLong(substring(split($41,"/")[4],toInteger(0),length(split($41,"/")[4])-4)) |
This file contains hidden or 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
cat filelist.txt | awk '{print "cp source_dir/" $1, " targetdir/"}' | bash |
This file contains hidden or 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
tar -cvf target_dir/foo.tar -T source_dir/filelist.txt > target_dir/results.txt |
This file contains hidden or 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
perl -nle'print $& if m{\b([yuiophjklbnm]+( |$)){3}' chatlines.txt |
This file contains hidden or 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
# Get the average classification counts for each group of subjects in Galaxy Zoo | |
db.galaxy_zoo_subjects.aggregate([{$group : {_id : "$metadata.survey", nClass : {$avg : "$classification_count"}}}]) | |
# Export data from MongoDB to a CSV file from the shell command line | |
mongoexport --db ouroboros --collection galaxy_zoo_subjects --csv --fields classification_count --query '{"metadata.survey":"ukidss"}' --out ukidss_nclass.csv |
This file contains hidden or 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 pandas | |
import numpy | |
import matplotlib.pyplot as plt | |
data = pandas.read_csv('/Users/willettk/Astronomy/meetings/garching2014/participants.csv',names=('person','country','institution')) | |
darkblue = '#00008b' | |
colordict = { |
This file contains hidden or 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
Success of missions to Mars by space agency* | |
Information from https://en.wikipedia.org/wiki/List_of_missions_to_Mars | |
China: 0/1 | |
ESA: 1/2 | |
Japan: 0/1 | |
India: 1/1 | |
USA: 17/23 | |
Russia/USSR: 2/21 |
OlderNewer