Skip to content

Instantly share code, notes, and snippets.

from pyraf import iraf
from pyraf.irafpar import makeIrafPar, IrafParList
from stsci.tools.irafglobals import *
from pyraf.pyrafglobals import *
def ReduceARCES(mode='ql', DOLLARnargs=1, taskObj=None):
Vars = IrafParList('ReduceARCES')
Vars.addParam(makeIrafPar(mode, datatype='string', name='mode', mode='h'))
Vars.addParam(
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bmorris3
bmorris3 / hdf5_demo.py
Last active November 21, 2016 06:26
Save reconstructions to an HDF5 file, for opening with the Fiji HDF5 viewer.
from shampoo.reconstruction import Hologram
import numpy as np
import h5py
# Load the USAF test target hologram
h = Hologram.from_tif('data/USAF_test.tif')
# Make lists for holding the phase and intensity of each reconstruction
phases = []
intensities = []
setinst echelle
hedit *.fits dispaxis 1 add=yes verify=no show=yes update=yes
!ls *fits | grep -v 'bias' > inlist
!sed s/.fits/.c.fits/ inlist > outlist
cosmicrays (input="@inlist", output="@outlist", answer="yes", crmasks="", threshold=50.0, fluxratio=10.0, npasses=20, window="5", interactive=no, train=no,objects="", savefile="", plotfile="")
!ls bias*fits > biaslist
zerocombine (input="@biaslist", output="Zero.fits", combine="average", reject="avsigclip", ccdtype="", process=no, delete=no, clobber=no, scale="none", nlow=0, nhigh=1, nkeep=1, mclip=yes, lsigma=3.0, hsigma=3.0, rdnoise="7", gain="3.8", snoise="0.")
!cp outlist inlist
!sed s/.c.fits/.pc.fits/ inlist > outlist
ccdproc (images="@inlist", output="@outlist", ccdtype="", fixpix = yes, overscan=no, trim=yes, zerocor=yes, darkcor=no, flatcor=no, illumcor=no, fringecor=no, readcor=no, scancor=no, readaxis="line", fixfile = "database/badpix.txt", biassec="", trimsec="[200:1850,1:2048]", zero="Zero.fits", dark="", flat="", illum="", fringe="", minreplace
@bmorris3
bmorris3 / mpi_goose_chase.py
Last active April 13, 2016 18:48
How do you send numpy arrays with metadata between processes using mpi?
"""
Run with
mpiexec -n 11 mpi_goose_chase.py
"""
from __future__ import print_function
from mpi4py import MPI
import numpy as np
import time
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bmorris3
bmorris3 / XSEDE-starter.md
Last active February 22, 2016 17:53
Minimal XSEDE starter scripts

Getting Started with XSEDE/OSG

Logging in

Login to the XSEDE login node with:

ssh [email protected]

Login to the Open Science Grid:

gsissh submit-1.osg.xsede.org
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.