Commit 6a81b10f authored by Hannes Diedrich's avatar Hannes Diedrich
Browse files

Fixed bug.

parent 03c0c4f8
Pipeline #1791 passed with stages
in 24 minutes and 18 seconds
......@@ -46,16 +46,16 @@ class Gts2Request(dict):
:param ur: tuple
:return:
"""
thres = 0.2
thres = 0.4
latrange = ur[1]-ll[1]
lonrange = ur[0]-ll[0]
if (lonrange >= thres) | (latrange >= thres):
raise ValueError("Your requestst area too large: ({lon}°x{lat}° excedes 0.2°x0.2°)".format(lat=latrange,
lon=lonrange))
raise ValueError("Your requestst area too large: ({lon:7.5f}°x{lat:7.5f}° exceeds {thres}°x{thres}°)"
"".format(lat=latrange, lon=lonrange, thres=thres))
def __init__(self, opts, logger=None):
self.check_geo(ll=opts["ll"], ur=opts["ll"])
self.check_geo(ll=opts["ll"], ur=opts["ur"])
address = "https://rz-vm175.gfz-potsdam.de:{port}/AC".format(port=opts["auth"]["port"])
......@@ -719,6 +719,9 @@ def client(outpath="", out_prefix="", out_mode="json", geo_ll=(), geo_ur=(), sen
logging.basicConfig(level=loggerlevel, format='# %(name)-15s %(message)s')
logger = logging.getLogger(name="gts2_client")
if "_" in out_prefix:
raise ValueError("out_prefix contains '_'. Please use different character, e.g. '-'.")
valid_stack_resolution = ["10", "20", ""]
if stack_resolution not in valid_stack_resolution:
raise AssertionError("Stack resolution is not in ", valid_stack_resolution)
......@@ -875,9 +878,6 @@ if __name__ == "__main__":
args = parser.parse_args()
if "_" in args.out_prefix:
raise ValueError("out_prefix contains '_'. Please use different character, e.g. '-'.")
suffix = "coreg" if (args.coreg is True) else ""
client(outpath=args.out_dir,
......
......@@ -221,7 +221,7 @@ class TestGts2Client(unittest.TestCase):
gts2_client.client(
out_mode=out_mode,
geo_ll=geo_ll,
geo_ur=(12.737961+0.2, 53.238058+0.2),
geo_ur=(12.737961+0.4, 53.238058+0.4),
bands="B05",
start_date=start_date,
end_date=end_date,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment