Объединение NetCDF с ncrcat, файлы с разными диапазонами lon

Я пытаюсь объединить два файла NetCDF по оси времени (записи).

Размерность lon имеет одинаковое количество значений в обоих файлах, но значения координаты lon первого файла находятся в диапазоне от 0,5 до 359,5, а значения координаты lon второго файла находятся в диапазоне от -179,5 до 179,5. Поэтому, когда я просматриваю последний временной шаг объединенного файла, построенного в Panoply, я вижу значения, которые хорошо выглядят в пространстве, но расположены в неправильном месте на карте. Я попытался исправить это, добавив 180 ко всем значениям lon во втором файле перед выполнением конкатенации, но это дает аналогичные результаты.

Команда, которую я использую для этого:

$ ncrcat precip.mon.total.1x1.v7.nc first_guess_monthly_2014_01.nc combined.nc

Ниже приведен вывод ncdump -h для двух файлов, которые я объединяю:

netcdf precip.mon.total.1x1.v7 {
dimensions:
        lat = 180 ;
        lon = 360 ;
        time = UNLIMITED ; // (1356 currently)
variables:
        float lat(lat) ;
                lat:units = "degrees_north" ;
                lat:actual_range = -89.5f, 89.5f ;
                lat:long_name = "Latitude" ;
                lat:standard_name = "latitude" ;
                lat:axis = "Y" ;
                lat:coordinate_defines = "point" ;
        float lon(lon) ;
                lon:long_name = "Longitude" ;
                lon:units = "degrees_east" ;
                lon:standard_name = "longitude" ;
                lon:actual_range = 0.5f, 359.5f ;
                lon:axis = "X" ;
                lon:coordinate_defines = "point" ;
        double time(time) ;
                time:long_name = "Time" ;
                time:units = "days since 1800-1-1 00:00:00" ;
                time:delta_t = "0000-01-00 00:00:00" ;
                time:avg_period = "0000-01-00 00:00:00" ;
                time:standard_name = "time" ;
                time:axis = "T" ;
                time:coordinate_defines = "start" ;
                time:actual_range = 36889., 78131. ;
        float p(time, lat, lon) ;
                p:long_name = "GPCC Monthly total of precipitation" ;
                p:missing_value = -9.96921e+36f ;
                p:statistic = "Total" ;
                p:valid_range = 0.f, 8000.f ;
                p:parent_stat = "Observations" ;
                p:var_desc = "Precipitation" ;
                p:actual_range = 0.f, 3153.04f ;
                p:dataset = "GPCC Precipitation 1.0degree V7 Full Reanalysis" ;
                p:units = "mm" ;
                p:level = "Surface" ;

// global attributes:
                :Original_Source = "http://www.dwd.de/en/FundE/Klima/KLIS/int/GPCC/GPCC.htm\n is the webpage and the data is at ftp://ftp.dwd.de/pub/data/gpcc/download.html" ;
                :Reference = "Users of the data sets are kindly requested to give feed back and to refer to GPCC publications on this webpage: http://www.dwd.de/bvbw/appmanager/bvbw/dwdwwwDesktop/?_nfpb=true&_pageLabel=_dwdwww_klima_umwelt_datenzentren_wzn&T12404518261141645246564gsbDocumentPath=Content%2FOeffentlichkeit%2FKU%2FKU4%2FKU42%2Fteaser__product__access.html&_state=maximized&_windowLabel=T12404518261141645246564&lastPageLabel=_dwdwww_klima_umwelt_datenzentren_wzn" ;
                :original_source = "ftp://ftp-anon.dwd.de/pub/data/gpcc/html/download_gate.html" ;
                :References = "http://www.esrl.noaa.gov/psd/data/gridded/data.gpcc.html" ;
                :Conventions = "CF 1.0" ;
                :title = "GPCC Full Data Reanalysis Version 7 1.0x1.0 Monthly Totals" ;
                :dataset_title = "Global Precipitation Climatology Centre (GPCC)" ;
                :history = "Tue Jun 14 10:59:21 2016: ncrename -v precip,p precip.mon.total.1x1.v7.nc\nCreated 01/2016 based on V7 data obtained via ftp" ;



netcdf first_guess_monthly_2014_01 {
dimensions:
        lon = 360 ;
        lat = 180 ;
        time = UNLIMITED ; // (1 currently)
variables:
        double lon(lon) ;
                lon:standard_name = "longitude" ;
                lon:long_name = "longitude" ;
                lon:units = "degrees_east" ;
                lon:axis = "X" ;
        double lat(lat) ;
                lat:standard_name = "latitude" ;
                lat:long_name = "latitude" ;
                lat:units = "degrees_south" ;
                lat:axis = "Y" ;
        double time(time) ;
                time:standard_name = "time" ;
                time:units = "months since 2014-01-01 00:00:00" ;
                time:calendar = "proleptic_gregorian" ;
        float p(time, lat, lon) ;
                p:long_name = "first guess monthly product, precipitation per grid" ;
                p:units = "mm/month" ;
                p:code = 20 ;
                p:_FillValue = -99999.99f ;
        float s(time, lat, lon) ;
                s:long_name = "first guess monthly product, number of gauges per grid" ;
                s:units = "gauges per gridcell" ;
                s:code = 21 ;
                s:_FillValue = -99999.99f ;

// global attributes:
                :CDI = "Climate Data Interface version 1.5.9 (http://code.zmaw.de/projects/cdi)" ;
                :Conventions = "CF-1.4" ;
                :history = "Mon Apr 07 10:41:42 2014: cdo -setgatts,gattfile gpcc10.nc first_guess_monthly_2014_01.nc\n",
                        "Mon Apr 07 10:41:41 2014: cdo -merge first_guess_monthly_precip_2014_01.nc first_guess_monthly_numgauge_2014_01.nc gpcc10.nc\n",
                        "Mon Apr 07 10:41:41 2014: cdo cat gpcc10.nc first_guess_monthly_numgauge_2014_01.nc\n",
                        "Mon Apr 07 10:41:41 2014: cdo -b F32 -r -f nc -setgrid,firstguess10desc.asc -settunits,month -setmissval,-99999.99 -setpartab,codetable.txt -setcode,21 -setdate,2014-01 -input,r360x180 gpcc10.nc" ;
                :DOI = "10.5676/DWD_GPCC/FG_M_100" ;
                :title = "GPCC First Guess Product at 1.0°: Near Real-Time First Guess Monthly Land-Surface Precipitation from Rain-Gauges based on SYNOP Data" ;
                :summary = "This is the GPCC First Guess Product of monthly global land-surface precipitation based on the station database (SYNOP) available via the Global Telecommunication System (GTS) of the World Meteorological Organization (WMO) at the time of analysis (3 - 5 days after end of the analysis month). This product contains the monthly totals on a regular latitude/longitude grid with a spatial resolution of 1.0° x 1.0° latitude by longitude. Interpolation is made on the anomalies from the GPCC Climatology V2011 in the corresponding resolution (DOI: 10.5676/DWD_GPCC/Clim_M_V2011_100). The temporal coverage of the dataset ranges from January 2005 until the most recent month for which GTS based SYNOP data is available, i.e. the previous month, 3-5 days after its completion." ;
                :usage = "This GPCC product is recommended to be used when the timeliness of the precipitation information is of highest importance, e.g. for drought monitoring or watch purposes." ;
                :keywords = "precipitation climatology,gpcc,global,gpcp,daily" ;
                :id = "first_guess_monthly_precipitation_10" ;
                :creator_url = "http://gpcc.dwd.de" ;
                :creator_name = "GPCC/DWD" ;
                :creator_email = "[email protected]" ;
                :institution = "Deutscher Wetterdienst" ;
                :date_created = "Mo 7. Apr 10:41:41 UTC 2014" ;
                :time_coverage_start = "2014-01" ;
                :time_coverage_end = "2014-01" ;
                :time_coverage_resolution = "month" ;
                :geospatial_lat_min = "-90." ;
                :geospatial_lat_max = "90." ;
                :geospatial_lon_min = "-180." ;
                :geospatial_lon_max = "180." ;
                :CDO = "Climate Data Operators version 1.5.9 (http://code.zmaw.de/projects/cdo)" ;
}

Может ли кто-нибудь увидеть, что я делаю не так? Спасибо заранее за любые предложения.


person James Adams    schedule 14.06.2016    source источник
comment
Можете ли вы показать первые несколько значений lon для двух файлов, которые вы пытаетесь объединить? Глобальные атрибуты в first_guess.nc файле предполагают, что lon здесь от -180 до 180.   -  person N1B4    schedule 15.06.2016


Ответы (1)


Я знаю, что это на 4 года слишком поздно, но вы пробовали использовать CDO?

cdo mergetime file1.nc file2.nc merged_file.nc 

Я думаю, что в таких случаях он может автоматически справиться с проблемой сдвига долготы.

person Adrian Tompkins    schedule 11.05.2020