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

Adding SURFRAD Capabilities #689

Merged
merged 6 commits into from
Jun 19, 2023
Merged

Adding SURFRAD Capabilities #689

merged 6 commits into from
Jun 19, 2023

Conversation

AdamTheisen
Copy link
Collaborator

@AdamTheisen AdamTheisen commented Jun 19, 2023

  • Tests added
  • Documentation reflects changes
  • PEP8 Standards or use of linter
  • Xarray Dataset or DataArray variable naming follows 'ds' or 'da' naming

@AdamTheisen
Copy link
Collaborator Author

Looks like there are some errors with the PySP2 tests

@mgrover1
Copy link
Collaborator

@AdamTheisen it appears that there is some 0 shaped array being multiplied within the try/except block...

if np.isfinite(base):
            try:
                height = data_fit.max() - base
                pos = np.argmax(data)
            except ValueError:
                height = np.nan
                pos = np.nan
    
            try:
                start = np.where((data - base) < 50)[0]
>               if start == []:
E               ValueError: operands could not be broadcast together with shapes (14,) (0,)

@zssherman
Copy link
Collaborator

Nothing changed within the pysp2 repo itself, hmm so curious why it's failing now

@mgrover1
Copy link
Collaborator

Nothing changed within the pysp2 repo itself, hmm so curious why it's failing now

pysp2 does not currently have a nightly build running/testing with dependencies, so I suspect is has to do with some upstream library cutting a new release

@mgrover1
Copy link
Collaborator

mgrover1 commented Jun 19, 2023

@zssherman I suspect numpy is the culprit here... https://github.com/numpy/numpy/releases/tag/v1.25.0

They cut a new release two days ago, and there are mentions about deprecated masking functionality/changes with array shapes.

@zssherman
Copy link
Collaborator

zssherman commented Jun 19, 2023

@mgrover1 @AdamTheisen Looks like we need a change upstream. So when it checks the start for empty list, check if its a numpy array

try:
    start = np.where((data - base) < 50)[0]
    if start == []:
        start = np.nan

@mgrover1
Copy link
Collaborator

@mgrover1 @AdamTheisen Looks like we need a change upstream. So when it checks the start for empty list, check if its a numpy array

try:
    start = np.where((data - base) < 50)[0]
    if start == []:
        start = np.nan

Upstream as in pysp2?

@zssherman
Copy link
Collaborator

@mgrover1 I believe so

@AdamTheisen AdamTheisen changed the title Adding SURFRAD Capabilitiys Adding SURFRAD Capabilities Jun 19, 2023
@mgrover1
Copy link
Collaborator

Ahh the good old method=nearest argument - good catch @AdamTheisen !

@AdamTheisen
Copy link
Collaborator Author

AdamTheisen commented Jun 19, 2023

Ahh the good old method=nearest argument - good catch @AdamTheisen !

Found another issue with the plot and the text showing up as expected while looking so it was a good error to help improve the example! There was also a deprecation warning with the fix I had put in so had to redo that.

Copy link
Collaborator

@mgrover1 mgrover1 left a comment

Choose a reason for hiding this comment

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

@AdamTheisen - does their documentation include anything about the standard_name for the variables? I think that would be helpful include here if that is the case.

@AdamTheisen
Copy link
Collaborator Author

AdamTheisen commented Jun 19, 2023

@AdamTheisen - does their documentation include anything about the standard_name for the variables? I think that would be helpful include here if that is the case.

The only documentation they really have is what's in the README file. They don't have anything about standard_names from what I can see.

@mgrover1
Copy link
Collaborator

@AdamTheisen - does their documentation include anything about the standard_name for the variables? I think that would be helpful include here if that is the case.

The only documentation they really have is what's in the README file. They don't have anything about standard_names from what I can see.

Gotcha - any chance you could take a look at this table
https://cfconventions.org/Data/cf-standard-names/current/build/cf-standard-name-table.html

And see which ones would map? One benefit of using a cf-standard name for as many variables as possible is the ability to use tools such as cf-xarray to generically compare different datastreams using these community standards...

@zssherman
Copy link
Collaborator

Looks good to me, tests are now passing!

@mgrover1 mgrover1 merged commit 3c28fe4 into ARM-DOE:main Jun 19, 2023
@AdamTheisen
Copy link
Collaborator Author

Just as a note, I did not get a chance to add in standard names yet. Was hoping to look into that tomorrow

@mgrover1
Copy link
Collaborator

Sounds good - I think that makes sense for separate PR 😄

zssherman pushed a commit to jrobrien91/ACT that referenced this pull request Jun 20, 2023
* ENH: Adding two new examples for heatmap and size distribution plots and made some updates to corresponding functions

* ENH: Copy and paste error.  Updated the title and descriptions

* ENH: Adding SURFRAD capabilities

* ENH: Bug fix for discovery test

* ENH: Updating for bug in testing

* ENH: Bug fixes and improvements to bottom margin
@AdamTheisen AdamTheisen deleted the surfrad branch January 31, 2024 20:13
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.

3 participants