Skip to content

Bad IMF clock angle calculation in geopack t01 model #1329

@jameswilburlewis

Description

@jameswilburlewis

When I used real solar wind parameters for a comparison between IDL and PySPEDAS geopack calculations, the IDL and Python results for the T01 model disagreed by several nT. A bit of trial and error showed that the issue had something to do with the IMF BY and BZ parameters. For some values, IDL and Python agreed; for others, they didn't match. I eventually tracked it down to this code in the geopack t01 routine to calculate the IMF clock angle:

      theta=np.arctan2(byimf,bzimf)
      if theta <= 0: theta = 2*np.pi
 

This replaces theta with 2 pi if it's negative...it should be adding 2 pi.

     if theta <= 0: theta += 2*np.pi

When I made this change locally, the IDL and Python results agreed within the established tolerance. I need to create a PR and hope Sheng Tian can get a patch out quickly.

Metadata

Metadata

Labels

QA/TestingbugSomething isn't workinggeopackField modeling, field line tracing, special coordinate transforms, etc

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions