-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from Open-ET/tcorr-image
Tcorr image support
- Loading branch information
Showing
12 changed files
with
3,059 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from .model import Image | ||
from .model import collection | ||
|
||
__version__ = "0.0.8" | ||
__version__ = "0.0.9" |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
#-------------------------------- | ||
# Name: cancel_tasks.py | ||
# Purpose: Cancel Earth Engine tasks | ||
#-------------------------------- | ||
|
||
import argparse | ||
import datetime | ||
import logging | ||
import os | ||
import sys | ||
|
||
import ee | ||
|
||
import utils | ||
|
||
|
||
def main(key=None, state='READY'): | ||
"""Cancel Earth Engine tasks | ||
Parameters | ||
---------- | ||
key : str, optional | ||
File path to an Earth Engine json key file. | ||
state : str, {'ALL', 'READY', 'RUNNING'} | ||
Task state (the default is to only cancel 'READY' tasks). | ||
""" | ||
logging.info('\nCancelling {} tasks'.format(state.lower())) | ||
|
||
if state == 'ALL': | ||
states = ['READY', 'RUNNING'] | ||
else: | ||
states = [state] | ||
|
||
logging.info('\nInitializing Earth Engine') | ||
if key: | ||
logging.info(' Using service account key file: {}'.format(key)) | ||
# The "EE_ACCOUNT" parameter is not used if the key file is valid | ||
ee.Initialize(ee.ServiceAccountCredentials('deadbeef', key_file=key)) | ||
else: | ||
ee.Initialize() | ||
|
||
# Get current task list | ||
tasks = utils.get_ee_tasks(states=states) | ||
|
||
logging.info('\nCancelling tasks:') | ||
for k, v in tasks.items(): | ||
logging.info(k) | ||
ee.data.cancelTask(v) | ||
|
||
|
||
def arg_parse(): | ||
"""""" | ||
parser = argparse.ArgumentParser( | ||
description='Cancel Earth Engine tasks', | ||
formatter_class=argparse.ArgumentDefaultsHelpFormatter) | ||
parser.add_argument( | ||
'--key', type=utils.arg_valid_file, | ||
help='JSON key file', metavar='FILE') | ||
parser.add_argument( | ||
'--state', default='READY', choices=['ALL', 'READY', 'RUNNING'], | ||
help='Task state') | ||
parser.add_argument( | ||
'-d', '--debug', default=logging.INFO, const=logging.DEBUG, | ||
help='Debug level logging', action='store_const', dest='loglevel') | ||
args = parser.parse_args() | ||
|
||
return args | ||
|
||
|
||
if __name__ == "__main__": | ||
args = arg_parse() | ||
|
||
logging.basicConfig(level=args.loglevel, format='%(message)s') | ||
logging.info('\n{0}'.format('#' * 80)) | ||
logging.info('{0:<20s} {1}'.format( | ||
'Run Time Stamp:', datetime.datetime.now().isoformat(' '))) | ||
logging.info('{0:<20s} {1}'.format('Current Directory:', os.getcwd())) | ||
logging.info('{0:<20s} {1}'.format( | ||
'Script:', os.path.basename(sys.argv[0]))) | ||
|
||
main(key=args.key, state=args.state) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# TopoWX Median Tcorr Export Input File | ||
|
||
[INPUTS] | ||
# Date range | ||
start_date = 1984-01-01 | ||
end_date = 2018-12-31 | ||
|
||
# Landsat flags (these don't do anything yet) | ||
# landsat4_flag = True | ||
# landsat5_flag = True | ||
# landsat7_flag = True | ||
# landsat8_flag = True | ||
|
||
# Maximum ACCA cloud cosver percentage (0-100) | ||
cloud_cover = 70 | ||
|
||
|
||
[EXPORT] | ||
# Export Destination (only ASSET is currently supported for Tcorr images) | ||
export_dest = ASSET | ||
|
||
# Project folder for the Tcorr image collection | ||
# The collection name is computed from the tmax_source | ||
export_path = projects/usgs-ssebop/tcorr_image | ||
|
||
# Image name format | ||
export_id_fmt = tcorr_image_{product}_{date}_{export} | ||
|
||
# Output raster cellsize (m) | ||
cell_size = 0.033333333333333333333333 | ||
# cell_size = 0.016666666666666666666666 | ||
# cell_size = 0.008333333333333333333333 | ||
|
||
|
||
[SSEBOP] | ||
# Tmax choices: | ||
# CIMIS, DAYMET, GRIDMET, TOPOWX, | ||
# CIMIS_MEDIAN_V1, DAYMET_MEDIAN_V1, GRIDMET_MEDIAN_V1, TOPOWX_MEDIAN_V0 | ||
tmax_source = TOPOWX_MEDIAN_V0 | ||
|
||
# Mask pixels with Tdiff (Tmax minus LST) greater than threshold (in K) | ||
tdiff_threshold = 15 | ||
|
||
|
||
[TCORR] | ||
# Tcorr specific inputs | ||
min_pixel_count = 1000 | ||
min_scene_count = 10 | ||
|
||
# Years to include in monthly medians | ||
# years = 1984-1990 | ||
# years = 1991-1997 | ||
# years = 1998-2004 | ||
# years = 2005-2011 | ||
# years = 2012-2018 | ||
# months = 1-12 | ||
|
||
years = 2018 | ||
months = 1-12 | ||
|
||
tcorr_default = 0.978 |
Oops, something went wrong.