[R-sig-Geo] Problem reading a HDF5 file with readGDAL in Windows

Robert J. Hijmans r.hijmans at gmail.com
Tue May 5 19:28:29 CEST 2015


Even better (renaming not necessary):

x <- raster("E:/downloads/OMI.L2.CloudOMCLDO2Strip200kmAlongCloudSat.2015.05.05.020752Z.v003.he5",
var='Data Fields/ChiSquaredOfFit', ncdf=TRUE)

Best, Robert

On Tue, May 5, 2015 at 10:24 AM, Robert J. Hijmans <r.hijmans at gmail.com> wrote:
> In which case you can change the extension to '.nc' and do
>
> library(raster)
> library(ncdf4)
> x <- raster("E:/downloads/OMI.L2.CloudOMCLDO2Strip200kmAlongCloudSat.2015.05.05.020752Z.v003.nc",
> var='Data Fields/ChiSquaredOfFit')
>
> Robert
>
> On Tue, May 5, 2015 at 5:28 AM, John Baumgartner <johnbaums at gmail.com> wrote:
>> Not a remedy, but the following might be a workable alternative...
>>
>> ncdf4::nc_open("OMI.L2.CloudOMCLDO2Strip200kmAlongCloudSat.2015.05.05.020752Z.v003.he5")$var$`Data
>> Fields/ChiSquaredOfFit`
>>
>> I'm not familiar with HDF5 structure, so not sure of possible downsides.
>>
>> Cheers,
>> John
>>
>> On Tue, May 5, 2015 at 9:34 PM, Oscar Perpiñan <oscar.perpinan at gmail.com>
>> wrote:
>>
>>> Hello,
>>>
>>> I am trying to read a HDF5 file whose variable name contains '//'. I have
>>> no
>>> problem in a Linux machine, but 'readGDAL' throws an error in Windows. If I
>>> am not wrong, it is because the initialize method of the
>>> 'GDALReadOnlyDataset'
>>> class includes a call to 'normalizePath'.
>>>
>>> For example, the next code works in Linux but fails in Windows (it uses
>>> this
>>> file
>>>
>>> ftp://atrain.sci.gsfc.nasa.gov/data/s4pa//OMI/OMCLDO2_CPR.003/2015/125/OMI.L2.CloudOMCLDO2Strip200kmAlongCloudSat.2015.05.05.020752Z.v003.he5
>>> )
>>>
>>> x <- readGDAL("HDF5:OMI.L2.CloudOMCLDO2Strip200kmAlongClo
>>> udSat.2015.05.05.020752Z.v003.he5://HDFEOS/SWATHS/
>>> CloudFractionAndPressure/Data_Fields/ChiSquaredOfFit")
>>>
>>> Is there any way to circumvent this problem?
>>>
>>> Thanks in advance.
>>>
>>> Oscar.
>>> -----------------------------------------------------------------
>>> Oscar Perpiñán Lamigueiro
>>> Dpto. Ing. Eléctrica, Electrónica, Automática y Física Aplicada
>>> (ETSIDI-UPM)
>>> Grupo de Sistemas Fotovoltaicos (IES-UPM)
>>> URL: http://oscarperpinan.github.io
>>>
>>>         [[alternative HTML version deleted]]
>>>
>>> _______________________________________________
>>> R-sig-Geo mailing list
>>> R-sig-Geo at r-project.org
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>>
>>
>>         [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo



More information about the R-sig-Geo mailing list