Bug description short
If the data is not great, FIDASIM will fail to identify the COCOS
Long description
Cocos is identified using the pressure derivative in the core sigma_Bp_in = -1 * np.sign(g['pprime'][0] * g['current']) (Line 912 of efit/io.py
But it can happen for some g files from TRANSP that due to numerical precision, the sign of this pprime in the core is wrong (at the end of the day, is a quantity which could be close to zero, numerical errors are easy). This causes the code to identify wrongly the cocos and have the wrong Br and Bz signs
Proposed solution
Calculate this sign uising the first and the second cells, if they yield different values, raise and exception so the user can know and check the Gfile or at least take the second (lest likely to be affected by this numerical error) and print a warning to the user
If you agree I can implement this
Bug description short
If the data is not great, FIDASIM will fail to identify the COCOS
Long description
Cocos is identified using the pressure derivative in the core
sigma_Bp_in = -1 * np.sign(g['pprime'][0] * g['current'])(Line 912 of efit/io.pyBut it can happen for some g files from TRANSP that due to numerical precision, the sign of this
pprimein the core is wrong (at the end of the day, is a quantity which could be close to zero, numerical errors are easy). This causes the code to identify wrongly the cocos and have the wrong Br and Bz signsProposed solution
Calculate this sign uising the first and the second cells, if they yield different values, raise and exception so the user can know and check the Gfile or at least take the second (lest likely to be affected by this numerical error) and print a warning to the user
If you agree I can implement this