Giter VIP home page Giter VIP logo

disco's Introduction

GalOrrery

Orrery on a Galactic Scale : packages for the dynamics of Galactic substructure

disco's People

Contributors

ccastro35 avatar nstarman avatar pre-commit-ci[bot] avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

disco's Issues

[BUG] Compile agama on CI and RTD

Description

Cannot install agama on GitHub and RTD VMs for testing optional dependencies

See also GalacticDynamics-Oxford/Agama#8

Expected behavior

To be able to pip install agama and have the c code compile

Actual behavior

It fails. See GalacticDynamics-Oxford/Agama#8

Steps to Reproduce

Add agama to optional dependencies in setup.cfg and push to GitHub.

Checklist

  • Check out our contributing guidelines.
  • Check out our code of conduct.
  • Search the GitHub repository to see if a similar issue has already been posted. If a similar issue is closed, have a quick look to see if you are satisfied by the resolution. If not please go ahead and open an issue!
  • Please check that the development version still produces the same bug. You can install development version with pip install git+https://github.com/astropy/astropy command.

Coefficient Correlations

Description

Get the coefficients in repeated runs and find the correlations!

Whiteboard 1 -01

Additional context

For agama multipole

``the coefficients are indeed written to text files by the Potential.export() method, though the detailed specification of this file is not given in the docs. But it does have a rather simple structure: after a few header lines, there comes an array of potential coefficients, followed by radial derivative coefficients: Phi_{lm}(r), dPhi_{lm}/dr. Each line contains the radius and then the values of each potential harmonic at this radius, in the following order: l=0; l=1,m=-1; l=1,m=0; l=1,m=1; l=2,m=-2; l=2,m=-1; etc., where negative m correspond to sine and positive - to cosine terms in the expansion - in total, (lmax+1)^2 terms. The normalization convention is described in the section A.4.1 of reference.pdf
Although there is no way to access these coefs from Python, you may save them to a file and read it off as a numpy array if needed." Eugene Vasiliev (GalacticDynamics-Oxford/Agama#9)

Checklist

  • Check out our contributing guidelines.
  • Check out our code of conduct.
  • Search the GitHub repository to see if a similar issue has already been posted. If a similar issue is closed, have a quick look to see if you are satisfied by the resolution. If not please go ahead and open an issue!

Have Measurer classes return in own frame, not original frame

Description

Currently the Measurer classes resample in a specific frame, but return to the user the data transformed back into the input frame. It would be better for the user and debugging purposes if it returned in the re-sampling frame.

Checklist

  • Check out our contributing guidelines.
  • [x ] Check out our code of conduct.
  • Search the GitHub repository to see if a similar issue has already been posted. If a similar issue is closed, have a quick look to see if you are satisfied by the resolution. If not please go ahead and open an issue!

SCF optimum Nmax/Lmax

Plot of reduced chi-square (or similar statistic) for how well a SCF fits the spiral arms potential as a function of Nmax/Lmax

Realistic Measurement sampling errors

Description

Subclass MeasurementErrorSampler to make a InterpolatedGridMeasurementErrorSampler that takes a catalog of data points, for example Gaia, takes the errors and creates a 3D interpolated & smoothed grid of the errors as a function of the position. This can be evaluated with the MeasurementErrorSampler given positions from the PotentialSampler class to create realistic measurement errors.

Checklist

  • Check out our contributing guidelines.
  • Check out our code of conduct.
  • Search the GitHub repository to see if a similar issue has already been posted. If a similar issue is closed, have a quick look to see if you are satisfied by the resolution. If not please go ahead and open an issue!

Match galpy potential to DF class

Description

Instead of wrapping a galpy potential in a galpy DF class before passing to PotentialSampler, have PotentialSampler be able to automatically determine the correct match. This could be a simple JSON registry.

Checklist

  • Check out our contributing guidelines.
  • Check out our code of conduct.
  • Search the GitHub repository to see if a similar issue has already been posted. If a similar issue is closed, have a quick look to see if you are satisfied by the resolution. If not please go ahead and open an issue!

[BUG] consistent offset and lobes in residual

Description

Figure out why and solve!

Unknown-6

Expected behavior

  • dependent on l, m max
  • dependent on the grid

Actual behavior

  • dependent on l, m max : it's not
  • dependent on the grid : maybe it is?

Steps to Reproduce

# THIRD PARTY
import agama
import astropy.coordinates as coord
import astropy.units as u
import numpy as np
from astropy.visualization import quantity_support
from galpy import df as gdf
from galpy import potential as gpot

# PROJECT-SPECIFIC
from discO import (
    GaussianMeasurementErrorSampler,
    PotentialFitter,
    PotentialSampler,
    conf,
)
from discO.plugin.agama.fitter import (
    AGAMAMultipolePotentialFitter,
    AGAMAPotentialFitter,
)
from discO.core.pipeline import Pipeline
from discO.core.residual import GridResidual

quantity_support();

mass = 1e12 * u.solMass
r0 = 10 * u.kpc  # scale factor

agama.setUnits(mass=1, length=1, velocity=1)

hernquist_pot = gpot.HernquistPotential(amp=2 * mass, a=r0)
sampler = PotentialSampler(gdf.isotropicHernquistdf(hernquist_pot))
measurer = GaussianMeasurementErrorSampler(c_err=1*u.percent)  # 10% error
fitter = PotentialFitter(None, key="agama", pot_type="multipole", symmetry="s", gridsizeR=50, lmax=0, mmax=0)

_x = np.linspace(-5, 5, num=50)
x, y, z = np.meshgrid(_x, _x, _x) * u.kpc
points = coord.CartesianRepresentation(x, y, z)
residualer = GridResidual(points, original_pot=hernquist_pot)

pipe = Pipeline(sampler=sampler, fitter=fitter, residualer=residualer)
pipe

resid = pipe(n=10000, frame=coord.Galactocentric(), random=0)


from mpl_toolkits.mplot3d import axes3d
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import numpy as np

fig = plt.figure()
ax = fig.gca(projection='3d')

rar = np.abs(resid.represent_as(coord.SphericalRepresentation).vf_distance.flatten().value)
norm = mpl.colors.Normalize(vmin=min(rar), vmax=max(rar), clip=True)
mapper = cm.ScalarMappable(norm=norm, cmap=cm.inferno_r)

uvw = resid.vf_xyz.value * 1e13

qv = ax.quiver(
    x, y, z, *uvw,
    color=mapper.to_rgba(rar, alpha=0.1),
    length=0.1, )
ax.set_xlim(-8, 8)
ax.set_ylim(-8, 8)
ax.set_zlim(-8, 8)

plt.colorbar(qv)

plt.show()

System Details

macOS-10.16-x86_64-i386-64bit
Python 3.8.2 | packaged by conda-forge | (default, Apr 24 2020, 07:56:27)
[Clang 9.0.1 ]
astropy 4.3.dev310+g59d625df4.d20201220
astroquery 0.4.2.dev6458
Matplotlib 3.2.1
Numpy 1.18.4
Scipy 1.4.1

Checklist

  • Check out our contributing guidelines.
  • Check out our code of conduct.
  • Search the GitHub repository to see if a similar issue has already been posted. If a similar issue is closed, have a quick look to see if you are satisfied by the resolution. If not please go ahead and open an issue!
  • Please check that the development version still produces the same bug. You can install development version with pip install git+https://github.com/astropy/astropy command.

Add Chris's Milky Way sims to data

@CCAstro35, as we discussed, we won't add the actual SIM data. Once I have the data file (can you email me the Google Drive link) we can set up the folder structure and correct .gitignore. Then we can close this issue.

better embedding of mass and potential

Description

Currently the mass and potential are embedded in a SkyCoord. This does not work very well as any operation that returns a new instance, like reshape means that the attributes need to be reassigned (separately reshaped).

Possible fixes:

  • Subclass SkyCoord, with hooks to properly maintain these attributes
  • embed in a table (SkyCoord is a valid mixin) ... but can tables be stacked depth-wise?
  • Xarray? but how does that deal with SkyCoords?

Checklist

  • Check out our contributing guidelines.
  • Check out our code of conduct.
  • Search the GitHub repository to see if a similar issue has already been posted. If a similar issue is closed, have a quick look to see if you are satisfied by the resolution. If not please go ahead and open an issue!

galpy SCF and discSCF

Description

Get these fitters working.

The SCF implementation doesn't seem to work. The errors are quite large.

Need the N-Body PR in galpy: jobovy/galpy#444

Additional context

Checklist

  • Check out our contributing guidelines.
  • Check out our code of conduct.
  • Search the GitHub repository to see if a similar issue has already been posted. If a similar issue is closed, have a quick look to see if you are satisfied by the resolution. If not please go ahead and open an issue!

AGAMA Units

Question

Help with Units! I'm trying to figure out how to get AGAMA functions to output units!

From the documentation pdf on AGAMA/doc

Screen Shot 2021-01-20 at 14 14 39

@CCAstro35 If you're familiar with this, could you send me a snippet of example code?

Write Documentation for Fitters

Description

#20 Needs documentation, docstrings, and examples.

Checklist

  • Check out our contributing guidelines.
  • Check out our code of conduct.
  • Search the GitHub repository to see if a similar issue has already been posted. If a similar issue is closed, have a quick look to see if you are satisfied by the resolution. If not please go ahead and open an issue!

agama CylSpline

Description

Like agama Multipole fitter, but CylSpline.

Additional context

Checklist

  • Check out our contributing guidelines.
  • Check out our code of conduct.
  • Search the GitHub repository to see if a similar issue has already been posted. If a similar issue is closed, have a quick look to see if you are satisfied by the resolution. If not please go ahead and open an issue!

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.