This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| from simple_density_functions import * | |
| def makemodel(func,M,funcargs,rvals = 10.**np.linspace(-2.,4.,2000),pfile='',plabel = '',verbose=True): | |
| """make an EXP-compatible spherical basis function table | |
| inputs | |
| ------------- | |
| func : (function) the callable functional form of the density |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| def read_orbtrace(filename): | |
| """definition to read EXP 'ORBTRACE'-style files | |
| One large dictionary is returned, with sub-dictionaries. | |
| Each orbit is returned as a sub-dictionary, with positions, | |
| velocities, and accelerations. | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| def read_outlog(filename): | |
| """definition to read EXP 'OUTLOG'-style files | |
| One large dictionary is returned, with sub-dictionaries. | |
| Each component is returned as a sub-dictionary, with positions, | |
| velocities, and energy conservation. | |
| An additional sub-dictionary, with global quantities, is also included. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ################################################################### | |
| # a 1-d Monte Carlo example | |
| ################################################################### | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| # first, set up the gaussian we want to approximate | |
| gaussmean = 0.0 | |
| gaussdisp = 0.3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // C++ program to calculate test breakdown of Legendre polynomials | |
| // clang++ -I/opt/local/include/eigen3 -o legendre legendre_test.cpp | |
| #include <iostream> | |
| #include <cmath> | |
| #include <Eigen/Eigen> | |
| #define MINEPS 1.0e-10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Principal Components and Data comparison. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| outcoef.py | |
| (broken out of exptool) | |
| tools to read coefficient files and do rudimentary manipulation. | |
| MSP 30 April 2020 | |
| ''' |
NewerOlder