<commit_before><commit_msg>compute the lyapunov time of pal5 over a very very long time<commit_after># coding: utf-8

from __future__ import division, print_function

__author__ = "adrn <<EMAIL>>"

import os

# Third-party
import astropy.units as u
import matplotlib.pyplot as plt
import numpy as np

# Custom
import gary.dynamics as gd
import gary.potential as gp

from streammorphology.freqmap import estimate_dt_nsteps

def main():
    outpath = "/vega/astro/users/amp2217/projects/morphology/output/pal5"

    x0 = np.array([8.312877511, 0.242593717, 16.811943627])
    v0 = ([-52.429087, -96.697363, -8.156130]*u.km/u.s).to(u.kpc/u.Myr).value
    w0 = np.append(x0,v0)

    potential = gp.LM10Potential()

    dt,nsteps = estimate_dt_nsteps(potential, w0, nperiods=50000, nsteps_per_period=250)

    le,t,w = gd.fast_lyapunov_max(w0, potential, dt, nsteps)

    np.save(os.path.join(outpath, "le.npy"), le)
    np.save(os.path.join(outpath, "t.npy"), t)
    np.save(os.path.join(outpath, "w.npy"), w)

    plt.figure(figsize=(10,8))
    plt.loglog(t[1:-10:10], le, marker=None)
    plt.savefig(os.path.join(outpath, "le.pdf"))

if __name__ == "__main__":
    main()

{'fraction_non_alphanumeric': 0.14773697694278395, 'fraction_numerical': 0.07344150298889837, 'mean_word_length': 4.051724137931035, 'pattern_counts': {'":': 1, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5252844', 'n_tokens_mistral': 528, 'n_tokens_neox': 473, 'n_words': 95}