TransWikia.com

Regrid a NetCDF file to match another without multiplication of pixels (CDO or R)

Geographic Information Systems Asked by Nemesi on May 28, 2021

I have a NetCDF file (file1.nc) displaying rasterized information for a series of point locations. Each pixel with a number is surrounded by no data (see the colored pixels in the image below). I need to remap this file to match the grid of an additional NetCDF (file2.nc – see b/w pixels in the figure below) without changing the information contained (no interpolation of other math required) in file1.nc.

enter image description here

I tried to do that using CDO, using the REMAP function. In order to maintain the information intact, I selected the -remapnn command assigning to the nearest neighbor in file2.nc the value in file1.nc.

cdo -remapnn,file2.nc file1.nc output.nc

Unfortunately, this procedure splits the pixels in file1 when they equally cover pixels in file2 (see below).

enter image description here

How can I prevent this duplication of pixels? is there a method in CDO or R that could prevent this from happening?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP