Skip to content

Commit

Permalink
- path changes
Browse files Browse the repository at this point in the history
- adapted time measurement to python 3
  • Loading branch information
fzaussin committed Jan 25, 2019
1 parent c975276 commit 568d0d8
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions merra/reshuffling_process.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.7
#!/usr/bin/env python3.7
# -*- coding: utf-8 -*-

"""
Expand All @@ -16,11 +16,11 @@
# data path definitions

in_path = '/home/fzaussin/shares/radar/Datapool_raw/Earth2Observe/MERRA2/datasets/M2T1NXLND.5.12.4'
out_path = '/home/fzaussin/shares/radar/Datapool_processed/Earth2Observe/MERRA2/datasets/M2T1NXLND.5.12.4_6h_temporal_sampling_test'
out_path = '/home/fzaussin/shares/radar/Datapool_processed/Earth2Observe/MERRA2/datasets/M2T1NXLND.5.12.4_6hourly'

# define date range as datetime (!) objects
start_date = datetime(1980, 1, 1)
end_date = datetime(1980, 1, 31)
end_date = datetime(2018, 11, 30)

# specific soil moisture params
param_list = ['TSOIL1', 'TSOIL2', 'TSOIL3', 'TSOIL4', 'TSOIL5', 'TSOIL6', 'TSURF',
Expand All @@ -32,7 +32,10 @@

if __name__ == '__main__':
import time, datetime
tic = time.clock()

t1_start = time.perf_counter()
t2_start = time.process_time()

# start process
reshuffle(in_path=in_path,
out_path=out_path,
Expand All @@ -41,7 +44,12 @@
parameters=param_list,
img_buffer=240,
# specify time resolution
temporal_sampling=6)
temporal_sampling=6) # one image every 6 hours

t1_stop = time.perf_counter()
t2_stop = time.process_time()

toc = time.clock()
print("Elapsed time: ", str(datetime.timedelta(seconds=toc - tic)))
print("--------------------------------------------------")
print("Elapsed time: %.1f [min]" % ((t1_stop - t1_start) / 60))
print("CPU process time: %.1f [min]" % ((t2_stop - t2_start) / 60))
print("--------------------------------------------------")

0 comments on commit 568d0d8

Please sign in to comment.