Skip to content

Instantly share code, notes, and snippets.

View dstndstn's full-sized avatar

Dustin Lang dstndstn

View GitHub Profile
#! /bin/bash
# Script for running the legacypipe code within a Shifter container at NERSC
# Using depth-cut v5 CCDs file, and v3 skies
export COSMO=/global/cfs/cdirs/cosmo
export LEGACY_SURVEY_DIR=$COSMO/work/legacysurvey/dr10
outdir=$PSCRATCH/dr10-sub
if [ ${PSCRATCH}x == x ]; then
#include <stdio.h>
#include <math.h>
/*
Copyright 2020 Dustin Lang. Released under BSD 3-term license.
Given a multinomial probability distribution, and a total number
of events, generates all histograms, evaluates their probabilities.
Given a "tail" probability level, computes the total probability mass of
histograms with probability less than the tail.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dstndstn
dstndstn / parallel-build.diff
Created August 31, 2018 14:42
A diff against wcslib-5.19.1 to allow parallel builds (eg, -j8) to work
diff --git a/C/GNUmakefile b/C/GNUmakefile
index eec9389..4631b63 100644
--- a/C/GNUmakefile
+++ b/C/GNUmakefile
@@ -50,8 +50,7 @@ else
endif
endif
-# For building the sharable library.
-PICLIB := libwcs-PIC.a
@dstndstn
dstndstn / demo.tex
Created August 31, 2017 20:04
Latex: vertically aligning images in tables
\documentclass{article}
\usepackage{graphicx}
\usepackage{adjustbox}
\begin{document}
\begin{tabular}{ccc}
\adjustimage{width=0.1\textwidth,valign=T,frame}{method-a} &
\adjustimage{width=0.1\textwidth,valign=T,frame}{method-b} &
valign=T \\
\end{tabular}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dstndstn
dstndstn / ngc2000names.c
Created June 14, 2014 18:39
ngc2000names
{ .is_ngc = TRUE,
.id = 1952,
.name = "M 1"
},
{ .is_ngc = TRUE,
.id = 7089,
.name = "M 2"
},
{ .is_ngc = TRUE,
.id = 5272,
diff --git a/drvrfile.c b/drvrfile.c
index fd89233..2e9890f 100644
--- a/drvrfile.c
+++ b/drvrfile.c
@@ -772,28 +772,33 @@ int file_is_compressed(char *filename) /* I - FITS file name */
strcat(filename,".gz");
if (file_openfile(filename, 0, &diskfile))
{
- strcpy(filename, tmpfilename);
- strcat(filename,".Z");