|
17 | 17 | "\n", |
18 | 18 | "More details on the ODM2 Python API and its source code and latest development can be found at https://github.com/ODM2/ODM2PythonAPI\n", |
19 | 19 | "\n", |
20 | | - "[Emilio Mayorga](https://github.com/emiliom/). Last updated 2019-4-18." |
| 20 | + "[Emilio Mayorga](https://github.com/emiliom/). Last updated 2019-5-10." |
21 | 21 | ] |
22 | 22 | }, |
23 | 23 | { |
|
33 | 33 | "metadata": {}, |
34 | 34 | "outputs": [], |
35 | 35 | "source": [ |
36 | | - "%matplotlib inline\n", |
37 | | - "\n", |
38 | 36 | "import os\n", |
39 | 37 | "\n", |
40 | 38 | "import matplotlib as mpl\n", |
41 | 39 | "import matplotlib.pyplot as plt\n", |
| 40 | + "%matplotlib inline\n", |
| 41 | + "\n", |
42 | 42 | "import pandas as pd\n", |
43 | 43 | "\n", |
44 | 44 | "import odm2api\n", |
|
81 | 81 | { |
82 | 82 | "data": { |
83 | 83 | "text/plain": [ |
84 | | - "'0.7.1+3.g0b0f9ab'" |
| 84 | + "'0.7.1+12.g6997f36'" |
85 | 85 | ] |
86 | 86 | }, |
87 | 87 | "execution_count": 3, |
|
216 | 216 | " 'SamplingFeatureName': u'Little Bear River at Mendon Road near Mendon, Utah',\n", |
217 | 217 | " 'SamplingFeatureTypeCV': u'Site',\n", |
218 | 218 | " 'SamplingFeatureUUID': u'6c74a4bd-e1d4-11e5-95b8-f45c8999816f',\n", |
219 | | - " '_sa_instance_state': <sqlalchemy.orm.state.InstanceState at 0x7f9b7a96ce50>}" |
| 219 | + " '_sa_instance_state': <sqlalchemy.orm.state.InstanceState at 0x7fd5bd5c65d0>}" |
220 | 220 | ] |
221 | 221 | }, |
222 | 222 | "execution_count": 8, |
|
291 | 291 | "text": [ |
292 | 292 | "The ResultID for the Result is: 1\n", |
293 | 293 | "('The FeatureAction object for the Result is: ', <FeatureActions({'FeatureActionID': 1, 'SamplingFeatureID': 1, 'ActionID': 1})>)\n", |
294 | | - "('The Action object for the Result is: ', <Actions({'MethodID': 1, 'ActionDescription': u'An observation action that generated a time series result.', 'ActionFileLink': None, 'EndDateTime': datetime.datetime(2009, 1, 16, 12, 30), 'BeginDateTime': datetime.datetime(2007, 8, 16, 16, 30), 'EndDateTimeUTCOffset': -7, 'ActionTypeCV': u'Observation', 'ActionID': 1, 'BeginDateTimeUTCOffset': -7})>)\n", |
| 294 | + "('The Action object for the Result is: ', <Actions({'MethodID': 1, 'ActionDescription': u'An observation action that generated a time series result.', 'ActionFileLink': None, 'EndDateTime': datetime.datetime(2009, 1, 16, 12, 30), 'BeginDateTime': datetime.datetime(2007, 8, 16, 16, 30), 'BeginDateTimeUTCOffset': -7, 'ActionTypeCV': u'Observation', 'ActionID': 1, 'EndDateTimeUTCOffset': -7})>)\n", |
295 | 295 | "\n", |
296 | 296 | "The following are some of the attributes for the Action that created the Result: \n", |
297 | 297 | "ActionTypeCV: Observation\n", |
|
358 | 358 | " 'ValidDateTimeUTCOffset': None,\n", |
359 | 359 | " 'ValueCount': 24206,\n", |
360 | 360 | " 'VariableID': 1,\n", |
361 | | - " '_sa_instance_state': <sqlalchemy.orm.state.InstanceState at 0x7f9b7a99aad0>})" |
| 361 | + " '_sa_instance_state': <sqlalchemy.orm.state.InstanceState at 0x7fd5bd5e7f90>})" |
362 | 362 | ] |
363 | 363 | }, |
364 | 364 | "execution_count": 12, |
|
437 | 437 | "\n", |
438 | 438 | "## Retrieve Time Series Result Values for a given Result\n", |
439 | 439 | "\n", |
440 | | - "The database contains a single time series result (a time series of water temperature sensor data at a single site). Let's use the **getResults( )** function to retrieve the time series values for this result by passing in the ResultID. We set the index to `ValueDateTime` for convenience." |
| 440 | + "The database contains a single time series result (a time series of water temperature sensor data at a single site). Let's use the **getResultValues()** function to retrieve the time series values for this result by passing in the ResultID. We set the index to `ValueDateTime` for convenience." |
441 | 441 | ] |
442 | 442 | }, |
443 | 443 | { |
|
603 | 603 | { |
604 | 604 | "data": { |
605 | 605 | "text/plain": [ |
606 | | - "<matplotlib.axes._subplots.AxesSubplot at 0x7f9b7a8782d0>" |
| 606 | + "<matplotlib.axes._subplots.AxesSubplot at 0x7fd5bd5663d0>" |
607 | 607 | ] |
608 | 608 | }, |
609 | 609 | "execution_count": 15, |
|
652 | 652 | "tsValues['DataValue'].plot(ax=ax)\n", |
653 | 653 | "\n", |
654 | 654 | "ax.set_ylabel('{} ({})'.format(\n", |
655 | | - " tsResult.VariableObj.VariableNameCV, tsResult.UnitsObj.UnitsAbbreviation))\n", |
| 655 | + " tsResult.VariableObj.VariableNameCV, \n", |
| 656 | + " tsResult.UnitsObj.UnitsAbbreviation))\n", |
656 | 657 | "ax.set_xlabel('')\n", |
657 | 658 | "\n", |
658 | 659 | "ax.xaxis.set_minor_locator(mpl.dates.MonthLocator())\n", |
|
686 | 687 | "nbconvert_exporter": "python", |
687 | 688 | "pygments_lexer": "ipython2", |
688 | 689 | "version": "2.7.15" |
689 | | - } |
| 690 | + }, |
| 691 | + "toc-autonumbering": false |
690 | 692 | }, |
691 | 693 | "nbformat": 4, |
692 | 694 | "nbformat_minor": 2 |
|
0 commit comments