sasze  0.0-0.dev0.dirty.el6
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups
sas_utils.h File Reference

SAS Ingest Utility Functions Header. More...

#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <string.h>
#include <time.h>
#include "dsproc3.h"

Go to the source code of this file.

Data Structures

struct  SasFileList
 SAS File List. More...
struct  SasConfigTable
 SAS Configuration Table. More...
struct  SasRecord
 SAS Data Record. More...
struct  SasRawData
 SAS Raw Data Structure. More...

Macros

#define PI   3.1415926
 The constant PI.
#define MISSING   -9999
 Missing value used in data values.
#define SAS_WL_MAX   2048
 Maximum number of wavelengths.
#define SAS_LINE_MAX   32768
 Maximum length of a line in an input file.
#define SAS_VALS_MAX   4096
 Maximum number of data values per line.
#define DEG_TO_RAD(a)   (a * 0.017453292519943)
 Convert degrees to radians.
#define RAD_TO_DEG(a)   (a * 57.29577951308232)
 Convert radians to degrees.
#define INTERPOLATE(x, x0, y0, x1, y1)   (y0 + (x - x0) * ((y1 - y0)/(x1 - x0)))
 Macro to interpolate between two values.
#define GET_REQUIRED_DS_VAR(dataset, varname, var, errval)
 Convenience macro for initializing a variable in an output dataset and getting the index into its data array.
#define ALLOC_DS_VAR(dataset, varname, datap, length, var, errval)
 Convenience macro for initializing a variable in an output dataset and getting the index into its data array.
#define SET_DS_VAR_DATA(dataset, varname, type, length, cvar, var, errval)
 Convenience macro for setting variable data in an output dataset.
#define SET_DS_ATT_IF_FOUND(parent, errval, name, format,...)
 Convenience macro for setting the value of an attribute if it exists in the specified CDSGroup or CDSVar.

Enumerations

enum  SasFileType {
  SASHEVIS,
  SASHENIR,
  SASZEVIS,
  SASZENIR
}
 SAS File Types. More...

Functions

int sas_add_file_to_list (SasFileList *list, const char *file_name)
 Add a file to a SasFileList structure.
void sas_clear_file_list (SasFileList *list)
 Reset a SasFileList structure back to 0 files.
SasFileListsas_create_file_list (void)
 Create a new SasFileList structure.
time_t sas_conf_file_name_time (const char *file_name)
 Get the time from a SASHE or SASZE config file name.
int sas_conf_file_name_time_compare (const void *str1, const void *str2)
 Function used to sort a list of config file names by file name time.
int sas_find_nearest_double (int n, double *x, double v)
 Find the index of a value in an array of doubles.
int sas_find_nearest_float (int n, float *x, float v)
 Find the index of a value in an array of floats.
void sas_free_config_table (SasConfigTable *table)
 Free the memory used by a SasConfigTable.
void sas_free_file_list (SasFileList *list)
 Free the memory used by a SasFileList structure.
void sas_free_raw_data (SasRawData *raw)
 Free the memory used by a SasRawData structure.
DirListsas_get_config_dirlist (const char *conf_dir, const char *pattern)
 Function used to get a list of configuration files.
void sas_get_config_values_double (SasConfigTable *table, int x_col, size_t x_nvals, double *x_vals, int y_col, double *y_vals)
 Get values from a configuration table.
void sas_get_config_values_float (SasConfigTable *table, int x_col, size_t x_nvals, float *x_vals, int y_col, float *y_vals)
 Get values from a configuration table.
void sas_get_config_values_interp_double (SasConfigTable *table, int x_col, size_t x_nvals, double *x_vals, int y_col, double *y_vals)
 Get values from a configuration table using interpolation.
void sas_get_config_values_interp_float (SasConfigTable *table, int x_col, size_t x_nvals, float *x_vals, int y_col, float *y_vals)
 Get values from a configuration table using interpolation.
SasRawDatasas_init_raw_data (SasFileType type)
 Initialize a new SasRawData structure.
SasConfigTablesas_load_config_table (const char *conf_dir, const char *conf_file, size_t ncols, SasConfigTable *table)
 Read in the values from a SAS configuration table file.
int sas_print_config_table (const char *file, SasConfigTable *table)
 Print a configuration table.
time_t sas_raw_file_name_time (const char *file_name)
 Get the time from a SASHE or SASZE raw data file name.
int sas_raw_file_name_time_compare (const void *str1, const void *str2)
 Function used to sort a list of raw file names by file name time.
int sas_set_default_att_values (CDSGroup *dataset)
 Set the default attribute values in an output dataset.
int sas_string_to_doubles (char *string, int buflen, double *buffer)
 Parse a string into an array of doubles.
int sas_read_line (SasRawData *raw, char **line)
 Read a line from the raw data file.
int sas_parse_header (SasRawData *raw)
 Read in the header lines from the raw data file.
int sas_parse_record (SasRawData *raw)
 Parse a line from a raw SASHE or SASZE raw data file.
int sas_read_data (const char *input_dir, const char *file_name, SasRawData *raw, int raw_dsid)
 Read in a raw SASHE or SASZE data file.
int sas_set_a0_metadata (SasRawData *raw, CDSGroup *dataset)
 Set the runtime attributes for an output a0 dataset.
int sas_store_a0_data (SasRawData *raw, int dsid)
 Store data for a SASHE or SASZE a0 datastream.

Detailed Description

SAS Ingest Utility Functions Header.

Definition in file sas_utils.h.