/************************************************************************************ * * * Program - rd_ax_drakkr.c * * * * AUTHOR: Mandira Mukherjee * * * * Date: 10/14/94 * * * *PURPOSE/DESCRIPTION: * * The goals of ASTEX were pursued by combining measurements * * from aircraft, satellites, ships and islands. Surface based * * measurements were made from the island of Santa Maria (in * * the Azores) and Porto Santo (near Madeira) and four research* * vessels- NOAA's Oceanus and Malcolm Baldrige, the German Ship* * Valdivia and the French Ship Le Suroit. Soundings were made * * from Le Suroit and Oceanus. * * * * DRAKKAR is an upward pointing, two channel microwave * * radiometer. Its channels are 23.8 and 36.5 GHz, and the an- * * tenna aperture is about 15deg. It has been developed at CRPE* * on the base of the ATSR/M (ERS-1/MWR) design. * * Its basic sampling was 0.5s during ASTEX. The calibration was* * performed before the campaign, verified using a cold load on* * 12th June, and verified again after return to France. * * During ASTEX, DRAKKAR was located on the upper level, upward* * pointing. * * Each article is respectively composed by: * * * the hour of the beginning of the 30s seconds period on * * which averages are done. * * * the 6 following numbers are the mean and the standard * * deviation of the microwave brightness temperatures * * - 23.8 GHz and of the integrated water vapor content * * (in g/cm2). * * Empirical corrections have been done for the first june to the* * seventh (calibration variation due to the change of the "radome"* * sheet). * * * ************************************************************************************/ #include #include #include #include #include #include #include #define RECSIZE 80 #define PARAMS 7 main (argc,argv) int argc; char *argv[]; { void Print_heading(); /* prints the heading of the data set */ void Get_par_type(); /* displays the choice of parameters */ char filename1[MAXPATHLEN+1]; /* name of the file as first argv */ char buf[256]; /* buffer to read strings at a time */ char par_type[10],tmp[10]; /* storage of requested parameter */ char col1[10]; /* storing time*/ FILE *fptr; /* file pointer */ int i,rec_count,count, /* counters */ param[PARAMS], /* array of parameters */ day,hour; double col2,col3,col4,col5,col6,col7; /* variables 2 thru 7 */ /*********************************************************************************/ void Print_heading(); for (count = 0;count < PARAMS; count++) { param[count] = -99; } (void) Print_heading(); if (argc == 1) { printf("Please enter the datafile name: "); scanf("%s",filename1); } else { strcpy (filename1,argv[1]); } printf ("\n\n"); printf("The datafile to be read is %s \n", filename1); Get_par_type(tmp,par_type,count,param); /*************** Read dataset and print the required Heading and the data********/ count = 0; /*Print header of requested Parameters*/ for ( count =1; count <= PARAMS;count++) { switch (param[count - 1]) { case 0: printf(" TIME "); break; case 1: printf (" MEAN RAD(23.8)"); break; case 2: printf(" STD DEV"); break; case 3: printf(" MEAN RAD(36.5)"); break; case 4: printf(" STD DEV"); break; case 5: printf(" WATER VAP(23.8)"); break; case 6: printf("WATER VAP(36.5)"); break; default: break; } /* end of case statement */ } /* end of for loop */ printf("\n"); /**************************************************************************/ if ((fptr = fopen(filename1,"r"))==NULL) { printf("***************************************************\n"); printf("ERROR-UNABLE TO OPEN DATA FILE. PROGRAM HAS TERMINATED\n"); printf("******************************************************\n"); exit(-1); } rec_count = 0; while ((feof(fptr)) ==0) { col2 = 0.0; col3 = 0.0; col4 = 0.0; col5 = 0.0; col6 = 0.0; col7 = 0.0; fgets(buf,80,fptr); sscanf(buf,"%s%lf%lf%lf%lf%lf%lf",col1,&col2,&col3,&col4,&col5,&col6,&col7); /* printf("%s .2lf% .2lf% .2lf% .2lf% .2lf% .2lf%\n",col1,col2,col3,col4,col5,col6,col7);*/ printf("\n"); if ((feof(fptr)!=0)) { printf("\n\n\n"); printf("----------------------------------------------------\n"); printf("*THE END OF FILE HAS BEEN REACHED........ \n"); printf(" THIS IS A NORMAL TERMINATION........... \n"); printf(" THE TOTAL NUMBER OF RECORDS: %d\n", rec_count); printf("-----------------------------------------------------\n"); exit(0); } ++rec_count; for ( count = 1; count <= PARAMS; count++) { switch (param[count -1]) { case 0: printf(" %s ",col1); break; case 1: printf (" %.2lf",col2); break; case 2: printf (" %.2lf",col3); break; case 3: printf (" %.2lf", col4); break; case 4: printf (" %.2lf",col5); break; case 5: printf (" %.2lf",col6); break; case 6: printf (" %.2lf",col7); break; } /* End of Switch */ } /*End of for */ printf ("\n"); } /* End of while */ fclose(fptr); } /* End of main */ /******************************************************************************** * * * FILE: Print_heading * * * * AUTHOR: Mandira Mukherjee * * * * PURPOSE/DESCRIPTION: Prints the heading for the FIRE_ASTEX_NAT_SOFIA program. * * * * INVOCATION: * * (void) Print_heading() * * * * INTERNAL ROUTINES: * * NONE. * * * * EXTERNAL ROUTINES: * * NONE * * * *********************************************************************************/ void Print_heading() { printf("\n\n"); printf("***********************************************************\n"); printf("* *\n"); printf("* FIRE_ASTEX_NAT_SOFIA_DRAKKAR *\n"); printf("* Read Program *\n"); printf("* *\n"); printf("* Version 1.00 September 30, 1994 *\n"); printf("* *\n"); printf("***********************************************************\n"); printf("\n"); } /* End of Printing */ /********************************************************************************* * * * FILE: Get_par_type * * * * AUTHOR: Mandira Mukherjee. * * * * PURPOSE/DESCRIPTION: * * There are seven parameters in FIRE_ASTEX_NAT_SOFIA_DRAKKAR * * dataset. They are Time (hr/min/sec), Mean microwave * * radiation(23.8 GHz), Standard Deviation at 23.8 microwave * * radiance (GHz), Mean microwave radiation(36.5 GHz), * * Standard Deviation at 36.5 GHz, Water Vapor Content * * (23.8g/cm2), Water Vapor content (36.5 g/cm2). * * * * INVOCATION: * * (void) Get_par_type * * * * INTERNALROUTINES: * * NONE: * *********************************************************************************/ void Get_par_type(tmp,par_type,count,param) int count,param[10]; char *par_type,*tmp; { char par[15]; /* Temp var to store type */ int pe; printf("\n"); printf("Seven parameters of information that were \n"); printf("collected at each event. These parameters are: \n"); printf("\n"); printf(" NO. Parameter Units \n"); printf(" ----- --------- ----- \n"); printf(" 1. Time hr/min/sec \n"); printf(" 2. Mcrw. Brightness Temps. (23.8 GHz)-Mean C \n"); printf(" 3. Mcrw. Brightness Temps. (23.8 GHz)-St. Dev. C \n"); printf(" 4. Mcrw. Brightness Temps. (36.5 GHz)-Mean C \n"); printf(" 5. Mcrw. Brightness Temps. (36.5 GHz)-St. Dev. C \n"); printf(" 6. Water Vapor Content (23.8 GHz) g/cm^2 \n"); printf(" 7. Water Vapor Content (36.5 GHz) g/cm^2 \n"); printf("\n\n"); /* SELECT PARAMETERS */ par_type[0]= 'q'; while ((par_type[0]!='a') && (par_type[0] != 'A') && (par_type[0] != 's') && (par_type[0]!= 'S') && (par_type[0] != 'X') && (par_type[0] != 'x')) { printf(" Please indicate the number of parameters to be printed \n"); printf(" Please select: a or A for ALL parameters\n"); printf(" S or s for some and X or x to exit the program\n\n\n"); scanf("%s",par_type); strcpy(tmp,par_type); } if ((strcmp(par_type,"a")== 0) || (strcmp(par_type,"A")== 0)) { for (count =0; count <= PARAMS; count++) param[count]= count; } else if ((strcmp(par_type, "s")== 0) || (strcmp(par_type,"S")== 0)) { printf ("**********Parameters selection Requested*************\n"); for (count =1; count <= PARAMS;count++) { printf("Enter q to end selection or X to exit program\n"); printf("Please enter parameter #%d-------->",count); scanf("%s",par_type); printf("%s\n",par_type); strcpy(tmp,par_type); if ((strcmp(par_type,"X")==0) || (strcmp(par_type,"x")== 0)) { printf ("\n\n"); printf("*******EXIT PROGRAM***********\n"); exit(-1); } if(((strcmp(par_type,"q")== 0) || (strcmp(par_type,"Q")== 0))&& (count == 1)) { printf("**********NO SELECTION OF PARAMETERS**********\n"); printf("*********EXIT PROGRAM*************************\n"); exit(-1); } if ((strcmp(par_type,"q")== 0) || (strcmp(par_type,"Q")== 0)) { break; } if ((atoi(tmp) > PARAMS) || (atoi(tmp) <= 0)) { printf("\n"); printf(" THE TOTAL PARAMETERS AVAILABLE ARE 1 THRU 7\n"); printf(" THE REQUESTED PARAMETER IS OUT OF RANGE\n"); strcpy(tmp," "); } pe = atoi(par_type); param[count-1]= pe -1; } /*end of for statement */ } /* end of else if */ else if ((strcmp(par_type,"x")== 0) || (strcmp(par_type,"X")== 0)) { printf ("\n\n"); printf("****************EXIT PROGAM*****************\n"); exit(0); } } /* end of the get_type function */ /*********************************************************************************/