/* * This example shows how to create datasets with region and object references to * datasets located under the group /Data_Products/VIIRS-MOD-GTM-EDR-GEO * Main illustrative functions: H5LRcreate_ref_to_all */ #include #include "hdf5.h" #include "hdf5_hl.h" #include "H5LTpublic.h" #include "h5hl_region.h" #define GROUP "/All_Data/VIIRS-MOD-GTM-EDR-GEO_All" #define Dataset_Aggr "/Data_Products/VIIRS-MOD-GTM-EDR-GEO/VIIRS-MOD-GTM-EDR-GEO_Aggr" #define Dataset_Gran_0 "/Data_Products/VIIRS-MOD-GTM-EDR-GEO/VIIRS-MOD-GTM-EDR-GEO_Gran_0" #define filename "GMGTO_npp_raw.h5" int main(void) { hid_t file_id; /* file identifier */ herr_t status; /* * Open the NPP file. */ file_id = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT); /* * Create a dataset with region references to all the datasets located under /All_Data/VIIRS-MOD-GTM-EDR-GEO_All * Store the region references in the /Data_Products/VIIRS-MOD-GTM-EDR-GEO/VIIRS-MOD-GTM-EDR-GEO_Gan_0 dataset. */ status = H5LRcreate_ref_to_all(file_id, GROUP, Dataset_Gran_0, H5_INDEX_NAME, H5_ITER_INC, H5R_DATASET_REGION); /* * Create a dataset with object references to all the datasets located under /All_Data/VIIRS-MOD-GTM-EDR-GEO_All * Store the region references in the /Data_Products/VIIRS-MOD-GTM-EDR-GEO/VIIRS-MOD-GTM-EDR-GEO_Aggr dataset. */ status = H5LRcreate_ref_to_all(file_id, GROUP, Dataset_Aggr, H5_INDEX_NAME, H5_ITER_INC, H5R_OBJECT); status = H5Fclose(file_id); }