/*----------------------------------------------------------------------*\ | Structure and function definitions for Desert Winds I/O routines | | | | Peter N. Schweitzer (U.S. Geological Survey, Reston, VA 22092) | \*----------------------------------------------------------------------*/ #ifndef DW_H #define DW_H 1 #define MISSING_VALUE -99 struct dms { short degrees; short minutes; short seconds; }; struct location { struct dms latitude; struct dms longitude; }; struct dwd { unsigned short year; unsigned short day; unsigned short hour; unsigned short minute; float hum; /* Humidity */ float ppt; /* Precipitation */ float bp; /* Barometric Pressure */ float wd; /* Wind Direction */ float ws20; /* Wind Speed at 20ft */ float pg20; /* Peak Gust at 20ft */ float ws88; /* Wind Speed at 8.8ft */ float ws4; /* Wind Speed at 4ft */ float pg4; /* Peak Gust at 4ft */ float at20; /* Air Temperature at 20ft */ float at4; /* Air Temperature at 4ft */ float st4; /* Soil Temperature at 4cm */ float st10; /* Soil Temperature at 10cm */ float st20; /* Soil Temperature at 20cm */ float srsi; /* Solar Radiation (short wavelength, incoming) */ float srli; /* Solar Radiation (long wavelength, incoming) */ float srso; /* Solar Radiation (short wavelength, outgoing) */ float srlo; /* Solar Radiation (long wavelength, outgoing) */ float sb; /* Shadow Band */ float bt1; /* Brightness Temperature, band 1 */ float bt2; /* Brightness Temperature, band 2 */ float bt3; /* Brightness Temperature, band 3 */ float bt4; /* Brightness Temperature, band 4 */ }; struct dw_file { struct dw_file *prev; struct dw_file *next; char name [FILENAME_MAX]; FILE *f; char binary; char version; short must_swap_bytes; struct location where; struct dwd *(*read)(struct dw_file *dwf, struct dwd *d); int (*write)(struct dw_file *dwf, struct dwd *d); }; extern struct dw_file *dw_open (char *name, char *mode, struct location *where); extern struct dwd *dw_read (struct dw_file *f, struct dwd *d); extern int dw_write (struct dw_file *f, struct dwd *d); extern void dw_close (struct dw_file *f); #endif /*----------------------------------------------------------------------*\ \*----------------------------------------------------------------------*/