Code Monkey home page Code Monkey logo

sed_fitting_tutorial's Introduction

SED Fitting Tutorial

This repository contains a series of iPython notebooks which will teach you how to perform very basic SED fitting. The assumption is that you're familiar with the basic concepts (e.g. by having read Section 2 of Conroy 2013), and now want to start implementing those concepts in Python.

I wrote the tutorial in the hope that it might be useful either for students who wanted to start writing their own SED fitting package, or for people who are using other people's SED fitting tools and want to understand a little better how they work.

The method the code applies is grid-based chi-squared minimisation. It fits age, mass and redshift for simple stellar population models from BPASS. The code is deliberately inefficient in order to make the syntax as clear as possible.

If you're working off this code as a starting point, suggestions for developing it further are as follows:
  • Vectorise mathematical operations with numpy to speed up the code, although beware running out of memory.
  • Perform analytic chi-squared minimisation to determine the best fitting mass and only grid over age and redshift.
  • Add a function to apply the Calzetti et al. (2000) dust law and add Av as another grid parameter.
  • Add the ability to fit grids of stellar models at different metallicities.
  • Add the ability to fit and more complex star-formation histories by adding SSP models together.
  • Put the whole thing inside a class so you're not accessing variables from the global namespace within functions.
  • Replace the grid method with a functional minimisation (e.g. scipy.optimise) or MCMC (e.g. emcee) routine.

At that point you've already got a highly competitive SED fitting code, where you go from there is up to you...

Or you could just used Bagpipes.

sed_fitting_tutorial's People

Contributors

accarnall avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.