/* This program reads Remote Sensing Systems Scatterometer Level-4 gridded bytemap daily files, Version-4, GMF: Ku-2011 The data are returned in 2 x 6 x 720 x 1440 arrays. the first index of the array is the morning/evening (ascending/descending) orbit segments the second index of the array is the data type (min gmt,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 with path in form qscat_yyyymmddvv where vv = version 'v4' or 'rt' for real time 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 GMT Time : mingmt = Minute of day GMT 2 Wind Speed : windspd = 10m surface wind speed in m/s 3 Wind Direction : winddir = direction wind is flowing to, North is 0 deg 4 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 5 scatflag (0=no rain, 1 = rain) and 6 radrain: 251-255 = no rad data -1.0 = adjacent rain exists 0.0-31.0 = radiometer columnar rain rate in km*mm/hr 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_DAILY_H #define QUIKSCAT_DAILY_H #include #include #include #include #include #include #include #include "dataset.h" using namespace std; class QuikScatdaily : public Dataset { /* Reads daily QuikScat datasets. */ std::string filename; int missing; public: QuikScatdaily(char * _filename, int _missing); QuikScatdaily(char * filename); QuikScatdaily(); 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 DailyVerify : public Verify { /* Contains info for verification. */ public: DailyVerify(); void checkVerify_scat(Dataset &dataset); DailyVerify(Dataset &dataset); }; #endif