Fun with the Milky Way

While not entirely useful at the moment. There is support for generating simplistic spiral galaxy distribtuions.

import popsynth
import ipyvolume as ipv

from astropy.coordinates import SkyCoord

%matplotlib inline

import matplotlib.pyplot as plt
from jupyterthemes import jtplot

purple = "#B833FF"

from popsynth.populations.spatial_populations import MWRadialPopulation
ld = popsynth.distributions.pareto_distribution.ParetoDistribution()
ld.alpha = 3
ld.Lmin = 1
synth = MWRadialPopulation(rho=1, luminosity_distribution=ld)
population = synth.draw_survey()
 INFO     |  The volume integral is 9676.75575509912 
 INFO     |  Expecting 9580 total objects 
 INFO     |  applying selection to fluxes 
 INFO     |  Detected 9580 distances 
 INFO     |  Detected 9580 objects out to a distance of 23.01 
fig = population.display_obs_fluxes_sphere(
    cmap="magma", background_color="black", size=0.1
/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/traittypes/ UserWarning: Given trait value dtype "float64" does not match required type "float64". A coerced copy has been created.
/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/jupyter_client/ UserWarning: Message serialization failed with:
Out of range float values are not JSON compliant
Supporting this message is deprecated in jupyter-client 7, please make sure your message is JSON-compliant
  content = self.pack(content)