Project

General

Profile

Change projection to lonlat

Added by Jens de Bruijn about 7 years ago

Hi,

I created a NetCDF file. By accident I added a spatial_ref, but the grid_mapping_name is missing. I have now the following sinfo:

Warning (cdf_read_mapping_atts) : Text attribute spatial_ref:grid_mapping_name missing!
File format : NetCDF4 ZIP                                                                                                
-1 : Institut Source   Steptype Levels Num    Points Num Dtype : Parameter ID                                            
1 : unknown  unknown  instant       1   1 311155200   1  F32z : -1
Grid coordinates :  
1 : projection               : points=311155200 (17760x17520)    mapping : undefined                                                                                                         
lon : -19 to 55 by 0.004166901 degrees_east                                                                             
lat : 38 to -35 by -0.004165649 degrees_north                                                
Vertical coordinates : 
1 : surface   : levels=1 
Time coordinate :  3014 steps 
RefTime =  1970-01-01 00:00:00  Units = hours  Calendar = standard                                                   
YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss                                      
1970-01-01 00:00:00  1970-01-01 00:00:00  1970-01-01 00:00:00  1970-01-01 00:00:00

As you can see the grid_mapping_name is missing.

I would like to remove the spatial_ref in order to get the following sinfo, where the grid coordinates are lonlat rather than projection:

   File format : NetCDF4 ZIP                                                                                         
-1 : Institut Source   Steptype Levels Num    Points Num Dtype : Parameter ID                                     
1 : unknown  unknown  instant       1   1  84960000   1  F32z : -1                                             
Grid coordinates :                                                                                                 
1 : lonlat                   : points=84960000 (14160x6000)                                                                               
lon : -119 to -60 by 0.004166961 degrees_east                                                                    
lat : 30 to 5 by -0.004167557 degrees_north                                           
Vertical coordinates :                                                                                             
1 : surface                  : levels=1                                                                        
Time coordinate :  3014 steps                                                                                      
RefTime =  1970-01-01 00:00:00  Units = hours  Calendar = standard                                            
YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss                               
1970-01-01 00:00:00  1970-01-01 00:00:00  1970-01-01 00:00:00  1970-01-01 00:00:00

It should not be required to reproject or interpolate the files. I just need to change the attribute.

Any help is greatly appreciated!


Replies (1)

RE: Change projection to lonlat - Added by Ralf Mueller about 7 years ago

please upload the file if possible...

-ralf

    (1-1/1)