From 30f3f96bdc51c2254d722c52e2e8c0e9a6796075 Mon Sep 17 00:00:00 2001 From: Israel Martinez Date: Tue, 23 Jan 2024 11:07:15 -0500 Subject: [PATCH] Add mode module to docs API. Move COSILike init decription to the top so it can be find by sphinx --- cosipy/threeml/COSILike.py | 51 ++++++++++++++++---------------- docs/api/data_io.rst | 11 +++++++ docs/api/image_deconvolution.rst | 7 +++++ docs/api/index.rst | 3 ++ docs/api/threeml.rst | 10 +++++++ 5 files changed, 56 insertions(+), 26 deletions(-) create mode 100644 docs/api/data_io.rst create mode 100644 docs/api/image_deconvolution.rst create mode 100644 docs/api/threeml.rst diff --git a/cosipy/threeml/COSILike.py b/cosipy/threeml/COSILike.py index 7dd76541..4bc072e9 100644 --- a/cosipy/threeml/COSILike.py +++ b/cosipy/threeml/COSILike.py @@ -27,32 +27,31 @@ logger = logging.getLogger(__name__) class COSILike(PluginPrototype): - - def __init__(self, name, dr, data, bkg, sc_orientation, nuisance_param=None, coordsys=None, **kwargs): - - """ - COSI 3ML plugin - - Parameters - ---------- - name : str - Plugin name e.g. "cosi". Needs to have a distinct name with respect to other plugins in the same analysis - dr : Path - Path to full detector response - data: histpy.Histogram - Binned data. Note: Eventually this should be a cosipy data class - bkg: histpy.Histogram - Binned background model. Note: Eventually this should be a cosipy data class - sc_orientation: cosipy.spacecraftfile.SpacecraftFile - Contains the information of the orientation: timestamps (astropy.Time) and attitudes (scoord.Attitude) that describe - the spacecraft for the duration of the data included in the analysis - nuisance_param: astromodels.core.parameter.Parameter - Background parameter (optional) - coordsys: str - Coordinate system ('galactic' or 'spacecraftframe') to perform fit in, which should match coordinate system of data - and background. This only needs to be specified if the binned data and background do not have a coordinate system - attached to them - """ + """ + COSI 3ML plugin + + Parameters + ---------- + name : str + Plugin name e.g. "cosi". Needs to have a distinct name with respect to other plugins in the same analysis + dr : Path + Path to full detector response + data: histpy.Histogram + Binned data. Note: Eventually this should be a cosipy data class + bkg: histpy.Histogram + Binned background model. Note: Eventually this should be a cosipy data class + sc_orientation: cosipy.spacecraftfile.SpacecraftFile + Contains the information of the orientation: timestamps (astropy.Time) and attitudes (scoord.Attitude) that describe + the spacecraft for the duration of the data included in the analysis + nuisance_param: astromodels.core.parameter.Parameter + Background parameter (optional) + coordsys: str + Coordinate system ('galactic' or 'spacecraftframe') to perform fit in, which should match coordinate system of data + and background. This only needs to be specified if the binned data and background do not have a coordinate system + attached to them + """ + + def __init__(self, name, dr, data, bkg, sc_orientation, nuisance_param=None, coordsys=None, **kwargs): # create the hash for the nuisance parameters. We have none for now. self._nuisance_parameters = collections.OrderedDict() diff --git a/docs/api/data_io.rst b/docs/api/data_io.rst new file mode 100644 index 00000000..f613a242 --- /dev/null +++ b/docs/api/data_io.rst @@ -0,0 +1,11 @@ +Data IO +======= + +Module +------ + +.. automodule:: cosipy.data_io + :imported-members: + :members: + :undoc-members: + diff --git a/docs/api/image_deconvolution.rst b/docs/api/image_deconvolution.rst new file mode 100644 index 00000000..b2c43491 --- /dev/null +++ b/docs/api/image_deconvolution.rst @@ -0,0 +1,7 @@ +Image deconvolution +=================== + +.. automodule:: cosipy.image_deconvolution + :imported-members: + :members: + :undoc-members: diff --git a/docs/api/index.rst b/docs/api/index.rst index bde41e45..a9d026e8 100644 --- a/docs/api/index.rst +++ b/docs/api/index.rst @@ -7,3 +7,6 @@ API response coordinates + data_io + threeml + image_deconvolution diff --git a/docs/api/threeml.rst b/docs/api/threeml.rst new file mode 100644 index 00000000..a2406af8 --- /dev/null +++ b/docs/api/threeml.rst @@ -0,0 +1,10 @@ +COSILike +======== + +ThreeML plugin + +.. automodule:: cosipy.threeml + :imported-members: + :members: + :undoc-members: +