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

Run "Filtering on CPUs versus GPUs" with data from pangeo catalog #5

Open
leticiafabre opened this issue Aug 17, 2022 · 9 comments
Open

Comments

@leticiafabre
Copy link
Collaborator

leticiafabre commented Aug 17, 2022

I am running this example but loading the NCAR data from pangeo catalog. Insted of filtering SST I filtered SSH just to test something different. That is what I got until now:

iltered_SSH_test

I think the next step is to select the area before filtering to save computional effort(?)

@paigem
Copy link
Collaborator

paigem commented Aug 17, 2022

This looks amazing @leticiafabre!

Regarding your question - yes, in general it is best to select the region first before computing. But it depends how you wrote your code. If you wrote the code in xarray and only do the computation (or plotting) at the end, then you are already essentially slicing your region before computing.

@NoraLoose
Copy link
Member

Yay, nice work @leticiafabre! 🎉

Have you played around with the filter scale: making it smaller and larger? You could also plot the difference SSH - filtered SSH, which will give you the small scales only (while the filtered SSH gives you the large scales).

@leticiafabre
Copy link
Collaborator Author

Thanks @paigem and @NoraLoose!

I will try change the filter scale and plot the difference SSH - filtered SSH.
Meanwhile, @anaclarabmariani is selecting a different area in the ocean to work in this project

@leticiafabre
Copy link
Collaborator Author

I run with 30km scale and that is the result:

filtered_SSH_test

Is the minimum scale for the filter the size of the grid?

@NoraLoose
Copy link
Member

@leticiafabre look at those pretty plots - yay! 🎉

Another thing you could try is to label the x- and y-axis with longitude and latitude values (rather than nlon and nlat, which are just grid indices).

Is the minimum scale for the filter the size of the grid?

Correct, the minimum scale is the grid scale.

@paigem
Copy link
Collaborator

paigem commented Aug 18, 2022

The POP model doesn't make it super straightforward to plot with lat/lon rather that nlat/nlon. Feel free to give it a try, but we can also make a note to discuss this more during our Zoom call tomorrow! 😊

@anaclarabmariani
Copy link
Collaborator

Here is the figure that I showed you today on the call. I tryed to select the North Tropical Atlantic Region and filtered the 60km scale.
filtered_SSH_test_60km

@NoraLoose
Copy link
Member

Looks awesome @anaclarabmariani 🎉

I have two small comments:

  • If you'd like to allow for more space between the 3 subpanels you can use
plt.subplots_adjust(hspace=0.4) 

before you save the figure, and play around with the value for hspace, see here for more information.

  • I just looked at your notebook, and I think you are using not a filter with a 60km scale but a filter with a factor of 60 (I know it is confusing!). Since the input data is on a 0.1 degree grid, a factor of 60 means that you filter to a scale of 0.1 * 60 = 6 degree. Does this make sense?

@anaclarabmariani
Copy link
Collaborator

anaclarabmariani commented Aug 18, 2022

  • Cool! Thank you, Nora! I'll try to do that!

  • About the filter scale: yes, that makes much more sense! Thank you, I'll work on that too.

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

No branches or pull requests

4 participants