This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ee | |
| # Filter collection by point and date | |
| def collection_filtering(point, collection_name, year_range, doy_range): | |
| collection = ee.ImageCollection(collection_name)\ | |
| .filterBounds(point)\ | |
| .filter(ee.Filter.calendarRange(year_range[0], year_range[1], 'year'))\ | |
| .filter(ee.Filter.dayOfYear(doy_range[0],doy_range[1])) | |
| return collection |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def simple_plotter(df, col_names, net_name, legend, fname): | |
| periods = np.arange(2002, 2016, 2) | |
| # Required, otherwise labels are shifted for some reason. | |
| df['period'] = periods | |
| ax1 = df.plot(x='period', y=col_names, kind='bar', stacked=True, | |
| figsize = FIGSIZE, rot=0, use_index=False) | |
| df.plot(x='period', y=net_name,kind='line', linestyle='-', marker='o', | |
| color='black', ax=ax1, figsize=FIGSIZE, use_index=False, rot=0) | |
| # Required to avoid figure being cut |