[R] #2 (Thanks) → Consultation about reading hdf files from nsidc

Nordlund, Dan (DSHS/RDA) NordlDJ at dshs.wa.gov
Thu Oct 29 20:13:58 CET 2015


-----Original Message-----
From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of David Winsemius
Sent: Thursday, October 29, 2015 11:51 AM
To: jorge.rabinovich at gmail.com
Cc: r-help at r-project.org; HDF-EOS Tools and Information Center Help
Subject: Re: [R] #2 (Thanks) → Consultation about reading hdf files from nsidc


> On Oct 29, 2015, at 10:21 AM, Jorge Rabinovich <bibtri at gmail.com> wrote:
> 
> City Bell, Thursday, October 29, 2015, 14:10
> 
> Hi there:
> On 10/29/2015 10:12 AM, HDF-EOS Tools and Information Center Help wrote:
>> Hi, Jorge!   The AMSR-E file you're trying to read with R is HDF"4", not HDF"5" file format. Unfortunately, R does not support HDF4 directly. You can either convert it to HDF5 using h4toh5tool [1] or to netCDF using h4tonccf [2]. Then, you can use HDF5 or netCDF R routines to access the file.
>> [1] https://www.hdfgroup.org/h4toh5/
>> [2] http://www.hdfeos.org/software/h4cflib.php
> Thanks a million.
> 
> I downloaded the h4h5tools-2.2.2-win64.zip file and obtained the H4TOH5-2.2.2-win64.exe after decompressing.
> 
> I executed that file and installed the H4TOH5-2.2.2-win64 without any problem. I also downloaded the H4TOH5 Users Guide and Reference Manual.
> 
> However I am not able to make the conversion. I went to the "command" option of Windows, and I pasted the following:
> 
> C:\Program Files\HDF_Group\H4TOH5\2.2.2\bin\h4toh5convert.exe 
> D:\Guanacos_3\Consultoria Santa Cruz\Datos SC\Clima\MODIS 
> Snow\AMSR_E_L3_5DaySnow_V09_20050126.hdf
> 
> and I got the following message: "C:\Program" is not recognized a an internal or external command.

It appears that you do not know how to tell Windows how to deal with a space in your command. That not really an on topic question for R-help. You need to learn how to use the operating system you have chosen. It might be a simple as not using full path to your program if it is registered, or you might need to navigate to the “Program Files” directory, or <something else>.


> 
> What do you think I am doing wrong?
> 
> Thanks again,
> 
> Jorge


You need to wrap paths that contain spaces with double quotes.  Given the way the lines are broken in the email I can only guess you might want something like this

"C:\Program Files\HDF_Group\H4TOH5\2.2.2\bin\h4toh5convert.exe "   "D:\Guanacos_3\Consultoria Santa Cruz\Datos SC\Clima\MODIS Snow\AMSR_E_L3_5DaySnow_V09_20050126.hdf"


Dan

Daniel Nordlund, PhD
Research and Data Analysis Division
Services & Enterprise Support Administration
Washington State Department of Social and Health Services




More information about the R-help mailing list