-
Notifications
You must be signed in to change notification settings - Fork 15
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
Independent of eggshell #317
Merged
Merged
Changes from 11 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
378628a
add parameter
nilshempelmann 5549fa3
Merge branch 'next' of https://github.com/bird-house/flyingpigeon int…
nilshempelmann 694b51b
import functions from eggshell
nilshempelmann 1e29a38
ts_data function
nilshempelmann 57f3503
uncertainty RCP function
nilshempelmann 06a4da4
include uncertainy process with RCP seperation
nilshempelmann b8df1f0
flake8 is happy
nilshempelmann eafded4
tutorials
nilshempelmann 109a059
tutorials
nilshempelmann 66f854e
eggshell independent
nilshempelmann 17242f2
flake is happy
nilshempelmann 4b6cbae
rename calculation to nc_statistic
nilshempelmann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ Table of content | |
user_guide | ||
dev_guide | ||
processes_des | ||
tutorial | ||
processes_api | ||
changes | ||
authors | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
.. tutorial | ||
|
||
Tutorials | ||
========= | ||
|
||
|
||
Subset Processes of Flyingpigeon | ||
-------------------------------- | ||
|
||
|
||
The WPS flyingpigeon provides several processes to perform spatial | ||
subsetts of netCDF files. This are: | ||
|
||
- **bounding box:** reduces the input netCDF files to a given latitude | ||
longitude bounding box. | ||
|
||
- **country or continent subset:** to reduce netCDF files to only the | ||
intersection of selected polygons. Countries and Continents are | ||
predifined. | ||
|
||
- **WFS subset:** reduce netCDF files to only the intersection of given | ||
polygons available on a given WFS server. | ||
|
||
.. code:: ipython3 | ||
|
||
# import the WPS client and connet to the server | ||
from birdy import WPSClient | ||
import birdy | ||
|
||
fp_server = 'http://localhost:8093/wps' # finch | ||
|
||
# simple connection (not recommended for larger processing) | ||
fp = WPSClient(fp_server) | ||
|
||
# asyncron connection with progess status requests | ||
fp_i = WPSClient(url=fp_server, progress=True) | ||
|
||
Explore the available processes: | ||
|
||
.. code:: ipython3 | ||
|
||
# fp? for general exploration on processes provided by flyingpigeon | ||
fp? | ||
|
||
# of check out a process in detail: | ||
help(fp.subset_continents) # or type: fp.subset_countries? | ||
|
||
|
||
.. parsed-literal:: | ||
|
||
Help on method subset_continents in module birdy.client.base: | ||
|
||
subset_continents(resource=None, region='Africa', mosaic=False) method of birdy.client.base.WPSClient instance | ||
Return the data whose grid cells intersect the selected continents for each input dataset. | ||
|
||
Parameters | ||
---------- | ||
region : {'Africa', 'Asia', 'Australia', 'North America', 'Oceania', 'South America', 'Antarctica', 'Europe'}string | ||
Continent name. | ||
mosaic : boolean | ||
If True, selected regions will be merged into a single geometry. | ||
resource : ComplexData:mimetype:`application/x-netcdf`, :mimetype:`application/x-tar`, :mimetype:`application/zip` | ||
NetCDF Files or archive (tar/zip) containing netCDF files. | ||
|
||
Returns | ||
------- | ||
output : ComplexData:mimetype:`application/x-netcdf` | ||
NetCDF output for first resource file. | ||
metalink : ComplexData:mimetype:`application/metalink+xml; version=4.0` | ||
Metalink file with links to all NetCDF outputs. | ||
|
||
|
||
|
||
.. code:: ipython3 | ||
|
||
# point out some input files: | ||
|
||
url1 = 'https://www.esrl.noaa.gov/psd/thredds/fileServer/Datasets/ncep.reanalysis.dailyavgs/surface/slp.2000.nc' | ||
url2 = 'https://www.esrl.noaa.gov/psd/thredds/fileServer/Datasets/ncep.reanalysis.dailyavgs/surface/slp.2001.nc' | ||
url3 = 'https://www.esrl.noaa.gov/psd/thredds/fileServer/Datasets/ncep.reanalysis.dailyavgs/surface/slp.2002.nc' | ||
url4 = 'https://www.esrl.noaa.gov/psd/thredds/fileServer/Datasets/ncep.reanalysis.dailyavgs/surface/slp.2003.nc' | ||
|
||
Call a continent subset process | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
All netCDF input files will be subsetted seperatly and depending on | ||
mosic=True or Fales the selected polygons are given as seperated files | ||
or one output file per input file including one intersection of all | ||
selected polygons. | ||
|
||
**subset_countries** is working in the same principe | ||
|
||
.. code:: ipython3 | ||
|
||
# run the process | ||
out = fp_i.subset_continents(resource=[url1, url2, url3, url4], region=['Europe', 'Africa'], mosaic=True) | ||
|
||
# You need to wait until the processing is done! | ||
|
||
|
||
|
||
.. parsed-literal:: | ||
|
||
HBox(children=(IntProgress(value=0, bar_style='info', description='Processing:'), Button(button_style='danger'… | ||
|
||
|
||
There are two outputs: \* a netCDF file to have a quick test to check if | ||
the process went according to the users needs \* a metalink file with | ||
the list of all output files | ||
|
||
.. code:: ipython3 | ||
|
||
# check the output files: | ||
out.get() | ||
|
||
|
||
|
||
|
||
.. parsed-literal:: | ||
|
||
subset_continentsResponse( | ||
output='http://127.0.0.1:8093/outputs/f232a4ba-67a0-11ea-a160-9cb6d08a53e7/slp.2000_EuropeAfrica.nc', | ||
metalink='http://127.0.0.1:8093/outputs/f232a4ba-67a0-11ea-a160-9cb6d08a53e7/input.meta4' | ||
) | ||
|
||
|
||
|
||
.. code:: ipython3 | ||
|
||
# plot the test file with the flyingpigeon plot function | ||
out = fp_i.plot_map_timemean(resource=out.get()[0]) | ||
|
||
|
||
|
||
.. parsed-literal:: | ||
|
||
HBox(children=(IntProgress(value=0, bar_style='info', description='Processing:'), Button(button_style='danger'… | ||
|
||
|
||
.. code:: ipython3 | ||
|
||
# the plot process returnes one graphic file | ||
out.get() | ||
|
||
|
||
|
||
|
||
.. parsed-literal:: | ||
|
||
plot_map_timemeanResponse( | ||
plotout_map='http://127.0.0.1:8093/outputs/bdbf0876-67a1-11ea-9e91-9cb6d08a53e7/tmp_5ahujnj.png' | ||
) | ||
|
||
|
||
|
||
.. code:: ipython3 | ||
|
||
from IPython.display import Image | ||
from IPython.core.display import HTML | ||
Image(url= out.get()[0], width=400) | ||
|
||
|
||
|
||
|
||
.. raw:: html | ||
|
||
<img src="http://127.0.0.1:8093/outputs/bdbf0876-67a1-11ea-9e91-9cb6d08a53e7/tmp_5ahujnj.png" width="400"/> |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,6 @@ dependencies: | |
############## | ||
# pip install | ||
- pip: | ||
- -e git+https://github.com/bird-house/eggshell.git#egg=eggshell | ||
# - -e git+https://github.com/bird-house/eggshell.git#egg=eggshell | ||
- -e git+https://github.com/NCPP/ocgis#egg=owslib | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The pypi release should be fine. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. instead of
use
but using released package resolves this. |
||
- sphinx_rtd_theme |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest converting this into a notebook (for example docs/source/notebooks/subset.ipynb).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@huard
to centralise notebooks they are a notebook repository:
https://github.com/bird-house/notebooks
Perfer to have the docs in rst format to avoid unecessary downloads.
I included the link to the original notebook to open optionally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you make sure that the rst file is in sync with the code ? Ie that it does not become outdated ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@huard
Will answer here: bird-house/notebooks#2