Skip to content

sort berremann qi's according to (12) #2

@dschick

Description

@dschick

Hi @pyMatJ ,

I am currently checking the GTM core code I stumbled a bit over this code here:

pyGTM/GTM/GTMcore.py

Lines 461 to 477 in 1f62af2

## sort berremann qi's according to (12)
if any(np.abs(np.imag(qsunsorted))):
for km in range(0,4):
if np.imag(qsunsorted[km])>=0 :
transmode[kt] = km
kt = kt + 1
else:
reflmode[kr] = km
kr = kr +1
else:
for km in range(0,4):
if np.real(qsunsorted[km])>0 :
transmode[kt] = km
kt = kt + 1
else:
reflmode[kr] = km
kr = kr +1

Shouldn't the if-else-case be within the for loop .
As I understood it, you need to sort according to the four cases:

  1. complex number with imaginary part >= 0: transmode[0]
  2. real number with >= 0: transmode[1]
  3. complex number with imaginary part < 0: reflmode[0]
  4. real number with < 0: reflmode[1]

Maybe you can check and tell me the idea of the current code.

Thanks

Daniel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions