/* This program reads Remote Sensing Systems Scatterometer Level-4 gridded bytemap files, Version-4, GMF: Ku-2011 The data are returned in 1 x 5 x 720 x 1440 arrays. the second index of the array is the data type (wind speed,wind direction and rain bitflag) the third index of the array is the latitude in 1/4 degrees and the fourth is the longitude in 1/4 degrees The center of the first cell of the 1440 column and 720 row map is at 0.125 E longitude and -89.875 latitude. The center of the second cell is 0.375 E longitude, -89.875 latitude. XLAT=0.25*ILAT-90.125 XLON=0.25*ILON-0.125 You must UNZIP FILES before reading them CHANGE filename format of file names are: 3-day qscat_yyyymmddv4_d3d weekly qscat_yyyymmddv4 monthly qscat_yyyymmv4 where ss = satellite number yyyy= year mm = month dd = day of month This main program can be adapted to your needs. It also calls a subroutine that extracts the rain data. Data Types: 1 Wind Speed : windspd = 10m surface wind speed in m/s 2 Wind Direction : winddir = direction wind is flowing to, North is 0 deg 3 Combination Rain Data : use bit extraction to access all data bit pos 0 SCATTEROMETER rainflag (0=no rain, 1=rain) bit pos 1 collocated SSMI, TMI or AMSR observation within 60 min=1, else=0 bit pos 2-7 0-63: radiometer rain where: 0= absolutely no rain 1= rain in one of the adjacent cells 2= Radiometer columnar RR = 0.5 km*mm/hr 3= Radiometer columnar RR = 1.0 4: Radiometer columnar RR = 1.5 etc. Rain subroutine will extract these bit flags and add the following 2 arrays 4 scatflag (0=no rain, 1 = rain) and 5 radrain: 251-255 = no rad data -1.0 = adjacent rain exists 0.0-31.0 = radiometer columnar rain rate in km*mm/hr Data from the daily files are scalar (wind speed) and vector (wind direction) averaged to produce the values in the time-averaged files. A data value for a given cell is only provided in a time-averaged file if a minimum number of pass data exist within the time period being produced (3-day maps, 2 obs; week maps, 5 obs; month maps, 20 obs) 3-day = (average of 3 days ending on file date) weekly= (average of 7 days ending on Saturday of file date) monthly=(average of all days in month) Please make sure your system/compiler reads the data as an array of 8-bit unsigned integer values (0-255) Please read the data description on www.remss.com To contact RSS support: http://www.remss.com/support 8/2014 n.picard */ #ifndef QUIKSCAT_AVERAGED_H #define QUIKSCAT_AVERAGED_H #include #include #include #include #include #include #include #include "dataset.h" using namespace std; class QuikScataveraged : public Dataset { /* Reads averaged QuikScat datasets (3day, weekly, monthly) */ std::string filename; int missing; public: QuikScataveraged(char * _filename, int _missing); QuikScataveraged(char * filename); QuikScataveraged(); void show_rain(int ilat, int ilon, int iasc); void unpack_rain(); std::vector get_attributes(); vector get_dimensions(); std::vector get_coordinates(); std::vector get_variables(); int get_index(std::string var); float get_scale(std::string var); float get_offset(std::string var); std::string get_long_name(std::string var); std::string get_units(std::string var); float get_valid_min(std::string var); float get_valid_max(std::string var); }; class AveragedVerify : public Verify { /* Contains info for verification. */ public: AveragedVerify(); void checkVerify_scat(Dataset &dataset); AveragedVerify(Dataset &dataset); }; #endif