In [1]:
%matplotlib inline

import numpy as np

import dmsky.targets
import dmsky.skymap


/Users/alex/fermi/software/dmsky/dmsky/data/targets

In [2]:
# Build the library of pre-defined targets                                           
library = dmsky.targets.TargetLibrary()


/Users/alex/fermi/software/dmsky/dmsky/data/targets

In [3]:
# Create the target    
name = 'galactic:ackermann2013_nfw'                                                          
gc = library.create_target(name)

Target names follow the convention:

  • name = "(physical name):(profile parameters)"

where

  • "physical name" : the conventional name of the physical object
  • "profile parameters" : the profile parameters usually specified through a literature reference

In [4]:
# List existing configuretions for the 'galactic' target
library.library['galactic']


Out[4]:
{'abbreviation': 'Gal',
 'ackermann2012_einasto': {'distance': 8.5,
  'profile': {'alpha': 0.17,
   'rhos': 0.08135,
   'rmax': 150,
   'rmin': 0.0001,
   'rs': 20,
   'type': 'Einasto',
   'units': 'gev_cm3_kpc'}},
 'ackermann2012_isothermal': {'distance': 8.5,
  'profile': {'rhos': 0.47225,
   'rmax': 100,
   'rmin': 0.0001,
   'rs': 5,
   'type': 'Isothermal',
   'units': 'gev_cm3_kpc'}},
 'ackermann2012_nfw': {'distance': 8.5,
  'profile': {'rhos': 0.3452,
   'rmax': 150,
   'rmin': 0.0001,
   'rs': 20,
   'type': 'NFW',
   'units': 'gev_cm3_kpc'}},
 'ackermann2013_einasto': {'distance': 8.5,
  'profile': {'alpha': 0.17,
   'rhos': 0.08135,
   'rmax': 100,
   'rmin': 0.0001,
   'rs': 20,
   'type': 'Einasto',
   'units': 'gev_cm3_kpc'}},
 'ackermann2013_gnfw': {'distance': 8.5,
  'profile': {'gamma': 1.3,
   'rhos': 0.2401,
   'rmax': 100,
   'rmin': 0.0001,
   'rs': 20,
   'type': 'gNFW',
   'units': 'gev_cm3_kpc'}},
 'ackermann2013_isothermal': {'distance': 8.5,
  'profile': {'rhos': 1.556,
   'rmax': 100,
   'rmin': 0.0001,
   'rs': 5,
   'type': 'Isothermal',
   'units': 'gev_cm3_kpc'}},
 'ackermann2013_nfw': {'distance': 8.5,
  'profile': {'rhos': 0.3452,
   'rmax': 100,
   'rmin': 0.0001,
   'rs': 20,
   'type': 'NFW',
   'units': 'gev_cm3_kpc'}},
 'altnames': ['halo'],
 'codename': 'galactic',
 'color': 'red',
 'dec': -28.93617,
 'default': {'abbr': 'Gal',
  'altnames': ['halo', 'gc'],
  'color': 'red',
  'dec': -28.93617,
  'distance': 8.33,
  'dsigma': 0.35,
  'name': 'galactic',
  'ra': 266.4051,
  'references': ['2004ApJ...616..872R', '2009ApJ...692.1075G'],
  'title': 'Galactic Halo',
  'type': 'galactic'},
 'distance': 8.33,
 'dsigma': 0.35,
 'name': 'Galactic',
 'ra': 266.4051,
 'references': ['2004ApJ...616..872R', '2009ApJ...692.1075G'],
 'type': 'galactic'}

In [5]:
# Create a skymap and fill it with the jfactor of the target
skymap = dmsky.skymap.Skymap(gc, nside=128)
skymap.fill()


Galactic
  name           : galactic
  ra             : 266.4051
  dec            : -28.93617
  distance       : 8.5
  density        : <class 'dmsky.density.NFWProfile'>
  Parameters:
    rs     : Parameter(6.17136e+22, [None, None], [None, None], False)
    rhos   : Parameter(6.15374232e-25, [None, None], [None, None], False)
    rmin   : Parameter(3.08568e+17, [None, None], [None, None], False)
    rmax   : Parameter(3.08568e+23, [None, None], [None, None], False)
    rhomax : Parameter(inf, [None, None], [None, None], False)
    covar  : None

In [6]:
# Do some plotting                                                                   
import healpy
healpy.mollview(np.log10(skymap.values))