Project

General

Profile

can't use mapping weights for file "with source mask"

Added by Adrian Tompkins over 6 years ago

I have series of daily rainfall netcdf files which apparently all have the same resolution and grid, which I want to remap to a new grid.

To speed up the process I calculate the weights using the first file and then apply the weights to remap all the subsequent files:

cdo -R genbil,gridfile.txt file_1.nc wgt.nc

loop over files:
cdo -R remap,gridfile.txt,wgt.nc file_N.nc remapped_file_N.nc

It works fine except that every now and then a file pops up with this message...

cdo remap (Warning): Remap weights from rainwgt.nc not used, lonlat (1440x400) grid not found

the remapping is still done of course, but from scratch, rather than using the weights...

If I examine the files with ncdump -h I see no difference between them and indeed I can add and subtract and combine them no problem with cdo...

But I notice that if I calculate the weights using the "problem" file, I get the message

SCRIP bilinear weights from lonlat (1440x400) to lonlat (40x45) grid, with source mask (575772)

The "WITH SOURCE MASK" is extra, it doesn't come up with the well behaved files... what does the "with source mask" mean, and what is different in that file that is causing this behavior? Can I prevent it somehow?

many thanks!


Replies (3)

RE: can't use mapping weights for file "with source mask" - Added by Karin Meier-Fleischer over 6 years ago

Hi Adrian,

can you provide some test data.

-Karin

RE: can't use mapping weights for file "with source mask" - Added by Adrian Tompkins over 6 years ago

Here are two example files attached plus my gridfile.txt

This is the response I get generating weights:

$ cdo genbil,gridfile.txt trmm_3B42_v7_19980701.nc wgt.nc
cdo genbil: SCRIP bilinear weights from lonlat (1440x400) to lonlat (40x45) grid
cdo genbil: Processed 576000 values from 2 variables over 1 timestep ( 0.08s )

$ cdo genbil,gridfile.txt trmm_3B42_v7_19980102.nc wgt.nc
cdo genbil: SCRIP bilinear weights from lonlat (1440x400) to lonlat (40x45) grid, with source mask (575319)
cdo genbil: Processed 576000 values from 2 variables over 1 timestep ( 0.11s )

I can combine that etc without a problem as I say. The header of each file looks identical. If I do a DIFF on the ncdump -h headers I simply get the gistory differences:

< netcdf trmm_3B42_v7_19980102 {
---

netcdf trmm_3B42_v7_19980701 {

41c41
< :creation_date = "Mon Jun 5 19:52:28 CEST 2017" ;
---

:creation_date = "Mon Jun 5 22:56:00 CEST 2017" ;

48c48
< :history = "Mon Jun 5 19:52:47 2017: ncatted a units,precip,m,c,mm/day trmm_3B42_v7_19980102.nc\nMon Jun 05 19:52:44 2017: cdo -f nc4 -z zip_9 daymean -mulc,24 all.nc trmm_3B42_v7_19980102.nc\nMon Jun 05 19:52:43 2017: cdo mergetime trmm_3B42_19980102.00.7.nc trmm_3B42_19980102.03.7.nc trmm_3B42_19980102.06.7.nc trmm_3B42_19980102.09.7.nc trmm_3B42_19980102.12.7.nc trmm_3B42_19980102.15.7.nc trmm_3B42_19980102.18.7.nc trmm_3B42_19980102.21.7.nc all.nc\nMon Jun 05 19:52:28 2017: cdo -f nc4 -z zip_9 copy ../netcdf/1998//trmm_3B42_19980102.00.7.nc temp.nc" ;
--

:history = "Mon Jun 5 22:56:17 2017: ncatted -a units,precip,m,c,mm/day trmm_3B42_v7_19980701.nc\nMon Jun 05 22:56:14 2017: cdo -f nc4 -z zip_9 daymean -mulc,24 all.nc trmm_3B42_v7_19980701.nc\nMon Jun 05 22:56:13 2017: cdo mergetime trmm_3B42_19980701.00.7.nc trmm_3B42_19980701.03.7.nc trmm_3B42_19980701.06.7.nc trmm_3B42_19980701.09.7.nc trmm_3B42_19980701.12.7.nc trmm_3B42_19980701.15.7.nc trmm_3B42_19980701.18.7.nc trmm_3B42_19980701.21.7.nc all.nc\nMon Jun 05 22:56:00 2017: cdo -f nc4 -z zip_9 copy ../netcdf/1998//trmm_3B42_19980701.00.7.nc temp.nc" ;

thanks!

RE: can't use mapping weights for file "with source mask" - Added by Uwe Schulzweida over 6 years ago

Hi Adrian,

the "with source mask" means that the input file contains missing values. These missing values are ignored during the remapping process. Thats why the remap weights are different for those files.
A workaround could be to set the missing values to zero. This should work at least for precip data:

cdo -R remap,gridfile.txt,wgt.nc -setmisstoc,0 file_N.nc remapped_file_N.nc
Cheers,
Uwe

    (1-3/3)