chianti-atomic / ChiantiPy

ChiantiPy is a python package to calculate the radiative properties of astrophysical plasmas based on the CHIANTI atomic database
64 stars 31 forks source link

Unexpected behavior when setting minAbund lower than lowest abund #377

Closed MadFisa closed 2 years ago

MadFisa commented 2 years ago

Hi, As the title suggests, if minAbund is less than min of abundances, a message appears telling that no ions were selected. The problem seems to be the following lines:

https://github.com/chianti-atomic/ChiantiPy/blob/7605314ef1858825813389ead9675069d53d6d35/ChiantiPy/base/_SpecTrails.py#L44-L46

which sets minAbund to minAbundAll which has type np.float64. This causes the following check to fail https://github.com/chianti-atomic/ChiantiPy/blob/7605314ef1858825813389ead9675069d53d6d35/ChiantiPy/base/_SpecTrails.py#L184

which results in no ions getting selected.

I believe this can be fixed by changing the problematic line tominAbund = float(minAbundAll). Hope this helps to fix the bug.

Asif

kdere commented 2 years ago

I will check this out Ken

kdere commented 2 years ago

Yes, your fix does the job. Am working on a new release and this will be in it. thanks, Ken

MadFisa commented 2 years ago

I believe this was fixed with the latest update (0.14.0). Closing the issue.