Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation update #175

Merged
merged 45 commits into from
Mar 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
fc8b327
Updates to example.rst - #153
jklenzing Feb 22, 2019
b0e5174
tidy up demos for consistency
jklenzing Feb 22, 2019
5c0b5d3
update
jklenzing Feb 22, 2019
494a96d
test
jklenzing Feb 22, 2019
ecada67
update to style
jklenzing Feb 22, 2019
de61aa7
fix
jklenzing Feb 22, 2019
dbd0c9b
fix
jklenzing Feb 22, 2019
4219722
Update examples.rst
aburrell Feb 22, 2019
0d0f9d5
Update examples.rst
jklenzing Feb 23, 2019
951dd94
Update new_instrument.rst
jklenzing Feb 23, 2019
1e344ea
fix for #69
jklenzing Feb 23, 2019
6c6223b
spellcheck and pep8
jklenzing Feb 23, 2019
e0b634d
fix for #94
jklenzing Feb 24, 2019
1de966f
tweak to format
jklenzing Feb 24, 2019
3fe9cc5
format fix
jklenzing Feb 24, 2019
663678e
pep8
jklenzing Feb 24, 2019
fe7de84
style
jklenzing Feb 24, 2019
5e3bdc5
Merge branch 'develop' into documentation
jklenzing Feb 24, 2019
151ef38
format
jklenzing Feb 24, 2019
5c2f3cc
format
jklenzing Feb 24, 2019
2dc0b04
revert example to code
jklenzing Feb 24, 2019
761b919
update to 3.6
jklenzing Feb 24, 2019
7b86b74
link to full example
jklenzing Feb 24, 2019
c63176a
scrub
jklenzing Feb 24, 2019
1522102
update figure
jklenzing Feb 24, 2019
8f70e1a
test
jklenzing Feb 24, 2019
fba224e
python style
jklenzing Feb 24, 2019
365385e
ipython style
jklenzing Feb 24, 2019
b6e710d
update cosmic and ivm ssnl demo
jklenzing Feb 24, 2019
934dd2b
update link
jklenzing Feb 24, 2019
4e5927a
fix link format
jklenzing Feb 24, 2019
61d099d
link
jklenzing Feb 24, 2019
444c92d
update examples
jklenzing Feb 24, 2019
78963c5
style
jklenzing Feb 25, 2019
3c52113
updates to new_instrument.rst
jklenzing Feb 25, 2019
2247635
typo
jklenzing Feb 26, 2019
bba9f07
Merge branch 'develop' into documentation
jklenzing Mar 1, 2019
d78862e
Merge branch 'documentation' of https://github.com/rstoneback/pysat i…
jklenzing Mar 1, 2019
67de470
formatting
jklenzing Mar 1, 2019
022f080
formatting
jklenzing Mar 1, 2019
6cacaa9
post-review comments
jklenzing Mar 1, 2019
6aafc89
format
jklenzing Mar 1, 2019
a81dd25
format
jklenzing Mar 1, 2019
ba41853
Merge branch 'develop' into documentation
jklenzing Mar 2, 2019
267b79f
Merge branch 'documentation' of https://github.com/rstoneback/pysat i…
jklenzing Mar 2, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions demo/cnofs_vefi_dc_b_orbit_plots.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
'''
"""
Demonstrates iterating over an instrument data set by orbit and plotting the
results.
'''
"""

import os
import pysat
import matplotlib.pyplot as plt
import pandas as pds

# set the directory to save plots to
results_dir = ''
Expand All @@ -18,8 +17,8 @@
clean_level=None, orbit_info=orbit_info)

# set limits on dates analysis will cover, inclusive
start = pds.datetime(2010, 5, 9)
stop = pds.datetime(2010, 5, 12)
start = pysat.datetime(2010, 5, 9)
stop = pysat.datetime(2010, 5, 12)

# if there is no vefi dc magnetometer data on your system, then run command
# below where start and stop are pandas datetimes (from above)
Expand Down Expand Up @@ -79,5 +78,6 @@
ax[6].set_xlim((0, 360))

f.tight_layout()
plt.savefig(os.path.join(results_dir, 'orbit_%05i.png' % orbit_count))
plt.savefig(os.path.join(results_dir,
'orbit_{num:05}.png').format(num=orbit_count))
plt.close()
8 changes: 4 additions & 4 deletions demo/cosmic_and_ivm_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def geo2mag(incoord):
r = 1.0

# convert first to radians
lon, lat = [x*pi/180 for x in lon, lat]
lon, lat = [x*pi/180 for x in [lon, lat]]

glat = incoord[0] * pi / 180.0
glon = incoord[1] * pi / 180.0
Expand Down Expand Up @@ -273,15 +273,15 @@ def addTopsideScaleHeight(cosmic):
cbar.set_label('Scale Height (km)')
axarr[3].set_xlabel('Apex Longitude')
f.tight_layout()
f.savefig('1D_params.png')
f.savefig('ssnl_median_ivm_cosmic_1d.png')


# make COSMIC profile plots
# 6 pages of plots, 4 plots per page
for k in np.arange(6):
f, axarr = plt.subplots(4, sharex=True, figsize=(8.5, 11))
# iterate over a group of four sectors at a time (4 plots per page)
for (j, sector) in enumerate(zip(*cosmicResults['profiles']['median'])
for (j, sector) in enumerate(list(zip(*cosmicResults['profiles']['median']))
[k * 4:(k + 1) * 4]):
# iterate over all local times within longitude sector
# data is returned from the median routine in plot order, [y, x]
Expand Down Expand Up @@ -309,4 +309,4 @@ def addTopsideScaleHeight(cosmic):
axarr[-1].set_xticks([0., 6., 12., 18., 24.])
axarr[-1].set_xlabel('Solar Local Time of Profile Maximum Density')
f.tight_layout()
f.savefig('cosmic_part%i' % (k))
f.savefig('cosmic_part{}.png'.format(k))
17 changes: 8 additions & 9 deletions demo/ssnl_occurrence_by_orbit.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
'''
"""
Demonstrates iterating over an instrument data set by orbit and determining
the occurrent probability of an event occurring.
'''
"""

import os
import pysat
import matplotlib.pyplot as plt
import pandas as pds
import numpy as np

# set the directory to save plots to
Expand All @@ -19,7 +18,7 @@
clean_level=None, orbit_info=orbit_info)


# define functino to remove flagged values
# define function to remove flagged values
def filter_vefi(inst):
idx, = np.where(vefi['B_flag'] == 0)
vefi.data = vefi.data.iloc[idx]
Expand All @@ -28,8 +27,8 @@ def filter_vefi(inst):

vefi.custom.add(filter_vefi, 'modify')
# set limits on dates analysis will cover, inclusive
start = pds.datetime(2010, 5, 9)
stop = pds.datetime(2010, 5, 15)
start = pysat.datetime(2010, 5, 9)
stop = pysat.datetime(2010, 5, 15)

# if there is no vefi dc magnetometer data on your system, then run command
# below where start and stop are pandas datetimes (from above)
Expand Down Expand Up @@ -60,13 +59,13 @@ def filter_vefi(inst):
plt.colorbar(im, ax=axarr[0], label='Occurrence Probability')

im = axarr[1].pcolor(ans['bin_x'], ans['bin_y'], ans['count'])
axarr[1].set_title('Number of Orbits in Bin')
axarr[1].set_xlabel('Longitude')
axarr[1].set_xticks((0, 60, 120, 180, 240, 300, 360))
axarr[1].set_xlim((ans['bin_x'][0], ans['bin_x'][-1]))
axarr[1].set_ylabel('Latitude')
axarr[1].set_title('Number of Orbits in Bin')

plt.colorbar(im, ax=axarr[1], label='Counts')

f.tight_layout()
plt.show()
plt.savefig(os.path.join(results_dir, 'ssnl_occurrence_by_orbit_demo'))
plt.close()