Skip to content

COCOS identification in the EFIT libraries #283

Description

@JoseRuedaRueda

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions