/* Basic reader for the satellite overpass datasets created for the Precipitation Measuring Missions (PMM) Land Surface Working Group (LSWG) case studies Description: Aqua and DMSP (F16, F17, F18) satellite overpasses passing with 700-km of the central field site during MC3E (36.N 97.5W) and GCPEx (44.2N 79.8W) were identified. The AMSR-E (Aqua) and SSMIS (DMSP) microwave radiometric data were extracted for an approximate 8-minute overpass segment centered on the the field site, and matched up with several other datasets necessary to carry out land surface emissivity studies. These other datasets include the NEXRAD NMQ radar mosaic (for knowledge of the rain structure and intensity at the time of the satellite overpass, as well as the previous accumulated precip prior to the satellite overpass time), the NOAA IMS snow mapping system (to identify surface snow or ice cover), and the NASA/GMAO MERRA land and atmospheric reanalysis (for background land and atmospheric state needed for microwave radiative transfer calculations) Currently only AMSR-E data were processed for MC3E and SSMIS for GCPEx. AMSR-E Level 2A V10 data were provided from NSIDC. SSMIS data were provided from the FCDR dataset prepared at Colorado State Univ. NMQ data were provided courtesy of the Univ. of Oklahoma. During the time of GCPEx the 150H channel on F-18 began to experience problems so this channel is not reliable after 14 Feb 2012 (rev number 11988). ASCII filename syntax examples: 20110501192549.333.20070.32.284.286.20.amsre.aqua.txt 20120222222348.473.14479.04.273.270.06.ssmis.f16.txt Each field in the filename refers to the following: 1= satellite scan time in YYYYMMDDHHMMSS for the sensor scan closest to the central field site during MC3E (for AMSRE data) and GCPEx (for SSMIS data) 2= closest distance in km between satellite subtrack and the field site (i.e., 0= satellite passed directly above the central site) 3= number of NMQ pixels identified as raining within 150-km of the central site location 4= maximum NMQ rainrate found in the total NMQ pixels in mm/hr 5= 2-meter air temp in Kelvin at the central site, at the sat overpass time, interpolated from MERRA 6= surface skin temp in Kelvin at the central site, at the sat overpass time, interpolated from MERRA 7= total column vapor in mm at the central site, at the sat overpass time, interpolated from MERRA 8= sensor name (amsre or ssmis) 9= satellite name (aqua for AMSRE and f16, f17, or f18 for SSMIS) For each dataset there is a corresponding quicklook image, which provides an 8-panel PNG image montage of various TB channels and other products, to assist in identifying case studies. The quicklook image has the same name except with a "png" extension instead of "txt". 27 Feb 2013 Joe Turk jturk@jpl.nasa.gov */ #include #include #include #include #include main(argc,argv) int argc; char *argv[]; { if ( argc != 2 ) { printf("Usage: %s FILE\n", argv[0]); exit(-1); } FILE *fp; int i, j, k, sfc, yyyy, mm, dd, hh, mn, ss; int scan, pixel; float lat, lon, tb[16]; int ims[10]; int nmq_type; float nmq_rate, nmq_1h, nmq_3h, nmq_6h, nmq_12h, nmq_24h; float merra_ts, merra_t2m, merra_t10m, merra_tqv; int merra_nlay1; int ilay; float merra_h, merra_p, merra_t, merra_qv; char clay[32]; if ((fp= fopen(argv[1],"r")) == 0) { printf("Unable to open %s\n", argv[1]); exit(-1); } while ( feof(fp) == 0 ) { /* scan scan number from the original AMSRE or SSMIS file. AMSRE has about 2000 lo-resolution (10/19/37 GHz ) scans per file and SSMIS has */ /* pixel across track pixel number in the lo-resolution pixels AMSRE has 243 lo-res pixels each scan and SSMIS has 90 */ /* sfc surface flag 1=land 2=water 3=coast */ /* lat and lon are the lo-resolution channel pixel coordinates */ /* time is provided by yyyy=year mm=month dd=day hh=hour mn=minute ss=second */ fscanf(fp,"%d %d %d %f %f %d %d %d %d %d %d\n", &scan, &pixel, &sfc, &lat, &lon, &yyyy, &mm, &dd, &hh, &mn, &ss); /* AMSRE TB order is tb10v tb10h tb18v tb18h tb23v tb23h tb36v tb36h tb89v tb89h -1 -1 -1 -1 -1 -1 (10 values and 6 missing) */ /* SSMIS TB order is tb19v tb19h tb22v tb37v tb37h tb91v tb91h tb150h tb183/1 tb183/3 tb183/7 tb50 tb52 tb53 tb54 tb55 (16 values) */ for (k=0; k< 16; k++) fscanf(fp,"%f", &tb[k]); fscanf(fp,"\n"); /* NOAA Interactive Multisensor Snow and Ice Mapping System (IMS) current and previous nine days (10 values total) */ /* -1=missing 0=not northern hemisphere 1=water 2=land 3=ice cover 4=snow cover */ for (k=0; k< 10; k++) fscanf(fp,"%d", &ims[k]); fscanf(fp,"\n"); /* NOAA NEXRAD mosaic (NMQ) averaged over a 25x25-km region surrounding each TB pixel */ /* nmq_type -1=missing 0=no precip 1=stratiform 2=bright band 3=snow 4=overshooting 6=convective 7=hail 9=warm rain/tropical */ /* the value provided is the mode (most common value) of the 25x25=625 values */ /* nmq_rate rainrate in mm/hr from the nearest 5-minute NMQ volume -1=missing */ /* nmq_1h one-hour accumulated rain in mm. Similar for 3, 6, 12 and 24 hr accumulations -1=missing */ fscanf(fp,"%d %f %f %f %f %f %f\n", &nmq_type, &nmq_rate, &nmq_1h, &nmq_3h, &nmq_6h, &nmq_12h, &nmq_24h); /* NASA/GMAO MERRA reanalysis, interpolated in time and location to each TB pixel */ /* ts= surface skin temp in Kelvin t2m= 2-meter air temp in Kelvin t10m= 10-m air temp in Kelvin tqv= total column vapor in mm */ /* merra_nlay1= number of pressure layers+1 This tells you how many lines to next read in the temperature profile. There are nlay+1 values since /* there are nlay layers and the surface (i.e., the last line read is the surface). For the surface the temperature and /* specific humdity are not provided (value= -1). Note that the surface skin temperature is provided on the previous line separately, /* since its value was extracted from a MERRA land dataset whereas the temperature profile comes from an atmospheric dataset */ fscanf(fp,"%f %f %f %f %d\n", &merra_ts, &merra_t2m, &merra_t10m, &merra_tqv, &merra_nlay1); /* Print out values for the SSMIS subtrack (middle pixel= 122 for AMSRE, 45 for SSMIS) */ if ( pixel == 45 ) { printf("Scan=%4d Date=%04d/%02d/%02d %02d:%02d:%02d LatLon=%8.3f %8.3f Ts=%6.2f TotVap=%6.2f NMQ=%6.2f TB=", scan, yyyy, mm, dd, hh, mn, ss, lat, lon, merra_ts, merra_tqv, nmq_rate); for (k=0; k< 16; k++) printf("%6.2f ", tb[k]); printf("\n"); } /* ilay=layer interface number increasing from top-down. The last line read is the surface */ /* merra_h= geopotential height in m, merra_p=pressure in hPa, merra_qv= specific humidity in g/g */ for (k=0; k< merra_nlay1; k++) { fscanf(fp,"%d %f %f %f %f\n", &ilay, &merra_h, &merra_p, &merra_t, &merra_qv); if ( pixel == 45 ) { if ( k == merra_nlay1-1) sprintf(clay,"%s","Surface"); else sprintf(clay,"Top of layer %2d",k+1); printf("%16s Height=%8.2f Pres=%8.2f Temp=%8.2f SpecHumid=%12.8f\n", clay, merra_h, merra_p, merra_t, merra_qv); } } } fclose(fp); return(0); }