Back porting Diane's firecrest.py from the trunk to v0.1.x branch