EHN: Add embargo watermark and message to FITACF plotting methods #355
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
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:
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