PAHFIT / pahfit

Model Decomposition for Near- to Mid-Infrared Spectroscopy of Astronomical Sources
https://pahfit.readthedocs.io/
19 stars 26 forks source link

PAHFIT takes about ~15 seconds to run on the example M101 Nucleus spectrum in docs #128

Closed Ameek-Sidhu closed 3 years ago

Ameek-Sidhu commented 3 years ago

@karllark PAHFIT is taking about 15 seconds to run the example M101 Nucleus spectrum. It seems like a lot of time to me after we installed the GitHub version of astropy.

karllark commented 3 years ago

Hard to judge. Depends on the computer you are using and the package versions you have installed. Are others seeing this issue? @ThomasSYLai was commenting recently that the fitting was nice and fast now.

Ameek-Sidhu commented 3 years ago

@els1 and @BethanyRS also experienced it to be slower yesterday.

karllark commented 3 years ago

Odd. Can you say what version of astropy you are using? Can be found by "pip list | grep astropy".

els1 commented 3 years ago

I run astropy 4.3.dev737+gfff5ccf46

Ameek-Sidhu commented 3 years ago

'4.3.dev737+gfff5ccf46' is the version I am using

alexmaragko commented 3 years ago

What is the maximum iterations you are using?

karllark commented 3 years ago

This is reasonable. With maxiter=200 I get ~5sec.

(base) [kgordon@grimy pahfit]$ time run_pahfit M101_Nucleus_irs.ipac scipack_ExGal_SpitzerIRSSLLL.ipac --estimate_start --fit_maxiter=200
WARNING: The fit may be unsuccessful; check fit_info['message'] for more information. [astropy.modeling.fitting]
Number of calls to function has reached maxfev = 200.

real    0m5.514s
user    0m5.994s
sys 0m1.025s

And this is what I expect based on the details given in the astropy issue. See https://github.com/astropy/astropy/issues/11314.

For maxiter=1000, I get:

(base) [kgordon@grimy pahfit]$ time run_pahfit M101_Nucleus_irs.ipac scipack_ExGal_SpitzerIRSSLLL.ipac --estimate_start --fit_maxiter=1000
Both actual and predicted relative reductions in the sum of squares
  are at most 0.000000

real    0m12.248s
user    0m13.189s
sys 0m1.562s