Skip to content

Error loading UERRA data #72

@dinilu

Description

@dinilu

Hi!
I found another error when trying to load data from the UERRA dataset (https://cds.climate.copernicus.eu/cdsapp#!/dataset/reanalysis-uerra-europe-single-levels?tab=overview) with the loadGridData function.

> uerra <- "../Data/UERRA/download.nc"
> di.uerra <- dataInventory(uerra)
[2020-09-10 13:35:48] Doing inventory ...
[2020-09-10 13:35:48] Retrieving info for 't2m' (0 vars remaining)
[2020-09-10 13:35:48] Done.
> str(di.uerra)
List of 1
 $ t2m:List of 4
  ..$ Description: chr "2 metre temperature"
  ..$ DataType   : chr "float"
  ..$ Units      : chr "K"
  ..$ Dimensions :List of 3
  .. ..$ time:List of 4
  .. .. ..$ Type      : chr "Time"
  .. .. ..$ TimeStep  : chr "21600 seconds"
  .. .. ..$ Units     : chr "seconds since 1970-01-01"
  .. .. ..$ Date_range: chr "1961-01-01T00:00:00Z - 1961-12-31T18:00:00Z"
  .. ..$ lat :List of 3
  .. .. ..$ Type  : chr "Lat"
  .. .. ..$ Units : chr "degrees_north"
  .. .. ..$ Values: num [1:565] 17.6 17.7 17.8 17.9 17.9 ...
  .. ..$ lon :List of 3
  .. .. ..$ Type  : chr "Lon"
  .. .. ..$ Units : chr "degrees_east"
  .. .. ..$ Values: num [1:565] 300 300 300 300 300 ...
> hist.uerra <- loadGridData(uerra, var = "t2m")
[2020-09-10 13:37:01] Defining harmonization parameters for variable "tas"
[2020-09-10 13:37:01] Defining geo-location parameters
Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl,  : 
  ucar.ma2.InvalidRangeException: last (-1) must be >= first (0)

I have tracked down inside the function to find the error in the function getLatLonDomain:

> latLon <- getLatLonDomain(grid, lonLim, latLim)
[2020-09-10 13:45:14] Defining geo-location parameters
Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl,  : 
  ucar.ma2.InvalidRangeException: last (-1) must be >= first (0)

Looking into this function, I found the error arise at the following line:

> llRanges[[2]] <- gcs$getRangesFromLatLonRect(.jnew("ucar/unidata/geoloc/LatLonRect", spec2))
Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl,  : 
  ucar.ma2.InvalidRangeException: last (-1) must be >= first (0)

I suspect the error is caused on how the dataset store longitude coordinates (dataset is Lambert Conformal Conic projection), and longitud coordinates goes from 299.596 to 394.3205

> min(di.uerra$t2m$Dimensions$lon$Values)
[1] 299.596
> max(di.uerra$t2m$Dimensions$lon$Values)
[1] 394.3205

Any work around to this problem?
Please, let me know if I can help somehow to debug the issue.
Best and thank you for the awesome framework.

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