2017-05-04 73 views
0

我在Windows 7命令提示符下使用NCO將NaN更改爲正常「缺失值」的Netcdf文件。我試圖從this問題的方法,並遵循這一procedureNCO - 將NaN值更改爲正常「缺失值」以在Panoply中打開Netcdf

ncatted -a _FillValue,,o,f,NaN metoffice_foam1_amm7_NWS_TBED_dm19850101.nc 
ncatted -a _FillValue,,m,f,1.0e36 metoffice_foam1_amm7_NWS_TBED_dm19850101.nc 

但是當我嘗試打開輸出文件(metoffice_foam1_amm7_NWS_TBED_dm19850101.nc)在全副盔甲,它給這個錯誤: 「(...)軸包括NaN值(s)「

請問,有什麼不對?

在此先感謝

蒂亞戈

回答

0

NaN的需要特殊照顧。上述命令可能不適用於非NC_FLOAT類型的變量。除了使用所有變量相同的命令,嘗試是雙精度的任何變量,例如一個NC_DOUBLE版本,

ncatted -a _FillValue,time,o,d,NaN metoffice_foam1_amm7_NWS_TBED_dm19850101.nc 
ncatted -a _FillValue,time,m,d,1.0e36 metoffice_foam1_amm7_NWS_TBED_dm19850101.nc 

我很想看看是否能解決問題。

0

對不起,但它仍然不能解決問題。我還創建了尺寸lat和長着1.0e36值的_FillValue屬性,但它一直沒有工作的全副盔甲,這種經常性的錯誤:

"There was an error preparing the data: Axis includes NaN value(s)"

要進一步檢查它是否是一個一整套的問題,我試圖打開該文件在ArcGIS(更換時間,緯度和經度尺寸與_FillValue = 1.0e36後),並導致這個錯誤:

"error 000276 : One or both dimensions have variable spacing in their coordinate values. Description: The spacing between x-coordinates and/or y-coordinates is not equal(...)"

這是我工作的NetCDF文件的信息:

netcdf file:/C:/nco/metoffice_foam1_amm7_NWS_TBED_dm19850101.nc { dimensions: 
    time = UNLIMITED; // (1 currently) 
    lat = 375; 
    lon = 297; variables: 
    double time(time=1); 
     :axis = "T"; 
     :calendar = "Gregorian"; 
     :data_time = 0.0; // double 
     :long_name = "Validity time"; 
     :standard_name = "time"; 
     :units = "seconds since 1985-01-01 00:00:00"; 
     :_FillValue = 1.0E36; // double 
     :_ChunkSizes = 1; // int 

    short votemper(time=1, lat=375, lon=297); 
     :_FillValue = -32768S; // short 
     :missing_value = -32768S; // short 
     :scale_factor = 0.001f; // float 
     :add_offset = 298.15f; // float 
     :standard_name = "sea_water_potential_temperature_at_sea_bed"; 
     :long_name = "Sea Water Potential Temperature at Sea Bed"; 
     :units = "K"; 
     :valid_min = -30000S; // short 
     :valid_max = 30000S; // short 
     :_ChunkSizes = 1, 375, 297; // int 

    float lat(lat=375); 
     :standard_name = "latitude"; 
     :units = "degrees_north"; 
     :valid_min = 40.06667f; // float 
     :valid_max = 65.00125f; // float 
     :long_name = "latitude"; 
     :nav_model = "Default grid"; 
     :axis = "Y"; 
     :_FillValue = 1.0E36; // double 
     :_ChunkSizes = 375; // int 

    float lon(lon=297); 
     :standard_name = "longitude"; 
     :units = "degrees_east"; 
     :valid_min = -19.88889f; // float 
     :valid_max = 12.99967f; // float 
     :long_name = "longitude"; 
     :nav_model = "Default grid"; 
     :axis = "X"; 
     :_FillValue = 1.0E36; // double 
     :_ChunkSizes = 297; // int 

    // global attributes: 
:Conventions = "CF-1.0"; 
:references = "http://www.ncof.co.uk"; 
:institution = "UK Met Office"; 
:netcdf-version-id = "netCDF-4"; 
:creation_date = "2015-03-26 09:01Z"; 
:product_version = "1.0"; 
:source = "UK Met Office Operational Suite, Atlantic Margin Model FOAM 7 km reanalysis"; 
:grid_resolution = "Lat-lon 7 km"; 
:start_date = "1985-01-01"; 
:start_time = "00:00Z"; 
:stop_date = "1985-01-01"; 
:stop_time = "23:59Z"; 
:file_quality_index = 0S; // short 
:nco_openmp_thread_number = 1; // int 
:title = "daily-mean seabed temperature (2D)"; 
:contact = "[email protected]"; 
:history = "Mon May 8 11:21:32 2017: ncatted -a 
_FillValue,lon,m,d,1.0e36 metoffice_foam1_amm7_NWS_TBED_dm19850101.nc\nMon May 8 11:21:21 2017: ncatted -a _FillValue,lon,o,d,NaN metoffice_foam1_amm7_NWS_TBED_dm19850101.nc\nMon May 8 11:19:53 2017: ncatted -a _FillValue,lat,m,d,1.0e36 metoffice_foam1_amm7_NWS_TBED_dm19850101.nc\nMon May 8 11:19:02 2017: ncatted -a _FillValue,lat,o,d,NaN metoffice_foam1_amm7_NWS_TBED_dm19850101.nc\nMon May 8 11:12:05 2017: ncatted -a _FillValue,time,m,d,1.0e36 metoffice_foam1_amm7_NWS_TBED_dm19850101.nc\nMon May 8 10:45:23 2017: ncatted -a _FillValue,time,o,d,NaN metoffice_foam1_amm7_NWS_TBED_dm19850101.nc\nFri May 5 17:06:19 2017: ncatted -a _FillValue,time,m,d,1.0e36 metoffice_foam1_amm7_NWS_TBED_dm19850101.nc\nFri May 5 17:06:05 2017: ncatted -a _FillValue,time,o,d,NaN metoffice_foam1_amm7_NWS_TBED_dm19850101.nc"; 
:NCO = "4.6.7-alpha04"; 
0

Panoply使用netCDF-Java庫以增強模式打開數據集。其中一個結果是,如果一個數組的值匹配指定的missing_value,_FillValue是否在valid_range之外,或者是「不好」,那麼Panoply只會看到一個NaN。

而你重複出現的「Axis includes NaN value(s)」錯誤的原因是,Panoply不喜歡軸中的NaN,並且根本不會讓你沿着包含它們的軸進行繪圖。