Code Monkey home page Code Monkey logo

Comments (2)

cosimoNigro avatar cosimoNigro commented on July 20, 2024

@huangylei, thanks a lot for reporting this.
I will make a fix soon.

Do you have a snippet to show the issue you are reporting?
The interpolated values are checked against the original table values in the tests, so I am surprised by this.

Thanks again.

from agnpy.

huangylei avatar huangylei commented on July 20, 2024

I used the table that Saldana-Lopez provided, and compared it with the result by agnpy. They are different. (Unfortunately
I cannot find the code)

I checked the function load_absorption_table into:

def load_absorption_table(self):
        """load the reference values from the table file to be interpolated later"""
        f = fits.open(self.model_file)
        self.energy_ref = (
            np.sqrt(f["ENERGIES"].data["ENERG_LO"] * f["ENERGIES"].data["ENERG_HI"])
            * u.keV
        )
        # Franceschini file has two columns repeated, eliminate them
        if self.model == "franceschini":
            self.z_ref = np.unique(f["SPECTRA"].data["PARAMVAL"])
            self.values_ref = np.unique(f["SPECTRA"].data["INTPSPEC"], axis=0)
        else:
            self.z_ref = f["SPECTRA"].data["PARAMVAL"]
            self.values_ref = f["SPECTRA"].data["INTPSPEC"]

It worked and perfectly match the result that Saldana-Lopez provided. After this change, the aborption should be:

截屏2023-05-23 17 10 19

from agnpy.

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.