keflavich / pyradex

Python interface to RADEX
BSD 3-Clause "New" or "Revised" License
19 stars 12 forks source link

Inconsistent / strange results on Ubuntu 18.04 #30

Open keflavich opened 4 years ago

keflavich commented 4 years ago

cc @low-sky

We have an issue where RADEX is producing nonsense results and crashing on ubuntu, but not on mac, for identical inputs.

import pyradex
R = pyradex.Radex(collider_densities={'oH2':0,'pH2':10000}, column=1e14, species='p-nh3', temperature=15, escapeProbGeom='lvg')
R(collider_densities={'oH2':0,'pH2':10000}, column=1e14, species='p-nh3', temperature=15, )

results in

 ***MESSAGE FROM ROUTINE SGEIR IN LIBRARY SLATEC.
 ***POTENTIALLY RECOVERABLE ERROR, PROG ABORTED, TRACEBACK REQUESTED
 *  SINGULAR MATRIX A - NO SOLUTION
 *  ERROR NUMBER = -4
 *
 ***END OF MESSAGE

 ***JOB ABORT DUE TO UNRECOVERED ERROR.
0          ERROR MESSAGE SUMMARY
 LIBRARY    SUBROUTINE MESSAGE START             NERR     LEVEL     COUNT
 SLATEC     SGEIR      SINGULAR MATRIX A -         -4         1         1
dkvieira commented 4 years ago

I have been having this same issue running Ubuntu 16.04. Is there a workaround available?

keflavich commented 4 years ago

No, we couldn't figure out what was causing it! Any insights you can offer would be very welcome. Maybe try different compilers?

dkvieira commented 4 years ago

I did manage to avoid the singular matrix error by editing line 952 of core.py:

frac_level_diff = level_diff/self.level_population

Here there was a divide by zero problem as self.level_population had a number of elements equal to zero (which may be part of the original problem). I removed the elements equal to zero and got some output but it did not match the example output provided on this site for the following input:

R = pyradex.Radex(collider_densities={'oH2':900,'pH2':100}, column=1e16, species='co', temperature=20)
Tlvg = R(escapeProbGeom='lvg')

So in short I am still having major problems with it.