Skip to content

An error occurred while using the nc.get.time.series function to get the UTC date. #10

@PanfengZhang

Description

@PanfengZhang

An error occurred while using the nc.get.time.series function to get the UTC date.

The example of .nc data is from NCEP (https://psl.noaa.gov/thredds/fileServer/Datasets/ncep.reanalysis/Monthlies/surface/slp.mon.ltm.1991-2020.nc)

library(ncdf4)
library(ncdf4.helpers)

diri = "C:/Rmet/data/slp.mon.ltm.1991-2020.nc"
fin <- nc_open(diri)

nc.get.time.series(fin)
##  [1] "0000-12-30" "0001-01-30" "0001-02-27" "0001-03-30" "0001-04-29"
##  [6] "0001-05-30" "0001-06-29" "0001-07-30" "0001-08-30" "0001-09-29"
## [11] "0001-10-30" "0001-11-29"

ncatt_get(fin, "time")$interpreted_actual_range
## [1] "0001/01/01 00:00:00 - 0001/12/01 00:00:00"

According to the metadata information of the data, it is known that the data started in January, not December.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions