Skip to content

NEW: remove ionospheric scatter or remove ground scatter#442

Open
carleyjmartin wants to merge 2 commits into
developfrom
enh/plot-only-gs
Open

NEW: remove ionospheric scatter or remove ground scatter#442
carleyjmartin wants to merge 2 commits into
developfrom
enh/plot-only-gs

Conversation

@carleyjmartin
Copy link
Copy Markdown
Collaborator

Scope

This PR allows a quick way to plot only ionospheric scatter (no ground scatter) or only ground scatter (no ionospheric scatter).

issue: #441

Approval

Number of approvals: 2

Test

matplotlib version: 3.10.8
Note testers: please indicate what version of matplotlib you are using

import pydarn
import matplotlib.pyplot as plt

# Read in FITACF data
data, _ = pydarn.read_fitacf('/home/carleyjm/data/fitacf/2025/01/20250101.1000.00.sas.a.fitacf.bz2')

# Range Time Plot Tests
fig, ax = plt.subplots(4,1, figsize=[10,12])
plt.subplots_adjust(hspace=0.45)

# Plot grey range time plot
pydarn.RTP.plot_range_time(data, ax=ax[0], parameter='v', beam_num=7, groundscatter=True, ymax=1000, zmin=-200, zmax=200)
ax[0].set_title('Grey Ground Scatter')
#plt.show()

# Plot data for ground scatter range time plot
pydarn.RTP.plot_range_time(data,  ax=ax[1], parameter='v', beam_num=7, groundscatter=False, ymax=1000, zmin=-200, zmax=200)
ax[1].set_title('All data')
#plt.show()

# Plot only ionospheric scatter range time plot
pydarn.RTP.plot_range_time(data,  ax=ax[2], parameter='v', beam_num=7, remove_ground_scatter=True, ymax=1000, zmin=-200, zmax=200)
ax[2].set_title('Only Ionospheric Scatter')
#plt.show()

# Plot only ground scatter range time plot
pydarn.RTP.plot_range_time(data,  ax=ax[3], parameter='v', beam_num=7, groundscatter=False, ymax=1000, zmin=-200, zmax=200, remove_iono_scatter=True)
ax[3].set_title('Only Ground Scatter')
plt.savefig('/home/carleyjm/scripts/1.png')
plt.close()

# Range Time Plot Tests
fig, ax = plt.subplots(4,1, figsize=[10,12])
plt.subplots_adjust(hspace=0.45)

# Plot grey range time plot
pydarn.RTP.plot_coord_time(data, ax=ax[0], parameter='w_l', beam_num=7, ymax = 70, zmin=0, zmax=240, groundscatter=True)
ax[0].set_title('Grey Ground Scatter')
#plt.show()

# Plot data for ground scatter range time plot
pydarn.RTP.plot_coord_time(data,  ax=ax[1], parameter='w_l', beam_num=7, ymax = 70, zmin=0, zmax=240, groundscatter=False)
ax[1].set_title('All data')
#plt.show()

# Plot only ionospheric scatter range time plot
pydarn.RTP.plot_coord_time(data,  ax=ax[2], parameter='w_l', beam_num=7, ymax = 70, zmin=0, zmax=240, remove_ground_scatter=True)
ax[2].set_title('Only Ionospheric Scatter')
#plt.show()

# Plot only ground scatter range time plot
pydarn.RTP.plot_coord_time(data,  ax=ax[3], parameter='w_l', beam_num=7, ymax = 70, zmin=0, zmax=240, groundscatter=False, remove_iono_scatter=True)
ax[3].set_title('Only Ground Scatter')
plt.savefig('/home/carleyjm/scripts/2.png')
plt.close()

# Error testing
#pydarn.RTP.plot_range_time(data, parameter='v', beam_num=7, groundscatter=True, remove_iono_scatter=True)
#pydarn.RTP.plot_coord_time(data, parameter='v', beam_num=7, groundscatter=True, remove_iono_scatter=True)
#pydarn.RTP.plot_summary(data, groundscatter=True, remove_iono_scatter=True)


# Summary Plot Test
# Only ground scatter
pydarn.RTP.plot_summary(data, beam_num=7, ymax=1000, remove_iono_scatter=True, groundscatter=False)
plt.title('Only Ground scatter')
plt.savefig('/home/carleyjm/scripts/3.png')
plt.close()

# Only Ionospheric scatter
pydarn.RTP.plot_summary(data, beam_num=7, ymax=1000, remove_ground_scatter=True)
plt.title('Only Ionopheric Scatter')
plt.savefig('/home/carleyjm/scripts/4.png')
plt.close()


# Fan Plot Test
# Greyed out Velocities
pydarn.Fan.plot_fan(data, scan_index=50, groundscatter=True, parameter='v', lowlat=60, coastline=True)
plt.title('Grey Ground scatter')
plt.savefig('/home/carleyjm/scripts/5.png')
plt.close()

# All data 
pydarn.Fan.plot_fan(data, scan_index=50, groundscatter=False, parameter='v', lowlat=60, coastline=True)
plt.title('All data')
plt.savefig('/home/carleyjm/scripts/6.png')
plt.close()

# Only ground scatter
pydarn.Fan.plot_fan(data, scan_index=50, groundscatter=False, parameter='v', lowlat=60, coastline=True, remove_iono_scatter=True)
plt.title('Only Ground Scatter')
plt.savefig('/home/carleyjm/scripts/7.png')
plt.close()

# Only ionosphere
pydarn.Fan.plot_fan(data, scan_index=50, groundscatter=False, parameter='v', remove_ground_scatter=True, lowlat=60, coastline=True)
plt.title('Only Ionospheric Scatter')
plt.savefig('/home/carleyjm/scripts/8.png')
plt.close()
1 2 3 4 5 6 7 8

@carleyjmartin carleyjmartin linked an issue Apr 20, 2026 that may be closed by this pull request
4 tasks
@carleyjmartin carleyjmartin added the enhancement New feature or request label Apr 20, 2026
@carleyjmartin carleyjmartin self-assigned this Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NEW: Plotting ionospheric scatter or groundscatter without the other

1 participant