mattkjames7 / PyGeopack

Wrapper for geopack-08 used for the Tsyganenko magnetic field models
GNU General Public License v3.0
11 stars 2 forks source link

Returning empty trace field #3

Closed TeriForey closed 4 years ago

TeriForey commented 4 years ago

Hi Matt,

I'm trying to get the trace field based on some Ephemeris data that Jenny Carter sent me, the file looks like this:

       Time (UTCG)              x (km)           y (km)           z (km)       Derivative x (km/sec)    Derivative y (km/sec)    Derivative z (km/sec)
------------------------    -------------    -------------    -------------    ---------------------    ---------------------    ---------------------
31 Dec 2023 00:00:00.000      1633.377226     -5003.389375    -10079.799752                 1.838226                -6.872110                 3.709038

I believe it the coordinates are in GSE based on the filename. Taking that first row of data I've tried calculating the trace field but I'm not getting any results back.

T = gp.TraceField(1633.38, -5003.39, -10079.8, 20231231, 0.0, CoordIn='GSE')
T.__dict__
{'n': 1,
 'nstep': 0,
 'x': array([], dtype=float64),
 'y': array([], dtype=float64),
 'z': array([], dtype=float64),
 'Bx': array([], dtype=float64),
 'By': array([], dtype=float64),
 'Bz': array([], dtype=float64),
 's': array([], dtype=float64),
 'R': array([], dtype=float64),
 'Rnorm': array([], dtype=float64),
 'GlatN': nan,
 'GlatS': nan,
 'MlatN': nan,
 'MlatS': nan,
 'GlonN': nan,
 'GlonS': nan,
 'MlonN': nan,
 'MlonS': nan,
 'GltN': nan,
 'GltS': nan,
 'MltN': nan,
 'MltS': nan,
 'Lshell': nan,
 'MltE': nan,
 'FlLen': nan}

I spoke to Jenny about this and she suggested I use some additional model parameters, so I ran

T = gp.TraceField(row.x, row.y, row.z, date, ut, CoordIn='GSE', Pdyn=5.0, By=10.0, Bz=10.0, tilt=0.0, Vx=-400.0, Vy=0.0, Vz=0.0)

but still returned an empty object with no values.

Have you any idea what's happening here?

Thanks!

-- edit: I've tried this on several other rows of data and they all return an empty object too

mattkjames7 commented 4 years ago

Hello Teri, At a first glance this looks like normal behaviour; the functions expect input coordinates in units of RE rather than km, so it thinks that point you have asked it to trace from is outside of the model magnetopause. The nans are output either when the trace is started outside the magnetopause, or if the field line is considered to be open (in this case you would get finite values for the one end which actually connects to the ionosphere). Hope that helps! Cheers, Matt.

TeriForey commented 4 years ago

Thanks Matt, I see that in the documentation now - I must have missed it on my first read through!