Skip to content

Request: option to recover the fitted flux, flux error, etc. in a TS map #473

@israelmcmc

Description

@israelmcmc

The TS map computes the best fit flux for each pixel (given a spectral shape). This information is returned by the solver pixe-by-pixel:

def _fit_one_direction(self, source,
data_cds_array, bkg_model_cds_array,
psr_cache):
"""
Perform a TS fit of data for a single source direction
Parameters
----------
source : np.ndarray
source direction as Cartesian 3-vector
data_cds_array : numpy.ndarray
The flattened Compton data space (CDS) array of the data.
bkg_model_cds_array : numpy.ndarray
The flattened Compton data space (CDS) array of the
background model.
psr_cache : PSRCache
Cache to retrieve PSR for source direction
Returns
-------
result of TS fitting:
[ts value, norm, norm_err, failed, # iterations]

but is then lost, since we only recover the TS:

self._fit_one_direction(source,
data_cds_array,
bkg_model_cds_array,
psr_cache)[0]

It would be nice for the user to obtain array for the rest of the value: norm, norm_err, failed, # iterations. This result can be output based on an optional flag in fit()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions