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

Major refactor of acf.py #359

Merged
merged 3 commits into from
Dec 18, 2023
Merged

Major refactor of acf.py #359

merged 3 commits into from
Dec 18, 2023

Conversation

RemingtonRohel
Copy link
Collaborator

@RemingtonRohel RemingtonRohel commented Dec 15, 2023

Scope

  • Changed all classmethods to staticmethods
  • Created staticmethod plot_acf_param() to handle plotting of values, which is called within plot_acfs() as needed to plot real, imaginary, power, and phase of ACF
  • Return all axes from plot_acfs() as list
  • Plot real and imaginary ACF values on input ax to plot_acfs() if pwr_and_phs False, otherwise use plt.gca()
  • Removed some unnecessary internal variables in plot_acfs().
  • Proper handling of markers for blanked lags, taking into consideration if marker is a filled marker or not

issue: N/A

Approval

Number of approvals: 1

Test

matplotlib version: 3.7.2

Try running the tutorial from https://pydarn.readthedocs.io/en/main/user/acf/, and using as many of the optional arguments as you can.

@RemingtonRohel RemingtonRohel added the enhancement New feature or request label Dec 15, 2023
* Changed all classmethods to staticmethods
* Created staticmethod plot_acf_param() to handle plotting of values, which is called within plot_acfs() as needed to plot real, imaginary, power, and phase of ACF
* Return all axes from plot_acfs() as list
* Plot real and imaginary ACF values on input ax to plot_acfs() if plot_pwr_and_phs False, otherwise use plt.gca()
* Removed some unnecessary internal variables in plot_acfs().
* The returned phase array from plot_acfs() now also returns values in radians.
@RemingtonRohel
Copy link
Collaborator Author

Made another commit as I realized I had inadvertently changed the phase plotting to plot in radians. It is now back to plotting in degrees.

Copy link
Collaborator

@carleyjmartin carleyjmartin left a comment

Choose a reason for hiding this comment

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

Other than the tiny error, looks great for everything else.

pydarn/plotting/acf.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@carleyjmartin carleyjmartin left a comment

Choose a reason for hiding this comment

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

Tested with various combos of values for:

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

#reader = pydarn.SuperDARNRead("/Users/carley/Documents/data/20140105.1208.03.rkn.rawacf")
reader = pydarn.SuperDARNRead("/Users/carley/Documents/data/20180520.0801.00.lyr.rawacf")
data = reader.read_rawacf()
plt.figure(figsize=(12, 7))
rtn = pydarn.ACF.plot_acfs(data, beam_num=5, gate_num=12, normalized=True,
                start_time=datetime(2018, 5, 20, 9, 0), pwr_and_phs=True,
                plot_blank=True)
print(rtn)
plt.show()

All worked well and plots are correct.

@carleyjmartin carleyjmartin merged commit 457bc35 into develop Dec 18, 2023
@carleyjmartin carleyjmartin deleted the acf_plot_refactor branch December 18, 2023 17:55
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.

2 participants