1

I have a NetCDF file that I would like to load into a stars object. The two functions st::read_stars and st::read_ncdf both load it in, but the data ends up in different locations when I plot it using mapview. I think I'm not getting something really basic here and just wanted to ask what the best way is to read NetCDF-files into a stars object. (The one with read_stars ends up in the right location). I'm using the exactly same path.

enter image description here

The description of two objects look like this:

Read with read_stars

stars object with 3 dimensions and 1 attribute
attribute(s):
 DAILYPCP_198001.nc [mm]
 Min.   :0.00           
 1st Qu.:0.00           
 Median :0.00           
 Mean   :0.07           
 3rd Qu.:0.00           
 Max.   :4.10           
 NA's   :194505         
dimension(s):
     from  to                                           offset                                       delta  refsys point values
x       1 641                                           605720                                         250 unnamed    NA   NULL
y       1 643                                          5220237                                        -250 unnamed    NA   NULL
DATE    1   1 3652.5 [(days since 1970-01-01 00:00:00 +00:00)] 1 [(days since 1970-01-01 00:00:00 +00:00)]      NA    NA   NULL
        
x    [x]
y    [y]
DATE    

And the one read with read_ncdf

stars object with 3 dimensions and 1 attribute
attribute(s):
 precipitation [mm]
 Min.   :0.00      
 1st Qu.:0.00      
 Median :0.00      
 Mean   :0.07      
 3rd Qu.:0.00      
 Max.   :4.10      
 NA's   :194505    
dimension(s):
     from  to         offset  delta                       refsys point values    
x       1 641         605720    250 +proj=tmerc +lat_0=0 +lon...    NA   NULL [x]
y       1 643        5059487    250 +proj=tmerc +lat_0=0 +lon...    NA   NULL [y]
DATE    1   1 1980-01-01 UTC 1 days                      POSIXct    NA   NULL 
2
  • This seems more like a bug report than a question.
    – Vince
    Commented Mar 3, 2021 at 12:29
  • Ok I'll post an issue. I was pretty sure I was just missing something
    – Lenn
    Commented Mar 3, 2021 at 12:30

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.