Replies: 2 comments
-
@mmann1123 Are you able to pull I think it should address Issue #183. |
Beta Was this translation helpful? Give feedback.
-
@mmann1123 I think I've fixed support for using a Dask Client to write data with It would be great if you could test it out on any of your data before I move it over to a PR. See below for an example. If you want to watch the computation in real time, you can open Experiment with threading, e.g. with LocalCluster(
processes=False,
n_workers=4,
threads_per_worker=1,
memory_limit="2GB",
) as cluster: and combinations of processes and threads. from dask.distributed import Client, LocalCluster, performance_report
import geowombat as gw
from geowombat.data import l8_224078_20200518
with LocalCluster(
processes=True,
n_workers=4,
threads_per_worker=2,
memory_limit="2GB",
) as cluster:
with Client(cluster) as client:
print(client)
with performance_report(filename="dask-report.html"):
# This is only here to increase the computation
with gw.config.update(ref_res=10.0):
with gw.open(l8_224078_20200518) as src:
# Something more complex than this would be good
data = src.gw.set_nodata(0, 32768, dtype="uint16")
data = (data * 10.0).assign_attrs(**data.attrs)
data.gw.save(
filename="test.tif",
overwrite=True,
# I don't think we can compress with a client
compress="none",
client=client,
) |
Beta Was this translation helpful? Give feedback.
-
@mmann1123 @rdenham this branch has a new raster save method in the works. The method is called
save()
and an example of use can be found here. I need to document the additions but the details are here.Much of the code used in
save()
already existed in geowombat. However, it was buried into_raster()
. Most of the tests withto_raster()
were done on an HPC with large raster data. We implementedto_raster()
because the dask task graphs were too slow to generate on rasters we were using. However, I found that thesave()
method, which usesdask.store()
and only callscompute()
once is faster on smaller images (e.g., Landsat or Sentinel scenes). And, maybe faster now on large rasters, but I haven't tested it.If you get a chance and are interested, test it out using the branch
jgrss/store
. And, if you do, let me know what you think and if you find it faster thanto_raster()
(on small or large rasters). My idea is that the two methods (save()
andto_raster()
) can both be used, depending on the use case.Beta Was this translation helpful? Give feedback.
All reactions