⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ppf_pointing_valid.c

📁 read envisat and analyis sar data from NASA
💻 C
📖 第 1 页 / 共 2 页
字号:
#include <stdio.h>#include <math.h>#include <string.h>#include <stdlib.h>#include <ppf_pointing.h>/* This version number is the SCCS version number valid only for internal configuration and control. *//* The oficial version number can be found in the History box below. */static char PPF_POINTING_VALID_C [] = "@(#)ppf_pointing_valid.c	1.14     01/07/05";/***************************************************************************************** * * Copyright    : DEIMOS Space S.L * Project      : REMASE * * Test level   : VALIDATION * * Module       : ppf_pointing_valid.c * Purpose      : It runs validation tests of PPF_POINTING * * History      +------------------------------------------------------------------------+ *              | Version | Date     | Name         | Change                             | *              |---------|----------|--------------|------------------------------------| *              |    4.1  | 15/01/97 | GMV, S.A.    | First release                      | *              |    4.2  | 30/04/97 | GMV, S.A.    | Second release                     | *              |    4.3  | 18/05/98 | GMV, S.A.    | Third release                      | *              |    4.4  | 13/10/98 | GMV, S.A.    | Fourth release                     | *		|    4.5  | 25/05/99 | GMV, S.A.    | Fifth release                      | *		|    4.6  | 14/04/00 | GMV, S.A.    | Sixth release                      | *              |    4.7  | 22/06/01 | GMV, S.A.    | Seventh release                    | *		|    4.8  | 31/07/00 | GMV, S.A.    | Eigth release                      | *              |    4.9  | 22/10/01 | DEIMOS Space | Ninth release                      | *              |    5.0  | 18/01/02 | DEIMOS Space | Tenth release                      | *              |    5.1  | 25/11/02 | DEIMOS Space | Eleventh release                   | *              |    5.2  | 26/05/03 | DEIMOS Space | Twelfth release                    | *		|    5.3  | 13/12/04 | DEIMOS Space | Thirteenth release                 | *		|   5.3.1 | 15/02/05 | DEIMOS Space | Forteenth release                  | *		|    5.4  | 17/05/05 | DEIMOS Space | Fifteenth release                  | *              +------------------------------------------------------------------------+ * ****************************************************************************************//* putenv declaration *//* ------------------ *//* int putenv(const char*); */#ifdef MACOS  int putenv(const char*);#else  int putenv(char*); /* patched for AIX 4.3 */#endif/* Macro definition *//* ---------------- */#define MAX_CONDITION			1000	/* Maximum number of checks per test case */#define START_VALIDATION		int main(int argc, char *argv[]){ \					double di,th,ta,tb,sinta,costa,sintb,costb; \					double di_l,di_r,th_l,th_r; \					int i,j; \					int checks; \					PL_Boolean condition[MAX_CONDITION]; \					PL_Boolean result;#define START_CHECK(msg)                printf(" *** %s\n",msg); \                                        checks = 0;#define END_CHECK                       result = PL_TRUE; \                                        for (i = 0 ; i < checks ; i++) \                                          { \                                          if (condition[i] == PL_FALSE) \                                            { \                                            result = PL_FALSE; \                                            break; \                                            } \                                          } \                                        if (result == PL_TRUE) \                                          { \                                          printf(" *** RESULT = PASS ***\n\n"); \                                          } \                                        else \ 					  { \                                          printf(" *** RESULT = FAIL ***\n\n"); \                                          }#define CHECK_STATUS(msg,stat)		if (stat < PP_OK ) { \					  condition[checks] = PL_FALSE; \					  printf(" ...\t%s (PL_FALSE)\n",msg); \					}else{ \					  condition[checks] = PL_TRUE; \					  printf(" ...\t%s (PL_TRUE)\n",msg); \					} \                                        checks++;					#define CHECK_PAR(msg,p,p0,dp)		if((di=fabs(p-p0)) <= (th=dp)){ \					  condition[checks] = PL_TRUE; \					  printf(" ...\t%s (PL_TRUE)\n",msg); \					}else{ \					  condition[checks] = PL_FALSE; \					  printf(" ...\t%s (PL_FALSE)\n",msg); \					} \					printf("\t\t Threshold  : %g\n",th); \					printf("\t\t Difference : %g\n",di); \					checks++;#define CHECK_VEC(msg,v,v0,im,iM,dp)	for(i=im;i<=iM;++i){ \					  CHECK_PAR(msg,v[i],v0[i],dp); \					}#define END_VALIDATION			return(0); \					}/* Nominal validation values *//* ------------------------- */double mjdp[] = { -2456.0 , 0.3 };double pos[] = { 4859964.138 , -5265612.059 , 0.002 };double vel[] = { -1203.303801, -1098.845511 , 7377.224410 };double acc[] = { 0.0 , 0.0 , 0.0 };double aocs[] = { PP_AOCS_CX, PP_AOCS_CY, PP_AOCS_CZ };double att[] = { 0.1 , -0.1 , 0.15 };double datt[] = { 0.0 , 0.0 , 0.0 };double longdrs = 15.4;double mjdrs[] = { -2456.0 , 0.3};double posdrs[] = { 40652295. , 11197507.0 , -844.0 };double veldrs[] = { 0.06 , -0.22 , 0.078 };double sta[] = {0.,0.,0.,0.};typedef enum{PL_FALSE = 0,      /* False variable */PL_TRUE = 1        /* True variable */} PL_Boolean;/* Validation for PPF_POINTING *//* --------------------------- */START_VALIDATION/* Local variables definition *//* -------------------------- */	  double   freq;  double   freq_lut;  long     ind;  int put;  char atm_var[200];  double   modulus;  double   local_status;  long  idir, iray, ieres;  long  idir_lut, idir_ini, iray_lut, iray_pred, ieres_lut;   double dir_t[8], res[75];  double dir_lut[8], res_lut[75], res_pred[75];   long   status[15];  char msg[PP_MAX_COD][PP_MAX_STR];  long code[PP_MAX_COD];  long n_msg;  double res_cf[31];  long ierr_cf[4];  double pos_cf[3],vel_cf[3];   double resdrs_cf[33];  int k ;  long func_id, n;/***************************************************************************************** * * --------- * Test case * --------- * * Test number          : VT-9 * ****************************************************************************************/START_CHECK("Cross check between target and stavis")  freq = 1e14;  pos[2] = 500;  /* Input parameters */  /* ---------------- */  dir_t[0] = 102.6883323274972;  dir_t[1] = 35.51035544761065;  dir_t[2] = 0;  dir_t[4] = -0.04221457543826715;  dir_t[5] = 0.01311451967490482;  /* In EF it would be direction (0.21,1,0) */  idir = 1;  iray = 0;  /* NO REF */  ieres = 1; /* Extended results*/  /* Call target */  /* ----------- */  local_status = target(mjdp, pos, vel, acc, aocs, att, datt, &idir, dir_t, &iray, 			&freq, &ieres, res, status);  CHECK_STATUS("target status", local_status)  func_id = PP_TARGET_ID;  local_status = PP_Vector_Msg(&func_id, status, &n_msg, msg);  local_status = PP_Print_Msg(&n_msg, msg);  PP_Vector_Code(&func_id, status, &n_msg, code);  for (k=0; k<n_msg; k++)  {     if (  (code[k] == PP_CFI_TARGET_TS_NO_SUN_VISIBILITY_WARN)        || (code[k] == PP_CFI_TARGET_SM_NO_SUN_VISIBILITY_WARN)        )     {        n = 0;        sprintf(msg[n++], "*** Ignore warning on no sun/moon visibility, it only means that the satellite is in eclipse");             PP_Print_Msg(&n, msg);     }  }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -