Git Product home page Git Product logo

Comments (5)

adonath avatar adonath commented on May 26, 2024

From my experience with TS maps, I think it's a good choice to use brentq in combination with multiprocessing. Sensitivity computation for TS maps is missing as well, I'll open a separate issue for that.

from gammapy.

adonath avatar adonath commented on May 26, 2024

The sensitivity_on_off method does not exist anymore, I think it's functionality was mostly replaced by the SensitivityEstimator class. Closing this issue.

from gammapy.

cdeil avatar cdeil commented on May 26, 2024

@adonath - The issue / task really is still the there, only sensitivity_on_off was renamed excess_matching_significance in the meantime.

Currently we use numpy.vectorize at

_excess_matching_significance_lima = np.vectorize(_excess_matching_significance_lima)
_excess_matching_significance_on_off_lima = np.vectorize(
_excess_matching_significance_on_off_lima
)

and execute all the code for this computation using Python scalar numbers.
I.e. there's a ton of Python overhead - moving to Cython should speed up by ~ 100x
It's the same thing as you have for the TS map computation - there you wrote it in Cython.

It's not a trivial task because currently the implementation is based on scipy.optimize.fsolve - I think that is callable from Cython, but only from the latest Scipy version, i.e. not available for us yet.

@adonath - Up to you if you want to re-open or keep this issue closed. It's certainly not urgent - but some day (can be next year) - this should be implemented in a fast way, and probably code duplication with the TS map code removed (by moving the stats part of that code to gammapy.stats and sharing as much as possible for these 1-dim amplitude fit tasks.

from gammapy.

adonath avatar adonath commented on May 26, 2024

Thanks @cdeil, you are right, I didn't notice the re-name of the function.

I just checked what the SensitivityEstimator does and I doubt a highly optimised version of this code is needed. Computing the minimal excess needed for a given significance for O(~30) energy bins should always be less than one second. The TS map computation does this for O(~1e4-1e6) pixels, which is a completely different magnitude. In the case of the SensitivityEstimator even a "brute-force" grid minimisation (30 energy bins and ~100 bins in flux / excess) with Numpy should be efficient and precise enough.

For me it's rather the question, whether the code should be shared e.g. with the FluxPointsEstimator or be re-written based on SED likelihood profiles, such that we can compute sensitivity curves for 1D and 3D datasets as well. I can make a reminder issue for this.

from gammapy.

cdeil avatar cdeil commented on May 26, 2024

Yes, a faster version would only be needed for sensitivity maps with ~ 1e6 pixels, not sensitivity spectra with @ 10 pixels. I'm not sure how to best avoid code (and test effort) duplication among the various use cases for 1D optimisation within Gammapy. Not high priority, thus the label here was "wishlist".

from gammapy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.