TerraFusion / basicFusion

Terra Basic Fusion Project - University of Illinois
Other
2 stars 0 forks source link

Add inputGranules attribute to the HDF5 root #98

Closed kyang2014 closed 7 years ago

kyang2014 commented 7 years ago

This inputGranule attribute should include all the input HDF4 file names. :InputGranules = "MISR_AM1_GRP_ELLIPSOID_GM_P022_O040110_AA_F03_0024.hdf", "AST_L1T_00307032007162020_20150520034221_121033.hdf ...." The order is not significant as far as I know. We may need to create an HDF5 variable length string list.
The following code may be helpful. We should use H5Awrite instead of H5Dwrite.

const char wdata[SPACE1_DIM1]= { "Four score and seven years ago our forefathers brought forth on this continent a new nation,", "conceived in liberty and dedicated to the proposition that all men are created equal.", "", NULL }; / Information to write / const char string_att= "This is the string for the attribute"; hid_t fid1; / HDF5 File IDs / hid_t dataset, root; / Dataset ID / hid_t sid1, dataspace;/ Dataspace ID / hid_t tid1, att; / Datatype ID / hsize_t dims1[] = {SPACE1_DIM1};

/* Create file */
fid1 = H5Fcreate(FILE38, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);

sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);

/* Create a VL string datatype to refer to */
tid1 = H5Tcopy (H5T_C_S1);
H5Tset_size (tid1, H5T_VARIABLE);

H5Tset_strpad(tid1, H5T_STR_NULLTERM);

/* Create a dataset and write VL string to it. */
dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
H5Dclose(dataset);

 H5Acreate2(root, "test_scalar", tid1, dataspace, H5P_DEFAULT, H5P_DEFAULT);
H5Awrite(att, tid1, &string_att);

/* Close */
H5Tclose(tid1);
H5Sclose(sid1);
H5Sclose(dataspace);
H5Aclose(att);
H5Gclose(root);
H5Fclose(fid1);
LandonTClipp commented 7 years ago

Dr. Yang,

Please see:

/projects/TDataFus/exampleOutput/May30-2017.h5

I have added the input granules. Want to make sure that this is the correct format you want. Also in this file should be all of the issues I've fixed ( #110 #82 #81, any other I'm forgetting).

kyang2014 commented 7 years ago

Is this the final one that includes all the issues you fixed?

Kent

From: Landon Clipp [mailto:notifications@github.com] Sent: Tuesday, May 30, 2017 10:11 AM To: TerraFusion/basicFusion Cc: Kent Yang; Assign Subject: Re: [TerraFusion/basicFusion] Add inputGranules attribute to the HDF5 root (#98)

Dr. Yang,

Please see:

/projects/TDataFus/exampleOutput/May30-2017.h5

I have added the input granules. Want to make sure that this is the correct format you want. Also in this file should be all of the issues I've fixed ( #110https://github.com/TerraFusion/basicFusion/issues/110 #82https://github.com/TerraFusion/basicFusion/issues/82 #81https://github.com/TerraFusion/basicFusion/issues/81, any other I'm forgetting).

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHubhttps://github.com/TerraFusion/basicFusion/issues/98#issuecomment-304909843, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AJyiE79e0lyDeqvn6j1q_1PaOhznToWNks5r_DGXgaJpZM4Nj68G.

LandonTClipp commented 7 years ago

Yes this should include all issues I have fixed thus far.

-- Landon Clipp

National Center for Supercomputing Applications BS Computer Engineering Student University of Illinois Urbana-Champaign

On May 30, 2017 10:16 AM, "kyang2014" notifications@github.com wrote:

Is this the final one that includes all the issues you fixed?

Kent

From: Landon Clipp [mailto:notifications@github.com] Sent: Tuesday, May 30, 2017 10:11 AM To: TerraFusion/basicFusion Cc: Kent Yang; Assign Subject: Re: [TerraFusion/basicFusion] Add inputGranules attribute to the HDF5 root (#98)

Dr. Yang,

Please see:

/projects/TDataFus/exampleOutput/May30-2017.h5

I have added the input granules. Want to make sure that this is the correct format you want. Also in this file should be all of the issues I've fixed ( #110https://github.com/TerraFusion/basicFusion/issues/110 #82< https://github.com/TerraFusion/basicFusion/issues/82> #81< https://github.com/TerraFusion/basicFusion/issues/81>, any other I'm forgetting).

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHubhttps://github.com/ TerraFusion/basicFusion/issues/98#issuecomment-304909843, or mute the threadhttps://github.com/notifications/unsubscribe- auth/AJyiE79e0lyDeqvn6j1q_1PaOhznToWNks5r_DGXgaJpZM4Nj68G.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/TerraFusion/basicFusion/issues/98#issuecomment-304911406, or mute the thread https://github.com/notifications/unsubscribe-auth/AKtmAbDmQbtBUHCVOv7xHW0CavLhWu_Iks5r_DLAgaJpZM4Nj68G .

kyang2014 commented 7 years ago

Landon,

Your InputGanule attribute mostly needs to be changed. I will notify you later. Kent

From: Landon Clipp [mailto:notifications@github.com] Sent: Tuesday, May 30, 2017 10:29 AM To: TerraFusion/basicFusion Cc: Kent Yang; Assign Subject: Re: [TerraFusion/basicFusion] Add inputGranules attribute to the HDF5 root (#98)

Yes this should include all issues I have fixed thus far.

-- Landon Clipp

National Center for Supercomputing Applications BS Computer Engineering Student University of Illinois Urbana-Champaign

On May 30, 2017 10:16 AM, "kyang2014" notifications@github.com<mailto:notifications@github.com> wrote:

Is this the final one that includes all the issues you fixed?

Kent

From: Landon Clipp [mailto:notifications@github.com] Sent: Tuesday, May 30, 2017 10:11 AM To: TerraFusion/basicFusion Cc: Kent Yang; Assign Subject: Re: [TerraFusion/basicFusion] Add inputGranules attribute to the HDF5 root (#98)

Dr. Yang,

Please see:

/projects/TDataFus/exampleOutput/May30-2017.h5

I have added the input granules. Want to make sure that this is the correct format you want. Also in this file should be all of the issues I've fixed ( #110https://github.com/TerraFusion/basicFusion/issues/110 #82< https://github.com/TerraFusion/basicFusion/issues/82> #81< https://github.com/TerraFusion/basicFusion/issues/81>, any other I'm forgetting).

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHubhttps://github.com/ <https://github.com/%0b> TerraFusion/basicFusion/issues/98#issuecomment-304909843>, or mute the threadhttps://github.com/notifications/unsubscribe- <https://github.com/notifications/unsubscribe-%0b> auth/AJyiE79e0lyDeqvn6j1q_1PaOhznToWNks5r_DGXgaJpZM4Nj68G>.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/TerraFusion/basicFusion/issues/98#issuecomment-304911406, or mute the thread https://github.com/notifications/unsubscribe-auth/AKtmAbDmQbtBUHCVOv7xHW0CavLhWu_Iks5r_DLAgaJpZM4Nj68G .

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHubhttps://github.com/TerraFusion/basicFusion/issues/98#issuecomment-304915960, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AJyiE_eJT6npY_lE35lLFQPGAbonbdzVks5r_DXSgaJpZM4Nj68G.

LandonTClipp commented 7 years ago

Complete

kyang2014 commented 7 years ago

Landon, Two things need to be modified for the inputGranule. 1) The attribute name should be "InputGranules" rather than "Input Granules". 2) The granule name should be separated by comma instead of /n. It should be something like MISR_AM1_GRP_ELLIPSOID_GM_P022_O040110_AA_F03_0024.hdf,AST_L1T_00307032007162020_20150520034221_121033.hdf

I will send you an email to point you an example file.

LandonTClipp commented 7 years ago

This is fixed.