Re: eos_gd_getpixvalues() and eos_gd_* generally [message #49924] |
Tue, 29 August 2006 09:32 |
James Kuyper
Messages: 425 Registered: March 2000
|
Senior Member |
|
|
Ed Hyer wrote:
> Hi Knowledgeable People,
>
> 1) I am working with specific files, namely HDF_EOS granules of the
> level 3 MOD43 MODIS albedo product. This problem seems not to occur
>
> 2) The difference, maybe, is grid attributes with non-geographic
> dimensions. MODIS LC(works) provides a single grid (x,y), while MOD43
> 'Albedo' (does not work) provides multiple fields (10,2,x,y).
>
> 3) Problem outline:
> fid=eos_gd_open(HDF_filename)
> ngrid=eos_gd_inqgrid(filename,grid)
HDF_filename => filename?
> gid=eos_gd_attach(fid,grid); grid name from previous INQGRID
> status=eos_gd_getpixels(gid,n_xy,x_latlong,y_latlong,x_image ,y_image)
I'm presuming that, despite their odd names, x_latlong contains the
list of longitude values you're interested in, and y_latlong contains
the corresponding list of latitudes?
> f=where(x_image ge 0 and y_image ge 0,nf)
> if(nf eq 0) then message, 'no points within image!'
> fieldname='Albedo'
> n_extracted=eos_gd_getpixvalues(gid,nf,x_image[f],x_image[f] ,fieldname,extracted_data)
I think the second x_image should be y_image.
> Now, according to the documentation, n_extracted should be (nf * 10 *
> 2), ...
The size is in bytes, so that shoud be multiplied by 2 when you're
extracting the 'Albedo' field.
> .... and extracted data should be [10,2,nf], but this is not the case.
> extracted_data is [nf], and n_extracted is [N * nf], where N=8 to 40.
I can confirm similar symptoms, though I get corrupted descriptors and
bus errors rather than segmentation faults. I also sometimes get
n_extracted that is correct, and sometimes I get 0; but I never get a
multidimensional extracted_data.
|
|
|