简体   繁体   中英

Number of hot days from daily temperature

I am following this answer to calculate number of hot days in a year (temperature exceeding 35degC) from daily tmax data.

I am using tmax from CHELSA from 2000-2016, and I have crop it based on my bounding-box requirement.

Here are the steps I have done (example using 2001 data - 1 month 1 nc file):

  • Merge monthly data to annual: cdo mergetime chelsa_daily_2001*.nc chelsa_annual_2001.nc
  • Calculate hot days: cdo gec,308.15 chelsa_annual_2001.nc chelsa_hotdays_2001.nc The Chelsa's temperature is in Kelvin, so threshold for hot days is 308.15
  • Sum number of days in a year: cdo yearsum chelsa_hotdays_2001.nc chelsa_hotdays_yearsum_2001.nc

And below is the result and unfortunately not what I expected. 图像1 img2

Why the number of days is not in integer? Did I missed something in the script?

UPDATE (following response from Adrian)

I have installed ncview via homebrew but unfortunately can't open. Got following error:

Note: could not open file /Users/xxx/.ncviewrc for reading
Error: Can't open display:

I try to open the nc output using QGIS, and the result still in float.

qgis

I strongly suspect panoply is performing some kind of spatial interpolation on the data on import.

Please take a look at the raw field directly using ncdump like this

ncdump chelsa_hotdays_yearsum_2001.nc | less

(I pipe to less so you can stroll down through the data). Or alternatively you can open the file in ncview and move the cursor over the data and you will see the field values displayed in the dialog box.

ncview chelsa_hotdays_yearsum_2001.nc

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM