GithubHelp home page GithubHelp logo

joepalmo / thesis-work Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 26.34 MB

This repository contains all of the code related to my senior honors thesis in astronomy

Python 1.34% Jupyter Notebook 98.66%

thesis-work's Introduction

thesis-work

Table of Contents

Overview
Set-Up and Build Dependencies
Code Outline
Tutorial
To-Do
Miscellaneous

Overview

This repository contains the code related to my senior honors thesis in astronomy, titled: Simulated Scatter: Computational Modeling of (Sub)Stellar Accretion. My project consists of a Monte Carlo error propagation, and will generate a simulated distribution of accretion rates given uncertainty values for each leg of the process that goes into measuring and calculating the value. With our simulated distribution, we will be able to separate systematic uncertainties such as observational error, parameter estimation error, and scaling relationship uncertainty, from physical uncertainties. By isolating the physical scatter in the distribution, we learn more about deep questions surrounding the formation of planetary systems in our universe.

Set-Up and Build Dependencies

Create and activate new python environment (Optional)

  1. With Anaconda Navigator
$ conda create -n newenvname python=3.6
$ conda activate newenvname
  1. Or
$ source create -n newenvname python=3.6
$ source activate newenvname

Then, install necessary dependencies:

(newenvname) $ pip install -r requirements.txt

Your environment should be set up and ready to run! Just remember to activate it using conda or source on the command line each time you are working with the code. And try to add any new dependencies to the requirements.txt file.

Files Outline

  1. accretion.py
  • Mdot Calculations - functions used to calculate mass accretion rate (Mdot) values for accreting objects
  • Object Parameter Estimation - models and functions used to estimate various object parameters
  • Uncertainty Distributions - code written to build Gaussian uncertainty distributions for a parameter given a mean and standard deviation
  • Inverse Transform Sampling
  • IMFs
  1. accretion_objects.py
  • class Accretion - single accreting star/BD/planet object
  • class AccretionDistribution - distribution of accreting objects
  • MC error propagation - these classes contain the functionality for running a Monte Carlo error propagation simulation
  • plotting functions - these classes have built-in plotting functions for visualizing the results of a simulation
  1. accdb_updated.csv
  • old version of the CASPAR database. I know that there will be a newer version of this that you can use!
  1. StellarParams folder
  • contains the Baraffe models used within the simulation
  1. ageinterceptfunc.pickle
  • text encoded pickle file containing the original exponential fit model I derived between age and MvMdot intercept. This is now deprecated, because I eventually opted to hard-code the fit into accretion.py (see function age_intercept_exponential())
  1. requirements.txt
  • dependencies
  1. Palmo_Thesis_Final.pdf
  • PDF document of my written up thesis
  1. notebooks folder
  • a bunch of (messy) notebooks that I used during my thesis

Tutorial

For a very quick walkthrough tutorial on how to use the code, open up tutorial.ipynb.

For a bunch of (messy) notebooks that I used during my thesis for creating figures, tables, and developing certain sections of the modules, check out the notebooks folder.

To-Do

Some of this is covered in the Future Work chapter of Palmo_Thesis_Final.pdf, or elsewhere.

  1. 2D model interpolation

    • Currently, I use a 1-dimensional interpolation approach coupled with the discrete age Baraffe models.
    • Adapting this to a continuous age approach might make things more accurate
  2. Uncertainty Interaction

    • Using a Monte Carlo approach for an error propagation makes it possible to build in interre- lationships between parameters and uncertainties.
    • Currently, my simulation does not make use of any property covariances, but there are some key places where it may be implemented to make the results more accurate.
  3. Add disk fragmentation

    • Future Work - Model "Truth"
  4. Detection Limits

    • Future Work - Detection Limits
  5. Packaging Code

    • pip installable package
  6. Keyword Arguments

    • while completing this thesis I learned a lot and made a TON of mistakes. There are places where my code is inefficient. One that comes to mind is making the inputs for the Accretion and AccretionDistribution classes follow a keyword arguments (**kwargs) structure.
    • There are many other things that might be made more efficient!

Miscellaneous

  • If you are interested in seeing the code for the Plotly-Dash app that I built as an accessible extension to this code, contact me!

  • See Appendix D: Scatter Metric Script for the code that I wrote to generate the scatter statistics tables in Chapter 9.

thesis-work's People

Contributors

joepalmo avatar

Watchers

 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.