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

EHN: Add embargo watermark and message to FITACF plotting methods #355

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

carleyjmartin
Copy link
Collaborator

Scope

This PR adds a watermark to data that is less than a year old and has a negative CPID (run in discretionary time) to methods that plot FITACF data (RTP and Fan). The code also checks to see if there is already an embargoed watermark or not so we don't keep plotting it over the top of the original one on summary plots or on multi-fan plots.
It is noted that for the first year or so while we move from all discretionary time having -cpid to only embargoed data having -cpid this might pop up quite a lot.
The wording of the watermark or message may be changed to align with RST when it's decided, this PR is to check that the logic is working. I was unable to include the file name to the warning message as the plotting methods do not have access to the file reading methods.

issue: will close #330

Approval

Number of approvals: 2 (but make sure either Carley or Bharat merges to make sure the wording is finalized!)

Test

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

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

file ="/Users/carley/Documents/data/20230808.1406.00.pgr.a.fitacf"
SDarn_read = pydarn.SuperDARNRead(file)
fitacf_data = SDarn_read.read_fitacf()

a = pydarn.RTP.plot_time_series(fitacf_data, beam_num=5)
plt.show()
a = pydarn.RTP.plot_range_time(fitacf_data, beam_num=5)
plt.show()
a = pydarn.RTP.plot_summary(fitacf_data, beam_num=5, watermark=False)
plt.show()
a = pydarn.Fan.plot_fan(fitacf_data, coastline=True)
plt.show()

You will need data from the last year with -ve CPID to test the watermark and message. Below is a PGR discretionary time data from last month to test if need be. Please test with your own data that is older or +ve CPID and you should find it plots as normal with no watermark or message. The above code will produce:
Screenshot 2023-09-14 at 10 32 03 AM
Screenshot 2023-09-14 at 10 32 13 AM
Screenshot 2023-09-14 at 10 32 26 AM
Screenshot 2023-09-14 at 10 32 40 AM

With the message in command line reading:
UserWarning: The data you are using is under embargo. Please contact the principal investigator of the Prince George radar for authorization to use the data

20230808.1406.00.pgr.a.fitacf.bz2.zip

@carleyjmartin carleyjmartin mentioned this pull request Nov 13, 2023
27 tasks
@carleyjmartin carleyjmartin self-assigned this Jan 29, 2024
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.

Discussion: Add warning to data <1 year old with -ve CPID
1 participant