Skip to content

Commit

Permalink
Edit README
Browse files Browse the repository at this point in the history
  • Loading branch information
nf679 committed Aug 14, 2024
1 parent 2cf915e commit e32ac80
Show file tree
Hide file tree
Showing 3 changed files with 765 additions and 20 deletions.
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Introduction to Scientific Computing course
# Introduction to Scientific Computing course
This repository holds teaching materials for the NCAS Introduction to Scientific Computing course.

## Overview
Expand All @@ -12,14 +12,11 @@ The course covers:
- [Presentation](https://github.com/ncasuk/ncas-isc/tree/main/version_control)
- [Exercise](https://github.com/ncasuk/ncas-isc/tree/main/version_control)
- Introduction to Python
- [Python Introduction Slides](https://github.com/ncasuk/ncas-isc/blob/main/python-intro/presentations.md)
- [Python Introduction Slides](https://github.com/ncasuk/ncas-isc/blob/main/python-intro/README.md)
- [Exercises - Jupyter Notebooks](https://github.com/ncasuk/ncas-isc/tree/main/python-intro/exercises) | [Solutions](https://github.com/ncasuk/ncas-isc/tree/main/python-intro/solutions)
- Data manipulation and visualisation in Python (Working with Data)
- [Python working with data Slides](https://github.com/ncasuk/ncas-isc/tree/main/python-data/slides)
- [Exercises - Jupyter Notebooks](https://github.com/ncasuk/ncas-isc/tree/main/python-data/notebooks) | [Solutions](https://github.com/ncasuk/ncas-isc/tree/main/python-data/solutions)
- Example code for all python modules
- [Example code for Python (Working with Data)](https://github.com/ncasuk/ncas-isc/tree/main/python-data/example_code)
- [Example data for Python (Working with Data)](https://github.com/ncasuk/ncas-isc/tree/main/python-data/example_data)
- [Python working with data Slides](https://github.com/ncasuk/ncas-isc/tree/main/python-data/README.md)
- [Exercises - Jupyter Notebooks](https://github.com/ncasuk/ncas-isc/tree/main/python-data/exercises) | [Solutions](https://github.com/ncasuk/ncas-isc/tree/main/python-data/solutions)

## Index
### Overview Presentations
Expand Down Expand Up @@ -57,9 +54,11 @@ The course covers:

## Python - Working with Data

### Handling arrays
* [Numpy](https://github.com/ncasuk/ncas-isc/blob/main/python-data/slides/numpy.pdf)
* [Exercises](https://github.com/ncasuk/ncas-isc/blob/main/python-data/notebooks/ex01_numpy_arrays.ipynb) and [Solutions](https://github.com/ncasuk/ncas-isc/blob/main/python-data/solutions/ex01_numpy_arrays_solutions.ipynb)
### xarray
| Lesson | Exercise | Solution |
| ------ | -------- | -------- |
| [Intro to multidimensional arrays](https://geohackweek.github.io/nDarrays/01-introduction/), [xarray](https://geohackweek.github.io/nDarrays/02-xarray-architecture/) and [indexing](https://geohackweek.github.io/nDarrays/03-label-based-indexing/) | [Exercise 01]() | [Solution 01]() |


### Visualisation
* [Matplotlib and cartopy](https://github.com/ncasuk/ncas-isc/blob/main/python-data/slides/matplotlib_and_cartopy.pdf)
Expand Down
16 changes: 8 additions & 8 deletions python-data/solutions/ex01_xarray_intro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"id": "48d19019-2546-46d3-9da1-64d8e7c363e8",
"metadata": {},
"source": [
"1. Open the test dataset '' and load it into an xarray `Dataset` called `ds`.\n",
"1. Open the `'../data/tas_rcp45_2055_mon_avg_change.nc'` dataset and load it into an xarray `Dataset` called `ds`.\n",
"(Hint: Don't forget to import any packages you need)"
]
},
Expand Down Expand Up @@ -574,7 +574,7 @@
"id": "3cee6429-dbf8-4a10-b384-ad9de719a0d0",
"metadata": {},
"source": [
"What are the dimensions and variables in this dataset? What does each represent? "
"3. What are the dimensions and variables in this dataset? What does each represent? "
]
},
{
Expand All @@ -593,7 +593,7 @@
"id": "81207a17-eeaf-4de3-a3f6-9a0fd782c252",
"metadata": {},
"source": [
"3. Find the name of the Data Variable, and use it to extract a `DataArray` called `temperature`."
"4. Find the name of the Data Variable, and use it to extract a `DataArray` called `temperature`."
]
},
{
Expand All @@ -612,7 +612,7 @@
"id": "6ee4a984-305e-44da-87ab-75cf88d71f22",
"metadata": {},
"source": [
"4. Take a look at the `temperature` data array and inspect its dimensions, coordinates and attributes. What are the specific dimensions and coordinates associated with it? What metadata (attributes) is provided?"
"5. Take a look at the `temperature` data array and inspect its dimensions, coordinates and attributes. What are the specific dimensions and coordinates associated with it? What metadata (attributes) is provided?"
]
},
{
Expand Down Expand Up @@ -1083,7 +1083,7 @@
"id": "f3e16f51-8a98-424a-b908-87360947f69a",
"metadata": {},
"source": [
"5. Select a subset of the `temperature` array using label-based indexing to get data at the position [0,0,0]."
"6. Select a subset of the `temperature` array using label-based indexing to get data at the position [0,0,0]."
]
},
{
Expand Down Expand Up @@ -1507,7 +1507,7 @@
"id": "2545ea6f-ad6c-4612-86c4-95cc9d23ffdb",
"metadata": {},
"source": [
"6. Use `.loc` to find the lat and lon values at the time `2065-01-30`. "
"7. Use `.loc` to find the lat and lon values at the time `2065-01-30`. "
]
},
{
Expand Down Expand Up @@ -1955,7 +1955,7 @@
"id": "61407fc5-2ff3-4467-875d-f3e3b06eaa34",
"metadata": {},
"source": [
"6. It's not ideal to have to keep track of which dimension is in which position. Instead, use `.isel` to use the dimension names to get the data in the first time, lat and lon position."
"8. It's not ideal to have to keep track of which dimension is in which position. Instead, use `.isel` to use the dimension names to get the data in the first time, lat and lon position."
]
},
{
Expand Down Expand Up @@ -2379,7 +2379,7 @@
"id": "0f6f10a7-0905-42ec-9bf4-b3cf07229637",
"metadata": {},
"source": [
"8. The previous method is still referring to a selection by integer position. Use `.sel` to give a labelled index with the named dimension to find the data at `time=2065-12-30`, `lat=-78.5`, `lon=11.0`."
"9. The previous method is still referring to a selection by integer position. Use `.sel` to give a labelled index with the named dimension to find the data at `time=2065-12-30`, `lat=-78.5`, `lon=11.0`."
]
},
{
Expand Down
Loading

0 comments on commit e32ac80

Please sign in to comment.