Skip to content

Commit

Permalink
Merge pull request #18 from whyjz/dev
Browse files Browse the repository at this point in the history
Update dhdt module
  • Loading branch information
whyjz authored Oct 7, 2023
2 parents 4fc4837 + 7e404c9 commit 5c7bec1
Show file tree
Hide file tree
Showing 9 changed files with 1,645 additions and 1,258 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ examples/dhdt/Demo_DEMs/HookerFJL_10m_dhdt*
examples/dhdt/Demo_DEMs/refgeo_10m_TSpickle.p
examples/dhdt/tmp.tif
other_process/log_getUncertaintyDEM_grdtrack_output.xyz
Utilities/unused/PXData/*
Utilities/unused/PXData/*
*.p
51 changes: 25 additions & 26 deletions bin/dhdt.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,46 +30,45 @@
# ==== Read ini file ====

inipath = args.config_file
ini = ConfParams(inipath)
ini.ReadParam()
ini.VerifyParam()

# ==== Create a DemPile object and load the config file into the object ====

a = DemPile()
a.ReadConfig(ini)
a.read_config(inipath)

# ==== Run main processes ====

if args.step is None:
a.InitTS()
a.PileUp()
a.DumpPickle()
a.Polyfit()
a.Fitdata2File()
a.init_ts()
a.pileup()
a.dump_pickle()
a.polyfit()
a.fitdata2file()
elif args.step == 'stack':
a.InitTS()
a.PileUp()
a.DumpPickle()
a.init_ts()
a.pileup()
a.dump_pickle()
elif args.step == 'dhdt':
a.LoadPickle()
a.Polyfit()
a.Fitdata2File()
a.load_pickle()
a.polyfit()
a.fitdata2file()
elif args.step == 'viewts':
a.LoadPickle()
data = a.ts
dhdt_raster, _, _, _ = a.ShowDhdtTifs()
img = dhdt_raster.ReadAsArray()
a.load_pickle()
a.viz()
plt.show()
# data = a.ts
# dhdt_raster, _, _, _ = a.ShowDhdtTifs()
# img = dhdt_raster.ReadAsArray()

fig, ax = plt.subplots()
img[img < -9000] = np.nan
ax.imshow(img, cmap='RdBu', vmin=-6, vmax=6)
onclick = onclick_wrapper(data, fig, ax)
# fig, ax = plt.subplots()
# img[img < -9000] = np.nan
# ax.imshow(img, cmap='RdBu', vmin=-6, vmax=6)
# onclick = onclick_wrapper(data, fig, ax)

# cid = fig.canvas.mpl_connect('button_press_event', onclick)

cid = fig.canvas.mpl_connect('button_press_event', onclick)
plt.show()
else:
print('Wrong Way!')
print('Wrong Way!')


# ==== Codes for test ====
Expand Down
Loading

0 comments on commit 5c7bec1

Please sign in to comment.