next up previous index
Next: Fitting Program with HDF Up: Caring, Really Caring About Previous: Reading File and Data

HDF Summary

Open File

sd_file_id = sfstart(sd_file_name, DFACC_CREATE)
sd_file_id = sfstart(sd_file_name, DFACC_WRITE)
sd_file_id = sfstart(sd_file_name, DFACC_READ)
Annotate File
sd_file_attr_status = sfscatt(sd_file_id, "File Contents", DFNT_CHAR8, &
                              30, "Data for the chi^2-fit Program")
Query the File Structure and Attributes
file_info_status = sffinfo(sd_file_id, n_datasets, n_file_attributes)
file_attr_status = sfgainfo(sd_file_id, file_attr_index, file_attr_name, &
                            file_attr_type, file_attr_length)
read_attr_status = sfrcatt(sd_file_id, file_attr_index, file_attribute)
Disconnect from the File
sd_file_status = sfend(sd_file_id)
Create and Select or Just Select anda Data Set
sd_set_id = sfcreate(sd_file_id, sd_set_name, DFNT_INT32, rank, dimensions)
sd_set_id = sfselect(sd_file_id, sd_set_index)
Annotate the Data Set
sd_set_attrib_status = sfscatt(sd_set_id, "First Set Annotation", &
                               DFNT_CHAR8, 25, "redshift velocity in km/h")
Query the Data Set Structure and Attributes
set_info_status = sfginfo(sd_set_id, sd_set_name, rank, dim_sizes, &
                          data_type, n_set_attributes)
set_attr_status = sfgainfo(sd_set_id, set_attr_index, set_attr_name, &
                           set_attr_type, set_attr_length)
read_attr_status = sfrcatt(sd_set_id, set_attr_index, set_attribute)
Write and Read Data
sd_write_status = sfwdata(sd_set_id, start, stride, edges, data)
sd_read_status = sfrdata(sd_set_id, start, stride, edges, data)
Disconnect from the Data Set
sd_set_status = sfendacc(sd_set_id)

Zdzislaw Meglicki