Simple python implementation with matplotlib to manually fit MIST isochrones to Gaia DR2 color-magnitude diagrams

Overview

MIST-isochrone-widget

Simple python implementation with matplotlib to manually fit MIST isochrones to Gaia DR2 color-magnitude diagrams

This widget was primarily made to illustrate how cluster properties like Age, Extinction(Av), distance, and FeH can be derived by fitting an isochrone to the cluster's color-magnitude sequence.

The code here relies primarily on the isochrones package developed by Timothy Morton, which can be found here at github link.

The isochrones package can be installed with 'pip install isochrones' Installing the isochrones package will install most of the packages needed to run this widget. Nonetheless, you should have the following packages for this widget:

  • Numpy
  • Matplotlib
  • Pandas

WARNING Upon running the MIST_isochrone_class for the first time, the isochrones package will initially produce an interpolation directory and table of isochrones that downloads from the MIST website server. All in all this interpolation/generation takes a few minutes and produces files/directories totalling 15Gb. Once these files are generated, you should be able generate isochrones on the relatively easily.

If you wish to avoid this interpolation step and want to jump right into creating isochrones, I am providing a link to a precompile directory of all necessary evolutionary tracks and their bolometric corrections to generate isochrones in Gaia DR2 [G, BP, RP] passbands. The files contains UBVRI passbands as well as WISE passbands. The directory is tar zipped and can be extracted with " tar -xvzf isochrones_precompiled_data.tar.gz "

The compressed directory can be downloaded from this One-drive-link The .isochrones directory will look like this once unzipped:

|── .isochrones
   ├── BC
   |   ├──mist
   |        ├── UBVRIplus and WISE passband files
   ├── mist
       ├──tracks
           ├──array_grid_v1.2_vvcrit0.4.npz
           ├──full_grid_v1.2_vvcrit0.4.npz
           ├──dt_deep_v1.2_vvcrit0.4.h5
           ├──mist_v1.2_vvcrit0.4.h5

Please Note It is important that the file be extracted into your username directory, such that the resulting pathway looks like " /Users/your_user_name/.isochrones ". This will ensure that the isochrones package seemlessly finds the preconstructed isochrone grids. Otherwise it will start the automatic downloading from the MIST servers and begin the grid construction on its own (That big 15GB step).

Using the isochrone widget for the first time

DON'T FORGET TO SET THE BASE DIRECTORY FOR THE WIDGET This can be done by changing the following line in run_isochrone_widget.py (line #16):

RepoDIR = "YOUR_REPOSITORY_DIRECTORY/MIST-isochrone-widget/"

To the directory into which you download this REPO.

Running the widget

The widget can be called from a terminal by typing: " python run_isochrone_widget.py "

After which the following should appear in your terminal:

Holoviews not imported. Some visualizations will not be available.
PyMultiNest not imported.  MultiNest fits will not work.
Initializing isochrone class object (takes a second...)
Initialization done

Once that is completed the matplotlib figure should appear and you're ready to explore with the sliders and the pre-loaded cluster buttons.

Unfortunately, sometimes the matplotlib figure will 'freeze' when being called within the ipython terminal. I have not found that to be the case when calling the function with python, so that's the more reliable way to use this widget if using it to teach in a lecture or lab.

You might also like...
Cartopy - a cartographic python library with matplotlib support
Cartopy - a cartographic python library with matplotlib support

Cartopy is a Python package designed to make drawing maps for data analysis and visualisation easy. Table of contents Overview Get in touch License an

The windML framework provides an easy-to-use access to wind data sources within the Python world, building upon numpy, scipy, sklearn, and matplotlib. Renewable Wind Energy, Forecasting, Prediction

windml Build status : The importance of wind in smart grids with a large number of renewable energy resources is increasing. With the growing infrastr

NorthPitch is a python soccer plotting library that sits on top of Matplotlib
NorthPitch is a python soccer plotting library that sits on top of Matplotlib

NorthPitch is a python soccer plotting library that sits on top of Matplotlib.

matplotlib: plotting with Python
matplotlib: plotting with Python

Matplotlib is a comprehensive library for creating static, animated, and interactive visualizations in Python. Check out our home page for more inform

:small_red_triangle: Ternary plotting library for python with matplotlib
:small_red_triangle: Ternary plotting library for python with matplotlib

python-ternary This is a plotting library for use with matplotlib to make ternary plots plots in the two dimensional simplex projected onto a two dime

Joyplots in Python with matplotlib & pandas :chart_with_upwards_trend:
Joyplots in Python with matplotlib & pandas :chart_with_upwards_trend:

JoyPy JoyPy is a one-function Python package based on matplotlib + pandas with a single purpose: drawing joyplots (a.k.a. ridgeline plots). The code f

A python package for animating plots build on matplotlib.
A python package for animating plots build on matplotlib.

animatplot A python package for making interactive as well as animated plots with matplotlib. Requires Python = 3.5 Matplotlib = 2.2 (because slider

matplotlib: plotting with Python
matplotlib: plotting with Python

Matplotlib is a comprehensive library for creating static, animated, and interactive visualizations in Python. Check out our home page for more inform

:small_red_triangle: Ternary plotting library for python with matplotlib
:small_red_triangle: Ternary plotting library for python with matplotlib

python-ternary This is a plotting library for use with matplotlib to make ternary plots plots in the two dimensional simplex projected onto a two dime

Owner
Karl Jaehnig
Ph.D candidate in Astrophysics at Vanderbilt University LSSTC Data Science Fellow Fisk-Vanderbilt Bridge Fellow
Karl Jaehnig
erdantic is a simple tool for drawing entity relationship diagrams (ERDs) for Python data model classes

erdantic is a simple tool for drawing entity relationship diagrams (ERDs) for Python data model classes. Diagrams are rendered using the venerable Graphviz library.

DrivenData 129 Jan 4, 2023
Python package that generates hardware pinout diagrams as SVG images

PinOut A Python package that generates hardware pinout diagrams as SVG images. The package is designed to be quite flexible and works well for general

null 336 Dec 20, 2022
Draw tree diagrams from indented text input

Draw tree diagrams This repository contains two very different scripts to produce hierarchical tree diagrams like this one: $ ./classtree.py collectio

Luciano Ramalho 8 Dec 14, 2022
A toolkit to generate MR sequence diagrams

mrsd: a toolkit to generate MR sequence diagrams mrsd is a Python toolkit to generate MR sequence diagrams, as shown below for the basic FLASH sequenc

Julien Lamy 3 Dec 25, 2021
Simple CLI python app to show a stocks graph performance. Made with Matplotlib and Tiingo.

stock-graph-python Simple CLI python app to show a stocks graph performance. Made with Matplotlib and Tiingo. Tiingo API Key You will need to add your

Toby 3 May 14, 2022
A simple python script using Numpy and Matplotlib library to plot a Mohr's Circle when given a two-dimensional state of stress.

Mohr's Circle Calculator This is a really small personal project done for Department of Civil Engineering, Delhi Technological University (formerly, D

Agyeya Mishra 0 Jul 17, 2021
A simple Monte Carlo simulation using Python and matplotlib library

Monte Carlo python simulation Install linux dependencies sudo apt update sudo apt install build-essential \ software-properties-commo

Samuel Terra 2 Dec 13, 2021
Plot toolbox based on Matplotlib, simple and elegant.

Elegant-Plot Plot toolbox based on Matplotlib, simple and elegant. 绘制效果 绘制过程 数据准备 每种图标类型的目录下有data.csv文件,依据样例数据填入自己的数据。

null 3 Jul 15, 2022
A script written in Python that generate output custom color (HEX or RGB input to x1b hexadecimal)

ColorShell ─ 1.5 Planned for v2: setup.sh for setup alias This script converts HEX and RGB code to x1b x1b is code for colorize outputs, works on ou

Riley 4 Oct 31, 2021
Color scales in Python for humans

colorlover Color scales for humans IPython notebook: https://plot.ly/ipython-notebooks/color-scales/ import colorlover as cl from IPython.display impo

Plotly 146 Sep 25, 2022