Project

General

Profile

Lat / Long changes on merge

Added by david mccracken over 5 years ago

Hi,

I am a new user to CDO so please forgive me if this is a silly question.

I have a number of .nc files which I am trying to merge into one file. The file is from the New European Wind Atlas and contains Time(Time), Latitude(XLAT), Longitude(XLON) & wind Speed(WS) for an area. I.e. with this data I should be able to plot wind speed over an area using lat/long.

As the files are daily I am trying to merge/concatenate 31 daily files so I can use 1 month of data rather than 1 day. I have used the following code and I successfully get an outfile.

cdo merge *.nc outfile.nc

however, my problem is with the coordinates. Upon merging the files the lat/lon seems to get converted/deleted and now i have north_south & east_west which has a format i am struggling to recognise. Can anybody help me with what is happeing?

I have attached a number of the file input files and the outfile

thanks


Replies (3)

RE: Lat / Long changes on merge - Added by Uwe Schulzweida over 5 years ago

CDO can't do anything with the coordinates in XLAT and XLON because the units are missing. This leads to the fact that the coordinates cannot be assigned to a space. Therefore these coordinates are not processed.
I have added a warning message for the next CDO version.

RE: Lat / Long changes on merge - Added by Ralf Mueller over 5 years ago

hi!

Let's have a look into your data
netcdf \2015-12-02_Area_1 {
dimensions:
        time = 48 ;
        height = 1 ;
        south_north = 8 ;
        west_east = 11 ;
        crs_len = 1 ;
        Times_len = 20 ;
variables:
        double time(time) ;
                time:_FillValue = 0. ;
                time:units = "minutes since 1900-01-01" ;
                time:calendar = "gregorian" ;
        float height(height) ;
                height:_FillValue = 0.f ;
                height:units = "m" ;
                height:long_name = "Height above Ground" ;
                height:standard_name = "height" ;
        double south_north(south_north) ;
                south_north:_FillValue = 0. ;
        double west_east(west_east) ;
                west_east:_FillValue = 0. ;
        float WS(time, height, south_north, west_east) ;
                WS:_FillValue = 0.f ;
                WS:units = "m s-1" ;
                WS:long_name = "Wind Speed" ;
                WS:standard_name = "wind_speed" ;
                WS:grid_mapping = "crs" ;
                WS:coordinates = "XLAT XLON" ;
        float XLON(south_north, west_east) ;
                XLON:_FillValue = 0.f ;
        float XLAT(south_north, west_east) ;
                XLAT:_FillValue = 0.f ;
        char crs(crs_len) ;
                crs:semi_major_axis = 6370000. ;
                crs:inverse_flattening = 0. ;
                crs:grid_mapping_name = "lambert_conformal_conic" ;
                crs:longitude_of_central_meridian = 15.f ;
                crs:false_easting = 0. ;
                crs:false_northing = 0. ;
                crs:latitude_of_projection_origin = 54.f ;
                crs:standard_parallel = 30.f, 60.f ;
                crs:longitude_of_prime_meridian = 0. ;
                crs:proj = "+units=m +proj=lcc +lat_1=30.0 +lat_2=60.0 +lat_0=54.0 +lon_0=15.0 +x_0=0 +y_0=0 +a=6370000 +b=6370000" ;
                crs:string_length = 1 ;
        char Times(time, Times_len) ;
                Times:format = "YYYY-MM-DD_HH:MM:SS" ;
                Times:long_name = "Time" ;
                Times:string_length = 19 ;

I see a problem with the coordinates:
  • none of you coordinates variables (west_east,south_north,XLAT,XLON) has CF-conform attributes like long_name, standard_name or unit.
  • you use the coordinates attribute for WS correctly, but since the XLON and XLAT have not meta information, CDO does not identify them as valid coordinate variables.

In general CDO does not copy things, that it cannot link to data variables (XLON, XLAT). If you do not want to change the meta-data, I think you might use some of NCO commands to concatenate these files.

hth
ralf

RE: Lat / Long changes on merge - Added by david mccracken over 5 years ago

Thanks Both .

The NCO tool have worked and provided me with what I require.

I will double check the files I downloaded from the New European Wind Atlas - its a fairly new project so it may be an issue with the portal(if so i will notify them about there metadata) or I may have done something wrong on the download.

David

    (1-3/3)