How to read hdf5 dataset with unknown datatype in c?How do you set, clear, and toggle a single bit?Improve INSERT-per-second performance of SQLite?How do I achieve the theoretical maximum of 4 FLOPs per cycle?“Large data” work flows using pandasHDF5 struct with pointer arrayRead from dataset in HDF5 file with datatype detectionIs there an analysis speed or memory usage advantage to using HDF5 for large array storage (instead of flat binary files)?Reading a large hdf5 dataset.How to read HDF5 dataset with HDF.Pinvoke?Read HDF5 dataset of multiple data types

Is open-sourcing the code of a webapp not recommended?

How can I defend against Pokémon Cinccino “Fluffy Tail”

How would a aircraft visually signal in distress?

Russian equivalents of "no love lost"

Inconsistent behavior of compiler optimization of unused string

What does the "c." listed under weapon length mean?

Do the English have an ancient (obsolete) verb for the action of the book opening?

Can a user sell my software (MIT license) without modification?

Do any instruments not produce overtones?

Smooth switching between 12 V batteries, with a toggle switch

Payment instructions allegedly from HomeAway look fishy to me

How does an ordinary object become radioactive?

Why would future John risk sending back a T-800 to save his younger self?

What makes Ada the language of choice for the ISS's safety-critical systems?

Understanding the TeXlive release cycle: What is the meaning of a TeXlive release and is it ever 'finished'?

Are there downsides to using std::string as a buffer?

"You've got another thing coming" - translation into French

Is it possible to 'live off the sea'

What can plausibly explain many of my very long and low-tech bridges?

Avoiding cliches when writing gods

Last survivors from different time periods living together

Confusion about off peak timings of London trains

How did they achieve the Gunslinger's shining eye effect in Westworld?

How Can I Tell The Difference Between Unmarked Sugar and Stevia?



How to read hdf5 dataset with unknown datatype in c?


How do you set, clear, and toggle a single bit?Improve INSERT-per-second performance of SQLite?How do I achieve the theoretical maximum of 4 FLOPs per cycle?“Large data” work flows using pandasHDF5 struct with pointer arrayRead from dataset in HDF5 file with datatype detectionIs there an analysis speed or memory usage advantage to using HDF5 for large array storage (instead of flat binary files)?Reading a large hdf5 dataset.How to read HDF5 dataset with HDF.Pinvoke?Read HDF5 dataset of multiple data types






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I'm trying to open an hdf5 dataset in c without knowing the dataset type. I can get the dataset type using "H5Dget_type(dataset_id)", however, when I want to allocate memory to the data array, i.e. "datatype(int, float, etc.) dset[n]", I cannot do it without knowing the datatype(int, float, etc.).



So, my question is that how can I get the data type in order to use it to allocate memory to the array which I'm going to use?



Thank!










share|improve this question




























    0















    I'm trying to open an hdf5 dataset in c without knowing the dataset type. I can get the dataset type using "H5Dget_type(dataset_id)", however, when I want to allocate memory to the data array, i.e. "datatype(int, float, etc.) dset[n]", I cannot do it without knowing the datatype(int, float, etc.).



    So, my question is that how can I get the data type in order to use it to allocate memory to the array which I'm going to use?



    Thank!










    share|improve this question
























      0












      0








      0








      I'm trying to open an hdf5 dataset in c without knowing the dataset type. I can get the dataset type using "H5Dget_type(dataset_id)", however, when I want to allocate memory to the data array, i.e. "datatype(int, float, etc.) dset[n]", I cannot do it without knowing the datatype(int, float, etc.).



      So, my question is that how can I get the data type in order to use it to allocate memory to the array which I'm going to use?



      Thank!










      share|improve this question














      I'm trying to open an hdf5 dataset in c without knowing the dataset type. I can get the dataset type using "H5Dget_type(dataset_id)", however, when I want to allocate memory to the data array, i.e. "datatype(int, float, etc.) dset[n]", I cannot do it without knowing the datatype(int, float, etc.).



      So, my question is that how can I get the data type in order to use it to allocate memory to the array which I'm going to use?



      Thank!







      c hdf5






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 24 at 15:39









      RezaReza

      1




      1






















          1 Answer
          1






          active

          oldest

          votes


















          0














          If you are not bound to a particular tool, check out HDFql as this will alleviate you from low-level details when dealing with HDF5 files. Your problem may be solved using HDFql in C as follows (assume you want to read dataset my_dataset):



          // declare variables
          void *data;
          long long size;

          // get size (in bytes) of dataset "my_dataset" and populate HDFql default cursor with it
          hdfql_execute("SHOW SIZE my_dataset");

          // move HDFql default cursor to first position
          hdfql_cursor_first(NULL);

          // retrieve size (in bytes) from HDFql default cursor
          size = hdfql_cursor_get_bigint(NULL);

          // allocate memory based on the size (in bytes) of dataset "my_dataset"
          data = malloc(size);

          // register variable "data" for subsequent usage
          hdfql_variable_register(&data);

          // select (i.e. read) data from dataset "my_dataset" and populate variable "data" with it
          hdfql_execute("SELECT FROM my_dataset INTO MEMORY 0");

          // from this point on, variable "data" contains the data from "my_dataset"





          share|improve this answer

























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55325503%2fhow-to-read-hdf5-dataset-with-unknown-datatype-in-c%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            If you are not bound to a particular tool, check out HDFql as this will alleviate you from low-level details when dealing with HDF5 files. Your problem may be solved using HDFql in C as follows (assume you want to read dataset my_dataset):



            // declare variables
            void *data;
            long long size;

            // get size (in bytes) of dataset "my_dataset" and populate HDFql default cursor with it
            hdfql_execute("SHOW SIZE my_dataset");

            // move HDFql default cursor to first position
            hdfql_cursor_first(NULL);

            // retrieve size (in bytes) from HDFql default cursor
            size = hdfql_cursor_get_bigint(NULL);

            // allocate memory based on the size (in bytes) of dataset "my_dataset"
            data = malloc(size);

            // register variable "data" for subsequent usage
            hdfql_variable_register(&data);

            // select (i.e. read) data from dataset "my_dataset" and populate variable "data" with it
            hdfql_execute("SELECT FROM my_dataset INTO MEMORY 0");

            // from this point on, variable "data" contains the data from "my_dataset"





            share|improve this answer





























              0














              If you are not bound to a particular tool, check out HDFql as this will alleviate you from low-level details when dealing with HDF5 files. Your problem may be solved using HDFql in C as follows (assume you want to read dataset my_dataset):



              // declare variables
              void *data;
              long long size;

              // get size (in bytes) of dataset "my_dataset" and populate HDFql default cursor with it
              hdfql_execute("SHOW SIZE my_dataset");

              // move HDFql default cursor to first position
              hdfql_cursor_first(NULL);

              // retrieve size (in bytes) from HDFql default cursor
              size = hdfql_cursor_get_bigint(NULL);

              // allocate memory based on the size (in bytes) of dataset "my_dataset"
              data = malloc(size);

              // register variable "data" for subsequent usage
              hdfql_variable_register(&data);

              // select (i.e. read) data from dataset "my_dataset" and populate variable "data" with it
              hdfql_execute("SELECT FROM my_dataset INTO MEMORY 0");

              // from this point on, variable "data" contains the data from "my_dataset"





              share|improve this answer



























                0












                0








                0







                If you are not bound to a particular tool, check out HDFql as this will alleviate you from low-level details when dealing with HDF5 files. Your problem may be solved using HDFql in C as follows (assume you want to read dataset my_dataset):



                // declare variables
                void *data;
                long long size;

                // get size (in bytes) of dataset "my_dataset" and populate HDFql default cursor with it
                hdfql_execute("SHOW SIZE my_dataset");

                // move HDFql default cursor to first position
                hdfql_cursor_first(NULL);

                // retrieve size (in bytes) from HDFql default cursor
                size = hdfql_cursor_get_bigint(NULL);

                // allocate memory based on the size (in bytes) of dataset "my_dataset"
                data = malloc(size);

                // register variable "data" for subsequent usage
                hdfql_variable_register(&data);

                // select (i.e. read) data from dataset "my_dataset" and populate variable "data" with it
                hdfql_execute("SELECT FROM my_dataset INTO MEMORY 0");

                // from this point on, variable "data" contains the data from "my_dataset"





                share|improve this answer















                If you are not bound to a particular tool, check out HDFql as this will alleviate you from low-level details when dealing with HDF5 files. Your problem may be solved using HDFql in C as follows (assume you want to read dataset my_dataset):



                // declare variables
                void *data;
                long long size;

                // get size (in bytes) of dataset "my_dataset" and populate HDFql default cursor with it
                hdfql_execute("SHOW SIZE my_dataset");

                // move HDFql default cursor to first position
                hdfql_cursor_first(NULL);

                // retrieve size (in bytes) from HDFql default cursor
                size = hdfql_cursor_get_bigint(NULL);

                // allocate memory based on the size (in bytes) of dataset "my_dataset"
                data = malloc(size);

                // register variable "data" for subsequent usage
                hdfql_variable_register(&data);

                // select (i.e. read) data from dataset "my_dataset" and populate variable "data" with it
                hdfql_execute("SELECT FROM my_dataset INTO MEMORY 0");

                // from this point on, variable "data" contains the data from "my_dataset"






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Mar 28 at 15:29

























                answered Mar 28 at 15:03









                SOGSOG

                1722




                1722





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55325503%2fhow-to-read-hdf5-dataset-with-unknown-datatype-in-c%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                    용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

                    155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해