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

New Feature: IQ Data Plots #338

Merged
merged 13 commits into from
Dec 14, 2023
Merged

New Feature: IQ Data Plots #338

merged 13 commits into from
Dec 14, 2023

Conversation

carleyjmartin
Copy link
Collaborator

@carleyjmartin carleyjmartin commented Jun 23, 2023

Scope

This PR has a new plotting module for IQ data. There are four types of plots, time-series, single sequence, single record and an overview plot for the IQ data.

Does include documentation changes, but we can test that works when we build the docs before a release.

Anyway, I wasn't really sure what people wanted when they asked to just plot IQ data so if you had different ideas of what was important let me know and we can add it.

Note: chnnum in the data is NOT related to frequency channels used. chnnum is the number of different channels in the IQ data: that means main array and interferometer array (chnnum=2) NOT the frequency channels.

issue: to close #320

Approval

Number of approvals: 2 at least, lots of things

Test

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

If you would like this IQ data please let me know, but I would like if people can test with different data as this file was a bit weird. It only had beams 6-15 and only for 15 minutes. If you have iq data from a radar with different channels being used, please test!

You can plot main array data when interferometer=False, and interferometer data when =True

import pydarn
import matplotlib.pyplot as plt
from datetime import datetime


iq_file = '/Users/carley/Desktop/20160113.1601.00.cly.iqdat'
iq_data = pydarn.SuperDARNRead(iq_file).read_iqdat()

# Use me to test what scalar fields I can plot in time series
print(iq_data[0].keys())

# Plot time series data
pydarn.IQ.plot_time_series(iq_data, beam_num = 7, parameter='tfreq')
plt.show()

# Plot single sequence of IQ data
pydarn.IQ.plot_iq_sequence(iq_data, start_time=datetime(2016,1,13,16,15),
                           beam_num=15, sequence_num = 20,
                           interferometer=False, plot_phase=True)
plt.show()

# Plot IQ data record
pydarn.IQ.plot_iq_record(iq_data, start_time=datetime(2016,1,13,16,0),
                           beam_num=15, interferometer=False)
plt.show()

# Plot IQ data over whole file
pydarn.IQ.plot_iq_overview(iq_data, beam_num='all', interferometer=False)
plt.show()

Should produce:
iq1
iq2
iq3
iq4

Copy link
Collaborator

@RemingtonRohel RemingtonRohel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall I like this a lot! There are some minor things in the code that I think would be good to change, but otherwise I was able to plot some iqdat data very easily.

docs/user/iq.md Outdated Show resolved Hide resolved
docs/user/iq.md Outdated Show resolved Hide resolved
pydarn/plotting/iq.py Show resolved Hide resolved
pydarn/plotting/iq.py Outdated Show resolved Hide resolved
pydarn/plotting/iq.py Outdated Show resolved Hide resolved
pydarn/plotting/iq.py Outdated Show resolved Hide resolved
RemingtonRohel and others added 3 commits November 21, 2023 21:19
* Fixed a bug with raising NoDataFoundError in plotting.py find_record() method
* Using ax parameters in methods of IQ class
* Added some whitespace in parameter default values
@carleyjmartin carleyjmartin merged commit f118c6a into develop Dec 14, 2023
@carleyjmartin carleyjmartin deleted the ehn/iq_plotting branch December 14, 2023 21:49
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.

New Feature: IQ Plotting/Reading
2 participants