diff --git a/README.md b/README.md index c132c31..59aeeac 100644 --- a/README.md +++ b/README.md @@ -270,6 +270,7 @@ op | description ------------------|-------------------------------------------------------------------------------| clip | Clip imagery can handle single and multi polygon verify or create geojson.io toar | Top of Atmosphere Reflectance imagery generated for imagery +harmonize| Harmonize Dove R (instrument type PS2.SD) data to classic dove (instrument type PS) composite | Composite number of images in a given order zip | Zip bundles together and creates downloads (each asset has a single bundle so multiple zip files) zipall | Create a single zip file containing all assets @@ -368,6 +369,11 @@ A simple setup would be ## Changelog +### v0.5.2 +- Added harmonization tool to harmonize PS2.SD to PS2. +- Improvements and error handling to quota tool +- Merged [pull request 35](https://github.com/samapriya/porder/pull/35) to keep download progress via enumerate. + ### v0.5.1 - Added utf-8 encoding for shapefile to geojson conversion - Merged [pull request 34](https://github.com/samapriya/porder/pull/34) to refresh url once expired. diff --git a/dist/porder-0.5.1-py2.py3-none-any.whl b/dist/porder-0.5.1-py2.py3-none-any.whl deleted file mode 100644 index 08104ce..0000000 Binary files a/dist/porder-0.5.1-py2.py3-none-any.whl and /dev/null differ diff --git a/dist/porder-0.5.1.tar.gz b/dist/porder-0.5.1.tar.gz deleted file mode 100644 index 979bc67..0000000 Binary files a/dist/porder-0.5.1.tar.gz and /dev/null differ diff --git a/dist/porder-0.5.2-py2.py3-none-any.whl b/dist/porder-0.5.2-py2.py3-none-any.whl new file mode 100644 index 0000000..87a8952 Binary files /dev/null and b/dist/porder-0.5.2-py2.py3-none-any.whl differ diff --git a/dist/porder-0.5.2.tar.gz b/dist/porder-0.5.2.tar.gz new file mode 100644 index 0000000..5ecb2e4 Binary files /dev/null and b/dist/porder-0.5.2.tar.gz differ diff --git a/porder/__init__.py b/porder/__init__.py index 845056a..296a65e 100644 --- a/porder/__init__.py +++ b/porder/__init__.py @@ -2,4 +2,4 @@ __author__ = 'Samapriya Roy' __email__ = 'samapriya.roy@gmail.com' -__version__ = '0.5.1' +__version__ = '0.5.2' diff --git a/porder/order_now.py b/porder/order_now.py index 2b735cd..b033e10 100644 --- a/porder/order_now.py +++ b/porder/order_now.py @@ -54,6 +54,7 @@ def list_depth(dic, level = 1): dtoar = {'toar': {'scale_factor': 10000}} dzip = {"delivery":{"archive_filename":"{{name}}.zip","archive_type":"zip"}} dcomposite ={"composite":{}} +dharmonize={"harmonize": {"target_sensor": "PS2"}} dreproject={"reproject": {"projection": [],"kernel":[]}} dtiff={"tiff_optimize": {"compression": []}} demail={'notifications':{'email': True}} @@ -124,6 +125,8 @@ def order(**kwargs): dbundle['tools'].append(dclip) elif items=='toar': dbundle['tools'].append(dtoar) + elif items=='harmonize': + dbundle['tools'].append(dharmonize) elif items=='zip': dbundle.update(dzip) elif items=='zipall': diff --git a/porder/porder.py b/porder/porder.py index 29bc938..cef48c7 100644 --- a/porder/porder.py +++ b/porder/porder.py @@ -116,36 +116,43 @@ def planet_quota(): if main.status_code == 200: content = main.json() for item_id in content: - print(" ") - print( - 'Subscription ID: %s' - % item_id['id']) - print( - 'Plan ID: %s' - % item_id['plan_id']) - print( - 'Allocation Name: %s' - % item_id['organization']['name']) - print( - 'Allocation active from: %s' - % item_id['active_from'].split("T")[0]) - print( - 'Quota Enabled: %s' - % item_id['quota_enabled']) - print( - 'Total Quota in SqKm: %s' - % item_id['quota_sqkm']) - print( - 'Total Quota used: %s' - % item_id['quota_used']) - if (item_id['quota_sqkm'])is not None: - leftquota = (float( - item_id['quota_sqkm'] - float(item_id['quota_used']))) + try: + print(" ") print( - 'Remaining Quota in SqKm: %s' % leftquota) - else: - print('No Quota Allocated') - print('') + 'Subscription ID: %s' + % item_id['id']) + print( + 'Plan ID: %s' + % item_id['plan_id']) + print( + 'Allocation Name: %s' + % item_id['organization']['name']) + print( + 'Allocation active from: %s' + % item_id['active_from'].split("T")[0]) + if item_id['active_to'] is not None: + print( + 'Allocation active to: %s' + % item_id['active_to'].split("T")[0]) + print( + 'Quota Enabled: %s' + % item_id['quota_enabled']) + print( + 'Total Quota in SqKm: %s' + % item_id['quota_sqkm']) + print( + 'Total Quota used: %s' + % item_id['quota_used']) + if (item_id['quota_sqkm'])is not None: + leftquota = (float( + item_id['quota_sqkm'] - float(item_id['quota_used']))) + print( + 'Remaining Quota in SqKm: %s' % leftquota) + else: + print('No Quota Allocated') + print('') + except Exception as e: + pass elif main.status_code == 500: print('Temporary issue: Try again') else: @@ -394,7 +401,7 @@ def main(args=None): optional_named.add_argument('--aws', help='AWS cloud credentials config yml file',default=None) optional_named.add_argument('--azure', help='Azure cloud credentials config yml file',default=None) optional_named.add_argument('--gcs', help='GCS cloud credentials config yml file',default=None) - optional_named.add_argument('--op', nargs='+',help="Add operations, delivery & notification clip|toar|composite|zip|zipall|compression|projection|kernel|aws|azure|gcs|email : ndvi|gndvi|bndvi|ndwi|tvi|osavi|evi2|msavi2|sr",default=None) + optional_named.add_argument('--op', nargs='+',help="Add operations, delivery & notification clip|toar|harmonize|composite|zip|zipall|compression|projection|kernel|aws|azure|gcs|email : ndvi|gndvi|bndvi|ndwi|tvi|osavi|evi2|msavi2|sr",default=None) parser_order.set_defaults(func=order_from_parser) diff --git a/setup.py b/setup.py index 8a51220..f7fb08a 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ def readme(): return f.read() setuptools.setup( name='porder', - version='0.5.1', + version='0.5.2', packages=['porder'], url='https://github.com/samapriya/porder', package_data={'': ['bundles.json']},