cherab / solps

Other
6 stars 5 forks source link

Check for presence of DAB2 in MDSplus reading is incorrect #26

Closed jacklovell closed 4 years ago

jacklovell commented 4 years ago

This section of code has a logic error:

# Load the neutral atom density from B2                                                             
dab2 = conn.get('\SOLPS::TOP.SNAPSHOT.DAB2')                                                        
if isinstance(dab2, np.ndarray):                                                                    
    sim._b2_neutral_densities = np.swapaxes(dab2.data(), 0, 2)

The return value of conn.get is an instance of an MDSplus Signal object, not a numpy array. So the neutral density is never assigned here, even though the DAB2 signal exists.

This means later on in the code, the fluid neutral density is used instead of DAB2, despite not being calculated in a self consistent way. Typically this means cherab-solps plasmas have a neutral density which is around 10 orders of magnitude too small.

The logic needs to be fixed to correctly determine if the DAB2 data is in fact present.