Skip to content
A tool to process Hubble Space Telescope data into a clean set of basis galaxies for simulations
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


This is the code I used to generate a basis set of parametric galaxies from the AEGIS data for ChromaticRealGalaxy in Galsim ( for issue #551 (

The postage stamps generated by this code from AEGIS f606w and f814 filters are here:

The corresponding catalogs generated by SExtractor with focus positions are here:

And the input files for Claire Lackner's fitting code are here:

The original images can be found at this password-protected location. Contact me, Rachel Mandelbaum, Jason Rhodes, Andrés Plazas, or Anton Koekemoer for access.

I can be contacted at to discuss the code or fix issues.

Software Requirements:

Python 2.7,

Standard NumPy, SciPy distributions,


SExtractor (,

Astro Ascii Data (,

Pyfits (,

GalSim (,

For f606w and f814w filters:

TinyTim starfield folders. This should be downloaded and placed into your path. For now you can download them off my Google Drive:

They have to be unzipped before you can use them. You'll need to put in the correct path in to these folders.

Your data should include:

A list of CTI-corrected, multi-drizzled HST image .fits files with a WCS, and their corresponding inverse variance files. These should have drz.fits and wht.fits extensions respectively. The names of these filters IN ORDER should be saved in two separate text files. An optional file with coordinates of manual masks. See for details.


Makes a clean sample of postage stamps of galaxies and stores them in folders compatible with Claire Lackner's parametric fitting code. Specifically it:

Runs SExtractor on the data

Cleans for blended objects using the hot-cold method (Leauthaud et. al. 2007)

Classifies stars and galaxies

Deletes objects on the noisy border

Automatic detection of star diffraction spikes, removal of objects affected

Checks for overlapping objects not caught by the hot-cold method

Finds the PSF by estimating the focus position from TT star fields

Generates postage-stamps and PSFs from simulated stars from the TT fields


You need to have all of the files in this repository in the same directory. But all you need to modify is the top of the script

Then all you need to do is: python

For developers, here is the dependency tree of the modules: requires assoc_catalogs, HST_sextractor_new, overlap, and postage_stamps. (will later require generate_masks, for now no masks are generated). requires focus_positions and cleanutils.

You can’t perform that action at this time.