Exemple #1
0
 public void Close(int sds_id)
 {
     try
     {
         HDF4Helper.SDendaccess(sds_id);
     }
     catch
     {
         Console.WriteLine("Error,SDendaccess:" + sds_id);
     }
 }
Exemple #2
0
        public static H4SDS Load(int sd_id, int sds_index)
        {
            int           status   = 0;
            int           sds_id   = 0;
            int           sds_ref  = 0;
            StringBuilder sds_name = new StringBuilder();
            int           rank     = 0;

            int[] dimsizes = new int[MAX_DIMSIZES];
            HDF4Helper.DataTypeDefinitions datatype;
            int num_attrs = 0;

            sds_id  = H4SDAPI.SDselect(sd_id, sds_index);
            sds_ref = HDF4API.SDidtoref(sds_id);
            int sds_index2 = HDF4API.SDreftoindex(sd_id, sds_ref);

            //HDF4Helper.SDreaddata

            status = HDF4Helper.SDgetinfo(sds_id, sds_name, out rank, dimsizes, out datatype, out num_attrs);
            status = HDF4Helper.SDendaccess(sds_id);
            int[] dims = new int[rank];
            for (int i = 0; i < rank; i++)
            {
                dims[i] = dimsizes[i];
            }
            H4SDS ds = new H4SDS();

            ds._sd_id     = sd_id;
            ds._sds_ref   = sds_ref;
            ds._sds_id    = sds_id;
            ds._sds_name  = sds_name.ToString();
            ds._rank      = rank;
            ds._dimsizes  = dims;
            ds._datatype  = datatype;
            ds._num_attrs = num_attrs;
            return(ds);
        }