Skip to content

Commit

Permalink
updated from /Users/plewis/Documents/GitHub/geog0111:t
Browse files Browse the repository at this point in the history
  • Loading branch information
profLewis committed Nov 2, 2020
1 parent 20fe5c2 commit f50f3c6
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 41 deletions.
24 changes: 15 additions & 9 deletions docs/043_Weighted_interpolation.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fips = "LU"

lai,std,doy = get_lai_data(year,tile,fips)

# sort the weight as in the exercio
# sort the weight as in the exercise
std[std<1] = 1
weight = np.zeros_like(std)
mask = (std > 0)
Expand Down Expand Up @@ -66,7 +66,7 @@ import matplotlib.pyplot as plt
# look at some stats
print(weight.min(),weight.max(),doy.min(),doy.max())
error = np.zeros_like(weight)
error[weight>0] = np.sqrt(1./(weight[weight>0] )) * 1.97
error[weight>0] = np.sqrt(1./(weight[weight>0] )) * 1.96

p0,p1 = (107,72)
x_size,y_size=(10,5)
Expand Down Expand Up @@ -124,7 +124,7 @@ plt.plot(x,gaussian)



[<matplotlib.lines.Line2D at 0x7fba6be4e7d0>]
[<matplotlib.lines.Line2D at 0x7fdf690783d0>]



Expand Down Expand Up @@ -172,7 +172,7 @@ axs.legend(loc='best')



<matplotlib.legend.Legend at 0x7fba639eaf90>
<matplotlib.legend.Legend at 0x7fdf68e4f3d0>



Expand Down Expand Up @@ -504,7 +504,7 @@ print(lcfiles['LC_Type3'])
```

[ 1 3 4 5 6 7 10 255]
/shared/groups/jrole001/geog0111/work/MCD12Q1/data.LC_Type3._h17v03_h18v03_h17v04_h18v04_.2019.001.001_warp.vrt
/nfsshare/groups/jrole001/geog0111/work/MCD12Q1/data.LC_Type3._h17v03_h18v03_h17v04_h18v04_.2019.001.001_warp.vrt



Expand All @@ -522,7 +522,7 @@ plt.legend(handles=patches,



<matplotlib.legend.Legend at 0x7fba5d278a90>
<matplotlib.legend.Legend at 0x7fdf687e92d0>



Expand Down Expand Up @@ -553,6 +553,8 @@ We can now consider masking both for valid pixels and for a particular land cove
from geog0111.get_lai_data import get_lai_data
from geog0111.get_weight import get_weight
from geog0111.regularise import regularise
from geog0111.get_lc import get_lc
import pandas as pd

year = 2019
tile = ['h17v03', 'h18v03','h17v04', 'h18v04']
Expand Down Expand Up @@ -582,8 +584,10 @@ print(f'code for {classy} is {code}')


```python
import numpy as np
# code
code_mask = (land_cover == code)

code_mask = (lc == code)
valid_mask = ~np.isnan(np.sum(interpolated_lai,axis=0))

# combine
Expand Down Expand Up @@ -619,6 +623,8 @@ masked_lai.shape,doy.shape


```python
import matplotlib.pyplot as plt

# plot
x_size,y_size=(10,5)

Expand All @@ -640,7 +646,7 @@ axs.legend(loc='upper right')



<matplotlib.legend.Legend at 0x7fba5ce1cf90>
<matplotlib.legend.Legend at 0x7f7b50ef3690>



Expand All @@ -665,7 +671,7 @@ Remember:
|function|comment|
|---|---|
|`scipy.ndimage.filters` | `scipy` filters |
|`zscipy.ndimage.filters.convolve1d(data,filter)` | 1D convolution of `filter` with `data`. Keywords : `axis=0,mode='wrap'`|
|`scipy.ndimage.filters.convolve1d(data,filter)` | 1D convolution of `filter` with `data`. Keywords : `axis=0,mode='wrap'`|


```python
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/TIMETABLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ GEOG0111 Timetable 2020-21
| 7 | **Space and time** | [Mosaicing](040_GDAL_mosaicing_and_masking.md) | [Timeseries](041_GDAL_timeseries.md) | |
| | |[![Mosaicing](images/icon.png)](https://web.microsoftstream.com/video/cf2d7286-2b3e-471d-b13c-697020797712) | [![Timeseries](images/icon.png)](https://web.microsoftstream.com/video/126c2d15-2dda-4c76-b1aa-eb7ef0125623)
| 8 | **Regularisation** | [Smoothing theory](042_Weighted_smoothing_and_interpolation.md) | [Smoothing and interpolation](043_Weighted_interpolation.md) | | | |[LAI](065_LAI.md)|
| | |[![Smoothing theory](images/icon.png)](https://web.microsoftstream.com/video/143428cb-d1f2-48bd-b064-d15c224025a4) | [![Smoothing and interpolation](images/icon.png)](https://web.microsoftstream.com/video/fe8e867a-7e36-4681-9ee3-e81fd2fab91e)
| 9 | **Parameter estimation** | [Models and inversion](050_Models.md) | [Phenology model](051_Phenology_model.md) | |
| 10 | **Recap** | [Summary](070_Summary.md)| | || | [Part 2](066_Part2.md)|

Expand Down
70 changes: 38 additions & 32 deletions notebooks_lab/043_Weighted_interpolation.ipynb

Large diffs are not rendered by default.

0 comments on commit f50f3c6

Please sign in to comment.