scifysim.map_manager module

class scifysim.map_manager.map_meta(asim=None, starmags=None, mgs=None, mgs_TNP=None, file=None, metadata={}, dummy=False)[source]

Bases: object

__dict__ = mappingproxy({'__module__': 'scifysim.map_manager', '__init__': <function map_meta.__init__>, 'from_sim': <function map_meta.from_sim>, 'to_fits': <function map_meta.to_fits>, 'from_fits': <function map_meta.from_fits>, 'get_loc': <function map_meta.get_loc>, 'get_value': <function map_meta.get_value>, 'plot_map': <function map_meta.plot_map>, '__dict__': <attribute '__dict__' of 'map_meta' objects>, '__weakref__': <attribute '__weakref__' of 'map_meta' objects>, '__doc__': None, '__annotations__': {}})
__init__(asim=None, starmags=None, mgs=None, mgs_TNP=None, file=None, metadata={}, dummy=False)[source]

Create or load a meta map object:

LOAD:

Parameters:

  • file : The path to a fits file

CREATE:

Parameters:

  • asim : Simulator object from which map parameters are taken

  • starmags : An array of star magnitudes

  • mgs : The planet magnitude maps

  • mgs_TNP : The planet magnitude maps for the NeymanPearson test

  • dummy : If True Create an empty object. Can be use to facilitate simple map operations.

__module__ = 'scifysim.map_manager'
__weakref__

list of weak references to the object (if defined)

from_fits(file)[source]

Loads meta map from file

Parameters:

  • file : The path to a fits file

from_sim(asim, starmags, metadata)[source]

Builds the meta map from simulator

Parameters:

  • asim : Simulator object from which map parameters are taken

  • starmags : An array of star magnitudes

  • mgs : The planet magnitude maps

get_loc(loc, mag)[source]

Get the index location from a relative location and star magnitude. Returns a tuple index to query self.mgs

Parameters:

  • loc : 2-tuple Relative location on sky in the band of interest

  • mag : Magnitude of the host star

get_value(loc, mag, detector='E')[source]

Get the limiting magnitude for a planet at the relative location loc around a star of magnitude mag.

Parameters:

  • loc : 2-tuple Relative location on sky in the band of interest

  • mag : Magnitude of the host star

  • detector : The type of detector test: “E” for energy detector “N” for Neyman-Pearson

Examples:

  • pmag_limit = mymap.get_value((5.2, 4.8), 4.)

plot_map(mag, cmap='viridis', show=True, detector='E', **kwargs)[source]

Uses matplotlib to show a map at a given star magnitude.

Parameters:

  • mag : The star magnitude

  • cmap : The colormap to use

  • detector : The type of detector test: “E” for energy detector “N” for Neyman-Pearson

  • **kwargs : Keyword arguments to pass to plt.figure()

Returns the figure object

to_fits(file, overwrite=True)[source]