PrincetonUniversity / SPEC

The Stepped-Pressure Equilibrium Code, an advanced MRxMHD equilibrium solver.
https://princetonuniversity.github.io/SPEC/
GNU General Public License v3.0
25 stars 6 forks source link

py_spec Poincare is 3-dimensional #96

Closed smiet closed 4 years ago

smiet commented 4 years ago

When I read in a h5 file using py_spec, I get a 3-dimensional array. @jonathanschilling

Import py_spec
spec = py_spec.SPEC('myfile.h5')
np.shape(spec.poincare.R)
Out[15]: (26, 1000, 24)

It looks like the step where we splice the arrays to retain only the successfull Poincare integrations is unsuccessfull (in read_spec.py):

            if hasattr(self, 'poincare'):
                            # remove unsuccessful Poincare trajectories
                self.poincare.R = self.poincare.R[self.poincare.success == 1, :, :]
                self.poincare.Z = self.poincare.Z[self.poincare.success == 1, :, :]
                self.poincare.t = self.poincare.t[self.poincare.success == 1, :, :]
                self.poincare.s = self.poincare.s[self.poincare.success == 1, :, :]

I don't know exactly what form poincare.R and Z are read in, so @jonathanschilling, can you have a look to see what it should be?

jonathanschilling commented 4 years ago

@smiet So far this behavior was intended: the first dimensions is over all radial grid points, and the other directions are poloidal and toroidal. I tried to illustrate this on slide 5 in 20190723_Schilling.pdf, which you find in the slides from previous SPEC zoom meetings.

smiet commented 4 years ago

That is purely a goof on my behalf. Closing the issue and going to sit in my corner of shame :).