Skip to content

Commit

Permalink
updated v0.5.2
Browse files Browse the repository at this point in the history
- Added harmonization tool to harmonize PS2.SD to PS2.
- Improvements and error handling to quota tool
- Merged [pull request 35](#35) to keep download progress via enumerate.
  • Loading branch information
samapriya committed Oct 24, 2019
1 parent 901827b commit 4070617
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 32 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
Binary file removed dist/porder-0.5.1-py2.py3-none-any.whl
Binary file not shown.
Binary file removed dist/porder-0.5.1.tar.gz
Binary file not shown.
Binary file added dist/porder-0.5.2-py2.py3-none-any.whl
Binary file not shown.
Binary file added dist/porder-0.5.2.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion porder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

__author__ = 'Samapriya Roy'
__email__ = '[email protected]'
__version__ = '0.5.1'
__version__ = '0.5.2'
3 changes: 3 additions & 0 deletions porder/order_now.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down Expand Up @@ -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':
Expand Down
67 changes: 37 additions & 30 deletions porder/porder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 <Choose indices from>: 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 <Choose indices from>: ndvi|gndvi|bndvi|ndwi|tvi|osavi|evi2|msavi2|sr",default=None)

parser_order.set_defaults(func=order_from_parser)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']},
Expand Down

0 comments on commit 4070617

Please sign in to comment.