From 064d63b08e0721224712100d45e027365e0bd670 Mon Sep 17 00:00:00 2001 From: JamesOConnor Date: Sat, 7 Sep 2019 18:47:42 +0100 Subject: [PATCH] Updated tutorial-1 to reflect recent changes to Catalog class --- tutorial-1.ipynb | 82 +++++++++++++++++------------------------------- 1 file changed, 28 insertions(+), 54 deletions(-) diff --git a/tutorial-1.ipynb b/tutorial-1.ipynb index 4088be4..3cf3eaf 100644 --- a/tutorial-1.ipynb +++ b/tutorial-1.ipynb @@ -50,9 +50,7 @@ { "cell_type": "code", "execution_count": 1, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "from satstac import Catalog\n", @@ -82,9 +80,7 @@ { "cell_type": "code", "execution_count": 2, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "name": "stdout", @@ -124,17 +120,15 @@ { "cell_type": "code", "execution_count": 3, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "\n", - "\n", - "\n" + "\n", + "\n", + "\n" ] } ], @@ -158,9 +152,7 @@ { "cell_type": "code", "execution_count": 4, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "name": "stdout", @@ -212,9 +204,7 @@ { "cell_type": "code", "execution_count": 5, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "name": "stdout", @@ -250,10 +240,8 @@ }, { "cell_type": "code", - "execution_count": 6, - "metadata": { - "collapsed": false - }, + "execution_count": 7, + "metadata": {}, "outputs": [ { "name": "stdout", @@ -267,7 +255,7 @@ ], "source": [ "# save as a root catalog\n", - "mycat.save_as('mycat/catalog.json')\n", + "mycat.save('mycat/catalog.json')\n", "\n", "print(mycat.id)\n", "# the filename is then stored with the object\n", @@ -286,10 +274,8 @@ }, { "cell_type": "code", - "execution_count": 7, - "metadata": { - "collapsed": false - }, + "execution_count": 8, + "metadata": {}, "outputs": [ { "name": "stdout", @@ -327,10 +313,8 @@ }, { "cell_type": "code", - "execution_count": 8, - "metadata": { - "collapsed": false - }, + "execution_count": 14, + "metadata": {}, "outputs": [ { "name": "stdout", @@ -340,9 +324,7 @@ "Collection filename: mycat/mykitten/landsat-8-l1/catalog.json\n", "\n", "**Collection links**\n", - "[ { 'href': 'https://my.cat/mykitten/landsat-8-l1/catalog.json',\n", - " 'rel': 'self'},\n", - " {'href': '../../catalog.json', 'rel': 'root'},\n", + "[ {'href': '../../catalog.json', 'rel': 'root'},\n", " {'href': '../catalog.json', 'rel': 'parent'}]\n" ] } @@ -359,7 +341,7 @@ "print('Collection filename: ', collection.filename)\n", "\n", "print('\\n**Collection links**')\n", - "pp.pprint(collection.data['links'])" + "pp.pprint(collection._data['links'])" ] }, { @@ -373,10 +355,8 @@ }, { "cell_type": "code", - "execution_count": 9, - "metadata": { - "collapsed": false - }, + "execution_count": 15, + "metadata": {}, "outputs": [ { "name": "stdout", @@ -386,9 +366,7 @@ "Item filename: mycat/mykitten/landsat-8-l1/LC08_L1GT_120046_20181012_20181012_01_RT.json\n", "\n", "**Item links**\n", - "[ { 'href': 'https://my.cat/mykitten/landsat-8-l1/LC08_L1GT_120046_20181012_20181012_01_RT.json',\n", - " 'rel': 'self'},\n", - " {'href': '../../catalog.json', 'rel': 'root'},\n", + "[ {'href': '../../catalog.json', 'rel': 'root'},\n", " {'href': 'catalog.json', 'rel': 'parent'},\n", " {'href': 'catalog.json', 'rel': 'collection'}]\n" ] @@ -406,7 +384,7 @@ "print('Item filename: ', item.filename)\n", "\n", "print('\\n**Item links**')\n", - "pp.pprint(item.data['links'])" + "pp.pprint(item._data['links'])" ] }, { @@ -440,10 +418,8 @@ }, { "cell_type": "code", - "execution_count": 10, - "metadata": { - "collapsed": false - }, + "execution_count": 16, + "metadata": {}, "outputs": [ { "name": "stdout", @@ -452,9 +428,7 @@ "Item filename: mycat/mykitten/landsat-8-l1/120/46/2018-10-12/LC08_L1GT_120046_20181012_20181012_01_RT.json\n", "\n", "**Item links**\n", - "[ { 'href': 'https://my.cat/mykitten/landsat-8-l1/120/46/2018-10-12/LC08_L1GT_120046_20181012_20181012_01_RT.json',\n", - " 'rel': 'self'},\n", - " {'href': '../../../../../catalog.json', 'rel': 'root'},\n", + "[ {'href': '../../../../../catalog.json', 'rel': 'root'},\n", " {'href': '../catalog.json', 'rel': 'parent'},\n", " {'href': '../../../catalog.json', 'rel': 'collection'}]\n" ] @@ -469,7 +443,7 @@ "print('Item filename: ', item.filename)\n", "\n", "print('\\n**Item links**')\n", - "pp.pprint(item.data['links'])" + "pp.pprint(item._data['links'])" ] }, { @@ -497,9 +471,9 @@ ], "metadata": { "kernelspec": { - "display_name": "Python3 sat-utils", + "display_name": "Python 3", "language": "python", - "name": "testenv" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -511,7 +485,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.1" + "version": "3.6.5" } }, "nbformat": 4,