Skip to content

Instantly share code, notes, and snippets.

View jamesmlane's full-sized avatar

James Lane jamesmlane

View GitHub Profile
@jamesmlane
jamesmlane / action-inverter-optimization.ipynb
Last active March 9, 2023 14:40
Example notebook to convert from actions to positions and velocities (galpy.orbit.Orbit) using optimization. Candidate actions are calculated assuming an action-angle object (galpy.actionAngle.actionAngle) and compared with target actions using a simple likelihood function. Positions and velocities are determined using scipy.optimize.minimize. M…
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jamesmlane
jamesmlane / action_map_dfs.ipynb
Created April 30, 2020 18:44
Use distribution functions of different stellar populations to show where they lie in kinematic and action spaces.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# ----------------------------------------------------------------------------
#
# TITLE - test_closed_orbit_finder.py
# AUTHOR - James Lane
# PROJECT - AST1501
# CONTENTS:
#
# ----------------------------------------------------------------------------
### Docstrings and metadata:
@jamesmlane
jamesmlane / galpy_aA_adiabatic_triaxial_issue.py
Last active November 13, 2018 23:22
Code to replicate galpy issue #361 where for certain orbits in a triaxial potential the ActionAngleAdiabatic form returns 0 for the radial action and an anomalously high value for the quasi-isothermal DF.
import copy, tqdm, pdb
import numpy as np
from matplotlib import pyplot as plt
from astropy import units as apu
from galpy import orbit
from galpy import potential
from galpy import df
from galpy.actionAngle import actionAngleAdiabatic
from galpy.util import bovy_conversion as gpconv