repository_name stringlengths 7 55 | func_path_in_repository stringlengths 4 223 | func_name stringlengths 1 134 | whole_func_string stringlengths 75 104k | language stringclasses 1
value | func_code_string stringlengths 75 104k | func_code_tokens listlengths 19 28.4k | func_documentation_string stringlengths 1 46.9k | func_documentation_tokens listlengths 1 1.97k | split_name stringclasses 1
value | func_code_url stringlengths 87 315 |
|---|---|---|---|---|---|---|---|---|---|---|
fermiPy/fermipy | fermipy/scripts/cluster_sources.py | count_sources_in_cluster | def count_sources_in_cluster(n_src, cdict, rev_dict):
""" Make a vector of sources in each cluster
Parameters
----------
n_src : number of sources
cdict : dict(int:[int,])
A dictionary of clusters. Each cluster is a source index and
the list of other source in the cluster.
... | python | def count_sources_in_cluster(n_src, cdict, rev_dict):
""" Make a vector of sources in each cluster
Parameters
----------
n_src : number of sources
cdict : dict(int:[int,])
A dictionary of clusters. Each cluster is a source index and
the list of other source in the cluster.
... | [
"def",
"count_sources_in_cluster",
"(",
"n_src",
",",
"cdict",
",",
"rev_dict",
")",
":",
"ret_val",
"=",
"np",
".",
"zeros",
"(",
"(",
"n_src",
")",
",",
"int",
")",
"for",
"i",
"in",
"range",
"(",
"n_src",
")",
":",
"try",
":",
"key",
"=",
"rev_d... | Make a vector of sources in each cluster
Parameters
----------
n_src : number of sources
cdict : dict(int:[int,])
A dictionary of clusters. Each cluster is a source index and
the list of other source in the cluster.
rev_dict : dict(int:int)
A single valued dictio... | [
"Make",
"a",
"vector",
"of",
"sources",
"in",
"each",
"cluster"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/scripts/cluster_sources.py#L317-L350 |
fermiPy/fermipy | fermipy/scripts/cluster_sources.py | find_dist_to_centroid | def find_dist_to_centroid(cvects, idx_list, weights=None):
""" Find the centroid for a set of vectors
Parameters
----------
cvects : ~numpy.ndarray(3,nsrc) with directional cosine (i.e., x,y,z component) values
idx_list : [int,...]
list of the source indices in the cluster
weights : ~nu... | python | def find_dist_to_centroid(cvects, idx_list, weights=None):
""" Find the centroid for a set of vectors
Parameters
----------
cvects : ~numpy.ndarray(3,nsrc) with directional cosine (i.e., x,y,z component) values
idx_list : [int,...]
list of the source indices in the cluster
weights : ~nu... | [
"def",
"find_dist_to_centroid",
"(",
"cvects",
",",
"idx_list",
",",
"weights",
"=",
"None",
")",
":",
"centroid",
"=",
"find_centroid",
"(",
"cvects",
",",
"idx_list",
",",
"weights",
")",
"dist_vals",
"=",
"np",
".",
"degrees",
"(",
"np",
".",
"arccos",
... | Find the centroid for a set of vectors
Parameters
----------
cvects : ~numpy.ndarray(3,nsrc) with directional cosine (i.e., x,y,z component) values
idx_list : [int,...]
list of the source indices in the cluster
weights : ~numpy.ndarray(nsrc) with the weights to use. None for equal weightin... | [
"Find",
"the",
"centroid",
"for",
"a",
"set",
"of",
"vectors"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/scripts/cluster_sources.py#L353-L369 |
fermiPy/fermipy | fermipy/scripts/cluster_sources.py | find_dist_to_centroids | def find_dist_to_centroids(cluster_dict, cvects, weights=None):
""" Find the centroids and the distances to the centroid for all sources in a set of clusters
Parameters
----------
cluster_dict : dict(int:[int,...])
Each cluster is a source index and the list of other sources in the cluster. ... | python | def find_dist_to_centroids(cluster_dict, cvects, weights=None):
""" Find the centroids and the distances to the centroid for all sources in a set of clusters
Parameters
----------
cluster_dict : dict(int:[int,...])
Each cluster is a source index and the list of other sources in the cluster. ... | [
"def",
"find_dist_to_centroids",
"(",
"cluster_dict",
",",
"cvects",
",",
"weights",
"=",
"None",
")",
":",
"distances",
"=",
"np",
".",
"zeros",
"(",
"(",
"cvects",
".",
"shape",
"[",
"1",
"]",
")",
")",
"cent_dict",
"=",
"{",
"}",
"for",
"k",
",",
... | Find the centroids and the distances to the centroid for all sources in a set of clusters
Parameters
----------
cluster_dict : dict(int:[int,...])
Each cluster is a source index and the list of other sources in the cluster.
cvects : np.ndarray(3,nsrc)
Directional cosines (i.e., x... | [
"Find",
"the",
"centroids",
"and",
"the",
"distances",
"to",
"the",
"centroid",
"for",
"all",
"sources",
"in",
"a",
"set",
"of",
"clusters"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/scripts/cluster_sources.py#L372-L397 |
fermiPy/fermipy | fermipy/scripts/cluster_sources.py | select_from_clusters | def select_from_clusters(cluster_dict, measure_vect):
""" Select a single source from each cluster and make it the new cluster key
cluster_dict : dict(int:[int,])
A dictionary of clusters. Each cluster is a source index and the list of other source in the cluster.
measure_vect : np.na... | python | def select_from_clusters(cluster_dict, measure_vect):
""" Select a single source from each cluster and make it the new cluster key
cluster_dict : dict(int:[int,])
A dictionary of clusters. Each cluster is a source index and the list of other source in the cluster.
measure_vect : np.na... | [
"def",
"select_from_clusters",
"(",
"cluster_dict",
",",
"measure_vect",
")",
":",
"out_dict",
"=",
"{",
"}",
"for",
"idx_key",
",",
"idx_list",
"in",
"cluster_dict",
".",
"items",
"(",
")",
":",
"out_idx",
",",
"out_list",
"=",
"select_from_cluster",
"(",
"... | Select a single source from each cluster and make it the new cluster key
cluster_dict : dict(int:[int,])
A dictionary of clusters. Each cluster is a source index and the list of other source in the cluster.
measure_vect : np.narray((nsrc),float)
vector of the measure used to select ... | [
"Select",
"a",
"single",
"source",
"from",
"each",
"cluster",
"and",
"make",
"it",
"the",
"new",
"cluster",
"key"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/scripts/cluster_sources.py#L400-L417 |
fermiPy/fermipy | fermipy/scripts/cluster_sources.py | make_reverse_dict | def make_reverse_dict(in_dict, warn=True):
""" Build a reverse dictionary from a cluster dictionary
Parameters
----------
in_dict : dict(int:[int,])
A dictionary of clusters. Each cluster is a source index and
the list of other source in the cluster.
Returns
-------
ou... | python | def make_reverse_dict(in_dict, warn=True):
""" Build a reverse dictionary from a cluster dictionary
Parameters
----------
in_dict : dict(int:[int,])
A dictionary of clusters. Each cluster is a source index and
the list of other source in the cluster.
Returns
-------
ou... | [
"def",
"make_reverse_dict",
"(",
"in_dict",
",",
"warn",
"=",
"True",
")",
":",
"out_dict",
"=",
"{",
"}",
"for",
"k",
",",
"v",
"in",
"in_dict",
".",
"items",
"(",
")",
":",
"for",
"vv",
"in",
"v",
":",
"if",
"vv",
"in",
"out_dict",
":",
"if",
... | Build a reverse dictionary from a cluster dictionary
Parameters
----------
in_dict : dict(int:[int,])
A dictionary of clusters. Each cluster is a source index and
the list of other source in the cluster.
Returns
-------
out_dict : dict(int:int)
A single valued d... | [
"Build",
"a",
"reverse",
"dictionary",
"from",
"a",
"cluster",
"dictionary"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/scripts/cluster_sources.py#L420-L443 |
fermiPy/fermipy | fermipy/scripts/cluster_sources.py | make_cluster_vector | def make_cluster_vector(rev_dict, n_src):
""" Converts the cluster membership dictionary to an array
Parameters
----------
rev_dict : dict(int:int)
A single valued dictionary pointing from source index to
cluster key for each source in a cluster.
n_src : int
Number of ... | python | def make_cluster_vector(rev_dict, n_src):
""" Converts the cluster membership dictionary to an array
Parameters
----------
rev_dict : dict(int:int)
A single valued dictionary pointing from source index to
cluster key for each source in a cluster.
n_src : int
Number of ... | [
"def",
"make_cluster_vector",
"(",
"rev_dict",
",",
"n_src",
")",
":",
"out_array",
"=",
"-",
"1",
"*",
"np",
".",
"ones",
"(",
"(",
"n_src",
")",
",",
"int",
")",
"for",
"k",
",",
"v",
"in",
"rev_dict",
".",
"items",
"(",
")",
":",
"out_array",
... | Converts the cluster membership dictionary to an array
Parameters
----------
rev_dict : dict(int:int)
A single valued dictionary pointing from source index to
cluster key for each source in a cluster.
n_src : int
Number of source in the array
Returns
-------
o... | [
"Converts",
"the",
"cluster",
"membership",
"dictionary",
"to",
"an",
"array"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/scripts/cluster_sources.py#L446-L469 |
fermiPy/fermipy | fermipy/scripts/cluster_sources.py | make_cluster_name_vector | def make_cluster_name_vector(cluster_vect, src_names):
""" Converts the cluster membership dictionary to an array
Parameters
----------
cluster_vect : `numpy.ndarray'
An array filled with the index of the seed of a cluster if a source belongs to a cluster,
and with -1 if it does not.
... | python | def make_cluster_name_vector(cluster_vect, src_names):
""" Converts the cluster membership dictionary to an array
Parameters
----------
cluster_vect : `numpy.ndarray'
An array filled with the index of the seed of a cluster if a source belongs to a cluster,
and with -1 if it does not.
... | [
"def",
"make_cluster_name_vector",
"(",
"cluster_vect",
",",
"src_names",
")",
":",
"out_array",
"=",
"np",
".",
"where",
"(",
"cluster_vect",
">=",
"0",
",",
"src_names",
"[",
"cluster_vect",
"]",
",",
"\"\"",
")",
"return",
"out_array"
] | Converts the cluster membership dictionary to an array
Parameters
----------
cluster_vect : `numpy.ndarray'
An array filled with the index of the seed of a cluster if a source belongs to a cluster,
and with -1 if it does not.
src_names :
An array with the source names
Ret... | [
"Converts",
"the",
"cluster",
"membership",
"dictionary",
"to",
"an",
"array"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/scripts/cluster_sources.py#L472-L491 |
fermiPy/fermipy | fermipy/scripts/cluster_sources.py | make_dict_from_vector | def make_dict_from_vector(in_array):
""" Converts the cluster membership array stored in a fits file back to a dictionary
Parameters
----------
in_array : `np.ndarray'
An array filled with the index of the seed of a cluster if a source belongs to a cluster,
and with -1 if it does not.
... | python | def make_dict_from_vector(in_array):
""" Converts the cluster membership array stored in a fits file back to a dictionary
Parameters
----------
in_array : `np.ndarray'
An array filled with the index of the seed of a cluster if a source belongs to a cluster,
and with -1 if it does not.
... | [
"def",
"make_dict_from_vector",
"(",
"in_array",
")",
":",
"out_dict",
"=",
"{",
"}",
"for",
"i",
",",
"k",
"in",
"enumerate",
"(",
"in_array",
")",
":",
"if",
"k",
"<",
"0",
":",
"continue",
"try",
":",
"out_dict",
"[",
"k",
"]",
".",
"append",
"(... | Converts the cluster membership array stored in a fits file back to a dictionary
Parameters
----------
in_array : `np.ndarray'
An array filled with the index of the seed of a cluster if a source belongs to a cluster,
and with -1 if it does not.
Returns
-------
returns dict(int:... | [
"Converts",
"the",
"cluster",
"membership",
"array",
"stored",
"in",
"a",
"fits",
"file",
"back",
"to",
"a",
"dictionary"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/scripts/cluster_sources.py#L494-L516 |
fermiPy/fermipy | fermipy/scripts/cluster_sources.py | filter_and_copy_table | def filter_and_copy_table(tab, to_remove):
""" Filter and copy a FITS table.
Parameters
----------
tab : FITS Table object
to_remove : [int ...}
list of indices to remove from the table
returns FITS Table object
"""
nsrcs = len(tab)
mask = np.zeros((nsrcs), '?')
mas... | python | def filter_and_copy_table(tab, to_remove):
""" Filter and copy a FITS table.
Parameters
----------
tab : FITS Table object
to_remove : [int ...}
list of indices to remove from the table
returns FITS Table object
"""
nsrcs = len(tab)
mask = np.zeros((nsrcs), '?')
mas... | [
"def",
"filter_and_copy_table",
"(",
"tab",
",",
"to_remove",
")",
":",
"nsrcs",
"=",
"len",
"(",
"tab",
")",
"mask",
"=",
"np",
".",
"zeros",
"(",
"(",
"nsrcs",
")",
",",
"'?'",
")",
"mask",
"[",
"to_remove",
"]",
"=",
"True",
"inv_mask",
"=",
"np... | Filter and copy a FITS table.
Parameters
----------
tab : FITS Table object
to_remove : [int ...}
list of indices to remove from the table
returns FITS Table object | [
"Filter",
"and",
"copy",
"a",
"FITS",
"table",
"."
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/scripts/cluster_sources.py#L519-L536 |
fermiPy/fermipy | fermipy/jobs/analysis_utils.py | baseline_roi_fit | def baseline_roi_fit(gta, make_plots=False, minmax_npred=[1e3, np.inf]):
"""Do baseline fitting for a target Region of Interest
Parameters
----------
gta : `fermipy.gtaanalysis.GTAnalysis`
The analysis object
make_plots : bool
Flag to make standard analysis plots
minmax_npred... | python | def baseline_roi_fit(gta, make_plots=False, minmax_npred=[1e3, np.inf]):
"""Do baseline fitting for a target Region of Interest
Parameters
----------
gta : `fermipy.gtaanalysis.GTAnalysis`
The analysis object
make_plots : bool
Flag to make standard analysis plots
minmax_npred... | [
"def",
"baseline_roi_fit",
"(",
"gta",
",",
"make_plots",
"=",
"False",
",",
"minmax_npred",
"=",
"[",
"1e3",
",",
"np",
".",
"inf",
"]",
")",
":",
"gta",
".",
"free_sources",
"(",
"False",
")",
"gta",
".",
"write_roi",
"(",
"'base_roi'",
",",
"make_pl... | Do baseline fitting for a target Region of Interest
Parameters
----------
gta : `fermipy.gtaanalysis.GTAnalysis`
The analysis object
make_plots : bool
Flag to make standard analysis plots
minmax_npred : tuple or list
Range of number of predicted coutns for which to free s... | [
"Do",
"baseline",
"fitting",
"for",
"a",
"target",
"Region",
"of",
"Interest"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/jobs/analysis_utils.py#L14-L36 |
fermiPy/fermipy | fermipy/jobs/analysis_utils.py | localize_sources | def localize_sources(gta, **kwargs):
"""Relocalize sources in the region of interest
Parameters
----------
gta : `fermipy.gtaanalysis.GTAnalysis`
The analysis object
kwargs :
These are passed to the gta.localize function
"""
# Localize all point sources
for src i... | python | def localize_sources(gta, **kwargs):
"""Relocalize sources in the region of interest
Parameters
----------
gta : `fermipy.gtaanalysis.GTAnalysis`
The analysis object
kwargs :
These are passed to the gta.localize function
"""
# Localize all point sources
for src i... | [
"def",
"localize_sources",
"(",
"gta",
",",
"*",
"*",
"kwargs",
")",
":",
"# Localize all point sources",
"for",
"src",
"in",
"sorted",
"(",
"gta",
".",
"roi",
".",
"sources",
",",
"key",
"=",
"lambda",
"t",
":",
"t",
"[",
"'ts'",
"]",
",",
"reverse",
... | Relocalize sources in the region of interest
Parameters
----------
gta : `fermipy.gtaanalysis.GTAnalysis`
The analysis object
kwargs :
These are passed to the gta.localize function | [
"Relocalize",
"sources",
"in",
"the",
"region",
"of",
"interest"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/jobs/analysis_utils.py#L39-L64 |
fermiPy/fermipy | fermipy/jobs/analysis_utils.py | add_source_get_correlated | def add_source_get_correlated(gta, name, src_dict, correl_thresh=0.25, non_null_src=False):
"""Add a source and get the set of correlated sources
Parameters
----------
gta : `fermipy.gtaanalysis.GTAnalysis`
The analysis object
name : str
Name of the source we are adding
src_d... | python | def add_source_get_correlated(gta, name, src_dict, correl_thresh=0.25, non_null_src=False):
"""Add a source and get the set of correlated sources
Parameters
----------
gta : `fermipy.gtaanalysis.GTAnalysis`
The analysis object
name : str
Name of the source we are adding
src_d... | [
"def",
"add_source_get_correlated",
"(",
"gta",
",",
"name",
",",
"src_dict",
",",
"correl_thresh",
"=",
"0.25",
",",
"non_null_src",
"=",
"False",
")",
":",
"if",
"gta",
".",
"roi",
".",
"has_source",
"(",
"name",
")",
":",
"gta",
".",
"zero_source",
"(... | Add a source and get the set of correlated sources
Parameters
----------
gta : `fermipy.gtaanalysis.GTAnalysis`
The analysis object
name : str
Name of the source we are adding
src_dict : dict
Dictionary of the source parameters
correl_thresh : float
Threshold... | [
"Add",
"a",
"source",
"and",
"get",
"the",
"set",
"of",
"correlated",
"sources"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/jobs/analysis_utils.py#L67-L127 |
fermiPy/fermipy | fermipy/jobs/analysis_utils.py | build_profile_dict | def build_profile_dict(basedir, profile_name):
"""Get the name and source dictionary for the test source.
Parameters
----------
basedir : str
Path to the analysis directory
profile_name : str
Key for the spatial from of the target
Returns
-------
... | python | def build_profile_dict(basedir, profile_name):
"""Get the name and source dictionary for the test source.
Parameters
----------
basedir : str
Path to the analysis directory
profile_name : str
Key for the spatial from of the target
Returns
-------
... | [
"def",
"build_profile_dict",
"(",
"basedir",
",",
"profile_name",
")",
":",
"profile_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"basedir",
",",
"\"profile_%s.yaml\"",
"%",
"profile_name",
")",
"profile_config",
"=",
"load_yaml",
"(",
"profile_path",
")",
... | Get the name and source dictionary for the test source.
Parameters
----------
basedir : str
Path to the analysis directory
profile_name : str
Key for the spatial from of the target
Returns
-------
profile_name : str
Name of for this particular... | [
"Get",
"the",
"name",
"and",
"source",
"dictionary",
"for",
"the",
"test",
"source",
".",
"Parameters",
"----------",
"basedir",
":",
"str",
"Path",
"to",
"the",
"analysis",
"directory",
"profile_name",
":",
"str",
"Key",
"for",
"the",
"spatial",
"from",
"of... | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/jobs/analysis_utils.py#L130-L159 |
fermiPy/fermipy | fermipy/jobs/batch.py | get_batch_job_args | def get_batch_job_args(job_time=1500):
""" Get the correct set of batch jobs arguments.
Parameters
----------
job_time : int
Expected max length of the job, in seconds.
This is used to select the batch queue and set the
job_check_sleep parameter that sets how often
we c... | python | def get_batch_job_args(job_time=1500):
""" Get the correct set of batch jobs arguments.
Parameters
----------
job_time : int
Expected max length of the job, in seconds.
This is used to select the batch queue and set the
job_check_sleep parameter that sets how often
we c... | [
"def",
"get_batch_job_args",
"(",
"job_time",
"=",
"1500",
")",
":",
"if",
"DEFAULT_JOB_TYPE",
"==",
"'slac'",
":",
"from",
"fermipy",
".",
"jobs",
".",
"slac_impl",
"import",
"get_slac_default_args",
"return",
"get_slac_default_args",
"(",
"job_time",
")",
"elif"... | Get the correct set of batch jobs arguments.
Parameters
----------
job_time : int
Expected max length of the job, in seconds.
This is used to select the batch queue and set the
job_check_sleep parameter that sets how often
we check for job completion.
Returns
-----... | [
"Get",
"the",
"correct",
"set",
"of",
"batch",
"jobs",
"arguments",
"."
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/jobs/batch.py#L17-L41 |
fermiPy/fermipy | fermipy/jobs/batch.py | get_batch_job_interface | def get_batch_job_interface(job_time=1500):
""" Create a batch job interface object.
Parameters
----------
job_time : int
Expected max length of the job, in seconds.
This is used to select the batch queue and set the
job_check_sleep parameter that sets how often
we chec... | python | def get_batch_job_interface(job_time=1500):
""" Create a batch job interface object.
Parameters
----------
job_time : int
Expected max length of the job, in seconds.
This is used to select the batch queue and set the
job_check_sleep parameter that sets how often
we chec... | [
"def",
"get_batch_job_interface",
"(",
"job_time",
"=",
"1500",
")",
":",
"batch_job_args",
"=",
"get_batch_job_args",
"(",
"job_time",
")",
"if",
"DEFAULT_JOB_TYPE",
"==",
"'slac'",
":",
"from",
"fermipy",
".",
"jobs",
".",
"slac_impl",
"import",
"SlacInterface",... | Create a batch job interface object.
Parameters
----------
job_time : int
Expected max length of the job, in seconds.
This is used to select the batch queue and set the
job_check_sleep parameter that sets how often
we check for job completion.
Returns
-------
j... | [
"Create",
"a",
"batch",
"job",
"interface",
"object",
"."
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/jobs/batch.py#L43-L69 |
fermiPy/fermipy | fermipy/scripts/HEALview.py | main | def main():
import sys
import argparse
# Argument defintion
usage = "usage: %(prog)s [options]"
description = "Collect all the new source"
parser = argparse.ArgumentParser(usage, description=__abstract__)
parser.add_argument("-i", "--input", type=argparse.FileType('r'), required=True,
... | python | def main():
import sys
import argparse
# Argument defintion
usage = "usage: %(prog)s [options]"
description = "Collect all the new source"
parser = argparse.ArgumentParser(usage, description=__abstract__)
parser.add_argument("-i", "--input", type=argparse.FileType('r'), required=True,
... | [
"def",
"main",
"(",
")",
":",
"import",
"sys",
"import",
"argparse",
"# Argument defintion",
"usage",
"=",
"\"usage: %(prog)s [options]\"",
"description",
"=",
"\"Collect all the new source\"",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"usage",
",",
"desc... | if args.ebin == "ALL":
wcsproj = hpxmap.geom.make_wcs(
naxis=2, proj='MOL', energies=None, oversample=2)
mapping = HpxToWcsMapping(hpxmap.hpx, wcsproj)
for i, data in enumerate(hpxmap.counts):
ip = ImagePlotter(data=data, proj=hpxmap.hpx, mapping=mapping)
fig... | [
"if",
"args",
".",
"ebin",
"==",
"ALL",
":",
"wcsproj",
"=",
"hpxmap",
".",
"geom",
".",
"make_wcs",
"(",
"naxis",
"=",
"2",
"proj",
"=",
"MOL",
"energies",
"=",
"None",
"oversample",
"=",
"2",
")",
"mapping",
"=",
"HpxToWcsMapping",
"(",
"hpxmap",
"... | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/scripts/HEALview.py#L30-L123 |
fermiPy/fermipy | fermipy/jobs/target_sim.py | register_classes | def register_classes():
"""Register these classes with the `LinkFactory` """
CopyBaseROI.register_class()
CopyBaseROI_SG.register_class()
SimulateROI.register_class()
SimulateROI_SG.register_class()
RandomDirGen.register_class()
RandomDirGen_SG.register_class() | python | def register_classes():
"""Register these classes with the `LinkFactory` """
CopyBaseROI.register_class()
CopyBaseROI_SG.register_class()
SimulateROI.register_class()
SimulateROI_SG.register_class()
RandomDirGen.register_class()
RandomDirGen_SG.register_class() | [
"def",
"register_classes",
"(",
")",
":",
"CopyBaseROI",
".",
"register_class",
"(",
")",
"CopyBaseROI_SG",
".",
"register_class",
"(",
")",
"SimulateROI",
".",
"register_class",
"(",
")",
"SimulateROI_SG",
".",
"register_class",
"(",
")",
"RandomDirGen",
".",
"... | Register these classes with the `LinkFactory` | [
"Register",
"these",
"classes",
"with",
"the",
"LinkFactory"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/jobs/target_sim.py#L529-L536 |
fermiPy/fermipy | fermipy/jobs/target_sim.py | CopyBaseROI.copy_analysis_files | def copy_analysis_files(cls, orig_dir, dest_dir, copyfiles):
""" Copy a list of files from orig_dir to dest_dir"""
for pattern in copyfiles:
glob_path = os.path.join(orig_dir, pattern)
files = glob.glob(glob_path)
for ff in files:
f = os.path.basename(... | python | def copy_analysis_files(cls, orig_dir, dest_dir, copyfiles):
""" Copy a list of files from orig_dir to dest_dir"""
for pattern in copyfiles:
glob_path = os.path.join(orig_dir, pattern)
files = glob.glob(glob_path)
for ff in files:
f = os.path.basename(... | [
"def",
"copy_analysis_files",
"(",
"cls",
",",
"orig_dir",
",",
"dest_dir",
",",
"copyfiles",
")",
":",
"for",
"pattern",
"in",
"copyfiles",
":",
"glob_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"orig_dir",
",",
"pattern",
")",
"files",
"=",
"glob"... | Copy a list of files from orig_dir to dest_dir | [
"Copy",
"a",
"list",
"of",
"files",
"from",
"orig_dir",
"to",
"dest_dir"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/jobs/target_sim.py#L66-L78 |
fermiPy/fermipy | fermipy/jobs/target_sim.py | CopyBaseROI.copy_target_dir | def copy_target_dir(cls, orig_dir, dest_dir, roi_baseline, extracopy):
""" Create and populate directoris for target analysis
"""
try:
os.makedirs(dest_dir)
except OSError:
pass
copyfiles = ['%s.fits' % roi_baseline,
'%s.npy' % roi_ba... | python | def copy_target_dir(cls, orig_dir, dest_dir, roi_baseline, extracopy):
""" Create and populate directoris for target analysis
"""
try:
os.makedirs(dest_dir)
except OSError:
pass
copyfiles = ['%s.fits' % roi_baseline,
'%s.npy' % roi_ba... | [
"def",
"copy_target_dir",
"(",
"cls",
",",
"orig_dir",
",",
"dest_dir",
",",
"roi_baseline",
",",
"extracopy",
")",
":",
"try",
":",
"os",
".",
"makedirs",
"(",
"dest_dir",
")",
"except",
"OSError",
":",
"pass",
"copyfiles",
"=",
"[",
"'%s.fits'",
"%",
"... | Create and populate directoris for target analysis | [
"Create",
"and",
"populate",
"directoris",
"for",
"target",
"analysis"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/jobs/target_sim.py#L81-L95 |
fermiPy/fermipy | fermipy/jobs/target_sim.py | CopyBaseROI.run_analysis | def run_analysis(self, argv):
"""Run this analysis"""
args = self._parser.parse_args(argv)
name_keys = dict(target_type=args.ttype,
target_name=args.target,
sim_name=args.sim,
fullpath=True)
orig_dir = NAME_FACT... | python | def run_analysis(self, argv):
"""Run this analysis"""
args = self._parser.parse_args(argv)
name_keys = dict(target_type=args.ttype,
target_name=args.target,
sim_name=args.sim,
fullpath=True)
orig_dir = NAME_FACT... | [
"def",
"run_analysis",
"(",
"self",
",",
"argv",
")",
":",
"args",
"=",
"self",
".",
"_parser",
".",
"parse_args",
"(",
"argv",
")",
"name_keys",
"=",
"dict",
"(",
"target_type",
"=",
"args",
".",
"ttype",
",",
"target_name",
"=",
"args",
".",
"target"... | Run this analysis | [
"Run",
"this",
"analysis"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/jobs/target_sim.py#L97-L109 |
fermiPy/fermipy | fermipy/jobs/target_sim.py | CopyBaseROI_SG.build_job_configs | def build_job_configs(self, args):
"""Hook to build job configurations
"""
job_configs = {}
ttype = args['ttype']
(sim_targets_yaml, sim) = NAME_FACTORY.resolve_targetfile(args)
targets = load_yaml(sim_targets_yaml)
base_config = dict(ttype=ttype,
... | python | def build_job_configs(self, args):
"""Hook to build job configurations
"""
job_configs = {}
ttype = args['ttype']
(sim_targets_yaml, sim) = NAME_FACTORY.resolve_targetfile(args)
targets = load_yaml(sim_targets_yaml)
base_config = dict(ttype=ttype,
... | [
"def",
"build_job_configs",
"(",
"self",
",",
"args",
")",
":",
"job_configs",
"=",
"{",
"}",
"ttype",
"=",
"args",
"[",
"'ttype'",
"]",
"(",
"sim_targets_yaml",
",",
"sim",
")",
"=",
"NAME_FACTORY",
".",
"resolve_targetfile",
"(",
"args",
")",
"targets",
... | Hook to build job configurations | [
"Hook",
"to",
"build",
"job",
"configurations"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/jobs/target_sim.py#L132-L156 |
fermiPy/fermipy | fermipy/jobs/target_sim.py | RandomDirGen._make_wcsgeom_from_config | def _make_wcsgeom_from_config(config):
"""Build a `WCS.Geom` object from a fermipy coniguration file"""
binning = config['binning']
binsz = binning['binsz']
coordsys = binning.get('coordsys', 'GAL')
roiwidth = binning['roiwidth']
proj = binning.get('proj', 'AIT')
... | python | def _make_wcsgeom_from_config(config):
"""Build a `WCS.Geom` object from a fermipy coniguration file"""
binning = config['binning']
binsz = binning['binsz']
coordsys = binning.get('coordsys', 'GAL')
roiwidth = binning['roiwidth']
proj = binning.get('proj', 'AIT')
... | [
"def",
"_make_wcsgeom_from_config",
"(",
"config",
")",
":",
"binning",
"=",
"config",
"[",
"'binning'",
"]",
"binsz",
"=",
"binning",
"[",
"'binsz'",
"]",
"coordsys",
"=",
"binning",
".",
"get",
"(",
"'coordsys'",
",",
"'GAL'",
")",
"roiwidth",
"=",
"binn... | Build a `WCS.Geom` object from a fermipy coniguration file | [
"Build",
"a",
"WCS",
".",
"Geom",
"object",
"from",
"a",
"fermipy",
"coniguration",
"file"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/jobs/target_sim.py#L176-L192 |
fermiPy/fermipy | fermipy/jobs/target_sim.py | RandomDirGen._build_skydir_dict | def _build_skydir_dict(wcsgeom, rand_config):
"""Build a dictionary of random directions"""
step_x = rand_config['step_x']
step_y = rand_config['step_y']
max_x = rand_config['max_x']
max_y = rand_config['max_y']
seed = rand_config['seed']
nsims = rand_config['nsim... | python | def _build_skydir_dict(wcsgeom, rand_config):
"""Build a dictionary of random directions"""
step_x = rand_config['step_x']
step_y = rand_config['step_y']
max_x = rand_config['max_x']
max_y = rand_config['max_y']
seed = rand_config['seed']
nsims = rand_config['nsim... | [
"def",
"_build_skydir_dict",
"(",
"wcsgeom",
",",
"rand_config",
")",
":",
"step_x",
"=",
"rand_config",
"[",
"'step_x'",
"]",
"step_y",
"=",
"rand_config",
"[",
"'step_y'",
"]",
"max_x",
"=",
"rand_config",
"[",
"'max_x'",
"]",
"max_y",
"=",
"rand_config",
... | Build a dictionary of random directions | [
"Build",
"a",
"dictionary",
"of",
"random",
"directions"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/jobs/target_sim.py#L195-L233 |
fermiPy/fermipy | fermipy/jobs/target_sim.py | RandomDirGen.run_analysis | def run_analysis(self, argv):
"""Run this analysis"""
args = self._parser.parse_args(argv)
if is_null(args.config):
raise ValueError("Config yaml file must be specified")
if is_null(args.rand_config):
raise ValueError(
"Random direction config yam... | python | def run_analysis(self, argv):
"""Run this analysis"""
args = self._parser.parse_args(argv)
if is_null(args.config):
raise ValueError("Config yaml file must be specified")
if is_null(args.rand_config):
raise ValueError(
"Random direction config yam... | [
"def",
"run_analysis",
"(",
"self",
",",
"argv",
")",
":",
"args",
"=",
"self",
".",
"_parser",
".",
"parse_args",
"(",
"argv",
")",
"if",
"is_null",
"(",
"args",
".",
"config",
")",
":",
"raise",
"ValueError",
"(",
"\"Config yaml file must be specified\"",
... | Run this analysis | [
"Run",
"this",
"analysis"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/jobs/target_sim.py#L235-L251 |
fermiPy/fermipy | fermipy/jobs/target_sim.py | SimulateROI._clone_config_and_srcmaps | def _clone_config_and_srcmaps(config_path, seed):
"""Clone the configuration"""
workdir = os.path.dirname(config_path)
new_config_path = config_path.replace('.yaml', '_%06i.yaml' % seed)
config = load_yaml(config_path)
comps = config.get('components', [config])
for i, com... | python | def _clone_config_and_srcmaps(config_path, seed):
"""Clone the configuration"""
workdir = os.path.dirname(config_path)
new_config_path = config_path.replace('.yaml', '_%06i.yaml' % seed)
config = load_yaml(config_path)
comps = config.get('components', [config])
for i, com... | [
"def",
"_clone_config_and_srcmaps",
"(",
"config_path",
",",
"seed",
")",
":",
"workdir",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"config_path",
")",
"new_config_path",
"=",
"config_path",
".",
"replace",
"(",
"'.yaml'",
",",
"'_%06i.yaml'",
"%",
"seed",
... | Clone the configuration | [
"Clone",
"the",
"configuration"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/jobs/target_sim.py#L276-L293 |
fermiPy/fermipy | fermipy/jobs/target_sim.py | SimulateROI._run_simulation | def _run_simulation(gta, roi_baseline,
injected_name, test_sources, current_seed, seed, non_null_src):
"""Simulate a realization of this analysis"""
gta.load_roi('sim_baseline_%06i.npy' % current_seed)
gta.set_random_seed(seed)
gta.simulate_roi()
if inject... | python | def _run_simulation(gta, roi_baseline,
injected_name, test_sources, current_seed, seed, non_null_src):
"""Simulate a realization of this analysis"""
gta.load_roi('sim_baseline_%06i.npy' % current_seed)
gta.set_random_seed(seed)
gta.simulate_roi()
if inject... | [
"def",
"_run_simulation",
"(",
"gta",
",",
"roi_baseline",
",",
"injected_name",
",",
"test_sources",
",",
"current_seed",
",",
"seed",
",",
"non_null_src",
")",
":",
"gta",
".",
"load_roi",
"(",
"'sim_baseline_%06i.npy'",
"%",
"current_seed",
")",
"gta",
".",
... | Simulate a realization of this analysis | [
"Simulate",
"a",
"realization",
"of",
"this",
"analysis"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/jobs/target_sim.py#L297-L334 |
fermiPy/fermipy | fermipy/jobs/target_sim.py | SimulateROI.run_analysis | def run_analysis(self, argv):
"""Run this analysis"""
args = self._parser.parse_args(argv)
if not HAVE_ST:
raise RuntimeError(
"Trying to run fermipy analysis, but don't have ST")
workdir = os.path.dirname(args.config)
_config_file = self._clone_conf... | python | def run_analysis(self, argv):
"""Run this analysis"""
args = self._parser.parse_args(argv)
if not HAVE_ST:
raise RuntimeError(
"Trying to run fermipy analysis, but don't have ST")
workdir = os.path.dirname(args.config)
_config_file = self._clone_conf... | [
"def",
"run_analysis",
"(",
"self",
",",
"argv",
")",
":",
"args",
"=",
"self",
".",
"_parser",
".",
"parse_args",
"(",
"argv",
")",
"if",
"not",
"HAVE_ST",
":",
"raise",
"RuntimeError",
"(",
"\"Trying to run fermipy analysis, but don't have ST\"",
")",
"workdir... | Run this analysis | [
"Run",
"this",
"analysis"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/jobs/target_sim.py#L336-L386 |
fermiPy/fermipy | fermipy/jobs/target_sim.py | RandomDirGen_SG.build_job_configs | def build_job_configs(self, args):
"""Hook to build job configurations
"""
job_configs = {}
ttype = args['ttype']
(targets_yaml, sim) = NAME_FACTORY.resolve_targetfile(args)
if targets_yaml is None:
return job_configs
config_yaml = 'config.yaml'
... | python | def build_job_configs(self, args):
"""Hook to build job configurations
"""
job_configs = {}
ttype = args['ttype']
(targets_yaml, sim) = NAME_FACTORY.resolve_targetfile(args)
if targets_yaml is None:
return job_configs
config_yaml = 'config.yaml'
... | [
"def",
"build_job_configs",
"(",
"self",
",",
"args",
")",
":",
"job_configs",
"=",
"{",
"}",
"ttype",
"=",
"args",
"[",
"'ttype'",
"]",
"(",
"targets_yaml",
",",
"sim",
")",
"=",
"NAME_FACTORY",
".",
"resolve_targetfile",
"(",
"args",
")",
"if",
"target... | Hook to build job configurations | [
"Hook",
"to",
"build",
"job",
"configurations"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/jobs/target_sim.py#L409-L445 |
fermiPy/fermipy | fermipy/jobs/target_sim.py | SimulateROI_SG.build_job_configs | def build_job_configs(self, args):
"""Hook to build job configurations
"""
job_configs = {}
ttype = args['ttype']
(targets_yaml, sim) = NAME_FACTORY.resolve_targetfile(args)
if targets_yaml is None:
return job_configs
config_yaml = 'config.yaml'
... | python | def build_job_configs(self, args):
"""Hook to build job configurations
"""
job_configs = {}
ttype = args['ttype']
(targets_yaml, sim) = NAME_FACTORY.resolve_targetfile(args)
if targets_yaml is None:
return job_configs
config_yaml = 'config.yaml'
... | [
"def",
"build_job_configs",
"(",
"self",
",",
"args",
")",
":",
"job_configs",
"=",
"{",
"}",
"ttype",
"=",
"args",
"[",
"'ttype'",
"]",
"(",
"targets_yaml",
",",
"sim",
")",
"=",
"NAME_FACTORY",
".",
"resolve_targetfile",
"(",
"args",
")",
"if",
"target... | Hook to build job configurations | [
"Hook",
"to",
"build",
"job",
"configurations"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/jobs/target_sim.py#L473-L526 |
fermiPy/fermipy | fermipy/scripts/merit_skimmer.py | get_branches | def get_branches(aliases):
"""Get unique branch names from an alias dictionary."""
ignore = ['pow', 'log10', 'sqrt', 'max']
branches = []
for k, v in aliases.items():
tokens = re.sub('[\(\)\+\*\/\,\=\<\>\&\!\-\|]', ' ', v).split()
for t in tokens:
if bool(re.search(r'^\d'... | python | def get_branches(aliases):
"""Get unique branch names from an alias dictionary."""
ignore = ['pow', 'log10', 'sqrt', 'max']
branches = []
for k, v in aliases.items():
tokens = re.sub('[\(\)\+\*\/\,\=\<\>\&\!\-\|]', ' ', v).split()
for t in tokens:
if bool(re.search(r'^\d'... | [
"def",
"get_branches",
"(",
"aliases",
")",
":",
"ignore",
"=",
"[",
"'pow'",
",",
"'log10'",
",",
"'sqrt'",
",",
"'max'",
"]",
"branches",
"=",
"[",
"]",
"for",
"k",
",",
"v",
"in",
"aliases",
".",
"items",
"(",
")",
":",
"tokens",
"=",
"re",
".... | Get unique branch names from an alias dictionary. | [
"Get",
"unique",
"branch",
"names",
"from",
"an",
"alias",
"dictionary",
"."
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/scripts/merit_skimmer.py#L24-L41 |
fermiPy/fermipy | fermipy/scripts/merit_skimmer.py | load_friend_chains | def load_friend_chains(chain, friend_chains, txt, nfiles=None):
"""Load a list of trees from a file and add them as friends to the
chain."""
if re.search('.root?', txt) is not None:
c = ROOT.TChain(chain.GetName())
c.SetDirectory(0)
c.Add(txt)
friend_chains.append(c)
... | python | def load_friend_chains(chain, friend_chains, txt, nfiles=None):
"""Load a list of trees from a file and add them as friends to the
chain."""
if re.search('.root?', txt) is not None:
c = ROOT.TChain(chain.GetName())
c.SetDirectory(0)
c.Add(txt)
friend_chains.append(c)
... | [
"def",
"load_friend_chains",
"(",
"chain",
",",
"friend_chains",
",",
"txt",
",",
"nfiles",
"=",
"None",
")",
":",
"if",
"re",
".",
"search",
"(",
"'.root?'",
",",
"txt",
")",
"is",
"not",
"None",
":",
"c",
"=",
"ROOT",
".",
"TChain",
"(",
"chain",
... | Load a list of trees from a file and add them as friends to the
chain. | [
"Load",
"a",
"list",
"of",
"trees",
"from",
"a",
"file",
"and",
"add",
"them",
"as",
"friends",
"to",
"the",
"chain",
"."
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/scripts/merit_skimmer.py#L103-L129 |
fermiPy/fermipy | fermipy/fits_utils.py | find_and_read_ebins | def find_and_read_ebins(hdulist):
""" Reads and returns the energy bin edges.
This works for both the CASE where the energies are in the ENERGIES HDU
and the case where they are in the EBOUND HDU
"""
from fermipy import utils
ebins = None
if 'ENERGIES' in hdulist:
hdu = hdulist['EN... | python | def find_and_read_ebins(hdulist):
""" Reads and returns the energy bin edges.
This works for both the CASE where the energies are in the ENERGIES HDU
and the case where they are in the EBOUND HDU
"""
from fermipy import utils
ebins = None
if 'ENERGIES' in hdulist:
hdu = hdulist['EN... | [
"def",
"find_and_read_ebins",
"(",
"hdulist",
")",
":",
"from",
"fermipy",
"import",
"utils",
"ebins",
"=",
"None",
"if",
"'ENERGIES'",
"in",
"hdulist",
":",
"hdu",
"=",
"hdulist",
"[",
"'ENERGIES'",
"]",
"ectr",
"=",
"hdu",
".",
"data",
".",
"field",
"(... | Reads and returns the energy bin edges.
This works for both the CASE where the energies are in the ENERGIES HDU
and the case where they are in the EBOUND HDU | [
"Reads",
"and",
"returns",
"the",
"energy",
"bin",
"edges",
"."
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/fits_utils.py#L23-L40 |
fermiPy/fermipy | fermipy/fits_utils.py | read_energy_bounds | def read_energy_bounds(hdu):
""" Reads and returns the energy bin edges from a FITs HDU
"""
nebins = len(hdu.data)
ebin_edges = np.ndarray((nebins + 1))
try:
ebin_edges[0:-1] = np.log10(hdu.data.field("E_MIN")) - 3.
ebin_edges[-1] = np.log10(hdu.data.field("E_MAX")[-1]) - 3.
exce... | python | def read_energy_bounds(hdu):
""" Reads and returns the energy bin edges from a FITs HDU
"""
nebins = len(hdu.data)
ebin_edges = np.ndarray((nebins + 1))
try:
ebin_edges[0:-1] = np.log10(hdu.data.field("E_MIN")) - 3.
ebin_edges[-1] = np.log10(hdu.data.field("E_MAX")[-1]) - 3.
exce... | [
"def",
"read_energy_bounds",
"(",
"hdu",
")",
":",
"nebins",
"=",
"len",
"(",
"hdu",
".",
"data",
")",
"ebin_edges",
"=",
"np",
".",
"ndarray",
"(",
"(",
"nebins",
"+",
"1",
")",
")",
"try",
":",
"ebin_edges",
"[",
"0",
":",
"-",
"1",
"]",
"=",
... | Reads and returns the energy bin edges from a FITs HDU | [
"Reads",
"and",
"returns",
"the",
"energy",
"bin",
"edges",
"from",
"a",
"FITs",
"HDU"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/fits_utils.py#L43-L54 |
fermiPy/fermipy | fermipy/fits_utils.py | read_spectral_data | def read_spectral_data(hdu):
""" Reads and returns the energy bin edges, fluxes and npreds from
a FITs HDU
"""
ebins = read_energy_bounds(hdu)
fluxes = np.ndarray((len(ebins)))
try:
fluxes[0:-1] = hdu.data.field("E_MIN_FL")
fluxes[-1] = hdu.data.field("E_MAX_FL")[-1]
npre... | python | def read_spectral_data(hdu):
""" Reads and returns the energy bin edges, fluxes and npreds from
a FITs HDU
"""
ebins = read_energy_bounds(hdu)
fluxes = np.ndarray((len(ebins)))
try:
fluxes[0:-1] = hdu.data.field("E_MIN_FL")
fluxes[-1] = hdu.data.field("E_MAX_FL")[-1]
npre... | [
"def",
"read_spectral_data",
"(",
"hdu",
")",
":",
"ebins",
"=",
"read_energy_bounds",
"(",
"hdu",
")",
"fluxes",
"=",
"np",
".",
"ndarray",
"(",
"(",
"len",
"(",
"ebins",
")",
")",
")",
"try",
":",
"fluxes",
"[",
"0",
":",
"-",
"1",
"]",
"=",
"h... | Reads and returns the energy bin edges, fluxes and npreds from
a FITs HDU | [
"Reads",
"and",
"returns",
"the",
"energy",
"bin",
"edges",
"fluxes",
"and",
"npreds",
"from",
"a",
"FITs",
"HDU"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/fits_utils.py#L57-L70 |
fermiPy/fermipy | fermipy/fits_utils.py | make_energies_hdu | def make_energies_hdu(energy_vals, extname="ENERGIES"):
""" Builds and returns a FITs HDU with the energy values
extname : The HDU extension name
"""
cols = [fits.Column("Energy", "D", unit='MeV', array=energy_vals)]
hdu = fits.BinTableHDU.from_columns(cols, name=extname)
return hd... | python | def make_energies_hdu(energy_vals, extname="ENERGIES"):
""" Builds and returns a FITs HDU with the energy values
extname : The HDU extension name
"""
cols = [fits.Column("Energy", "D", unit='MeV', array=energy_vals)]
hdu = fits.BinTableHDU.from_columns(cols, name=extname)
return hd... | [
"def",
"make_energies_hdu",
"(",
"energy_vals",
",",
"extname",
"=",
"\"ENERGIES\"",
")",
":",
"cols",
"=",
"[",
"fits",
".",
"Column",
"(",
"\"Energy\"",
",",
"\"D\"",
",",
"unit",
"=",
"'MeV'",
",",
"array",
"=",
"energy_vals",
")",
"]",
"hdu",
"=",
... | Builds and returns a FITs HDU with the energy values
extname : The HDU extension name | [
"Builds",
"and",
"returns",
"a",
"FITs",
"HDU",
"with",
"the",
"energy",
"values"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/fits_utils.py#L73-L80 |
fermiPy/fermipy | fermipy/fits_utils.py | read_projection_from_fits | def read_projection_from_fits(fitsfile, extname=None):
"""
Load a WCS or HPX projection.
"""
f = fits.open(fitsfile)
nhdu = len(f)
# Try and get the energy bounds
try:
ebins = find_and_read_ebins(f)
except:
ebins = None
if extname is None:
# If there is an im... | python | def read_projection_from_fits(fitsfile, extname=None):
"""
Load a WCS or HPX projection.
"""
f = fits.open(fitsfile)
nhdu = len(f)
# Try and get the energy bounds
try:
ebins = find_and_read_ebins(f)
except:
ebins = None
if extname is None:
# If there is an im... | [
"def",
"read_projection_from_fits",
"(",
"fitsfile",
",",
"extname",
"=",
"None",
")",
":",
"f",
"=",
"fits",
".",
"open",
"(",
"fitsfile",
")",
"nhdu",
"=",
"len",
"(",
"f",
")",
"# Try and get the energy bounds",
"try",
":",
"ebins",
"=",
"find_and_read_eb... | Load a WCS or HPX projection. | [
"Load",
"a",
"WCS",
"or",
"HPX",
"projection",
"."
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/fits_utils.py#L125-L176 |
fermiPy/fermipy | fermipy/fits_utils.py | write_tables_to_fits | def write_tables_to_fits(filepath, tablelist, clobber=False,
namelist=None, cardslist=None, hdu_list=None):
"""
Write some astropy.table.Table objects to a single fits file
"""
outhdulist = [fits.PrimaryHDU()]
rmlist = []
for i, table in enumerate(tablelist):
ft_... | python | def write_tables_to_fits(filepath, tablelist, clobber=False,
namelist=None, cardslist=None, hdu_list=None):
"""
Write some astropy.table.Table objects to a single fits file
"""
outhdulist = [fits.PrimaryHDU()]
rmlist = []
for i, table in enumerate(tablelist):
ft_... | [
"def",
"write_tables_to_fits",
"(",
"filepath",
",",
"tablelist",
",",
"clobber",
"=",
"False",
",",
"namelist",
"=",
"None",
",",
"cardslist",
"=",
"None",
",",
"hdu_list",
"=",
"None",
")",
":",
"outhdulist",
"=",
"[",
"fits",
".",
"PrimaryHDU",
"(",
"... | Write some astropy.table.Table objects to a single fits file | [
"Write",
"some",
"astropy",
".",
"table",
".",
"Table",
"objects",
"to",
"a",
"single",
"fits",
"file"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/fits_utils.py#L179-L209 |
fermiPy/fermipy | fermipy/docstring_utils.py | update_docstring | def update_docstring(docstring, options_dict):
"""Update a method docstring by inserting option docstrings defined in
the options dictionary. The input docstring should define `{options}`
at the location where the options docstring block should be inserted.
Parameters
----------
docstring : st... | python | def update_docstring(docstring, options_dict):
"""Update a method docstring by inserting option docstrings defined in
the options dictionary. The input docstring should define `{options}`
at the location where the options docstring block should be inserted.
Parameters
----------
docstring : st... | [
"def",
"update_docstring",
"(",
"docstring",
",",
"options_dict",
")",
":",
"options_str",
"=",
"[",
"]",
"for",
"i",
",",
"(",
"k",
",",
"v",
")",
"in",
"enumerate",
"(",
"sorted",
"(",
"options_dict",
".",
"items",
"(",
")",
")",
")",
":",
"option_... | Update a method docstring by inserting option docstrings defined in
the options dictionary. The input docstring should define `{options}`
at the location where the options docstring block should be inserted.
Parameters
----------
docstring : str
Existing method docstring.
options_dict... | [
"Update",
"a",
"method",
"docstring",
"by",
"inserting",
"option",
"docstrings",
"defined",
"in",
"the",
"options",
"dictionary",
".",
"The",
"input",
"docstring",
"should",
"define",
"{",
"options",
"}",
"at",
"the",
"location",
"where",
"the",
"options",
"do... | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/docstring_utils.py#L6-L45 |
fermiPy/fermipy | fermipy/residmap.py | convolve_map | def convolve_map(m, k, cpix, threshold=0.001, imin=0, imax=None, wmap=None):
"""
Perform an energy-dependent convolution on a sequence of 2-D spatial maps.
Parameters
----------
m : `~numpy.ndarray`
3-D map containing a sequence of 2-D spatial maps. First
dimension should be energy.... | python | def convolve_map(m, k, cpix, threshold=0.001, imin=0, imax=None, wmap=None):
"""
Perform an energy-dependent convolution on a sequence of 2-D spatial maps.
Parameters
----------
m : `~numpy.ndarray`
3-D map containing a sequence of 2-D spatial maps. First
dimension should be energy.... | [
"def",
"convolve_map",
"(",
"m",
",",
"k",
",",
"cpix",
",",
"threshold",
"=",
"0.001",
",",
"imin",
"=",
"0",
",",
"imax",
"=",
"None",
",",
"wmap",
"=",
"None",
")",
":",
"islice",
"=",
"slice",
"(",
"imin",
",",
"imax",
")",
"o",
"=",
"np",
... | Perform an energy-dependent convolution on a sequence of 2-D spatial maps.
Parameters
----------
m : `~numpy.ndarray`
3-D map containing a sequence of 2-D spatial maps. First
dimension should be energy.
k : `~numpy.ndarray`
3-D map containing a sequence of convolution kernels (P... | [
"Perform",
"an",
"energy",
"-",
"dependent",
"convolution",
"on",
"a",
"sequence",
"of",
"2",
"-",
"D",
"spatial",
"maps",
"."
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/residmap.py#L36-L107 |
fermiPy/fermipy | fermipy/residmap.py | convolve_map_hpx_gauss | def convolve_map_hpx_gauss(m, sigmas, imin=0, imax=None, wmap=None):
"""
Perform an energy-dependent convolution on a sequence of 2-D spatial maps.
Parameters
----------
m : `HpxMap`
2-D map containing a sequence of 1-D HEALPix maps. First
dimension should be energy.
sigmas : `... | python | def convolve_map_hpx_gauss(m, sigmas, imin=0, imax=None, wmap=None):
"""
Perform an energy-dependent convolution on a sequence of 2-D spatial maps.
Parameters
----------
m : `HpxMap`
2-D map containing a sequence of 1-D HEALPix maps. First
dimension should be energy.
sigmas : `... | [
"def",
"convolve_map_hpx_gauss",
"(",
"m",
",",
"sigmas",
",",
"imin",
"=",
"0",
",",
"imax",
"=",
"None",
",",
"wmap",
"=",
"None",
")",
":",
"islice",
"=",
"slice",
"(",
"imin",
",",
"imax",
")",
"o",
"=",
"np",
".",
"zeros",
"(",
"m",
".",
"... | Perform an energy-dependent convolution on a sequence of 2-D spatial maps.
Parameters
----------
m : `HpxMap`
2-D map containing a sequence of 1-D HEALPix maps. First
dimension should be energy.
sigmas : `~numpy.ndarray`
1-D map containing a sequence gaussian widths for smoothin... | [
"Perform",
"an",
"energy",
"-",
"dependent",
"convolution",
"on",
"a",
"sequence",
"of",
"2",
"-",
"D",
"spatial",
"maps",
"."
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/residmap.py#L141-L187 |
fermiPy/fermipy | fermipy/residmap.py | get_source_kernel | def get_source_kernel(gta, name, kernel=None):
"""Get the PDF for the given source."""
sm = []
zs = 0
for c in gta.components:
z = c.model_counts_map(name).data.astype('float')
if kernel is not None:
shape = (z.shape[0],) + kernel.shape
z = np.apply_over_axes(np.... | python | def get_source_kernel(gta, name, kernel=None):
"""Get the PDF for the given source."""
sm = []
zs = 0
for c in gta.components:
z = c.model_counts_map(name).data.astype('float')
if kernel is not None:
shape = (z.shape[0],) + kernel.shape
z = np.apply_over_axes(np.... | [
"def",
"get_source_kernel",
"(",
"gta",
",",
"name",
",",
"kernel",
"=",
"None",
")",
":",
"sm",
"=",
"[",
"]",
"zs",
"=",
"0",
"for",
"c",
"in",
"gta",
".",
"components",
":",
"z",
"=",
"c",
".",
"model_counts_map",
"(",
"name",
")",
".",
"data"... | Get the PDF for the given source. | [
"Get",
"the",
"PDF",
"for",
"the",
"given",
"source",
"."
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/residmap.py#L190-L215 |
fermiPy/fermipy | fermipy/residmap.py | ResidMapGenerator.residmap | def residmap(self, prefix='', **kwargs):
"""Generate 2-D spatial residual maps using the current ROI
model and the convolution kernel defined with the `model`
argument.
Parameters
----------
prefix : str
String that will be prefixed to the output residual map... | python | def residmap(self, prefix='', **kwargs):
"""Generate 2-D spatial residual maps using the current ROI
model and the convolution kernel defined with the `model`
argument.
Parameters
----------
prefix : str
String that will be prefixed to the output residual map... | [
"def",
"residmap",
"(",
"self",
",",
"prefix",
"=",
"''",
",",
"*",
"*",
"kwargs",
")",
":",
"timer",
"=",
"Timer",
".",
"create",
"(",
"start",
"=",
"True",
")",
"self",
".",
"logger",
".",
"info",
"(",
"'Generating residual maps'",
")",
"schema",
"... | Generate 2-D spatial residual maps using the current ROI
model and the convolution kernel defined with the `model`
argument.
Parameters
----------
prefix : str
String that will be prefixed to the output residual map files.
{options}
Returns
... | [
"Generate",
"2",
"-",
"D",
"spatial",
"residual",
"maps",
"using",
"the",
"current",
"ROI",
"model",
"and",
"the",
"convolution",
"kernel",
"defined",
"with",
"the",
"model",
"argument",
"."
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/residmap.py#L225-L279 |
fermiPy/fermipy | fermipy/jobs/factory.py | LinkFactory.create | def create(appname, **kwargs):
"""Create a `Link` of a particular class, using the kwargs as options"""
if appname in LinkFactory._class_dict:
return LinkFactory._class_dict[appname].create(**kwargs)
else:
raise KeyError(
"Could not create object associat... | python | def create(appname, **kwargs):
"""Create a `Link` of a particular class, using the kwargs as options"""
if appname in LinkFactory._class_dict:
return LinkFactory._class_dict[appname].create(**kwargs)
else:
raise KeyError(
"Could not create object associat... | [
"def",
"create",
"(",
"appname",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"appname",
"in",
"LinkFactory",
".",
"_class_dict",
":",
"return",
"LinkFactory",
".",
"_class_dict",
"[",
"appname",
"]",
".",
"create",
"(",
"*",
"*",
"kwargs",
")",
"else",
":... | Create a `Link` of a particular class, using the kwargs as options | [
"Create",
"a",
"Link",
"of",
"a",
"particular",
"class",
"using",
"the",
"kwargs",
"as",
"options"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/jobs/factory.py#L25-L32 |
fermiPy/fermipy | fermipy/diffuse/gt_split_and_bin.py | SplitAndBin._map_arguments | def _map_arguments(self, args):
"""Map from the top-level arguments to the arguments provided to
the indiviudal links """
comp_file = args.get('comp', None)
datafile = args.get('data', None)
if is_null(comp_file):
return
if is_null(datafile):
retur... | python | def _map_arguments(self, args):
"""Map from the top-level arguments to the arguments provided to
the indiviudal links """
comp_file = args.get('comp', None)
datafile = args.get('data', None)
if is_null(comp_file):
return
if is_null(datafile):
retur... | [
"def",
"_map_arguments",
"(",
"self",
",",
"args",
")",
":",
"comp_file",
"=",
"args",
".",
"get",
"(",
"'comp'",
",",
"None",
")",
"datafile",
"=",
"args",
".",
"get",
"(",
"'data'",
",",
"None",
")",
"if",
"is_null",
"(",
"comp_file",
")",
":",
"... | Map from the top-level arguments to the arguments provided to
the indiviudal links | [
"Map",
"from",
"the",
"top",
"-",
"level",
"arguments",
"to",
"the",
"arguments",
"provided",
"to",
"the",
"indiviudal",
"links"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/gt_split_and_bin.py#L77-L161 |
fermiPy/fermipy | fermipy/diffuse/gt_split_and_bin.py | SplitAndBinChain._map_arguments | def _map_arguments(self, args):
"""Map from the top-level arguments to the arguments provided to
the indiviudal links """
data = args.get('data')
comp = args.get('comp')
ft1file = args.get('ft1file')
scratch = args.get('scratch', None)
dry_run = args.get('dry_run'... | python | def _map_arguments(self, args):
"""Map from the top-level arguments to the arguments provided to
the indiviudal links """
data = args.get('data')
comp = args.get('comp')
ft1file = args.get('ft1file')
scratch = args.get('scratch', None)
dry_run = args.get('dry_run'... | [
"def",
"_map_arguments",
"(",
"self",
",",
"args",
")",
":",
"data",
"=",
"args",
".",
"get",
"(",
"'data'",
")",
"comp",
"=",
"args",
".",
"get",
"(",
"'comp'",
")",
"ft1file",
"=",
"args",
".",
"get",
"(",
"'ft1file'",
")",
"scratch",
"=",
"args"... | Map from the top-level arguments to the arguments provided to
the indiviudal links | [
"Map",
"from",
"the",
"top",
"-",
"level",
"arguments",
"to",
"the",
"arguments",
"provided",
"to",
"the",
"indiviudal",
"links"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/gt_split_and_bin.py#L251-L274 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory._replace_none | def _replace_none(self, aDict):
""" Replace all None values in a dict with 'none' """
for k, v in aDict.items():
if v is None:
aDict[k] = 'none' | python | def _replace_none(self, aDict):
""" Replace all None values in a dict with 'none' """
for k, v in aDict.items():
if v is None:
aDict[k] = 'none' | [
"def",
"_replace_none",
"(",
"self",
",",
"aDict",
")",
":",
"for",
"k",
",",
"v",
"in",
"aDict",
".",
"items",
"(",
")",
":",
"if",
"v",
"is",
"None",
":",
"aDict",
"[",
"k",
"]",
"=",
"'none'"
] | Replace all None values in a dict with 'none' | [
"Replace",
"all",
"None",
"values",
"in",
"a",
"dict",
"with",
"none"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L136-L140 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.irfs | def irfs(self, **kwargs):
""" Get the name of IFRs associted with a particular dataset
"""
dsval = kwargs.get('dataset', self.dataset(**kwargs))
tokens = dsval.split('_')
irf_name = "%s_%s_%s" % (DATASET_DICTIONARY['%s_%s' % (tokens[0], tokens[1])],
... | python | def irfs(self, **kwargs):
""" Get the name of IFRs associted with a particular dataset
"""
dsval = kwargs.get('dataset', self.dataset(**kwargs))
tokens = dsval.split('_')
irf_name = "%s_%s_%s" % (DATASET_DICTIONARY['%s_%s' % (tokens[0], tokens[1])],
... | [
"def",
"irfs",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"dsval",
"=",
"kwargs",
".",
"get",
"(",
"'dataset'",
",",
"self",
".",
"dataset",
"(",
"*",
"*",
"kwargs",
")",
")",
"tokens",
"=",
"dsval",
".",
"split",
"(",
"'_'",
")",
"irf_name"... | Get the name of IFRs associted with a particular dataset | [
"Get",
"the",
"name",
"of",
"IFRs",
"associted",
"with",
"a",
"particular",
"dataset"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L152-L160 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.dataset | def dataset(self, **kwargs):
""" Return a key that specifies the data selection
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
try:
return NameFactory.dataset_format.format(**kwargs_copy)
except Key... | python | def dataset(self, **kwargs):
""" Return a key that specifies the data selection
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
try:
return NameFactory.dataset_format.format(**kwargs_copy)
except Key... | [
"def",
"dataset",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"self",
".",
"_replace_none",
"(",
"kwargs_copy",
")",
... | Return a key that specifies the data selection | [
"Return",
"a",
"key",
"that",
"specifies",
"the",
"data",
"selection"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L167-L176 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.component | def component(self, **kwargs):
""" Return a key that specifies data the sub-selection
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
try:
return NameFactory.component_format.format(**kwargs_copy)
... | python | def component(self, **kwargs):
""" Return a key that specifies data the sub-selection
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
try:
return NameFactory.component_format.format(**kwargs_copy)
... | [
"def",
"component",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"self",
".",
"_replace_none",
"(",
"kwargs_copy",
")",
... | Return a key that specifies data the sub-selection | [
"Return",
"a",
"key",
"that",
"specifies",
"data",
"the",
"sub",
"-",
"selection"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L178-L187 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.sourcekey | def sourcekey(self, **kwargs):
""" Return a key that specifies the name and version of a source or component
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
try:
return NameFactory.sourcekey_format.f... | python | def sourcekey(self, **kwargs):
""" Return a key that specifies the name and version of a source or component
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
try:
return NameFactory.sourcekey_format.f... | [
"def",
"sourcekey",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"self",
".",
"_replace_none",
"(",
"kwargs_copy",
")",
... | Return a key that specifies the name and version of a source or component | [
"Return",
"a",
"key",
"that",
"specifies",
"the",
"name",
"and",
"version",
"of",
"a",
"source",
"or",
"component"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L189-L198 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.galprop_ringkey | def galprop_ringkey(self, **kwargs):
""" return the sourcekey for galprop input maps : specifies the component and ring
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
try:
return NameFactory.galprop... | python | def galprop_ringkey(self, **kwargs):
""" return the sourcekey for galprop input maps : specifies the component and ring
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
try:
return NameFactory.galprop... | [
"def",
"galprop_ringkey",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"self",
".",
"_replace_none",
"(",
"kwargs_copy",
... | return the sourcekey for galprop input maps : specifies the component and ring | [
"return",
"the",
"sourcekey",
"for",
"galprop",
"input",
"maps",
":",
"specifies",
"the",
"component",
"and",
"ring"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L200-L209 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.galprop_sourcekey | def galprop_sourcekey(self, **kwargs):
""" return the sourcekey for merged galprop maps :
specifies the merged component and merging scheme
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
try:
... | python | def galprop_sourcekey(self, **kwargs):
""" return the sourcekey for merged galprop maps :
specifies the merged component and merging scheme
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
try:
... | [
"def",
"galprop_sourcekey",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"self",
".",
"_replace_none",
"(",
"kwargs_copy",... | return the sourcekey for merged galprop maps :
specifies the merged component and merging scheme | [
"return",
"the",
"sourcekey",
"for",
"merged",
"galprop",
"maps",
":",
"specifies",
"the",
"merged",
"component",
"and",
"merging",
"scheme"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L211-L221 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.merged_sourcekey | def merged_sourcekey(self, **kwargs):
""" return the sourcekey for merged sets of point sources :
specifies the catalog and merging rule
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
try:
r... | python | def merged_sourcekey(self, **kwargs):
""" return the sourcekey for merged sets of point sources :
specifies the catalog and merging rule
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
try:
r... | [
"def",
"merged_sourcekey",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"self",
".",
"_replace_none",
"(",
"kwargs_copy",
... | return the sourcekey for merged sets of point sources :
specifies the catalog and merging rule | [
"return",
"the",
"sourcekey",
"for",
"merged",
"sets",
"of",
"point",
"sources",
":",
"specifies",
"the",
"catalog",
"and",
"merging",
"rule"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L223-L233 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.galprop_gasmap | def galprop_gasmap(self, **kwargs):
""" return the file name for Galprop input gasmaps
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
localpath = NameFactory.galprop_gasmap_format.format(**kwargs_copy)
... | python | def galprop_gasmap(self, **kwargs):
""" return the file name for Galprop input gasmaps
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
localpath = NameFactory.galprop_gasmap_format.format(**kwargs_copy)
... | [
"def",
"galprop_gasmap",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"self",
".",
"_replace_none",
"(",
"kwargs_copy",
... | return the file name for Galprop input gasmaps | [
"return",
"the",
"file",
"name",
"for",
"Galprop",
"input",
"gasmaps"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L235-L244 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.merged_gasmap | def merged_gasmap(self, **kwargs):
""" return the file name for Galprop merged gasmaps
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
localpath = NameFactory.merged_gasmap_format.format(**kwargs_copy)
i... | python | def merged_gasmap(self, **kwargs):
""" return the file name for Galprop merged gasmaps
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
localpath = NameFactory.merged_gasmap_format.format(**kwargs_copy)
i... | [
"def",
"merged_gasmap",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"self",
".",
"_replace_none",
"(",
"kwargs_copy",
"... | return the file name for Galprop merged gasmaps | [
"return",
"the",
"file",
"name",
"for",
"Galprop",
"merged",
"gasmaps"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L246-L255 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.diffuse_template | def diffuse_template(self, **kwargs):
""" return the file name for other diffuse map templates
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
localpath = NameFactory.diffuse_template_format.format(**kwargs_copy... | python | def diffuse_template(self, **kwargs):
""" return the file name for other diffuse map templates
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
localpath = NameFactory.diffuse_template_format.format(**kwargs_copy... | [
"def",
"diffuse_template",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"self",
".",
"_replace_none",
"(",
"kwargs_copy",
... | return the file name for other diffuse map templates | [
"return",
"the",
"file",
"name",
"for",
"other",
"diffuse",
"map",
"templates"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L257-L266 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.spectral_template | def spectral_template(self, **kwargs):
""" return the file name for spectral templates
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
localpath = NameFactory.spectral_template_format.format(**kwargs_copy)
if kwargs.get('fullpath', False):
... | python | def spectral_template(self, **kwargs):
""" return the file name for spectral templates
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
localpath = NameFactory.spectral_template_format.format(**kwargs_copy)
if kwargs.get('fullpath', False):
... | [
"def",
"spectral_template",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"localpath",
"=",
"NameFactory",
".",
"spectral_t... | return the file name for spectral templates | [
"return",
"the",
"file",
"name",
"for",
"spectral",
"templates"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L268-L276 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.srcmdl_xml | def srcmdl_xml(self, **kwargs):
""" return the file name for source model xml files
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
localpath = NameFactory.srcmdl_xml_format.format(**kwargs_copy)
if kwargs.get('fullpath', False):
return se... | python | def srcmdl_xml(self, **kwargs):
""" return the file name for source model xml files
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
localpath = NameFactory.srcmdl_xml_format.format(**kwargs_copy)
if kwargs.get('fullpath', False):
return se... | [
"def",
"srcmdl_xml",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"localpath",
"=",
"NameFactory",
".",
"srcmdl_xml_format... | return the file name for source model xml files | [
"return",
"the",
"file",
"name",
"for",
"source",
"model",
"xml",
"files"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L278-L286 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.nested_srcmdl_xml | def nested_srcmdl_xml(self, **kwargs):
""" return the file name for source model xml files of nested sources
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
localpath = NameFactory.nested_srcmdl_xml_format.forma... | python | def nested_srcmdl_xml(self, **kwargs):
""" return the file name for source model xml files of nested sources
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
localpath = NameFactory.nested_srcmdl_xml_format.forma... | [
"def",
"nested_srcmdl_xml",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"self",
".",
"_replace_none",
"(",
"kwargs_copy",... | return the file name for source model xml files of nested sources | [
"return",
"the",
"file",
"name",
"for",
"source",
"model",
"xml",
"files",
"of",
"nested",
"sources"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L288-L297 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.ft1file | def ft1file(self, **kwargs):
""" return the name of the input ft1 file list
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
self._replace_none(kwargs_copy)
localpat... | python | def ft1file(self, **kwargs):
""" return the name of the input ft1 file list
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
self._replace_none(kwargs_copy)
localpat... | [
"def",
"ft1file",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"kwargs_copy",
"[",
"'dataset'",
"]",
"=",
"kwargs",
".... | return the name of the input ft1 file list | [
"return",
"the",
"name",
"of",
"the",
"input",
"ft1",
"file",
"list"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L299-L309 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.ft2file | def ft2file(self, **kwargs):
""" return the name of the input ft2 file list
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['data_time'] = kwargs.get(
'data_time', self.dataset(**kwargs))
self._replace_none(kwargs_copy) ... | python | def ft2file(self, **kwargs):
""" return the name of the input ft2 file list
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['data_time'] = kwargs.get(
'data_time', self.dataset(**kwargs))
self._replace_none(kwargs_copy) ... | [
"def",
"ft2file",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"kwargs_copy",
"[",
"'data_time'",
"]",
"=",
"kwargs",
... | return the name of the input ft2 file list | [
"return",
"the",
"name",
"of",
"the",
"input",
"ft2",
"file",
"list"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L311-L322 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.ltcube | def ltcube(self, **kwargs):
""" return the name of a livetime cube file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
localpath = NameFactory.ltcube_format.format(**kwargs_copy)
... | python | def ltcube(self, **kwargs):
""" return the name of a livetime cube file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
localpath = NameFactory.ltcube_format.format(**kwargs_copy)
... | [
"def",
"ltcube",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"kwargs_copy",
"[",
"'dataset'",
"]",
"=",
"kwargs",
"."... | return the name of a livetime cube file | [
"return",
"the",
"name",
"of",
"a",
"livetime",
"cube",
"file"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L324-L333 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.select | def select(self, **kwargs):
""" return the name of a selected events ft1file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
kwargs_copy['component'] = kwargs.get(
'com... | python | def select(self, **kwargs):
""" return the name of a selected events ft1file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
kwargs_copy['component'] = kwargs.get(
'com... | [
"def",
"select",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"kwargs_copy",
"[",
"'dataset'",
"]",
"=",
"kwargs",
"."... | return the name of a selected events ft1file | [
"return",
"the",
"name",
"of",
"a",
"selected",
"events",
"ft1file"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L335-L347 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.mktime | def mktime(self, **kwargs):
""" return the name of a selected events ft1file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
kwargs_copy['component'] = kwargs.get(
'com... | python | def mktime(self, **kwargs):
""" return the name of a selected events ft1file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
kwargs_copy['component'] = kwargs.get(
'com... | [
"def",
"mktime",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"kwargs_copy",
"[",
"'dataset'",
"]",
"=",
"kwargs",
"."... | return the name of a selected events ft1file | [
"return",
"the",
"name",
"of",
"a",
"selected",
"events",
"ft1file"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L349-L361 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.ccube | def ccube(self, **kwargs):
""" return the name of a counts cube file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
kwargs_copy['component'] = kwargs.get(
'component',... | python | def ccube(self, **kwargs):
""" return the name of a counts cube file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
kwargs_copy['component'] = kwargs.get(
'component',... | [
"def",
"ccube",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"kwargs_copy",
"[",
"'dataset'",
"]",
"=",
"kwargs",
".",... | return the name of a counts cube file | [
"return",
"the",
"name",
"of",
"a",
"counts",
"cube",
"file"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L363-L374 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.bexpcube | def bexpcube(self, **kwargs):
""" return the name of a binned exposure cube file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
kwargs_copy['component'] = kwargs.get(
... | python | def bexpcube(self, **kwargs):
""" return the name of a binned exposure cube file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
kwargs_copy['component'] = kwargs.get(
... | [
"def",
"bexpcube",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"kwargs_copy",
"[",
"'dataset'",
"]",
"=",
"kwargs",
"... | return the name of a binned exposure cube file | [
"return",
"the",
"name",
"of",
"a",
"binned",
"exposure",
"cube",
"file"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L376-L388 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.srcmaps | def srcmaps(self, **kwargs):
""" return the name of a source map file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
kwargs_copy['component'] = kwargs.get(
'component'... | python | def srcmaps(self, **kwargs):
""" return the name of a source map file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
kwargs_copy['component'] = kwargs.get(
'component'... | [
"def",
"srcmaps",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"kwargs_copy",
"[",
"'dataset'",
"]",
"=",
"kwargs",
".... | return the name of a source map file | [
"return",
"the",
"name",
"of",
"a",
"source",
"map",
"file"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L390-L402 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.mcube | def mcube(self, **kwargs):
""" return the name of a model cube file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
kwargs_copy['component'] = kwargs.get(
'component', ... | python | def mcube(self, **kwargs):
""" return the name of a model cube file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
kwargs_copy['component'] = kwargs.get(
'component', ... | [
"def",
"mcube",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"kwargs_copy",
"[",
"'dataset'",
"]",
"=",
"kwargs",
".",... | return the name of a model cube file | [
"return",
"the",
"name",
"of",
"a",
"model",
"cube",
"file"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L404-L416 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.ltcube_sun | def ltcube_sun(self, **kwargs):
""" return the name of a livetime cube file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
self._replace_none(kwargs_copy)
localpat... | python | def ltcube_sun(self, **kwargs):
""" return the name of a livetime cube file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
self._replace_none(kwargs_copy)
localpat... | [
"def",
"ltcube_sun",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"kwargs_copy",
"[",
"'dataset'",
"]",
"=",
"kwargs",
... | return the name of a livetime cube file | [
"return",
"the",
"name",
"of",
"a",
"livetime",
"cube",
"file"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L418-L428 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.ltcube_moon | def ltcube_moon(self, **kwargs):
""" return the name of a livetime cube file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
self._replace_none(kwargs_copy)
localpa... | python | def ltcube_moon(self, **kwargs):
""" return the name of a livetime cube file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
self._replace_none(kwargs_copy)
localpa... | [
"def",
"ltcube_moon",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"kwargs_copy",
"[",
"'dataset'",
"]",
"=",
"kwargs",
... | return the name of a livetime cube file | [
"return",
"the",
"name",
"of",
"a",
"livetime",
"cube",
"file"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L430-L440 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.bexpcube_sun | def bexpcube_sun(self, **kwargs):
""" return the name of a binned exposure cube file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
kwargs_copy['component'] = kwargs.get(
... | python | def bexpcube_sun(self, **kwargs):
""" return the name of a binned exposure cube file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
kwargs_copy['component'] = kwargs.get(
... | [
"def",
"bexpcube_sun",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"kwargs_copy",
"[",
"'dataset'",
"]",
"=",
"kwargs",... | return the name of a binned exposure cube file | [
"return",
"the",
"name",
"of",
"a",
"binned",
"exposure",
"cube",
"file"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L442-L454 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.bexpcube_moon | def bexpcube_moon(self, **kwargs):
""" return the name of a binned exposure cube file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
kwargs_copy['component'] = kwargs.get(
... | python | def bexpcube_moon(self, **kwargs):
""" return the name of a binned exposure cube file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
kwargs_copy['component'] = kwargs.get(
... | [
"def",
"bexpcube_moon",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"kwargs_copy",
"[",
"'dataset'",
"]",
"=",
"kwargs"... | return the name of a binned exposure cube file | [
"return",
"the",
"name",
"of",
"a",
"binned",
"exposure",
"cube",
"file"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L456-L468 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.angprofile | def angprofile(self, **kwargs):
""" return the file name for sun or moon angular profiles
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
localpath = NameFactory.angprofile_format.format(**kwargs_copy)
i... | python | def angprofile(self, **kwargs):
""" return the file name for sun or moon angular profiles
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
localpath = NameFactory.angprofile_format.format(**kwargs_copy)
i... | [
"def",
"angprofile",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"self",
".",
"_replace_none",
"(",
"kwargs_copy",
")",... | return the file name for sun or moon angular profiles | [
"return",
"the",
"file",
"name",
"for",
"sun",
"or",
"moon",
"angular",
"profiles"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L470-L479 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.template_sunmoon | def template_sunmoon(self, **kwargs):
""" return the file name for sun or moon template files
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
kwargs_copy['component'] = kwargs.get(... | python | def template_sunmoon(self, **kwargs):
""" return the file name for sun or moon template files
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
kwargs_copy['component'] = kwargs.get(... | [
"def",
"template_sunmoon",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"kwargs_copy",
"[",
"'dataset'",
"]",
"=",
"kwar... | return the file name for sun or moon template files | [
"return",
"the",
"file",
"name",
"for",
"sun",
"or",
"moon",
"template",
"files"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L481-L493 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.residual_cr | def residual_cr(self, **kwargs):
"""Return the name of the residual CR analysis output files"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
kwargs_copy['component'] = kwargs.get(
... | python | def residual_cr(self, **kwargs):
"""Return the name of the residual CR analysis output files"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
kwargs_copy['component'] = kwargs.get(
... | [
"def",
"residual_cr",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"kwargs_copy",
"[",
"'dataset'",
"]",
"=",
"kwargs",
... | Return the name of the residual CR analysis output files | [
"Return",
"the",
"name",
"of",
"the",
"residual",
"CR",
"analysis",
"output",
"files"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L495-L505 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.galprop_rings_yaml | def galprop_rings_yaml(self, **kwargs):
""" return the name of a galprop rings merging yaml file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
localpath = NameFactory.galprop_rings_yaml_format.format(**kwargs_... | python | def galprop_rings_yaml(self, **kwargs):
""" return the name of a galprop rings merging yaml file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
localpath = NameFactory.galprop_rings_yaml_format.format(**kwargs_... | [
"def",
"galprop_rings_yaml",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"self",
".",
"_replace_none",
"(",
"kwargs_copy"... | return the name of a galprop rings merging yaml file | [
"return",
"the",
"name",
"of",
"a",
"galprop",
"rings",
"merging",
"yaml",
"file"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L507-L516 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.catalog_split_yaml | def catalog_split_yaml(self, **kwargs):
""" return the name of a catalog split yaml file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
localpath = NameFactory.catalog_split_yaml_format.format(**kwargs_copy)
... | python | def catalog_split_yaml(self, **kwargs):
""" return the name of a catalog split yaml file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
localpath = NameFactory.catalog_split_yaml_format.format(**kwargs_copy)
... | [
"def",
"catalog_split_yaml",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"self",
".",
"_replace_none",
"(",
"kwargs_copy"... | return the name of a catalog split yaml file | [
"return",
"the",
"name",
"of",
"a",
"catalog",
"split",
"yaml",
"file"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L518-L527 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.model_yaml | def model_yaml(self, **kwargs):
""" return the name of a model yaml file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
localpath = NameFactory.model_yaml_format.format(**kwargs_copy)
if kwargs.get('ful... | python | def model_yaml(self, **kwargs):
""" return the name of a model yaml file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
localpath = NameFactory.model_yaml_format.format(**kwargs_copy)
if kwargs.get('ful... | [
"def",
"model_yaml",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"self",
".",
"_replace_none",
"(",
"kwargs_copy",
")",... | return the name of a model yaml file | [
"return",
"the",
"name",
"of",
"a",
"model",
"yaml",
"file"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L529-L538 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.merged_srcmaps | def merged_srcmaps(self, **kwargs):
""" return the name of a source map file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
kwargs_copy['component'] = kwargs.get(
'com... | python | def merged_srcmaps(self, **kwargs):
""" return the name of a source map file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
kwargs_copy['component'] = kwargs.get(
'com... | [
"def",
"merged_srcmaps",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"kwargs_copy",
"[",
"'dataset'",
"]",
"=",
"kwargs... | return the name of a source map file | [
"return",
"the",
"name",
"of",
"a",
"source",
"map",
"file"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L540-L552 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.master_srcmdl_xml | def master_srcmdl_xml(self, **kwargs):
""" return the name of a source model file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
localpath = NameFactory.master_srcmdl_xml_format.format(**kwargs_copy)
if... | python | def master_srcmdl_xml(self, **kwargs):
""" return the name of a source model file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
localpath = NameFactory.master_srcmdl_xml_format.format(**kwargs_copy)
if... | [
"def",
"master_srcmdl_xml",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"self",
".",
"_replace_none",
"(",
"kwargs_copy",... | return the name of a source model file | [
"return",
"the",
"name",
"of",
"a",
"source",
"model",
"file"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L554-L563 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.comp_srcmdl_xml | def comp_srcmdl_xml(self, **kwargs):
""" return the name of a source model file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
kwargs_copy['component'] = kwargs.get(
'... | python | def comp_srcmdl_xml(self, **kwargs):
""" return the name of a source model file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
kwargs_copy['component'] = kwargs.get(
'... | [
"def",
"comp_srcmdl_xml",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"kwargs_copy",
"[",
"'dataset'",
"]",
"=",
"kwarg... | return the name of a source model file | [
"return",
"the",
"name",
"of",
"a",
"source",
"model",
"file"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L565-L577 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.fullpath | def fullpath(self, **kwargs):
"""Return a full path name for a given file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
return NameFactory.fullpath_format.format(**kwargs_copy) | python | def fullpath(self, **kwargs):
"""Return a full path name for a given file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
return NameFactory.fullpath_format.format(**kwargs_copy) | [
"def",
"fullpath",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"self",
".",
"_replace_none",
"(",
"kwargs_copy",
")",
... | Return a full path name for a given file | [
"Return",
"a",
"full",
"path",
"name",
"for",
"a",
"given",
"file"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L586-L592 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.generic | def generic(self, input_string, **kwargs):
""" return a generic filename for a given dataset and component
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
kwargs_copy['component'] ... | python | def generic(self, input_string, **kwargs):
""" return a generic filename for a given dataset and component
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
kwargs_copy['component'] ... | [
"def",
"generic",
"(",
"self",
",",
"input_string",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"self",
".",
"base_dict",
".",
"copy",
"(",
")",
"kwargs_copy",
".",
"update",
"(",
"*",
"*",
"kwargs",
")",
"kwargs_copy",
"[",
"'dataset'",
"]"... | return a generic filename for a given dataset and component | [
"return",
"a",
"generic",
"filename",
"for",
"a",
"given",
"dataset",
"and",
"component"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L594-L603 |
fermiPy/fermipy | fermipy/diffuse/name_policy.py | NameFactory.make_filenames | def make_filenames(self, **kwargs):
""" Make a dictionary of filenames for various types
"""
out_dict = dict(ft1file=self.ft1file(**kwargs),
ltcube=self.ltcube(**kwargs),
ccube=self.ccube(**kwargs),
bexpcube=self.bexpcube(**... | python | def make_filenames(self, **kwargs):
""" Make a dictionary of filenames for various types
"""
out_dict = dict(ft1file=self.ft1file(**kwargs),
ltcube=self.ltcube(**kwargs),
ccube=self.ccube(**kwargs),
bexpcube=self.bexpcube(**... | [
"def",
"make_filenames",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"out_dict",
"=",
"dict",
"(",
"ft1file",
"=",
"self",
".",
"ft1file",
"(",
"*",
"*",
"kwargs",
")",
",",
"ltcube",
"=",
"self",
".",
"ltcube",
"(",
"*",
"*",
"kwargs",
")",
... | Make a dictionary of filenames for various types | [
"Make",
"a",
"dictionary",
"of",
"filenames",
"for",
"various",
"types"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/name_policy.py#L605-L614 |
fermiPy/fermipy | fermipy/diffuse/diffuse_analysis.py | DiffuseCompChain._map_arguments | def _map_arguments(self, args):
"""Map from the top-level arguments to the arguments provided to
the indiviudal links """
data = args.get('data')
comp = args.get('comp')
library = args.get('library')
dry_run = args.get('dry_run', False)
self._set_link('sum-rings'... | python | def _map_arguments(self, args):
"""Map from the top-level arguments to the arguments provided to
the indiviudal links """
data = args.get('data')
comp = args.get('comp')
library = args.get('library')
dry_run = args.get('dry_run', False)
self._set_link('sum-rings'... | [
"def",
"_map_arguments",
"(",
"self",
",",
"args",
")",
":",
"data",
"=",
"args",
".",
"get",
"(",
"'data'",
")",
"comp",
"=",
"args",
".",
"get",
"(",
"'comp'",
")",
"library",
"=",
"args",
".",
"get",
"(",
"'library'",
")",
"dry_run",
"=",
"args"... | Map from the top-level arguments to the arguments provided to
the indiviudal links | [
"Map",
"from",
"the",
"top",
"-",
"level",
"arguments",
"to",
"the",
"arguments",
"provided",
"to",
"the",
"indiviudal",
"links"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/diffuse_analysis.py#L59-L81 |
fermiPy/fermipy | fermipy/diffuse/diffuse_analysis.py | CatalogCompChain._map_arguments | def _map_arguments(self, args):
"""Map from the top-level arguments to the arguments provided to
the indiviudal links """
data = args.get('data')
comp = args.get('comp')
library = args.get('library')
dry_run = args.get('dry_run', False)
self._set_link('srcmaps-ca... | python | def _map_arguments(self, args):
"""Map from the top-level arguments to the arguments provided to
the indiviudal links """
data = args.get('data')
comp = args.get('comp')
library = args.get('library')
dry_run = args.get('dry_run', False)
self._set_link('srcmaps-ca... | [
"def",
"_map_arguments",
"(",
"self",
",",
"args",
")",
":",
"data",
"=",
"args",
".",
"get",
"(",
"'data'",
")",
"comp",
"=",
"args",
".",
"get",
"(",
"'comp'",
")",
"library",
"=",
"args",
".",
"get",
"(",
"'library'",
")",
"dry_run",
"=",
"args"... | Map from the top-level arguments to the arguments provided to
the indiviudal links | [
"Map",
"from",
"the",
"top",
"-",
"level",
"arguments",
"to",
"the",
"arguments",
"provided",
"to",
"the",
"indiviudal",
"links"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/diffuse_analysis.py#L120-L142 |
fermiPy/fermipy | fermipy/diffuse/diffuse_analysis.py | DiffuseAnalysisChain._map_arguments | def _map_arguments(self, args):
"""Map from the top-level arguments to the arguments provided to
the indiviudal links """
config_yaml = args['config']
config_dict = load_yaml(config_yaml)
dry_run = args.get('dry_run', False)
data = config_dict.get('data')
comp =... | python | def _map_arguments(self, args):
"""Map from the top-level arguments to the arguments provided to
the indiviudal links """
config_yaml = args['config']
config_dict = load_yaml(config_yaml)
dry_run = args.get('dry_run', False)
data = config_dict.get('data')
comp =... | [
"def",
"_map_arguments",
"(",
"self",
",",
"args",
")",
":",
"config_yaml",
"=",
"args",
"[",
"'config'",
"]",
"config_dict",
"=",
"load_yaml",
"(",
"config_yaml",
")",
"dry_run",
"=",
"args",
".",
"get",
"(",
"'dry_run'",
",",
"False",
")",
"data",
"=",... | Map from the top-level arguments to the arguments provided to
the indiviudal links | [
"Map",
"from",
"the",
"top",
"-",
"level",
"arguments",
"to",
"the",
"arguments",
"provided",
"to",
"the",
"indiviudal",
"links"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/diffuse/diffuse_analysis.py#L173-L214 |
fermiPy/fermipy | fermipy/gtutils.py | create_spectrum_from_dict | def create_spectrum_from_dict(spectrum_type, spectral_pars, fn=None):
"""Create a Function object from a parameter dictionary.
Parameters
----------
spectrum_type : str
String identifying the spectrum type (e.g. PowerLaw).
spectral_pars : dict
Dictionary of spectral parameters.
... | python | def create_spectrum_from_dict(spectrum_type, spectral_pars, fn=None):
"""Create a Function object from a parameter dictionary.
Parameters
----------
spectrum_type : str
String identifying the spectrum type (e.g. PowerLaw).
spectral_pars : dict
Dictionary of spectral parameters.
... | [
"def",
"create_spectrum_from_dict",
"(",
"spectrum_type",
",",
"spectral_pars",
",",
"fn",
"=",
"None",
")",
":",
"if",
"fn",
"is",
"None",
":",
"fn",
"=",
"pyLike",
".",
"SourceFactory_funcFactory",
"(",
")",
".",
"create",
"(",
"str",
"(",
"spectrum_type",... | Create a Function object from a parameter dictionary.
Parameters
----------
spectrum_type : str
String identifying the spectrum type (e.g. PowerLaw).
spectral_pars : dict
Dictionary of spectral parameters. | [
"Create",
"a",
"Function",
"object",
"from",
"a",
"parameter",
"dictionary",
"."
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/gtutils.py#L208-L248 |
fermiPy/fermipy | fermipy/gtutils.py | gtlike_spectrum_to_dict | def gtlike_spectrum_to_dict(spectrum):
""" Convert a pyLikelihood object to a python dictionary which can
be easily saved to a file."""
parameters = pyLike.ParameterVector()
spectrum.getParams(parameters)
d = dict(spectrum_type=spectrum.genericName())
for p in parameters:
pname = p.... | python | def gtlike_spectrum_to_dict(spectrum):
""" Convert a pyLikelihood object to a python dictionary which can
be easily saved to a file."""
parameters = pyLike.ParameterVector()
spectrum.getParams(parameters)
d = dict(spectrum_type=spectrum.genericName())
for p in parameters:
pname = p.... | [
"def",
"gtlike_spectrum_to_dict",
"(",
"spectrum",
")",
":",
"parameters",
"=",
"pyLike",
".",
"ParameterVector",
"(",
")",
"spectrum",
".",
"getParams",
"(",
"parameters",
")",
"d",
"=",
"dict",
"(",
"spectrum_type",
"=",
"spectrum",
".",
"genericName",
"(",
... | Convert a pyLikelihood object to a python dictionary which can
be easily saved to a file. | [
"Convert",
"a",
"pyLikelihood",
"object",
"to",
"a",
"python",
"dictionary",
"which",
"can",
"be",
"easily",
"saved",
"to",
"a",
"file",
"."
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/gtutils.py#L251-L267 |
fermiPy/fermipy | fermipy/gtutils.py | gtlike_spectrum_to_vectors | def gtlike_spectrum_to_vectors(spectrum):
""" Convert a pyLikelihood object to a python dictionary which can
be easily saved to a file."""
parameters = pyLike.ParameterVector()
spectrum.getParams(parameters)
npar = max(parameters.size(), 10)
o = {'param_names': np.zeros(npar, dtype='S32')... | python | def gtlike_spectrum_to_vectors(spectrum):
""" Convert a pyLikelihood object to a python dictionary which can
be easily saved to a file."""
parameters = pyLike.ParameterVector()
spectrum.getParams(parameters)
npar = max(parameters.size(), 10)
o = {'param_names': np.zeros(npar, dtype='S32')... | [
"def",
"gtlike_spectrum_to_vectors",
"(",
"spectrum",
")",
":",
"parameters",
"=",
"pyLike",
".",
"ParameterVector",
"(",
")",
"spectrum",
".",
"getParams",
"(",
"parameters",
")",
"npar",
"=",
"max",
"(",
"parameters",
".",
"size",
"(",
")",
",",
"10",
")... | Convert a pyLikelihood object to a python dictionary which can
be easily saved to a file. | [
"Convert",
"a",
"pyLikelihood",
"object",
"to",
"a",
"python",
"dictionary",
"which",
"can",
"be",
"easily",
"saved",
"to",
"a",
"file",
"."
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/gtutils.py#L270-L290 |
fermiPy/fermipy | fermipy/gtutils.py | get_function_pars | def get_function_pars(fn):
"""Extract the parameters of a pyLikelihood function object
(value, scale, bounds).
Parameters
----------
fn : pyLikelihood.Function
Returns
-------
pars : list
"""
pars = []
par_names = pyLike.StringVector()
fn.getParamNames(par_names)
... | python | def get_function_pars(fn):
"""Extract the parameters of a pyLikelihood function object
(value, scale, bounds).
Parameters
----------
fn : pyLikelihood.Function
Returns
-------
pars : list
"""
pars = []
par_names = pyLike.StringVector()
fn.getParamNames(par_names)
... | [
"def",
"get_function_pars",
"(",
"fn",
")",
":",
"pars",
"=",
"[",
"]",
"par_names",
"=",
"pyLike",
".",
"StringVector",
"(",
")",
"fn",
".",
"getParamNames",
"(",
"par_names",
")",
"for",
"pname",
"in",
"par_names",
":",
"par",
"=",
"fn",
".",
"getPar... | Extract the parameters of a pyLikelihood function object
(value, scale, bounds).
Parameters
----------
fn : pyLikelihood.Function
Returns
-------
pars : list | [
"Extract",
"the",
"parameters",
"of",
"a",
"pyLikelihood",
"function",
"object",
"(",
"value",
"scale",
"bounds",
")",
"."
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/gtutils.py#L300-L333 |
fermiPy/fermipy | fermipy/gtutils.py | get_priors | def get_priors(like):
"""Extract priors from a likelihood object."""
npar = len(like.params())
vals = np.ones(npar)
errs = np.ones(npar)
has_prior = np.array([False] * npar)
for i, p in enumerate(like.params()):
prior = like[i].log_prior()
if prior is None:
conti... | python | def get_priors(like):
"""Extract priors from a likelihood object."""
npar = len(like.params())
vals = np.ones(npar)
errs = np.ones(npar)
has_prior = np.array([False] * npar)
for i, p in enumerate(like.params()):
prior = like[i].log_prior()
if prior is None:
conti... | [
"def",
"get_priors",
"(",
"like",
")",
":",
"npar",
"=",
"len",
"(",
"like",
".",
"params",
"(",
")",
")",
"vals",
"=",
"np",
".",
"ones",
"(",
"npar",
")",
"errs",
"=",
"np",
".",
"ones",
"(",
"npar",
")",
"has_prior",
"=",
"np",
".",
"array",... | Extract priors from a likelihood object. | [
"Extract",
"priors",
"from",
"a",
"likelihood",
"object",
"."
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/gtutils.py#L367-L402 |
fermiPy/fermipy | fermipy/gtutils.py | get_source_pars | def get_source_pars(src):
"""Extract the parameters associated with a pyLikelihood Source object.
"""
fnmap = src.getSrcFuncs()
keys = fnmap.keys()
if 'Position' in keys:
ppars = get_function_pars(src.getSrcFuncs()[str('Position')])
elif 'SpatialDist' in keys:
ppars = get_fun... | python | def get_source_pars(src):
"""Extract the parameters associated with a pyLikelihood Source object.
"""
fnmap = src.getSrcFuncs()
keys = fnmap.keys()
if 'Position' in keys:
ppars = get_function_pars(src.getSrcFuncs()[str('Position')])
elif 'SpatialDist' in keys:
ppars = get_fun... | [
"def",
"get_source_pars",
"(",
"src",
")",
":",
"fnmap",
"=",
"src",
".",
"getSrcFuncs",
"(",
")",
"keys",
"=",
"fnmap",
".",
"keys",
"(",
")",
"if",
"'Position'",
"in",
"keys",
":",
"ppars",
"=",
"get_function_pars",
"(",
"src",
".",
"getSrcFuncs",
"(... | Extract the parameters associated with a pyLikelihood Source object. | [
"Extract",
"the",
"parameters",
"associated",
"with",
"a",
"pyLikelihood",
"Source",
"object",
"."
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/gtutils.py#L405-L434 |
fermiPy/fermipy | fermipy/gtutils.py | SummedLikelihood.nFreeParams | def nFreeParams(self):
"""Count the number of free parameters in the active model."""
nF = 0
pars = self.params()
for par in pars:
if par.isFree():
nF += 1
return nF | python | def nFreeParams(self):
"""Count the number of free parameters in the active model."""
nF = 0
pars = self.params()
for par in pars:
if par.isFree():
nF += 1
return nF | [
"def",
"nFreeParams",
"(",
"self",
")",
":",
"nF",
"=",
"0",
"pars",
"=",
"self",
".",
"params",
"(",
")",
"for",
"par",
"in",
"pars",
":",
"if",
"par",
".",
"isFree",
"(",
")",
":",
"nF",
"+=",
"1",
"return",
"nF"
] | Count the number of free parameters in the active model. | [
"Count",
"the",
"number",
"of",
"free",
"parameters",
"in",
"the",
"active",
"model",
"."
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/gtutils.py#L490-L497 |
fermiPy/fermipy | fermipy/gtutils.py | BinnedAnalysis.Ts2 | def Ts2(self, srcName, reoptimize=False, approx=True,
tol=None, MaxIterations=10, verbosity=0):
"""Computes the TS value for a source indicated by "srcName."
If "reoptimize=True" is selected this function will reoptimize
the model up to "MaxIterations" given the tolerance "tol"
... | python | def Ts2(self, srcName, reoptimize=False, approx=True,
tol=None, MaxIterations=10, verbosity=0):
"""Computes the TS value for a source indicated by "srcName."
If "reoptimize=True" is selected this function will reoptimize
the model up to "MaxIterations" given the tolerance "tol"
... | [
"def",
"Ts2",
"(",
"self",
",",
"srcName",
",",
"reoptimize",
"=",
"False",
",",
"approx",
"=",
"True",
",",
"tol",
"=",
"None",
",",
"MaxIterations",
"=",
"10",
",",
"verbosity",
"=",
"0",
")",
":",
"saved_state",
"=",
"LikelihoodState",
"(",
"self",
... | Computes the TS value for a source indicated by "srcName."
If "reoptimize=True" is selected this function will reoptimize
the model up to "MaxIterations" given the tolerance "tol"
(default is the tolerance selected for the overall fit). If
"appox=True" is selected (the default) it will... | [
"Computes",
"the",
"TS",
"value",
"for",
"a",
"source",
"indicated",
"by",
"srcName",
"."
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/gtutils.py#L658-L715 |
fermiPy/fermipy | fermipy/jobs/scatter_gather.py | ScatterGather._make_scatter_logfile_name | def _make_scatter_logfile_name(cls, key, linkname, job_config):
"""Hook to inster the name of a logfile into the input config """
logfile = job_config.get('logfile', "%s_%s_%s.log" %
(cls.default_prefix_logfile, linkname, key))
job_config['logfile'] = logfile | python | def _make_scatter_logfile_name(cls, key, linkname, job_config):
"""Hook to inster the name of a logfile into the input config """
logfile = job_config.get('logfile', "%s_%s_%s.log" %
(cls.default_prefix_logfile, linkname, key))
job_config['logfile'] = logfile | [
"def",
"_make_scatter_logfile_name",
"(",
"cls",
",",
"key",
",",
"linkname",
",",
"job_config",
")",
":",
"logfile",
"=",
"job_config",
".",
"get",
"(",
"'logfile'",
",",
"\"%s_%s_%s.log\"",
"%",
"(",
"cls",
".",
"default_prefix_logfile",
",",
"linkname",
","... | Hook to inster the name of a logfile into the input config | [
"Hook",
"to",
"inster",
"the",
"name",
"of",
"a",
"logfile",
"into",
"the",
"input",
"config"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/jobs/scatter_gather.py#L97-L101 |
fermiPy/fermipy | fermipy/jobs/scatter_gather.py | ScatterGather.create | def create(cls, **kwargs):
"""Build and return a `ScatterGather` object """
linkname = kwargs.setdefault('linkname', cls.clientclass.linkname_default)
# Don't use setdefault b/c we don't want to build a JobArchive
# Unless it is needed
job_archive = kwargs.get('job_archive', None... | python | def create(cls, **kwargs):
"""Build and return a `ScatterGather` object """
linkname = kwargs.setdefault('linkname', cls.clientclass.linkname_default)
# Don't use setdefault b/c we don't want to build a JobArchive
# Unless it is needed
job_archive = kwargs.get('job_archive', None... | [
"def",
"create",
"(",
"cls",
",",
"*",
"*",
"kwargs",
")",
":",
"linkname",
"=",
"kwargs",
".",
"setdefault",
"(",
"'linkname'",
",",
"cls",
".",
"clientclass",
".",
"linkname_default",
")",
"# Don't use setdefault b/c we don't want to build a JobArchive",
"# Unless... | Build and return a `ScatterGather` object | [
"Build",
"and",
"return",
"a",
"ScatterGather",
"object"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/jobs/scatter_gather.py#L104-L119 |
fermiPy/fermipy | fermipy/jobs/scatter_gather.py | ScatterGather._latch_file_info | def _latch_file_info(self):
"""Internal function to update the dictionaries
keeping track of input and output files
"""
self.files.file_dict.clear()
self.sub_files.file_dict.clear()
self.files.latch_file_info(self.args)
self._scatter_link._update_sub_file_dict(sel... | python | def _latch_file_info(self):
"""Internal function to update the dictionaries
keeping track of input and output files
"""
self.files.file_dict.clear()
self.sub_files.file_dict.clear()
self.files.latch_file_info(self.args)
self._scatter_link._update_sub_file_dict(sel... | [
"def",
"_latch_file_info",
"(",
"self",
")",
":",
"self",
".",
"files",
".",
"file_dict",
".",
"clear",
"(",
")",
"self",
".",
"sub_files",
".",
"file_dict",
".",
"clear",
"(",
")",
"self",
".",
"files",
".",
"latch_file_info",
"(",
"self",
".",
"args"... | Internal function to update the dictionaries
keeping track of input and output files | [
"Internal",
"function",
"to",
"update",
"the",
"dictionaries",
"keeping",
"track",
"of",
"input",
"and",
"output",
"files"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/jobs/scatter_gather.py#L138-L145 |
fermiPy/fermipy | fermipy/jobs/scatter_gather.py | ScatterGather._check_link_completion | def _check_link_completion(self, link, fail_pending=False, fail_running=False):
"""Internal function to check the completion of all the dispatched jobs
Returns
-------
status_vect : `JobStatusVector`
Vector that summarize the number of jobs in various states.
"""
... | python | def _check_link_completion(self, link, fail_pending=False, fail_running=False):
"""Internal function to check the completion of all the dispatched jobs
Returns
-------
status_vect : `JobStatusVector`
Vector that summarize the number of jobs in various states.
"""
... | [
"def",
"_check_link_completion",
"(",
"self",
",",
"link",
",",
"fail_pending",
"=",
"False",
",",
"fail_running",
"=",
"False",
")",
":",
"status_vect",
"=",
"JobStatusVector",
"(",
")",
"for",
"job_key",
",",
"job_details",
"in",
"link",
".",
"jobs",
".",
... | Internal function to check the completion of all the dispatched jobs
Returns
-------
status_vect : `JobStatusVector`
Vector that summarize the number of jobs in various states. | [
"Internal",
"function",
"to",
"check",
"the",
"completion",
"of",
"all",
"the",
"dispatched",
"jobs"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/jobs/scatter_gather.py#L147-L177 |
fermiPy/fermipy | fermipy/jobs/scatter_gather.py | ScatterGather._build_job_dict | def _build_job_dict(self):
"""Build a dictionary of `JobDetails` objects for the internal `Link`"""
if self.args['dry_run']:
status = JobStatus.unknown
else:
status = JobStatus.not_ready
base_config = self.scatter_link.args
for jobkey, job_config in sort... | python | def _build_job_dict(self):
"""Build a dictionary of `JobDetails` objects for the internal `Link`"""
if self.args['dry_run']:
status = JobStatus.unknown
else:
status = JobStatus.not_ready
base_config = self.scatter_link.args
for jobkey, job_config in sort... | [
"def",
"_build_job_dict",
"(",
"self",
")",
":",
"if",
"self",
".",
"args",
"[",
"'dry_run'",
"]",
":",
"status",
"=",
"JobStatus",
".",
"unknown",
"else",
":",
"status",
"=",
"JobStatus",
".",
"not_ready",
"base_config",
"=",
"self",
".",
"scatter_link",
... | Build a dictionary of `JobDetails` objects for the internal `Link` | [
"Build",
"a",
"dictionary",
"of",
"JobDetails",
"objects",
"for",
"the",
"internal",
"Link"
] | train | https://github.com/fermiPy/fermipy/blob/9df5e7e3728307fd58c5bba36fd86783c39fbad4/fermipy/jobs/scatter_gather.py#L179-L197 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.