Do you really need to warp this file? There may be better options to
improve the workflow if you are only warping as part of another goal.  If
warping is the goal then carry on and ignore me.
There are myriad excellent ways of extracting data from NetCDF in R, and
reprojecting a grid should be a last resort.

Cheers, Mike.


On Thu, Jun 19, 2014 at 5:32 AM, Yerguner <yasebaytok@gmail.com> wrote:

> Hi Jonathan,
>
> Believe me I tried that and all other different combinations but starting
> with the gdal_translate step only adds extra hrs to finish the whole
> process. Actually, when I run the below gdalwarp commanline outside R, it
> completes the same small netcdf file in ~ 2hrs but I just do the
> reprojection and then do the resampling step in R in ~25 min. So, this was
> the my first approach alternative to projectRaster() approach and 2,5 hrs
> is
> better than 8 hrs. But again, unless there is a solution to speed up the
> process (at least the reprojection part), both approaches do not work my
> case. That's why I'm looking for way to do this all process in R to be able
> to parallelize the functions as for the first approach. And I have also
> many
> large files (each about the same size 5.5 GB) to repeat this process. So,
> both the file sizes are large and many, in addition to doParallel(),
> foreach() package might also be a solution?
>
> gdalwarp and resample() approach:
>
> gdalwarp -t_srs "+proj=laea +lat_0=45 +lon_0=-100 +x_0=0 +y_0=0 +no_defs
> +a=6370997 +b=6370997 +to_meter=1.0" NETCDF:"colds1.nc":tmin colds1.tif
> ## ~2 hrs
>
> library(raster)
> library(rgdal)
> rasterOptions(tmpdir="some_tmp_path")
> source_file1 <- "mod2000.tif"
> source_file2 <- "colds1.tif"
> mod00 <- raster(source_file1)
> cold00s1 <- brick(source_file2)
> submod00 <- crop(mod00,cold00s1)
> rsmp1 <- resample(cold00s1,submod00,method="ngb")     ## 25 min
> stackSelect
> (rsmp1,submod00,filename="modcold00.tif",options="INTERLEAVE=BAND")
>
> Thank you so much and looking forward to hearing from you,
> Yasemin
>
>
>
>
> --
> View this message in context:
> http://r-sig-geo.2731867.n2.nabble.com/parallelize-projectRaster-tp7586598p7586608.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
Michael Sumner
Software and Database Engineer
Australian Antarctic Division
Hobart, Australia
e-mail: mdsumner@gmail.com

	[[alternative HTML version deleted]]

