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 10 of 20 Topic 5658 of 5734
Post > Topic >>

Re: HDF_SD_ADDDATA problem

by jameskuyper@[EMAIL PROTECTED] Apr 25, 2008 at 09:15 AM

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!

SInce you were talking about Gridded data, I presume that you ordered
the data with reprojection. I placed an order for MOD021KM  for
2008-04-23 08:40, with channel subsetting for bands 5, 6, and 7, and
with reprojection to a grid at 1km resolution in an azimulhal equal-
area projection centered at 40E 35N. I used

filename = $
'MOD021KM.A2008114.0840.005.2008114172926.bsrpcs_000500294808.EV_500_Aggr1km_RefSB_1_1.hdf'
sdsname = 'EV_500_Aggr1km_RefSB_0'

I use exactly the code you provided above, except that I added the
required call to HDF_SD_EndAccess. I filled in  newdata by executing
the following commands:

HDF_SD_GetData, thisSdsID, olddata
newdata = olddata+500

Everything worked perfectly. Therefore, whatever problem you're
running into depends upon some of the details you haven't given us.
Could you provide some more details about how you triggered this
problem?




 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 8:03:01 CDT 2008.