hzovaro / spaxelsleuth

A package for analysing data from large integral field unit surveys such as the SAMI and Hector Galaxy Surveys.
MIT License
1 stars 1 forks source link

Fix bugs/issues in metallicity.py #29

Closed hzovaro closed 11 months ago

hzovaro commented 11 months ago

There are currently a few (relatively minor) issues with the implementation of strong-line gas-phase metallicity diagnostics:

hzovaro commented 11 months ago

In a number of diagnostics there are finite metallicity measurements when the associated line ratios are outside the range of acceptable values.

I think I know what's happening - when errors are computed via the MC routine, if the line ratio is just outside the acceptable bounds, then during some of the random iterations it's bound to jump back into within the acceptable range, in which case a finite metallicity is returned. In this case the final value will be the average of these "valid" values & will therefore be finite even though the line ratio in the DataFrame is in the invalid data range.

The question is, is this desired behaviour? Or do we not want to calculate metallicities for these spaxels at all?

Possible ways to deal with this:

hzovaro commented 11 months ago

I have addressed the above issue by setting a threshold 50% fraction of NaN values below which metallicity/ionisation parameter measurements will be discarded.

hzovaro commented 11 months ago

In R23_KK04, there are points with R23 ratios lying far above the polynomial curves near the upper/lower branch division.

This issue was resolved by setting the 50% NaN threshold as above.

There appears to be a bug in the implementation of the Rcal/Scal diagnostics such that spaxels are being incorrectly assigned to upper and lower branches.

This was a simple typo and has now been fixed.

hzovaro commented 11 months ago

Checking functional forms, limits, etc:

hzovaro commented 11 months ago

Repeatability has been tested (see attached). In general, repeatability is very good - well within 0.01 dex when 1000 MC iterations are used. metallicity_repeatability.pdf