Skip to content

Commit

Permalink
Merge pull request #48 from JamesOConnor/update_tutorial1
Browse files Browse the repository at this point in the history
Updated tutorial-1 to reflect recent changes to Catalog class
  • Loading branch information
matthewhanson authored Sep 19, 2019
2 parents 8f6ea12 + 064d63b commit b629a5d
Showing 1 changed file with 28 additions and 54 deletions.
82 changes: 28 additions & 54 deletions tutorial-1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"from satstac import Catalog\n",
Expand Down Expand Up @@ -82,9 +80,7 @@
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -124,17 +120,15 @@
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<generator object Catalog.catalogs at 0x7f119a70bf68>\n",
"<generator object Catalog.collections at 0x7f119a70bfc0>\n",
"<generator object Catalog.items at 0x7f119a6b6048>\n"
"<generator object Catalog.catalogs at 0x7f40441d5830>\n",
"<generator object Catalog.collections at 0x7f4034f87780>\n",
"<generator object Catalog.items at 0x7f4034f87360>\n"
]
}
],
Expand All @@ -158,9 +152,7 @@
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -212,9 +204,7 @@
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -250,10 +240,8 @@
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand All @@ -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",
Expand All @@ -286,10 +274,8 @@
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -327,10 +313,8 @@
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"execution_count": 14,
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand All @@ -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"
]
}
Expand All @@ -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'])"
]
},
{
Expand All @@ -373,10 +355,8 @@
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"execution_count": 15,
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand All @@ -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"
]
Expand All @@ -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'])"
]
},
{
Expand Down Expand Up @@ -440,10 +418,8 @@
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"execution_count": 16,
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand All @@ -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"
]
Expand All @@ -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'])"
]
},
{
Expand Down Expand Up @@ -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": {
Expand All @@ -511,7 +485,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.1"
"version": "3.6.5"
}
},
"nbformat": 4,
Expand Down

0 comments on commit b629a5d

Please sign in to comment.