Make a tensor with nc images?

2 visualizaciones (últimos 30 días)
Lilia A.L.
Lilia A.L. el 29 de Sept. de 2015
Comentada: Lilia A.L. el 1 de Oct. de 2015
Hello, I´m trying to make a Tensor with satellite images of Chloroplyll. I have a script to make a tensor but It´s for hdf images and since juanury the NOAA changed the format, now are nc. I have this errors: Error using hdfquickinfo (line 15) HDF file 'C:\Maestria\Imagenes\Clo\clo200801.mat' may be invalid or corrupt.
Error in hdfread>dataSetInfo (line 356) hinfo = hdfquickinfo(filename,dataname,params);
Error in hdfread (line 209) [hinfo,params] = dataSetInfo(varargin{:});
Error in oceancolor (line 53) nl = double(cell2mat(hdfread(hdffile,'Number of Lines'))); %No de lineas de lat
Error in Tensor (line 16) [data,lon,lat,dndate, units, parameter]=oceancolor(archi,lonlims,latlims);
I think I need a different function, but I have no idea what It could be. Thanks so much for your help!

Respuesta aceptada

Chad Greene
Chad Greene el 29 de Sept. de 2015
I think you need ncread rather than hdfread. NetCDF and HDF formats are quite similar, but there are some minor differences between the two. The transition from HDF to NetCDF should be relatively painless.
  1 comentario
Lilia A.L.
Lilia A.L. el 30 de Sept. de 2015
Thanks for your help! Actually my files are .mat, we made an orthorectification because are from level 1. Should I change the files to NetCDF? I´m new with MatLab!!!

Iniciar sesión para comentar.

Más respuestas (2)

Chad Greene
Chad Greene el 1 de Oct. de 2015
Ah, .mat files are Matlab's own file format. The nice thing about .mat files is that they're super easy to work with when you use Matlab. The bad thing about .mat files is they're very frustrating for people who do not use Matlab because .mat files are not human readable. Luckily you're using Matlab so you should be able to just say
load clo200801.mat
And then the variables will be in your workspace.

Kelly Kearney
Kelly Kearney el 1 de Oct. de 2015
How were the .mat files generated? Version 7.3 .mat files (created using the -v7.3 argument with save) are technically hdf5 files, so they could be read via the hdf-related functions ( load is probably easier, but hdfread may make sense for your application). However, the default Version 7 .mat files are a different binary format, so those can only be read via load.
My guess is your old .mat files were saved with the -v7.3 flag, and your new ones weren't.
  1 comentario
Lilia A.L.
Lilia A.L. el 1 de Oct. de 2015
All the files were generated with the -v7.3 argument with save.
I think I got It! Thanks!

Iniciar sesión para comentar.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by