GeoTIFF to HDF Conversion? - idl-programming-language

I'm in a big trouble. I've downloaded a GeoTIFFF Dataset from http://earthexplorer.usgs.gov/ ; my problem is that I need the dataset in HDFv4 format, because I've to open it in IDL (please don't tell me "IDL can open GeoTIFF", I NEED HDFv4 format) . May you please suggest me a tool that does this conversion?
Thanks a lot.

Just to get you started, you could read in the image and its GEOTIFF tags using the following command:
file = FILEPATH('boulder.tif', SUBDIR=['examples','data'])
data_variable=READ_TIFF(file, GEOTIFF=GeoKeys)
HELP, GeoKeys, /STRUCTURE
You would then need to pull apart the geotiff structure and write the data back to an HDF4 file. I don't quite understand why you need HDF4, and I'm also not sure how you're going to write the GEOTIFF data into the HDF4 file, since HDF4 doesn't have anything "specific" about map projections.
See the docs for more details:
http://www.harrisgeospatial.com/docs/read_tiff.html
Here's a really bad way to do the conversion:
https://www.hdfgroup.org/HDF5-FAQ.html#gtifftohdf
Basically, in that case you are only saving the image data, not the geotiff-specific data.
Good luck!

Related

How to open mht file via R?

I met a problem to open mht files in R. There is an approach in which first I need to open it in Excel then save as .xlsx and after that read it in R.
But this way doesn't correspond to my requirements as soon as I need the program which must work automatically (no manual work needed).
But unfortunately I didn't found in the Internet how to do this.
Can someone advise me the way in which I can open file with mht format with some data in R?

Converting a (probable) ENVI file to decimals using R or excel

I got the output file from a spectrometer which is supposed to be a series of decimals numbers. The file looks like this:
™pQH1JHxþFH$ÏFH÷~EHa×BHäBHßdBH.#H²Ï=HL=HŒÚ<Hê‰:H­P:Hoõ9H¢Ž6Hº7H¨Y5H ?1H½¶.Hø²0HøŽ2H8æ.H.î,HŒt/H&1H͸0Hí.Hvî,H$ª+HµX+HCý*H·W+H!º+HP+HfØ(Hû'H†Ù'H|U(HQ`)Hn*H
})H'Hó%HÂ%H¶¨&H&H|•&H\
I have been reading a lot without getting to the solution. My silly question is: is that a ENVI or ASCII file? Or? How can I see the numbers I need do to use? I tried some online converters without being successful.
The starting point would be to get these numbers to develop a R code to make graphs. Thanks a lot for your time.
This looks like you opened the binary file of the mass spectrometer. Almost all vendors keep their format a secret. The only way to do this is to export it to an open format. Most vendors supply some kind of data analysis software and there are often export functions present. Most general open data formats are mzXML and mzML.
For converting have a look at the msconvert program from ProteoWizard.
If you have converted the data one of the packages in R where you can start with is XCMS.

Read .rdata without R

I have received an .rdata file with what I think should be a list of co-ordinates (x,y) and their corresponding gray value; however, I do not know exactly the data type/format within the .rdata file. Is there a way for me to read these data without R? I do not have access to R. I have Excel and Matlab on a Mac. Please help. Unfortunately, I am not allowed to pass on the data (my Googling tells me someone familiar with R can export the data into a text of csv file easily).
Thank you in advance.
I downloaded R, read the .rdata in using load() and saved it out again using write.csv().

How to read .hdf file in R?

I have a large number of files in .hdf format. These are sadly not the hdf5 files that I know are readable in R. Is there a way to load and read hdf files in R? Or is there a way to convert .hdf to hdf5? I downloaded the C-based h4toh5 tool, but it is not useful. Are there any other ways to convert? Many thanks.
I wouldn't describe hdf4 as a legacy format #mdsummer. NASA still provides a lot of its data in hdf4.
This is similar to a few posts where people (myself included) haven't been sure whether their .hdf files are hdf4 or hdf5. You can use a program called HDFView which is free to download and really easy to use to find out if you've got hdf4/5 files. Just load a file in and look under "properties".
If you've got hdf4 files then you should check out the gdal_translate from the gdalUtils package. There's some more info here including the code I used for my hdf files:
Reading hdf files into R and converting them to geoTIFF rasters
You can use ncdf4 or rgdal packages as we explain here:
https://hdfeos.org/software/r.php
If you don't like h4toh5, h4tonccf is another tool that you can try:
http://hdfeos.org/software/h4cflib.php

Convert a netCDF file to RData?

I've got a netCDF data file.The file can be downloaded at:
http://www.nodc.noaa.gov/OC5/WOA09/pr_woa09.html
It's the one called WOA09 netCDF version.
I want to use only climatology data (variable 4) and the first depth range [ , ,1] so I've used the code below so far in R. In now want to have the subset called MyData in RData format.
I want to convert it to RData to be able to play around with it in R. I haven't found anything on the internet about doing this, is it even possible? How?
Thank you so much if you can help! And let me know if I haven't given enough info .
library(ncdf)
MyFile<-open.ncdf("/home/et1211/wspd.mean.nc")
MyFile$var[[4]]->var4
MyData<-get.var.ncdf(MyFile,var4)
MyData<-MyData[,,1]
It's simple. You just save the object from R and use .RData as extension:
save(MyData, file="myNCDFdata.RData")
Or else you can read the ncdf data to an empty workspace, do whatever transformations you need, and then quit R and click ok to save workspace.

Resources