Skip to content

Instantly share code, notes, and snippets.

View dannygoldstein's full-sized avatar

Danny Goldstein dannygoldstein

  • Weights & Biases
  • Los Angeles, CA
View GitHub Profile
[('http://dessne.cosmology.illinois.edu/SNWG/web/display/examineCand.php?SNId=1098152',
'z=0.129',
'numepochs=17',
'numepochs_ml=0'),
('http://dessne.cosmology.illinois.edu/SNWG/web/display/examineCand.php?SNId=1098305',
'z=0.129',
'numepochs=17',
'numepochs_ml=0'),
('http://dessne.cosmology.illinois.edu/SNWG/web/display/examineCand.php?SNId=1052550',
'z=0.216',
@dannygoldstein
dannygoldstein / gist:e1b3276b778fdb48f905
Created August 11, 2014 04:37
candidate_efficiency
[('http://dessne.cosmology.illinois.edu/SNWG/web/display/examineCand.php?SNId=1098152',
'z=0.129',
'numepochs=17',
'numepochs_ml=0'),
('http://dessne.cosmology.illinois.edu/SNWG/web/display/examineCand.php?SNId=1098305',
'z=0.129',
'numepochs=17',
'numepochs_ml=0'),
('http://dessne.cosmology.illinois.edu/SNWG/web/display/examineCand.php?SNId=1052550',
'z=0.216',
@dannygoldstein
dannygoldstein / fake_query.py
Last active August 29, 2015 14:05
query to get fakes from a subtraction
import cx_Oracle
username = 'your_username'
password = 'your_password'
dsn = 'leovip148.ncsa.uiuc.edu/destest'
db = cx_Oracle.connect(username, password, dsn)
cursor = db.cursor()
cursor.execute('begin fixSynonyms(\'\',\'SNY1REPROC\'); end;') # this points you to the right
# tablespace
@dannygoldstein
dannygoldstein / find_high_det_count.py
Last active August 29, 2015 14:05
failed subtraction search with ML
# Query to find the subtractions with more than 5x the
# median number of detections per subtraction passing an ML cut of 0.5
query = 'SELECT DISTINCT test.IMAGE_NAME_DIFF, SNOBS.nite, passing_det_count FROM '\
'(SELECT IMAGE_NAME_DIFF, COUNT(CASE WHEN a.ml_score >= 0.5 THEN 1 END) passing_det_count '\
'FROM SNOBS o JOIN SNAUTOSCAN a ON o.snobjid = a.snobjid '\
'WHERE a.ml_version = 2 GROUP BY '\
'IMAGE_NAME_DIFF) test JOIN SNOBS ON '\
'test.IMAGE_NAME_DIFF = SNOBS.IMAGE_NAME_DIFF where passing_det_count >= 55'
@dannygoldstein
dannygoldstein / makepicture.py
Last active August 29, 2015 14:04
KBO triplet picture
import cx_Oracle
import pickle
import numpy as np
from itertools import chain
from PIL import Image, ImageDraw, ImageFont
from exceptions import IOError
import shutil
import os