The profiler processing code is made up of 3 programs written by me. Once Jeff's program profiler_to_netcdf is run to convert profiler data from pop format to netcdf format the 3 programs can be used. They all use the structures defined in ProfTypes.h.

spc_to_mom_hs

spc_to_mom_hs converts spectra to moments using the hildebrand- sekhon algorithm. This program is mainly used for the spaced antenna data that didn't have any pop moments created or saved for it. It should imitate what pop does to compute moments. So, if pop moments are available, there is really no reason to use this program. The code itself consists of the following routines:

 

where,

etl_find_signal.c could be replaced with atd_find_signal.c

atd_moments.c could be replaced with atd_moments.c

atd_noise.c could be replaced with etl_noise.c

 

etl_clutter.c has not been tested or implemented.

qc_mom_ww

qc_mom_ww qc's the data using the etl method which calls the weber/wuertz algorithm.

mom_to_wind_etl

mom_to_wind_etl computes winds onto a given grid. Uses:

ProfTypes.h

#ifndef _ProfTypes_

#define _ProfTypes_

 

#include <time.h>

 

#define STR_LEN 31

#define LABELEN 11

#define FILENAME_LEN 80

 

#define BYTE_FILL 0

#define LONG_FILL -99999

#define SHORT_FILL -9999

#define FLOAT_FILL -99999.

#define FLOAT_MSG -999.

 

/**************************************************************/

/* structure holding information about the site location */

typedef struct

{

float lat; /* latitude */

float lon; /* longitude */

short elev; /* site elevation */

char name[STR_LEN]; /* site name */

float frequency; /* profiler frequency */

} Site_t;

 

/************************************************************/

/* structures holding header information for the profilers */

typedef struct

{

short nbeams; /* number of beams */

short *nbprofs; /* array of nbeams (number of profiles per beam) */

} BeamInfo_t;

 

 

/* Beam information (separate from other header so that different beams */

/* can be held in the same TimeSeriesProfiles structure */

typedef struct

{

short beam;

short azimuth;

short elevation;

char dir_label[STR_LEN];

} Beam_t;

 

/* General header (used for winds and rass computed data) */

typedef struct

{

short num_heights;

long ipp;

char method[STR_LEN];

} GenHeader_t;

 

/* Spectra header */

typedef struct

{

short num_heights;

short num_bins;

 

unsigned char data_type;

long ncoh_int; /* number of coherent integrations */

long ipp; /* inter-pulse period */

long pulse_width; /* pulse width */

long rcvr_delay; /* receiver delay */

long gate_spacing;

long sample_delay;

long nspec_avg; /* number of spectra averaged */

long nfft; /* number of fft's */

unsigned char pcbits;

unsigned char dc_onoff;

unsigned char windowing;

float declutter_hgt;

char method[STR_LEN];

} SpcHeader_t;

 

/* Moment header */

typedef struct

{

short num_heights;

 

unsigned char data_type;

long ncoh_int; /* number of coherent integrations */

long ipp; /* inter-pulse period */

long pulse_width;

long rcvr_delay; /* receiver delay */

long gate_spacing;

long sample_delay;

long nspec_avg; /* number of spectra averaged */

long nfft;

unsigned char pcbits;

unsigned char dc_onoff;

unsigned char windowing;

float declutter_hgt;

unsigned char calib_constant;

unsigned char window_correction;

unsigned char noise_correction;

} MomHeader_t;

 

/*************************************************************/

/* Structures containing all data for a given time */

/* unless otherwise specified all pointers indicate arrays of */

/* (0 ... number of heights) */

 

/* Spectra data */

typedef struct

{

float *height;

float **spectra_dbs; /* (dbs=doppler beam swinging) two dimensional (nfft x ht) */

} SpcData_t;

 

/* Moment data */

typedef struct

{

float *height;

float *doppler; /* or velocity or 1st moment */

float *spectrum_width;

float *snr; /* signal to noise ratio */

float *noise;

float *power;

float *temp; /* temperature */

short *qc; /*quality control value */

float *interp_vel; /* interpolated velocity (or doppler) */

float *error_estimate; /* error estimate for the interpolated velocity */

} MomData_t;

 

/* Meteorological components and computed winds data */

typedef struct

{

float *height;

float *u_comp; /* u component */

float *v_comp; /* v component */

float *w_comp; /* w component */

float *speed;

float *direction;

float *error_estimate; /* error estimate for these averaged values (u,v,w) */

} WindData_t;

 

/* computed temperature data */

typedef struct

{

float *height;

float *temperature;

} RassData_t;

 

/***************************************************************/

/* Structures holding all information for a single profile in time */

 

/* one moment profile */

typedef struct

{

time_t itime; /* time stamp of this profile */

Beam_t beam;

MomData_t data;

} MomProfile_t;

 

/* one spectra profile */

typedef struct

{

time_t itime; /* time stamp of this profile */

Beam_t beam;

SpcData_t data;

} SpcProfile_t;

 

/* one wind profile */

typedef struct

{

time_t itime; /* time stamp of this profile */

WindData_t data;

} WindProfile_t;

 

/* one rass profile */

typedef struct

{

time_t itime; /* time stamp of this profile */

RassData_t data;

} RassProfile_t;

 

/***************************************************************/

/* Structures holding all information for a time series of profiles */

 

/* Time Series of Moment Profiles */

typedef struct

{

Site_t site;

MomHeader_t *header;

char method[STR_LEN]; /* method used to compute moments */

short num_profs; /* number of profiles in this time series */

BeamInfo_t beaminfo;

MomProfile_t *prof; /* array of (0 ... number of profiles) */

} MomTsProfiles_t;

 

/* Time Series of Spectra Profiles */

typedef struct

{

Site_t site;

SpcHeader_t *header;

short num_profs; /* number of profiles */

SpcProfile_t *prof; /* array of (0 ... number of profiles) */

} SpcTsProfiles_t;

 

/* Time Series of Wind Profiles */

typedef struct

{

Site_t site;

GenHeader_t header;

short num_profs; /* number of profiles */

WindProfile_t *prof; /* array of (0 ... number of profiles */

} WindTsProfiles_t;

 

/* Time Series of Rass Profiles */

typedef struct

{

Site_t site;

GenHeader_t header;

short num_profs; /* number of profiles */

RassProfile_t *prof; /* array of (0 ... number of profiles */

} RassTsProfiles_t;

/***************************************************************/

 

 

typedef struct

{

MomHeader_t mheader;

Site_t msite;

MomProfile_t mom;

SpcHeader_t sheader;

Site_t ssite;

SpcProfile_t spc;

} NetCDFStuff;

 

#endif