Skip to content

Commit

Permalink
renamed DataLoader -> DataDeconvolutionAlgorithmInterface or DataIF
Browse files Browse the repository at this point in the history
  • Loading branch information
hiyoneda committed Jul 2, 2024
1 parent e0571bb commit 1d5cb62
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 16 deletions.
13 changes: 11 additions & 2 deletions cosipy/image_deconvolution/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
from .data_loader_DC2 import DataLoaderDC2
from .image_deconvolution import ImageDeconvolution, model_classes, deconvolution_algorithm_classes

from .data_deconvolution_algorithm_interface_base import DataDeconvolutionAlgorithmInterfaceBase
from .dataIF_COSI_DC2 import DataIF_COSI_DC2

from .model_base import ModelBase
from .allskyimage import AllSkyImageModel
from .image_deconvolution import ImageDeconvolution

from .deconvolution_algorithm_base import DeconvolutionAlgorithmBase
from .RichardsonLucy import RichardsonLucy
from .RichardsonLucySimple import RichardsonLucySimple

from .exposure_table import SpacecraftAttitudeExposureTable
from .coordsys_conversion_matrix import CoordsysConversionMatrix
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,17 @@
from histpy import Histogram, Axes

from cosipy.response import FullDetectorResponse
from cosipy.data_io import BinnedData
from .coordsys_conversion_matrix import CoordsysConversionMatrix

from .data_loader_base import DataLoaderBase
from .data_deconvolution_algorithm_interface_base import DataDeconvolutionAlgorithmInterfaceBase

class DataLoaderDC2(DataLoaderBase):
class DataIF_COSI_DC2(DataDeconvolutionAlgorithmInterfaceBase):
"""
A subclass of DataLoaderBase for the COSI data challenge 2.
A subclass of DataDeconvolutionAlgorithmInterfaceBase for the COSI data challenge 2.
"""

def __init__(self, name = None):

DataLoaderBase.__init__(self, name)
DataDeconvolutionAlgorithmInterfaceBase.__init__(self, name)

self._image_response = None # histpy.Histogram (dense)

Expand Down Expand Up @@ -52,8 +50,8 @@ def load(cls, name, event_binned_data, dict_bkg_binned_data, rsp, coordsys_conv_
Returns
-------
:py:class:`cosipy.image_deconvolution.DataLoader`
An instance of DataLoader containing the input data set
:py:class:`cosipy.image_deconvolution.DataIF_COSI_DC2`
An instance of DataIF_COSI_DC2 containing the input data set
"""

new = cls(name)
Expand Down Expand Up @@ -103,7 +101,7 @@ def _modify_axes(self):
Modify the axes of data. This method will be removed in the future.
"""

logger.warning("Note that _modify_axes() in DataLoader was implemented for a temporary use. It will be removed in the future.")
logger.warning("Note that _modify_axes() in DataIF_COSI_DC2 was implemented for a temporary use. It will be removed in the future.")

if self._coordsys_conv_matrix is None:
axis_name = ['Em', 'Phi', 'PsiChi']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from abc import ABC, abstractmethod

class DataLoaderBase(ABC):
class DataDeconvolutionAlgorithmInterfaceBase(ABC):
"""
A base class for managing data for image analysis, i.e.,
event data, background models, response, coordsys conversion matrix etc.
Expand Down
2 changes: 1 addition & 1 deletion cosipy/image_deconvolution/deconvolution_algorithm_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class DeconvolutionAlgorithmBase(ABC):
Attributes
----------
initial_model: :py:class:`cosipy.image_deconvolution.ModelMap`
dataset: list of :py:class:`cosipy.image_deconvolution.DataLoader`
dataset: list of :py:class:`cosipy.image_deconvolution.DataDeconvolutionAlgorithmInterfaceBase` or its subclass
parameter : py:class:`yayc.Configurator`
results: list of results
dict_bkg_norm: the dictionary of background normalizations
Expand Down
6 changes: 3 additions & 3 deletions cosipy/image_deconvolution/image_deconvolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ def set_dataset(self, dataset):
Parameters
----------
dataset : list of :py:class:`cosipy.image_deconvolution.DataLoader`
Each data loader contaning an event histogram, a background model, a response matrix, and a coordsys_conversion_matrix.
dataset : list of :py:class:`cosipy.image_deconvolution.DataDeconvolutionAlgorithmInterfaceBase` or its subclass
Each component contaning an event histogram, a background model, a response matrix, and a coordsys_conversion_matrix.
"""

self._dataset = dataset
Expand Down Expand Up @@ -75,7 +75,7 @@ def dataset(self):
@property
def parameter(self):
"""
Return the parameter set to DataLoader.
Return the registered parameter.
"""
return self._parameter

Expand Down

0 comments on commit 1d5cb62

Please sign in to comment.