Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Idl-pvware > Re: HDF_SD_ADDD...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 20 Topic 5658 of 5734
Post > Topic >>

Re: HDF_SD_ADDDATA problem

by UV_Catastrophe <bripman@[EMAIL PROTECTED] > Apr 22, 2008 at 01:57 PM

On Apr 21, 7:24 pm, adfra...@[EMAIL PROTECTED]
 wrote:
> Dear Everyone,
>
> I'm having trouble writing to an HDF file using HDF_SD_ADDDATA, but
> let me set the scene quickly first.
>
> I'm using a multispectral satellite imagery dataset in its native L1B
> (HDF-EOS, it's MODIS for those who care!) format. When ordering the
> data, one has the option to channel subset the data to reduce size.
>
> I've written IDL programs to cloud mask the data, which involves
> manipulating an SDS within the HDF. My programs all work fine using
> the full, un-subsetted data, but whenever I try them on the subsetted
> HDFs, they fall over with this error.
>
> -----------------------------------------------------------------------
> % HDF_SD_ADDDATA: Unable to write the specified HDF-SD slice.
> % Execution halted at: HDFEDITSDS         28 /array/work/adfraser/
> MODIS
>    images/18_4_08 processing of winter2 data/output/HDFeditSDS.pro
> %                      $MAIN$
> -----------------------------------------------------------------------
>
> Here is the code which I've been using to write successfully to the
> unsubsetted data but unsuccessfully to the subsetted data:
>
> ------------------------------------------------------------------------
> PRO HDFeditSDS, filename, sdsname, newdata
>
> sdfileid=hdf_sd_start(filename, /rdwr)
>
> ; Find the index of the "Gridded Data" SDS.
> index = HDF_SD_NAMETOINDEX(sdFileID, sdsname)
>
> ; Select the Gridded Data SDS.
> thisSdsID = HDF_SD_SELECT(sdFileID, index)
>
> HDF_SD_AddData, thisSdsID, newdata
>
> hdf_sd_end, sdfileid
>
> END
>
-------------------------------------------------------------------------
>
> I've checked all the obvously stupid things (file access permissions
> are identical, and the SDS name exists within the HDF). I'm at a loss,
> please help!
>
> Cheers,
> Alex.
>
> Alex Fraser
> Ph.D. candidate
> University of Tasmania
> Antarctic Climate and Ecosystems Cooperative Research Centre
> Sandy Bay Campus
> Tasmania 7001

Hi Alex,

As Mary Jo pointed out, before calling HDF_SD_END, you should insert
the following command: "HDF_SD_ENDACCESS, sdfileid". However, as she
said, that doesn't explain why your code was working for unsubsetted
data.

Could you provide a little more information about the data that you're
working with? Specifically:

- Have you tried running your code with various different data
subsets? (You probably have, but it doesn't hurt to ask.)

- When you channel subset the data, which bands are you keeping?

- Out of curiosity, why aren't you just using the pre-masked data? (I
believe that the website can provide you with data that has already
been cloud masked.)

Ben Ripman
MODIS IOT




 20 Posts in Topic:
HDF_SD_ADDDATA problem
adfraser@[EMAIL PROTECTED  2008-04-21 16:24:17 
Re: HDF_SD_ADDDATA problem
"brodzik@[EMAIL PROT  2008-04-22 07:23:38 
Re: HDF_SD_ADDDATA problem
"brodzik@[EMAIL PROT  2008-04-22 07:25:50 
Re: HDF_SD_ADDDATA problem
UV_Catastrophe <bripma  2008-04-22 13:57:56 
Re: HDF_SD_ADDDATA problem
adfraser@[EMAIL PROTECTED  2008-04-23 19:17:22 
Re: HDF_SD_ADDDATA problem
adfraser@[EMAIL PROTECTED  2008-04-23 19:18:31 
Re: HDF_SD_ADDDATA problem
adfraser@[EMAIL PROTECTED  2008-04-23 19:23:27 
Re: HDF_SD_ADDDATA problem
jameskuyper@[EMAIL PROTEC  2008-04-24 06:00:58 
Re: HDF_SD_ADDDATA problem
"brodzik@[EMAIL PROT  2008-04-24 07:25:39 
Re: HDF_SD_ADDDATA problem
jameskuyper@[EMAIL PROTEC  2008-04-25 09:15:05 
Re: HDF_SD_ADDDATA problem
liamgumley@[EMAIL PROTECT  2008-04-25 09:18:25 
Re: HDF_SD_ADDDATA problem
adfraser@[EMAIL PROTECTED  2008-04-27 18:05:57 
Re: HDF_SD_ADDDATA problem
adfraser@[EMAIL PROTECTED  2008-04-27 18:08:32 
Re: HDF_SD_ADDDATA problem
James Kuyper <jameskuy  2008-04-28 02:52:31 
Re: HDF_SD_ADDDATA problem
jameskuyper@[EMAIL PROTEC  2008-04-28 16:07:27 
Re: HDF_SD_ADDDATA problem
adfraser@[EMAIL PROTECTED  2008-04-29 22:57:17 
Re: HDF_SD_ADDDATA problem
James Kuyper <jameskuy  2008-04-30 11:13:39 
Re: HDF_SD_ADDDATA problem
adfraser@[EMAIL PROTECTED  2008-04-29 23:43:34 
Re: HDF_SD_ADDDATA problem
James Kuyper <jameskuy  2008-04-30 11:20:11 
Re: HDF_SD_ADDDATA problem
adfraser@[EMAIL PROTECTED  2008-05-01 19:05:51 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri May 16 6:58:28 CDT 2008.