{ "info": { "author": "Loic Dutrieux", "author_email": "loic.dutrieux@gmail.com", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "Landsat-ESPA-util\n=================\n\n*Interface to USGS and ESPA APIs for Landsat surface reflectance data\nordering*\n\n\n.. image:: https://travis-ci.org/loicdtx/lsru.svg?branch=master\n :target: https://travis-ci.org/loicdtx/lsru\n\n.. image:: https://badge.fury.io/py/lsru.svg\n :target: https://badge.fury.io/py/lsru\n\n.. image:: https://readthedocs.org/projects/lsru/badge/?version=latest\n :target: https://lsru.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n\nOnline doc at `lsru.readthedocs.io `__\n\nBefore, downloading Landsat surface reflectance data for a given area\nmeant:\n\n- Manually querying the sceneIDs on Earth Explorer\n- Saving these lists of sceneIDs to text files\n- Manually uploading these files to ESPA to place the order\n- Downloading the processed data with a download manager\n\nNow, thanks to `USGS\nAPI `__,\nand `espa API `__ it can all be\ndone programtically.\n\n\nExample\n-------\n\nSend a spatio-temporal query to the Usgs API\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nUsed to retrieve a list of available scenes metadata\n\n\n.. code:: python\n\n from lsru import Usgs\n import datetime\n\n # Define query extent\n bbox = (3.5, 43.4, 4, 44)\n\n # Instantiate Usgs class and login\n usgs = Usgs()\n usgs.login()\n\n # Query the Usgs api to find scene intersecting with the spatio-temporal window\n scene_list = usgs.search(collection='LANDSAT_8_C1',\n bbox=bbox,\n begin=datetime.datetime(2013,1,1),\n end=datetime.datetime(2016,1,1),\n max_results=10,\n max_cloud_cover=40)\n\n # Extract Landsat scene ids for each hit from the metadata\n scene_list = [x['displayId'] for x in scene_list]\n\n\nPlace a processing order to Espa\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe scene list can be used to send a processing order to Espa via the Espa API. \nMany options are available (full scene, pixel resizing, reprojection, cropping).\n\n\nOrder full scenes\n\n\n.. code:: python\n\n from lsru import Espa\n from pprint import pprint\n\n # Instantiate Espa class\n espa = Espa()\n\n # Place order (full scenes, no reprojection, sr and pixel_qa)\n order = espa.order(scene_list=scene_list, products=['sr', 'pixel_qa'])\n print(order.orderid)\n\n # espa-loic.dutrieux@wur.nl-10212018-102816-245'\n\nCheck current orders status\n\n.. code:: python\n\n for order in espa.orders:\n # Orders have their own class with attributes and methods\n print('%s: %s' % (order.orderid, order.status))\n\n # espa-loic.dutrieux@wur.nl-10222018-062836-330: ordered\n # espa-loic.dutrieux@wur.nl-10212018-174321-508: complete\n # espa-loic.dutrieux@wur.nl-10212018-174430-792: complete\n # espa-loic.dutrieux@wur.nl-10212018-102816-245: complete\n # espa-loic.dutrieux@wur.nl-10182018-100137-786: complete\n\n\nDownload completed orders. When Espa finishes pre-processing an order, its status \nchanges to ``complete``, we can then download the processed scenes.\n\n.. code:: python\n\n for order in espa.orders:\n if order.is_complete:\n order.download_all_complete('/media/landsat/download/dir')\n\nIt is also possible order processing with reprojection, cropping, resizing, etc\n\n.. code:: python\n\n # Inspect aea projection parameters\n pprint(espa.projections['aea'])\n # Define projection parameters\n proj_params = {'aea': {'central_meridian': 3.8,\n 'datum': 'wgs84',\n 'false_easting': 0,\n 'false_northing': 0,\n 'latitude_of_origin': 43.7,\n 'standard_parallel_1': 43,\n 'standard_parallel_2': 44}}\n # Place order\n order_meta = espa.order(scene_list=scene_list, products=['sr', 'pixel_qa'],\n note='cropped order with resampling', projection=proj_params,\n extent=bbox, resolution=60)\n\n\nInstallation\n------------\n\n\nActivate a virtualenv (optional but preferable) and run:\n\n.. code:: sh\n\n pip install lsru\n\n\nSetup\n-----\n\nThe package requires a configuration file in which usgs credentials are written. \nBy default the file is called ``~/.lsru`` (this can be modified if you want to join \nthis configuration with the configuration of another project) and has the following structure.\n\n::\n\n [usgs]\n username=your_usgs_username\n password=your_very_secure_password\n\n\n\nWhy can't I just retrieve my Landsat data from Earth Explorer, Amazon or Google cloud?\n--------------------------------------------------------------------------------------\n\nYou can but it will be top of atmosphere (TOA) radiance, not surface\nreflectance. If you aim to have a scientific use of the data, you\nprobably want to have surface reflectance.\n\nThe critical part between TOA radiance and surface reflectance is the\natmospheric correction. That means that surface reflectance data are\ncorrected for atmospheric effects, therefore providing accurate\nmeasurements of the target's spectral properties.\n\nToday (October 2016), there are a few ways to obtain Landsat surface\nreflectance data (All of them have been processed by LEDAPS, the\nreference high level Landsat processing tool):\n\n1. By ordering them via the ESPA system\n\n- this is what this utility helps you to do\n- ESPA does on demand pre-processing of full (reprojected) scenes or\n subsets\n- A cloud mask (fmask) and vegetation indices can also be added to the\n order\n\n1. By ordering them from Google Earth Engine\n\n- GEE has ingested the entire ESPA surface reflectance collection to\n make it available via its platform\n\n1. By downloading TOA data from any source and processing with a local\n installation of LEDAPS\n\n- Not necessarily trivial\n\n\n.. figure:: https://i.imgflip.com/1c7eet.jpg\n :alt:", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/loicdtx/landsat-espa-util", "keywords": "landsat,API,espa,usgs", "license": "GPLv3", "maintainer": "", "maintainer_email": "", "name": "lsru", "package_url": "https://pypi.org/project/lsru/", "platform": "", "project_url": "https://pypi.org/project/lsru/", "project_urls": { "Homepage": "https://github.com/loicdtx/landsat-espa-util" }, "release_url": "https://pypi.org/project/lsru/0.5.2/", "requires_dist": null, "requires_python": "", "summary": "Access the ESPA API for Landsat surface reflectance data ordering and download", "version": "0.5.2" }, "last_serial": 4589996, "releases": { "0.3.4": [ { "comment_text": "", "digests": { "md5": "c9f27255051531c9c873e6c04c29b2eb", "sha256": "7322f8153c8a0530b6b01a078a0b9964eec265cb718adf197a9c267fe55c14a9" }, "downloads": -1, "filename": "lsru-0.3.4.tar.gz", "has_sig": false, "md5_digest": "c9f27255051531c9c873e6c04c29b2eb", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 9975, "upload_time": "2018-10-27T20:14:38", "url": "https://files.pythonhosted.org/packages/cf/e3/fd1a893dfde74cecd5cd623fe31a69257712e83d72f94a10513070bdba2c/lsru-0.3.4.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "4f37977f4dd5a2e3376b98ef84bd0477", "sha256": "a7b351cb43538ba20f37f399726b71c72a7b65b9aa71dd695814d5e51c3bdc47" }, "downloads": -1, "filename": "lsru-0.4.0.tar.gz", "has_sig": false, "md5_digest": "4f37977f4dd5a2e3376b98ef84bd0477", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10165, "upload_time": "2018-10-28T13:51:58", "url": "https://files.pythonhosted.org/packages/d4/87/65a86c31bcb6ccc23acdd1b7bc693eb5a7a6400a49787ffce5cfb14914d1/lsru-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "b1961c3f561f1a0d8c324ec04a946d23", "sha256": "e32b05215ca9d484bf0ef8eb8ce74c4d8a8b3008c524f1bbaafa74574bb08600" }, "downloads": -1, "filename": "lsru-0.4.1.tar.gz", "has_sig": false, "md5_digest": "b1961c3f561f1a0d8c324ec04a946d23", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10210, "upload_time": "2018-10-29T11:01:23", "url": "https://files.pythonhosted.org/packages/7a/27/15dc65e3f87c3450238e26437e96592dcad1200d247a099367331dc5668b/lsru-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "701e156c23514c1c66878210fd4bfead", "sha256": "c1068c66fc3af4207442a4e46f1f5983dcc915fd1e39c2924ee5978af99f28aa" }, "downloads": -1, "filename": "lsru-0.4.2.tar.gz", "has_sig": false, "md5_digest": "701e156c23514c1c66878210fd4bfead", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10206, "upload_time": "2018-10-30T18:25:00", "url": "https://files.pythonhosted.org/packages/d3/38/ed5c3336b535afdfcf31929659e75c478c4185b251125cd7a08897201a01/lsru-0.4.2.tar.gz" } ], "0.4.3": [ { "comment_text": "", "digests": { "md5": "d245ad65f93b209194a78196bb18b3d4", "sha256": "adad34c65c886ae97765a57a1337698794cfad9c72fbb70ee627d755e6d5afda" }, "downloads": -1, "filename": "lsru-0.4.3.tar.gz", "has_sig": false, "md5_digest": "d245ad65f93b209194a78196bb18b3d4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10218, "upload_time": "2018-10-31T11:14:42", "url": "https://files.pythonhosted.org/packages/e0/2b/605c83acf45dc86a16d5df748f93df0a80269de56a58ee72bbbed07a612c/lsru-0.4.3.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "865ffada95378054baab4a332c08938a", "sha256": "041cf5a92f0d27d99e48d8f5823aac82d0caad62cd161909d5acdc36e851e23f" }, "downloads": -1, "filename": "lsru-0.5.0.tar.gz", "has_sig": false, "md5_digest": "865ffada95378054baab4a332c08938a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10578, "upload_time": "2018-10-31T14:49:55", "url": "https://files.pythonhosted.org/packages/7c/46/f22c9bbd19d5c7c5d1c557d0acc359553121e28b979112398ee6e81ec478/lsru-0.5.0.tar.gz" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "c3bb7394b1502004376c0c944e375b2a", "sha256": "ca09f77ba38acd16a267d60180e43ae0995fd2d9ed8444149da322d7411c411b" }, "downloads": -1, "filename": "lsru-0.5.1.tar.gz", "has_sig": false, "md5_digest": "c3bb7394b1502004376c0c944e375b2a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10592, "upload_time": "2018-12-06T18:11:12", "url": "https://files.pythonhosted.org/packages/f2/7c/48851fdd07812ad0d8ebb6dd9d38e0ab6b7d5b332152ea3318c68bde1617/lsru-0.5.1.tar.gz" } ], "0.5.2": [ { "comment_text": "", "digests": { "md5": "bdc8ea80fdfe66b6317c6ecb02d33b50", "sha256": "5a136ee63f9e96885280b9a5d8f34e8c69dfa9ca850a9e76a5bbd42af8d3895f" }, "downloads": -1, "filename": "lsru-0.5.2.tar.gz", "has_sig": false, "md5_digest": "bdc8ea80fdfe66b6317c6ecb02d33b50", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10622, "upload_time": "2018-12-12T12:50:43", "url": "https://files.pythonhosted.org/packages/51/e7/766b1491fe6dd0d06e1130d14149d9b597f78412746fda5987ea5f3cdd84/lsru-0.5.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "bdc8ea80fdfe66b6317c6ecb02d33b50", "sha256": "5a136ee63f9e96885280b9a5d8f34e8c69dfa9ca850a9e76a5bbd42af8d3895f" }, "downloads": -1, "filename": "lsru-0.5.2.tar.gz", "has_sig": false, "md5_digest": "bdc8ea80fdfe66b6317c6ecb02d33b50", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10622, "upload_time": "2018-12-12T12:50:43", "url": "https://files.pythonhosted.org/packages/51/e7/766b1491fe6dd0d06e1130d14149d9b597f78412746fda5987ea5f3cdd84/lsru-0.5.2.tar.gz" } ] }