Previous: Two Templates for SDDS Application Organization
Up: Two Templates for SDDS Application Organization
Next: SDDS Output of Internally-Generated Data
Previous Page: Two Templates for SDDS Application Organization
Next Page: SDDS Output of Internally-Generated Data

Accessing Data Stored in a SDDS File

SDDS_TABLE SDDS_table;

/* open the file and read the SDDS header */ SDDS_InitializeInput(&SDDS_table, filename)

/* see if arrays that are needed are present */ if (!SDDS_GetArrayDefinition(&SDDS_table, array_I_need)) { fprintf(stderr, "array %s is not in the data file", array_I_need); exit(1); } ...

/* see if parameters that are needed are present */ if (!SDDS_GetParameterDefinition(&SDDS_table, parameter_I_need)) { fprintf(stderr, "parameter %s is not in the data file", parameter_I_need); exit(1); } ...

/* see if columns that are needed are present */ if (!SDDS_GetColumnDefinition(&SDDS_table, column_I_need)) { fprintf(stderr, "column %s is not in the data file", column_I_need); exit(1); } ...

/* read and process each data table in the data set */ while (SDDS_ReadTable(&SDDS_table)>0) { /* set all rows and all columns to initially be "of interest" */ SDDS_SetColumnFlags(&SDDS_table, 1); SDDS_SetRowFlags(&SDDS_table, 1);

/* access array data */ SDDS_GetArray(...)

/* access parameter data */ SDDS_GetParameter(...)

/* optional row and column selection operations */ SDDS_SetColumnsOfInterest(...); SDDS_SetRowsOfInterest(...); SDDS_FilterRowsOfInterest(...);

/* access tabular data values */ SDDS_GetValue(...) SDDS_GetRow(...) SDDS_GetColumn(...) ... }

borland@aps.anl.gov
Mon Jan 10 14:46:05 CST 1994