Unified Sampling Architecture

Sample a Potential.

Introduction

What is PotentialSampler?

Registering a Sampler

Registering a sampler is easy. All you need to do is subclass PotentialSampler and provide information about the sampling object’s package.

For example

Let’s do this for galpy

class GalpyPotentialSampler(PotentialSampler):

A Worked Example

First we do the standard set of imports. In this example we will be sampling from

>>> from discO import PotentialSampler

When we sample from this potential

Reference/API

discO.core.sample Module

Classes

PotentialSampler(potential, *[, total_mass, ...])

Sample a Potential.

MeshGridPotentialSampler(potential, meshgrid, *)

Mesh-Grid Position Distribution.

Class Inheritance Diagram

digraph inheritance76b2523b41 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "CommonBase" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Base-class for interfacing with a Potential."]; "MeshGridPotentialSampler" [URL="../api/discO.core.sample.MeshGridPotentialSampler.html#discO.core.sample.MeshGridPotentialSampler",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mesh-Grid Position Distribution."]; "PotentialSampler" -> "MeshGridPotentialSampler" [arrowsize=0.5,style="setlinewidth(0.5)"]; "PotentialSampler" [URL="../api/discO.core.sample.PotentialSampler.html#discO.core.sample.PotentialSampler",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Sample a Potential."]; "CommonBase" -> "PotentialSampler" [arrowsize=0.5,style="setlinewidth(0.5)"]; }