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

xarray lecture #283

Merged
merged 27 commits into from
Oct 27, 2024
Merged

xarray lecture #283

merged 27 commits into from
Oct 27, 2024

Conversation

gregordecristoforo
Copy link
Contributor

This is my suggestion for the outline of the Xarray lecture. The biggest questions for me are the following:

  1. Shall we include exercises in this lectures or shall we use all allocated 30 minutes for the lecture. In the latter case we can still include the exercises so that people can do them in their own time.
  2. Is this outline to dense? If yes, which topic has the lowest priority?
  3. Which example dataset shall we use? We can use the one showed below. Personally, I would prefer one that doesn't use a a custom datatype for the time coordinates.
from pythia_datasets import DATASETS

filepath = DATASETS.fetch('CESM2_sst_data.nc')
ds = xr.open_dataset(filepath)

Feedback of any kind is very welcome!

@wmvanvliet
Copy link
Contributor

How about using NARR_19930313_0000 instead? Is has temperature at different heights of the atmosphere (measured as isobaric pressure). It doesn't have a time component.

@wmvanvliet
Copy link
Contributor

wmvanvliet commented Sep 23, 2024

I've made an image that I hope will be enlightening of how xarray annotates a numpy array in dimensions, coordinates and units.
xarray
xarray

@gregordecristoforo
Copy link
Contributor Author

Great, thank you for creating the figure! Let's use the NARR_19930313_0000.nc dataset then. Just one question, shouldn't the isobaric pressure decrease with height?
And out of interest, do the coordinates shown in the figure actually refer to the right lon and lat in Colorado as the image suggests? That would be really cool, but no problem if they don't. For illustrative purposes that is more than enough.

@gregordecristoforo
Copy link
Contributor Author

In the upcoming days and weeks I will start working on the lecture material. Is there a part that you want to lead during the lecture, @wmvanvliet? Shall I work the whole markdown document or is there a part you want to take over?

@wmvanvliet
Copy link
Contributor

shouldn't the isobaric pressure decrease with height?

Oh yeah :)

@wmvanvliet
Copy link
Contributor

do the coordinates shown in the figure actually refer to the right lon and lat in Colorado as the image suggests? That would be really cool, but no problem if they don't.

I think somewhere in that region, but the image is not precise. I could make it precise if I have a little time.

@wmvanvliet
Copy link
Contributor

In the upcoming days and weeks I will start working on the lecture material. Is there a part that you want to lead during the lecture, @wmvanvliet? Shall I work the whole markdown document or is there a part you want to take over?

With only 30mins, I'm fine with you taking the lead during the entire lecture. Of course I want to help with putting the lecture materials together.

@gregordecristoforo
Copy link
Contributor Author

I think somewhere in that region, but the image is not precise. I could make it precise if I have a little time.

Don't worry about it, the picture (with the corrected hPA values) is very useful for the lecture material :) Thanks again for creating it.

With only 30mins, I'm fine with you taking the lead during the entire lecture. Of course I want to help with putting the lecture materials together.

Sounds good, I will start with creating the lecture material then. I will let you know when I have a section ready for review. Your feedback would be very much appreciated!

@wmvanvliet
Copy link
Contributor

wmvanvliet commented Oct 8, 2024

I've updated the image. The actual coordinates of the cube are drawn on this map: https://framacarte.org/en/map/anonymous-edit/196572:0w7b-sUXFbHgfyUZYs7kGu1VLe7nLL2NzzthvtWdGhQ which is used as the floor of the image now.

xarray
xarray

@gregordecristoforo
Copy link
Contributor Author

Thanks a lot, that looks perfect!

@gregordecristoforo
Copy link
Contributor Author

It seems like I am unable to download the image of the dataset. Can you forward me the image @wmvanvliet? I will use a screenshot with lower resolution in the meantime. My email is [email protected]

@gregordecristoforo gregordecristoforo marked this pull request as ready for review October 22, 2024 14:04
@gregordecristoforo
Copy link
Contributor Author

This is the first version of the Xarray lecture. It is still a bit rough around the edges and I will add the two exercises tomorrow. @wmvanvliet If you have any comments or ideas for improvement, please let me know.

@gregordecristoforo gregordecristoforo changed the title add outline of xarray lecture xarray lecture Oct 22, 2024
@rkdarst
Copy link
Member

rkdarst commented Oct 23, 2024

I invited Gregor to the repo for independent merging and pushing as needed. For whatever makes sense, go ahead and do it!

@gregordecristoforo
Copy link
Contributor Author

The exercises are now included. Please let me know, what you think about them.

@gregordecristoforo
Copy link
Contributor Author

The sphinx build also breaks for the last commit (commit 188a462) before anything is added in this PR

@rkdarst
Copy link
Member

rkdarst commented Oct 23, 2024

I'm working on the problem. I found it this morning (but not the solution), and haven't had time to do a proper fix. I plan to do any fix to get it working asap.

@gregordecristoforo
Copy link
Contributor Author

Thx no stress! One can build the xarray lecture with sphinx-autobuild content _build if anyone wants to have a look at the lecture.

@rkdarst
Copy link
Member

rkdarst commented Oct 23, 2024

Now it builds. The files list has some warnings saying that some of the image files are missing. And a lot of other warnings from other files but I'd ignore them and merge, we can figure them out later.

Copy link
Contributor

@wmvanvliet wmvanvliet left a comment

Choose a reason for hiding this comment

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

Really nice work @gregordecristoforo!

content/xarray.rst Outdated Show resolved Hide resolved
content/xarray.rst Outdated Show resolved Hide resolved
content/xarray.rst Outdated Show resolved Hide resolved
content/xarray.rst Outdated Show resolved Hide resolved
content/xarray.rst Show resolved Hide resolved
content/xarray.rst Outdated Show resolved Hide resolved
content/xarray.rst Show resolved Hide resolved
content/xarray.rst Outdated Show resolved Hide resolved

# Put everything together to create the Dataset
ds = xr.Dataset(
{
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
{
data_vars = {

Let's make it super clear that these are the Data Variables.

content/xarray.rst Outdated Show resolved Hide resolved
gregordecristoforo and others added 12 commits October 23, 2024 16:24
Co-authored-by: Marijn van Vliet <[email protected]>
Co-authored-by: Marijn van Vliet <[email protected]>
Co-authored-by: Marijn van Vliet <[email protected]>
Co-authored-by: Marijn van Vliet <[email protected]>
Co-authored-by: Marijn van Vliet <[email protected]>
Co-authored-by: Marijn van Vliet <[email protected]>
Co-authored-by: Marijn van Vliet <[email protected]>
Co-authored-by: Marijn van Vliet <[email protected]>
Co-authored-by: Marijn van Vliet <[email protected]>
Co-authored-by: Marijn van Vliet <[email protected]>
Co-authored-by: Marijn van Vliet <[email protected]>
@gregordecristoforo
Copy link
Contributor Author

Thanks for the feedback! I included most of your suggestions. I'll get to the remaining ones probably tomorrow.

Co-authored-by: Marijn van Vliet <[email protected]>
@bast
Copy link
Collaborator

bast commented Oct 27, 2024

I moved the two remaining suggestions to a new follow-up issue: #295

I did this because I want to merge this now so that it can get some exposure/visibility for other instructors/helpers/organizers.

Thank you for the great lesson addition!

@bast bast merged commit 0f68da9 into AaltoSciComp:master Oct 27, 2024
2 checks passed
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.

4 participants