Skip to content

Point inherits from Profile#25

Open
aburrell wants to merge 6 commits intotimduly4:profilefrom
aburrell:profile
Open

Point inherits from Profile#25
aburrell wants to merge 6 commits intotimduly4:profilefrom
aburrell:profile

Conversation

@aburrell
Copy link

Adapted Point class to inherit from Profile, removing duplicate routine calls.

Secondary adjusts:

  • incorporated write_to_tempdir, so that it doesn't continue to break on my machines
  • added more ignores to .gitignore, to avoid inadvertently adding unwanted files.

Follow updated README to test:

from pyglow.pyglow import Point
import datetime as dt

dn = dt.datetime(2011, 3, 23, 9, 30)
lat = 0.0
lon = -80.0
alt = 250.0

pt = Point(dn, lat, lon, alt)

print "Before running any models:"
print pt

Before running any models:
date and time = 2011-03-23 09:30:00
lat, lon, alt min, max, step (km) = 0.00, -80.00, 250.00, 250.00, 10.00

Geophysical Indices:

                           kp = 2.70
                           ap = 12.00
                         f107 = 104.00
                        f107a = 110.47
                          Dst = nan
                           ae = nan

Model Data Available For:

                         IGRF = False
                          HWM = False
                          IRI = False
                         MSIS = False
                      Airglow = False
pt.run_igrf()
pt.run_hwm93()
pt.run_msis()
pt.run_iri()
pt.run_airglow()

                date and time = 2011-03-23 09:30:00

lat, lon, alt min, max, step (km) = 0.00, -80.00, 250.00, 250.00, 10.00

Geophysical Indices:

                           kp = 2.70
                           ap = 12.00
                         f107 = 104.00
                        f107a = 110.47
                          Dst = nan
                           ae = nan

Model Data Available For:

                         IGRF = 12
                          HWM = 1993
                          IRI = 2016
                         MSIS = 2000
                      Airglow = True
print "After running models:"
pt.flatten()
test_line = "IGRF {:d}:\n(Bx, By, Bz) = ({:.4g}, {:.4g}, {:.4g})\n".format(pt.igrf_version, pt.By, pt.Bx, pt.Bz)
test_line = "{:s}{:>15s}{:.4g}\n".format(test_line, "B = ", pt.B)
test_line = "{:s}{:>15s}{:.4g}\n\n".format(test_line, "dip = ", pt.dip)
test_line = "{:s}{:>15s}{:d}\n".format(test_line, "HWM Version = ", pt.hwm_version)
test_line = "{:s}{:>15s}({:.2f}, {:.2f})\n\n".format(test_line, "(u, v) = ", pt.u, pt.v)
test_line = "{:s}{:>15s}{:d}\n".format(test_line, "IRI Version = ", pt.iri_version)
test_line = "{:s}{:>15s}({:.2f}, {:.4g})\n\n".format(test_line, "(hmF2, NmF2) = ", pt.hmF2, pt.NmF2)
test_line = "{:s}{:>15s}{:d}\n".format(test_line, "MSIS Version = ", pt.msis_version)
test_line = "{:s}{:>15s}{:.4g}\n\n".format(test_line, "Tn = ", pt.Tn_msis)
test_line = "{:s}{:>15s}{:.4g}\n".format(test_line, "Airglow at 6300 = ", pt.ag6300)
test_line = "{:s}{:>15s}{:.4g}".format(test_line, "Airglow at 7774 = ", pt.ag7774)
print test_line

After running models:

IGRF 12:
(Bx, By, Bz) = (2.448e-05, -6.433e-07, -9.925e-06)
B = 2.643e-05
dip = 22.06

HWM Version = 1993
(u, v) = (14.07, 12.18)

IRI Version = 2016
(hmF2, NmF2) = (266.28, 7.869e+04)

MSIS Version = 2000
Tn = 779.9

Airglow at 6300 = 4.032
Airglow at 7774 = 0.00749

aburrell and others added 6 commits January 31, 2017 13:10
When user doesn’t have write permissions in pyglow directory, look for
common linux, windows, and osx temp directory environment variables and
write to these instead.
Merge pull request timduly4#22 from aburrell/profile
Untested update where Point inherits from Profile
Added ignores for *.pyc, *~, mtime_table.pkl, and
geophysical_indices.npy
Tested version of Point, with updated README
@bharding512 bharding512 mentioned this pull request Jul 1, 2019
@bharding512
Copy link
Collaborator

This is a very old PR but it may still be merge-able. It would be great to have a "vectorized" version to work with. Thoughts?

@aburrell
Copy link
Author

aburrell commented May 3, 2023

It'd be good to at least get this off of my fork and into the main repository as a branch. Discussion as to whether or not it should be merged into develop/main could go forward after that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants