fermipy.diffuse subpackage¶
fermipy.diffuse.binning module¶
Small helper class to represent the binning used for a single component of a summed likelihood in diffuse analysis
-
class
fermipy.diffuse.binning.
Component
(**kwargs)[source]¶ Bases:
object
Small helper class to represent the binning used for a single component of a summed likelihood in diffuse analysis
Parameters: - log_emin (float) – Log base 10 of minimum energy for this component
- log_emax (float) – Log base 10 of maximum energy for this component
- enumbins (int) – Number of energy bins for this component
- zmax (float) – Maximum zenith angle cube for this component in degrees
- hpx_order (int) – HEALPix order to use for this component
-
static
build_from_energy_dict
(ebin_name, input_dict)[source]¶ Build a list of components from a dictionary for a single energy range
-
emax
¶ Maximum energy for this component
-
emin
¶ Minimum energy for this component
-
evtype
¶ Event type bit mask for this component
fermipy.diffuse.defaults module¶
Analysis framework for all-sky diffuse emission fitting
fermipy.diffuse.name_policy module¶
Handle the naming conventions for composite likelihood analysis
-
class
fermipy.diffuse.name_policy.
NameFactory
(**kwargs)[source]¶ Bases:
object
Helper class to define file names and keys consistently.
-
angprofile_format
= 'templates/profile_{sourcekey}.fits'¶
-
bexpcube_format
= 'bexp_cubes/bexcube_{dataset}_{component}_{coordsys}_{irf_ver}.fits'¶
-
bexpcubemoon_format
= 'bexp_cubes/bexcube_{dataset}_{component}_{irf_ver}_moon.fits'¶
-
bexpcubesun_format
= 'bexp_cubes/bexcube_{dataset}_{component}_{irf_ver}_sun.fits'¶
-
catalog_split_yaml_format
= 'models/{sourcekey}.yaml'¶
-
ccube_format
= 'counts_cubes/ccube_{dataset}_{component}_{coordsys}.fits'¶
-
comp_srcmdl_xml_format
= 'analysis/model_{modelkey}/srcmdl_{modelkey}_{component}.xml'¶
-
component_format
= '{zcut}_{ebin}_{psftype}'¶
-
dataset_format
= '{data_pass}_{data_ver}_{data_time}_{evclass}'¶
-
diffuse_template_format
= 'templates/template_{sourcekey}.fits'¶
-
ft1file_format
= '{dataset}_{zcut}.lst'¶
-
ft2file_format
= 'ft2_{data_time}.lst'¶
-
fullpath_format
= '{basedir}/{localpath}'¶
-
galprop_gasmap_format
= 'gasmap/{sourcekey}_{projtype}_{galprop_run}_{maptype}.fits.gz'¶
-
galprop_ringkey
(**kwargs)[source]¶ return the sourcekey for galprop input maps : specifies the component and ring
-
galprop_ringkey_format
= '{source_name}_{ringkey}'¶
-
galprop_rings_yaml_format
= 'models/galprop_rings_{galkey}.yaml'¶
-
galprop_sourcekey
(**kwargs)[source]¶ return the sourcekey for merged galprop maps : specifies the merged component and merging scheme
-
galprop_sourcekey_format
= '{source_name}_{galpropkey}'¶
-
generic
(input_string, **kwargs)[source]¶ return a generic filename for a given dataset and component
-
ltcube_format
= 'lt_cubes/ltcube_{data_time}_{zcut}.fits'¶
-
ltcubemoon_format
= 'sunmoon/ltcube_{data_time}_{zcut}_moon.fits'¶
-
ltcubesun_format
= 'sunmoon/ltcube_{data_time}_{zcut}_sun.fits'¶
-
master_srcmdl_xml_format
= 'analysis/model_{modelkey}/srcmdl_{modelkey}_master.xml'¶
-
mcube_format
= 'model_cubes/mcube_{sourcekey}_{dataset}_{component}_{coordsys}_{irf_ver}.fits'¶
-
merged_gasmap_format
= 'merged_gasmaps/{sourcekey}_{projtype}_{maptype}.fits.gz'¶
-
merged_sourcekey
(**kwargs)[source]¶ return the sourcekey for merged sets of point sources : specifies the catalog and merging rule
-
merged_sourcekey_format
= '{catalog}_{rulekey}'¶
-
merged_srcmaps_format
= 'analysis/model_{modelkey}/srcmaps_{dataset}_{component}_{coordsys}_{irf_ver}.fits'¶
-
model_yaml_format
= 'models/model_{modelkey}.yaml'¶
-
nested_srcmdl_xml
(**kwargs)[source]¶ return the file name for source model xml files of nested sources
-
nested_srcmdl_xml_format
= 'srcmdls/{sourcekey}_sources.xml'¶
-
residual_cr_format
= 'residual_cr/residual_cr_{dataset}_{component}_{coordsys}_{irf_ver}.fits'¶
-
sourcekey
(**kwargs)[source]¶ Return a key that specifies the name and version of a source or component
-
sourcekey_format
= '{source_name}_{source_ver}'¶
-
spectral_template_format
= 'templates/spectral_{sourcekey}.txt'¶
-
srcmaps_format
= 'srcmaps/srcmaps_{sourcekey}_{dataset}_{component}_{coordsys}_{irf_ver}.fits'¶
-
srcmdl_xml_format
= 'srcmdls/{sourcekey}.xml'¶
-
stamp_format
= 'stamps/{linkname}.stamp'¶
-
templatesunmoon_format
= 'templates/template_{sourcekey}_{zcut}.fits'¶
-
fermipy.diffuse.spectral module¶
Classes and utilities that manage spectral model specific to diffuse analyses
fermipy.diffuse.source_factory module¶
Classes and utilities that create fermipy source objects
-
class
fermipy.diffuse.source_factory.
SourceFactory
[source]¶ Bases:
object
Small helper class to build and keep track of sources
-
static
build_catalog
(catalog_type, catalog_file, catalog_extdir, **kwargs)[source]¶ Build a
fermipy.catalog.Catalog
objectParameters:
-
static
copy_selected_sources
(roi, source_names)[source]¶ Build and return a
fermipy.roi_model.ROIModel
object by copying selected sources from another such object
-
static
make_fermipy_roi_model_from_catalogs
(cataloglist)[source]¶ Build and return a
fermipy.roi_model.ROIModel object from a list of fermipy.catalog.Catalog
objects
-
static
make_roi
(sources={})[source]¶ Build and return a
fermipy.roi_model.ROIModel
object from a dict with information about the sources
-
source_info_dict
¶ Return the dictionary of source_info objects used to build sources
-
sources
¶ Return the dictionary of sources
-
static
-
fermipy.diffuse.source_factory.
make_catalog_sources
(catalog_roi_model, source_names)[source]¶ Construct and return dictionary of sources that are a subset of sources in catalog_roi_model.
Parameters: - catalog_roi_model (dict or
fermipy.roi_model.ROIModel
) – Input set of sources - source_names (list) – Names of sourcs to extract
- dict mapping source_name to fermipy.roi_model.Source object (Returns) –
- catalog_roi_model (dict or
-
fermipy.diffuse.source_factory.
make_composite_source
(name, catalog_roi_model, spectrum, nested_source_names)[source]¶ Construct and return a
fermipy.roi_model.CompositeSource
object
-
fermipy.diffuse.source_factory.
make_isotropic_source
(name, Spectrum_Filename, spectrum)[source]¶ Construct and return a
fermipy.roi_model.IsoSource
object
-
fermipy.diffuse.source_factory.
make_mapcube_source
(name, Spatial_Filename, spectrum)[source]¶ Construct and return a
fermipy.roi_model.MapCubeSource
object
-
fermipy.diffuse.source_factory.
make_point_source
(name, src_dict)[source]¶ Construct and return a
fermipy.roi_model.Source
object
fermipy.diffuse.catalog_src_manager module¶
Classes and utilities that manage catalog sources
-
class
fermipy.diffuse.catalog_src_manager.
CatalogComponentChain
(linkname)[source]¶ Bases:
fermipy.jobs.chain.Chain
Small class to build srcmaps for diffuse components
-
default_options
= {'sources': (None, 'Path to yaml file defining catalog components.', <type 'str'>), 'make_xml': (False, 'Make XML files for diffuse components', <type 'bool'>), 'data': (None, 'Path to yaml file defining dataset.', <type 'str'>), 'dry_run': (False, 'Print commands but do not run them', <type 'bool'>), 'comp': (None, 'Path to yaml file defining binning.', <type 'str'>)}¶
-
-
class
fermipy.diffuse.catalog_src_manager.
CatalogSourceManager
(**kwargs)[source]¶ Bases:
object
Small helper class to keep track of how we deal with catalog sources
This keeps track of two dictionaries
One of the dictionaries is keyed by catalog name, and contains information about complete catalogs catalog_comp_info_dicts[catalog_name] :
model_component.CatalogInfo
The other dictionary is keyed by [{catalog_name}_{split_ver}][{split_key}] Where: {catalog_name} is something like ‘3FGL’ {split_ver} is somthing like ‘v00’ and specifes how to divide sources in the catalog {split_key} refers to a specific sub-selection of sources
split_comp_info_dicts[splitkey] :
model_component.ModelComponentInfo
-
catalog_components
(catalog_name, split_ver)[source]¶ Return the set of merged components for a particular split key
-
make_catalog_comp_info
(full_cat_info, split_key, rule_key, rule_val, sources)[source]¶ Make the information about a single merged component
Parameters: - full_cat_info (
_model_component.CatalogInfo
) – Information about the full catalog - split_key (str) – Key identifying the version of the spliting used
- rule_key (str) – Key identifying the specific rule for this component
- rule_val (list) – List of the cuts used to define this component
- sources (list) – List of the names of the sources in this component
- CompositeSourceInfo or CatalogSourcesInfo (Returns) –
- full_cat_info (
-
make_catalog_comp_info_dict
(catalog_sources)[source]¶ Make the information about the catalog components
Parameters: catalog_sources (dict) – Dictionary with catalog source defintions Returns: - catalog_ret_dict (dict) –
Dictionary mapping catalog_name to
model_component.CatalogInfo
- split_ret_dict (dict) –
Dictionary mapping sourcekey to
model_component.ModelComponentInfo
- catalog_ret_dict (dict) –
Dictionary mapping catalog_name to
-
split_comp_info
(catalog_name, split_ver, split_key)[source]¶ Return the info for a particular split key
-
-
fermipy.diffuse.catalog_src_manager.
create_chain_catalog_comps
(**kwargs)[source]¶ Create and return a
CatalogComponentChain
object
-
fermipy.diffuse.catalog_src_manager.
main_chain
()[source]¶ Entry point for command line use for single job
-
fermipy.diffuse.catalog_src_manager.
make_catalog_comp_dict
(**kwargs)[source]¶ Build and return the information about the catalog components
-
fermipy.diffuse.catalog_src_manager.
make_mask
(cat_table, cut)[source]¶ Mask a bit mask selecting the rows that pass a selection
-
fermipy.diffuse.catalog_src_manager.
mask_extended
(cat_table)[source]¶ Remove rows representing extended sources from a catalog table
fermipy.diffuse.diffuse_src_manager module¶
Classes and utilities that manage the diffuse emission background models
-
class
fermipy.diffuse.diffuse_src_manager.
DiffuseComponentChain
(linkname)[source]¶ Bases:
fermipy.jobs.chain.Chain
Small class to build srcmaps for diffuse components
-
default_options
= {'make_xml': (False, 'Make XML files for diffuse components', <type 'bool'>), 'data': (None, 'Path to yaml file defining dataset.', <type 'str'>), 'diffuse': (None, 'Path to yaml file defining diffuse components.', <type 'str'>), 'dry_run': (False, 'Print commands but do not run them', <type 'bool'>), 'comp': (None, 'Path to yaml file defining binning.', <type 'str'>)}¶
-
-
class
fermipy.diffuse.diffuse_src_manager.
DiffuseModelManager
(**kwargs)[source]¶ Bases:
object
Small helper class to keep track of diffuse component templates
This keeps track of the ‘diffuse component infomation’ dictionary
This keyed by: key = {source_name}_{source_ver} Where: {source_name} is something like ‘loopI’ {source_ver} is somthinng like v00
The dictioary is diffuse_comp_info_dict[key] - >
model_component.ModelComponentInfo
Note that some components ( those that represent moving sources or are selection depedent ) will have a sub-dictionary of diffuse_comp_info_dict object for each sub-component
The compoents are defined in a file called config/diffuse_components.yaml
-
make_diffuse_comp_info
(source_name, source_ver, diffuse_dict, components=None, comp_key=None)[source]¶ Make a dictionary mapping the merged component names to list of template files
Parameters: - source_name (str) – Name of the source
- source_ver (str) – Key identifying the version of the source
- diffuse_dict (dict) – Information about this component
- comp_key (str) – Used when we need to keep track of sub-components, i.e., for moving and selection dependent sources.
- model_component.ModelComponentInfo or (Returns) –
- model_component.IsoComponentInfo –
-
make_diffuse_comp_info_dict
(diffuse_sources, components)[source]¶ Make a dictionary maping from diffuse component to information about that component
Parameters: Returns: ret_dict – Dictionary mapping sourcekey to
model_component.ModelComponentInfo
Return type:
-
make_template_name
(model_type, sourcekey)[source]¶ Make the name of a template file for particular component
Parameters:
-
-
class
fermipy.diffuse.diffuse_src_manager.
GalpropMapManager
(**kwargs)[source]¶ Bases:
object
Small helper class to keep track of Galprop gasmaps
This keeps track of two types of dictionaries. Both are keyed by: key = {source_name}_{ring}_{galkey}
Where: {source_name} is something like ‘merged_C0’ {ring} is the ring index {galkey} is a key specifying which version of galprop rings to use.
The two dictionaries are: ring_dict[key] =
model_component.GalpropMergedRingInfo
diffuse_comp_info_dict[key] ]model_component.ModelComponentInfo
The dictionaries are defined in files called. models/galprop_rings_{galkey}.yaml
-
diffuse_comp_info_dicts
(galkey)[source]¶ Return the components info dictionary for a particular galprop key
-
make_diffuse_comp_info
(merged_name, galkey)[source]¶ Make the information about a single merged component
Parameters:
-
make_diffuse_comp_info_dict
(galkey)[source]¶ Make a dictionary maping from merged component to information about that component
Parameters: galkey (str) – A short key identifying the galprop parameters
-
make_merged_name
(source_name, galkey, fullpath)[source]¶ Make the name of a gasmap file for a set of merged rings
Parameters:
-
make_ring_dict
(galkey)[source]¶ Make a dictionary mapping the merged component names to list of template files
Parameters: - galkey (str) – Unique key for this ring dictionary
- model_component.GalpropMergedRingInfo (Returns) –
-
make_ring_filelist
(sourcekeys, rings, galprop_run)[source]¶ Make a list of all the template files for a merged component
Parameters: - sourcekeys (list-like of str) – The names of the componenents to merge
- rings (list-like of int) – The indices of the rings to merge
- galprop_run (str) – String identifying the galprop parameters
-
make_ring_filename
(source_name, ring, galprop_run)[source]¶ Make the name of a gasmap file for a single ring
Parameters:
-
-
fermipy.diffuse.diffuse_src_manager.
create_chain_diffuse_comps
(**kwargs)[source]¶ Create and return a
DiffuseComponentChain
object
-
fermipy.diffuse.diffuse_src_manager.
main_chain
()[source]¶ Entry point for command line use for single job
fermipy.diffuse.model_component module¶
Small helper classes that wrap information about model components
-
class
fermipy.diffuse.model_component.
CatalogInfo
(**kwargs)[source]¶ Bases:
object
Information about a source catalog
Parameters: - catalog_name (str) – The name given to the merged component, e.g., merged_CO or merged_HI
- catalog_file (str) – Fits file with catalog data
- catalog_extdir (str) – Directory with extended source templates
- catalog_type (str) – Identifies the format of the catalog fits file: e.g., ‘3FGL’ or ‘4FGLP’
- catalog (
fermipy.catalog.Catalog
) – Catalog object - roi_model (
fermipy.roi_model.ROIModel
) – Fermipy object describing all the catalog sources - srcmdl_name (str) – Name of xml file with the catalog source model
-
class
fermipy.diffuse.model_component.
CatalogSourcesInfo
(**kwargs)[source]¶ Bases:
fermipy.diffuse.model_component.ModelComponentInfo
Information about a model component consisting of sources from a catalog
Parameters: - source_names (list) – The names of the nested sources
- catalog_info (
model_component.CatalogInfo
or None) – Information about the catalog containing the nested sources - roi_model (
fermipy.roi_model.ROIModel
) – Fermipy object describing the nested sources
-
class
fermipy.diffuse.model_component.
CompositeSourceInfo
(**kwargs)[source]¶ Bases:
fermipy.diffuse.model_component.ModelComponentInfo
Information about a model component represented by a CompositeSource
Parameters: - source_names (list) – The names of the nested sources
- catalog_info (
model_component.CatalogInfo
or None) – Information about the catalog containing the nested sources - roi_model (
fermipy.roi_model.ROIModel
) – Fermipy object describing the nested sources
-
class
fermipy.diffuse.model_component.
GalpropMergedRingInfo
(**kwargs)[source]¶ Bases:
object
Information about a set of Merged Galprop Rings
Parameters: - source_name (str) – The name given to the merged component, e.g., merged_CO or merged_HI
- ring (int) – The index of the merged ring
- sourcekey (str) – Key that identifies this component, e.g., merged_CO_1, or merged_HI_3
- galkey (str) – Key that identifies how to merge the galprop rings, e.g., ‘ref’
- galprop_run (str) – Key that idenfifies the galprop run used to make the input rings
- files (str) – List of files of the input gasmap files
- merged_gasmap (str) – Filename for the merged gasmap
-
class
fermipy.diffuse.model_component.
IsoComponentInfo
(**kwargs)[source]¶ Bases:
fermipy.diffuse.model_component.ModelComponentInfo
Information about a model component represented by a IsoSource
Parameters: Spectral_Filename (str) – Name of the template file for the spatial model
-
class
fermipy.diffuse.model_component.
MapCubeComponentInfo
(**kwargs)[source]¶ Bases:
fermipy.diffuse.model_component.ModelComponentInfo
Information about a model component represented by a MapCubeSource
Parameters: Spatial_Filename (str) – Name of the template file for the spatial model
-
class
fermipy.diffuse.model_component.
ModelComponentInfo
(**kwargs)[source]¶ Bases:
object
Information about a model component
Parameters: - source_name (str) – The name given to the component, e.g., loop_I or moon
- source_ver (str) – Key to indentify the model version of the source, e.g., v00
- sourcekey (str) – Key that identifies this component, e.g., loop_I_v00 or moon_v00
- model_type (str) – Type of model, ‘MapCubeSource’ | ‘IsoSource’ | ‘CompositeSource’ | ‘Catalog’ | ‘PointSource’
- srcmdl_name (str) – Name of the xml file with the xml just for this component
- moving (bool) – Flag for moving sources (i.e., the sun and moon)
- selection_dependent (bool) – Flag for selection dependent sources (i.e., the residual cosmic ray model)
- components (dict) – Sub-dictionary of
ModelComponentInfo
objects for moving and selection_dependent sources - comp_key (str) – Component key for this component of moving and selection_dependent sources
-
add_component_info
(compinfo)[source]¶ Add sub-component specific information to a particular data selection
Parameters: compinfo ( ModelComponentInfo
object) – Sub-component being added
-
clone_and_merge_sub
(key)[source]¶ Clones self and merges clone with sub-component specific information
Parameters: - key (str) – Key specifying which sub-component
- ModelComponentInfo object (Returns) –
-
class
fermipy.diffuse.model_component.
PointSourceInfo
(**kwargs)[source]¶ Bases:
fermipy.diffuse.model_component.ModelComponentInfo
Information about a model component represented by a PointSource
fermipy.diffuse.model_manager module¶
Classes and utilities that manage fitting models for diffuse analyses
-
class
fermipy.diffuse.model_manager.
ModelComponent
(**kwargs)[source]¶ Bases:
object
Small helper class to tie a ModelComponentInfo to a spectrum
-
class
fermipy.diffuse.model_manager.
ModelInfo
(**kwargs)[source]¶ Bases:
object
Small helper class to keep track of a single fitting model
-
component_names
¶ Return the list of name of the components
-
make_model_rois
(components, name_factory)[source]¶ Make the fermipy roi_model objects for each of a set of binning components
-
make_srcmap_manifest
(components, name_factory)[source]¶ Build a yaml file that specfies how to make the srcmap files for a particular model
Parameters: - components (list) – The binning components used in this analysis
- name_factory (
NameFactory
) – Object that handles naming conventions - a dictionary that contains information about where to find the (Returns) –
- maps for each component of the model (source) –
-
-
class
fermipy.diffuse.model_manager.
ModelManager
(**kwargs)[source]¶ Bases:
object
Small helper class to create fitting models and manager XML files for fermipy
This class contains a ‘library’, which is a dictionary of all the source components:
specifically it maps:
sourcekey :
model_component.ModelComponentInfo
-
csm
¶ Return the CatalogSourceManager
-
dmm
¶ Return the DiffuseModelManager
-
static
get_sub_comp_info
(source_info, comp)[source]¶ Build and return information about a sub-component for a particular selection
-
gmm
¶ Return the GalpropMapManager
-
make_fermipy_config_yaml
(modelkey, components, data, **kwargs)[source]¶ Build a fermipy top-level yaml configuration file
Parameters:
-
make_library
(diffuse_yaml, catalog_yaml, binning_yaml)[source]¶ Build up the library of all the components
Parameters:
-
make_model_info
(modelkey)[source]¶ Build a dictionary with the information for a particular model.
Parameters: - modelkey (str) – Key used to identify this particular model
- ModelInfo (Return) –
-
fermipy.diffuse.job_library module¶
Module to collect configuration to run specific jobs
-
class
fermipy.diffuse.job_library.
ConfigMaker_Gtexpcube2
(link, **kwargs)[source]¶ Bases:
fermipy.jobs.scatter_gather.ConfigMaker
Small class to generate configurations for gtexpcube2
This takes the following arguments: –comp : binning component definition yaml file –data : datset definition yaml file –irf_ver : IRF verions string (e.g., ‘V6’) –coordsys : Coordinate system [‘GAL’ | ‘CEL’] –hpx_order: HEALPix order parameter
-
default_options
= {'irf_ver': ('V6', 'Version of IRFs to use.', <type 'str'>), 'comp': (None, 'Path to yaml file defining binning.', <type 'str'>), 'data': (None, 'Path to yaml file defining dataset.', <type 'str'>), 'coordsys': ('GAL', 'Coordinate system of the spatial projection (CEL or GAL).', <type 'str'>), 'hpx_order_max': (6, 'Maximum HEALPIX order for exposure cubes.', <type 'int'>)}¶
-
-
class
fermipy.diffuse.job_library.
ConfigMaker_SrcmapsCatalog
(link, **kwargs)[source]¶ Bases:
fermipy.jobs.scatter_gather.ConfigMaker
Small class to generate configurations for gtsrcmaps for catalog sources
This takes the following arguments: –comp : binning component definition yaml file –data : datset definition yaml file –irf_ver : IRF verions string (e.g., ‘V6’) –sources : Yaml file with input source model definitions –make_xml : Write xml files for the individual components
-
default_options
= {'irf_ver': ('V6', 'Version of IRFs to use.', <type 'str'>), 'sources': (None, 'Path to yaml file defining catalog components.', <type 'str'>), 'make_xml': (False, 'Write xml files needed to make source maps', <type 'bool'>), 'data': (None, 'Path to yaml file defining dataset.', <type 'str'>), 'comp': (None, 'Path to yaml file defining binning.', <type 'str'>)}¶
-
-
class
fermipy.diffuse.job_library.
ConfigMaker_SumRings
(link, **kwargs)[source]¶ Bases:
fermipy.jobs.scatter_gather.ConfigMaker
Small class to generate configurations for fermipy-coadd to sum galprop ring gasmaps
This takes the following arguments: –diffuse : Diffuse model component definition yaml file –outdir : Output directory
-
default_options
= {'diffuse': (None, 'Path to yaml file defining diffuse components.', <type 'str'>), 'outdir': (None, 'Output directory', <type 'str'>)}¶
-
-
class
fermipy.diffuse.job_library.
ConfigMaker_Vstack
(link, **kwargs)[source]¶ Bases:
fermipy.jobs.scatter_gather.ConfigMaker
Small class to generate configurations for fermipy-vstack to merge source maps
This takes the following arguments: –comp : binning component definition yaml file –data : datset definition yaml file –irf_ver : IRF verions string (e.g., ‘V6’) –diffuse : Diffuse model component definition yaml file’
-
default_options
= {'irf_ver': ('V6', 'Version of IRFs to use.', <type 'str'>), 'comp': (None, 'Path to yaml file defining binning.', <type 'str'>), 'data': (None, 'Path to yaml file defining dataset.', <type 'str'>), 'diffuse': (None, 'Path to yaml file defining diffuse components.', <type 'str'>)}¶
-
-
class
fermipy.diffuse.job_library.
ConfigMaker_healview
(link, **kwargs)[source]¶ Bases:
fermipy.jobs.scatter_gather.ConfigMaker
Small class to generate configurations for fermipy-healview to display source maps
This takes the following arguments: –comp : binning component definition yaml file –data : datset definition yaml file –irf_ver : IRF verions string (e.g., ‘V6’) –diffuse : Diffuse model component definition yaml file’
-
default_options
= {'irf_ver': ('V6', 'Version of IRFs to use.', <type 'str'>), 'comp': (None, 'Path to yaml file defining binning.', <type 'str'>), 'data': (None, 'Path to yaml file defining dataset.', <type 'str'>), 'diffuse': (None, 'Path to yaml file defining diffuse components.', <type 'str'>)}¶
-
-
fermipy.diffuse.job_library.
create_link_fermipy_coadd
(**kwargs)[source]¶ Make a
fermipy.jobs.Link
object to run fermipy-coadd
-
fermipy.diffuse.job_library.
create_link_fermipy_healview
(**kwargs)[source]¶ Make a
fermipy.jobs.Link
object to run fermipy-healview
-
fermipy.diffuse.job_library.
create_link_fermipy_vstack
(**kwargs)[source]¶ Make a
fermipy.jobs.Link
object to run fermipy-vstack
-
fermipy.diffuse.job_library.
create_link_gtexpcube2
(**kwargs)[source]¶ Make a
fermipy.jobs.Gtlink
object to run gtexpcube2
-
fermipy.diffuse.job_library.
create_link_gtscrmaps
(**kwargs)[source]¶ Make a
fermipy.jobs.Gtlink
object to run gtsrcmaps
-
fermipy.diffuse.job_library.
create_sg_gtexpcube2
(**kwargs)[source]¶ Build and return a ScatterGather object that can invoke gtexpcube2
-
fermipy.diffuse.job_library.
create_sg_gtsrcmaps_catalog
(**kwargs)[source]¶ Build and return a ScatterGather object that can invoke gtsrcmaps for catalog sources
-
fermipy.diffuse.job_library.
create_sg_healview_diffuse
(**kwargs)[source]¶ Build and return a ScatterGather object that can invoke fermipy-healview
-
fermipy.diffuse.job_library.
create_sg_sum_ring_gasmaps
(**kwargs)[source]¶ Build and return a ScatterGather object that can invoke fermipy-coadd
-
fermipy.diffuse.job_library.
create_sg_vstack_diffuse
(**kwargs)[source]¶ Build and return a ScatterGather object that can invoke fermipy-vstack
-
fermipy.diffuse.job_library.
invoke_sg_gtexpcube2
()[source]¶ Entry point for command line use for dispatching batch jobs
-
fermipy.diffuse.job_library.
invoke_sg_gtsrcmaps_catalog
()[source]¶ Entry point for command line use for dispatching batch jobs
-
fermipy.diffuse.job_library.
invoke_sg_healview_diffuse
()[source]¶ Entry point for command line use for dispatching batch jobs
fermipy.diffuse.gt_assemble_model module¶
Merge source maps to build composite sources
-
class
fermipy.diffuse.gt_assemble_model.
ConfigMaker_AssembleModel
(link, **kwargs)[source]¶ Bases:
fermipy.jobs.scatter_gather.ConfigMaker
Small class to generate configurations for this script
Parameters: - --comp (binning component definition yaml file) –
- --data (datset definition yaml file) –
- --hpx_order (Maximum HEALPix order to use) –
- --irf_ver (IRF verions string (e.g., 'V6')) –
- args (Names of models to assemble source maps for) –
-
default_options
= {'sources': (None, 'Path to yaml file defining catalog components.', <type 'str'>), 'irf_ver': ('V6', 'Version of IRFs to use.', <type 'str'>), 'comp': (None, 'Path to yaml file defining binning.', <type 'str'>), 'args': (None, 'Names of input models', <type 'list'>), 'hpx_order': (7, 'Maximum HEALPIX order for model fitting.', <type 'int'>), 'diffuse': (None, 'Path to yaml file defining diffuse components.', <type 'str'>), 'data': (None, 'Path to yaml file defining dataset.', <type 'str'>)}¶
-
class
fermipy.diffuse.gt_assemble_model.
GtAssembleModel
(**kwargs)[source]¶ Bases:
object
Small class to assemple source map files for fermipy analysis.
This is useful for re-merging after parallelizing source map creation.
-
static
append_hdus
(hdulist, srcmap_file, source_names, hpx_order)[source]¶ Append HEALPix maps to a list
Parameters:
-
static
assemble_component
(compname, compinfo, hpx_order)[source]¶ Assemble the source map file for one binning component
Parameters:
-
static
copy_ccube
(ccube, outsrcmap, hpx_order)[source]¶ Copy a counts cube into outsrcmap file reducing the HEALPix order to hpx_order if needed.
-
default_options
= {'comp': (None, 'Path to yaml file defining binning.', <type 'str'>), 'hpx_order': (7, 'Maximum HEALPIX order for model fitting.', <type 'int'>), 'input': (None, 'Input yaml file', <type 'str'>)}¶
-
static
make_link
(**kwargs)[source]¶ Make a
fermipy.jobs.Link
object to runGtAssembleModel
-
static
-
class
fermipy.diffuse.gt_assemble_model.
GtInitModel
(**kwargs)[source]¶ Bases:
object
Small class to preprate files fermipy analysis.
Specifically this create the srcmap_manifest and fermipy_config_yaml files
-
default_options
= {'sources': (None, 'Path to yaml file defining catalog components.', <type 'str'>), 'comp': (None, 'Path to yaml file defining binning.', <type 'str'>), 'args': (None, 'Names of input models', <type 'list'>), 'hpx_order': (7, 'Maximum HEALPIX order for model fitting.', <type 'int'>), 'diffuse': (None, 'Path to yaml file defining diffuse components.', <type 'str'>), 'data': (None, 'Path to yaml file defining dataset.', <type 'str'>)}¶
-
static
make_link
(**kwargs)[source]¶ Make a
fermipy.jobs.Link
object to runGtAssembleModel
-
-
fermipy.diffuse.gt_assemble_model.
create_link_assemble_model
(**kwargs)[source]¶ Build and return a
Link
object that can invoke GtAssembleModel
-
fermipy.diffuse.gt_assemble_model.
create_sg_assemble_model
(**kwargs)[source]¶ Build and return a ScatterGather object that can invoke this script
-
fermipy.diffuse.gt_assemble_model.
main_batch
()[source]¶ Entry point for command line use for dispatching batch jobs
fermipy.diffuse.gt_coadd_split module¶
Prepare data for diffuse all-sky analysis
-
class
fermipy.diffuse.gt_coadd_split.
CoaddSplit
(linkname, comp_dict=None)[source]¶ Bases:
fermipy.jobs.chain.Chain
Small class to merge counts cubes for a series of binning components
-
fermipy.diffuse.gt_coadd_split.
create_chain_coadd_split
(**kwargs)[source]¶ Build and return a
CoaddSplit
object
fermipy.diffuse.gt_merge_srcmaps module¶
Merge source maps to build composite sources
-
class
fermipy.diffuse.gt_merge_srcmaps.
ConfigMaker_MergeSrcmaps
(link, **kwargs)[source]¶ Bases:
fermipy.jobs.scatter_gather.ConfigMaker
Small class to generate configurations for this script
This adds the following arguments: –comp : binning component definition yaml file –data : datset definition yaml file –irf_ver : IRF verions string (e.g., ‘V6’) –sources : Catalog model component definition yaml file’
-
default_options
= {'irf_ver': ('V6', 'Version of IRFs to use.', <type 'str'>), 'sources': (None, 'Path to yaml file defining catalog components.', <type 'str'>), 'data': (None, 'Path to yaml file defining dataset.', <type 'str'>), 'comp': (None, 'Path to yaml file defining binning.', <type 'str'>)}¶
-
-
class
fermipy.diffuse.gt_merge_srcmaps.
GtMergeSourceMaps
(**kwargs)[source]¶ Bases:
object
Small class to merge source maps for composite sources.
This is useful for parallelizing source map creation.
-
NULL_MODEL
= 'srcmdls/null.xml'¶
-
default_options
= {'irfs': ('CALDB', 'Instrument response functions', <type 'str'>), 'expcube': (None, 'Input Livetime cube file', <type 'str'>), 'srcmaps': (None, 'Input source maps file', <type 'str'>), 'srcmdl': (None, 'Input source model xml file', <type 'str'>), 'outxml': (None, 'Output source model xml file', <type 'str'>), 'bexpmap': (None, 'Input binned exposure map file', <type 'str'>), 'outfile': (None, 'Output file', <type 'str'>), 'gzip': (False, 'Compress output file', <type 'bool'>), 'merged': (None, 'Name of merged source', <type 'str'>)}¶
-
-
fermipy.diffuse.gt_merge_srcmaps.
create_link_merge_srcmaps
(**kwargs)[source]¶ Build and return a
Link
object that can invoke GtAssembleModel
-
fermipy.diffuse.gt_merge_srcmaps.
create_sg_merge_srcmaps
(**kwargs)[source]¶ Build and return a ScatterGather object that can invoke this script
fermipy.diffuse.gt_split_and_bin module¶
Prepare data for diffuse all-sky analysis
-
class
fermipy.diffuse.gt_split_and_bin.
ConfigMaker_SplitAndBin
(chain, gather, **kwargs)[source]¶ Bases:
fermipy.jobs.scatter_gather.ConfigMaker
Small class to generate configurations for SplitAndBin
-
default_options
= {'coordsys': ('GAL', 'Coordinate system of the spatial projection (CEL or GAL).', <type 'str'>), 'hpx_order_max': (9, 'Maximum HEALPIX order for binning counts data.', <type 'int'>), 'scratch': (None, 'Path to scratch area', <type 'str'>), 'comp': (None, 'Path to yaml file defining binning.', <type 'str'>), 'data': (None, 'Path to yaml file defining dataset.', <type 'str'>), 'inputlist': (None, 'Input FT1 file', <type 'str'>)}¶
-
-
class
fermipy.diffuse.gt_split_and_bin.
SplitAndBin
(linkname, comp_dict=None)[source]¶ Bases:
fermipy.jobs.chain.Chain
Small class to split and bin data according to some user-provided specification
-
fermipy.diffuse.gt_split_and_bin.
create_chain_split_and_bin
(**kwargs)[source]¶ Make a
fermipy.jobs.SplitAndBin
-
fermipy.diffuse.gt_split_and_bin.
create_inputlist
(arglist)[source]¶ Read lines from a file and makes a list of file names.
Removes whitespace and lines that start with ‘#’ Recursively read all files with the extension ‘.lst’
-
fermipy.diffuse.gt_split_and_bin.
create_sg_split_and_bin
(**kwargs)[source]¶ Build and return a
fermipy.jobs.ScatterGather
object that can invoke this script
-
fermipy.diffuse.gt_split_and_bin.
main_batch
()[source]¶ Entry point for command line use for dispatching batch jobs
fermipy.diffuse.gt_srcmap_partial module¶
Run gtsrcmaps for a single energy plane for a single source
This is useful to parallize the production of the source maps
-
class
fermipy.diffuse.gt_srcmap_partial.
ConfigMaker_SrcmapPartial
(link, **kwargs)[source]¶ Bases:
fermipy.jobs.scatter_gather.ConfigMaker
Small class to generate configurations for this script
This adds the following arguments: –comp : binning component definition yaml file –data : datset definition yaml file –irf_ver : IRF verions string (e.g., ‘V6’) –diffuse : Diffuse model component definition yaml file’ –make_xml : Write xml files for the individual components
-
default_options
= {'irf_ver': ('V6', 'Version of IRFs to use.', <type 'str'>), 'make_xml': (False, 'Write xml files needed to make source maps', <type 'bool'>), 'data': (None, 'Path to yaml file defining dataset.', <type 'str'>), 'diffuse': (None, 'Path to yaml file defining diffuse components.', <type 'str'>), 'comp': (None, 'Path to yaml file defining binning.', <type 'str'>)}¶
-
-
class
fermipy.diffuse.gt_srcmap_partial.
GtSrcmapPartial
(**kwargs)[source]¶ Bases:
object
Small class to create srcmaps for only once source in a model, and optionally for only some of the energy layers.
This is useful for parallelizing source map creation.
-
NULL_MODEL
= 'srcmdls/null.xml'¶
-
default_options
= {'irfs': ('CALDB', 'Instrument response functions', <type 'str'>), 'expcube': (None, 'Input Livetime cube file', <type 'str'>), 'srcmdl': (None, 'Input source model xml file', <type 'str'>), 'source': (None, 'Input source', <type 'str'>), 'kmin': (0, 'Minimum Energy Bin', <type 'int'>), 'bexpmap': (None, 'Input binned exposure map file', <type 'str'>), 'outfile': (None, 'Output file', <type 'str'>), 'kmax': (-1, 'Maximum Energy Bin', <type 'int'>), 'cmap': (None, 'Input counts cube file', <type 'str'>), 'gzip': (False, 'Compress output file', <type 'bool'>)}¶
-
-
fermipy.diffuse.gt_srcmap_partial.
create_link_srcmap_partial
(**kwargs)[source]¶ Build and return a
Link
object that can invoke GtAssembleModel
-
fermipy.diffuse.gt_srcmap_partial.
create_sg_srcmap_partial
(**kwargs)[source]¶ Build and return a ScatterGather object that can invoke this script
fermipy.diffuse.residual_cr module¶
Compute the residual cosmic-ray contamination
-
class
fermipy.diffuse.residual_cr.
ConfigMaker_ResidualCR
(link, **kwargs)[source]¶ Bases:
fermipy.jobs.scatter_gather.ConfigMaker
Small class to generate configurations for this script
-
default_options
= {'data_dirty': (None, 'Path to yaml file defining dataset for "clean" selection', <type 'str'>), 'full_output': (False, 'Include diagnostic output', <type 'bool'>), 'mask_factor': (2.0, 'Pixel selection factor for output mask', <type 'float'>), 'hpx_order': (4, 'HEALPIX order for analysis', <type 'int'>), 'data_clean': (None, 'Path to yaml file defining dataset for "dirty" selection', <type 'str'>), 'coordsys': ('GAL', 'Coordinate system of the spatial projection (CEL or GAL).', <type 'str'>), 'comp': (None, 'Path to yaml file defining binning.', <type 'str'>), 'irf_ver': ('V6', 'Version of IRFs to use.', <type 'str'>), 'sigma': (3.0, 'Width of gaussian to smooth output maps [degrees]', <type 'float'>), 'select_factor': (5.0, 'Pixel selection factor for Aeff Correction', <type 'float'>)}¶
-
-
class
fermipy.diffuse.residual_cr.
ResidualCRAnalysis
(**kwargs)[source]¶ Bases:
object
Small class to analyze the residual cosmic-ray contaimination.
-
default_options
= {'bexpcube_clean': (None, 'Input exposure cube for clean event class.', <type 'str'>), 'ccube_clean': (None, 'Input counts cube for clean event class.', <type 'str'>), 'full_output': (False, 'Include diagnostic output', <type 'bool'>), 'mask_factor': (2.0, 'Pixel selection factor for output mask', <type 'float'>), 'hpx_order': (4, 'HEALPIX order for analysis', <type 'int'>), 'clobber': (False, 'Overwrite output file', <type 'bool'>), 'outfile': (None, 'Name of output file', <type 'str'>), 'coordsys': ('GAL', 'Coordinate system of the spatial projection (CEL or GAL).', <type 'str'>), 'bexpcube_dirty': (None, 'Input exposure cube for dirty event class.', <type 'str'>), 'sigma': (3.0, 'Width of gaussian to smooth output maps [degrees]', <type 'float'>), 'ccube_dirty': (None, 'Input counts cube for dirty event class.', <type 'str'>), 'select_factor': (5.0, 'Pixel selection factor for Aeff Correction', <type 'float'>)}¶
-
-
class
fermipy.diffuse.residual_cr.
ResidualCRChain
(linkname)[source]¶ Bases:
fermipy.jobs.chain.Chain
Small class to preform analysis of residual cosmic-ray contamination
-
fermipy.diffuse.residual_cr.
create_chain_residual_cr
(**kwargs)[source]¶ Build and return a
ResidualCRChain
object
-
fermipy.diffuse.residual_cr.
create_link_residual_cr
(**kwargs)[source]¶ Build and return a
Link
object that can invokeResidualCRAnalysis
-
fermipy.diffuse.residual_cr.
create_sg_residual_cr
(**kwargs)[source]¶ Build and return a ScatterGather object that can invoke this script
-
fermipy.diffuse.residual_cr.
main_batch
()[source]¶ Entry point for command line use for dispatching batch jobs