📄 ppf_orbit_valid.c
字号:
START_CHECK("genstate and ppforb consistency") status_cf = genstate(mjdr, &irep, &icyc, &rlong, &ascmlst, &iorb0, &iorb0,mjdp, pos_ref, vel_ref, ierr_cf); CHECK_STATUS("genstate",status_cf) pr_mode = -1; /* INI_NOMINAL */ status_cf = ppforb(&pr_mode,mj_anx,xm,mjdp,x,pos_ref,vel_ref,accel,resorb_cf,ierr_cf); CHECK_STATUS("ppforb",status_cf) mjdp[0] = 0.0; mjdp[1] = 0.0; pr_mode = 1; /* PROP_REL */ status_cf = ppforb(&pr_mode,mj_anx,xm,mjdp,x,pos,vel,accel,resorb_cf,ierr_cf); CHECK_STATUS("ppforb",status_cf) CHECK_VEC("ANX position vector",pos,pos_ref,0,2,0.001); CHECK_VEC("ANX velocity vector",vel,vel_ref,0,2,0.001); iorb = iorb0 + 1; status_cf = genstate(mjdr, &irep, &icyc, &rlong, &ascmlst, &iorb0, &iorb , mjdp, pos_ref, vel_ref, ierr_cf); CHECK_STATUS("genstate",status_cf) mjdp[0] = resorb_cf[52]; mjdp[1] = 0.0; pr_mode = PO_PROPAG_ANX + PO_NO_RESULTS; /*PROP_REL+PO_NO_RESULTS*/ status_cf = ppforb(&pr_mode,mj_anx,xm,mjdp,x,pos,vel,accel,resorb_cf,ierr_cf); CHECK_STATUS("ppforb",status_cf) u1[1] = pos[0]; u1[2] = pos[1]; u1[3] = pos[2]; my_aux = sqrt(u1[1]*u1[1]+u1[2]*u1[2]+u1[3]*u1[3]); for(ii=1;ii<=3;ii++) u1[ii]=u1[ii]/my_aux; u2[1] = pos_ref[0]; u2[2] = pos_ref[1]; u2[3] = pos_ref[2]; my_aux = sqrt(u2[1]*u2[1]+u2[2]*u2[2]+u2[3]*u2[3]); for(ii=1;ii<=3;ii++) u2[ii]=u2[ii]/my_aux; my_aux = 6700.0e3*acos(u1[1]*u2[1]+u1[2]*u2[2]+u1[3]*u2[3]); CHECK_PAR("ANX position vector discontinuity [m]",my_aux,0.0,1.0); u1[1] = vel[0]; u1[2] = vel[1]; u1[3] = vel[2]; my_aux = sqrt(u1[1]*u1[1]+u1[2]*u1[2]+u1[3]*u1[3]); for(ii=1;ii<=3;ii++) u1[ii]=u1[ii]/my_aux; u2[1] = vel_ref[0]; u2[2] = vel_ref[1]; u2[3] = vel_ref[2]; my_aux = sqrt(u2[1]*u2[1]+u2[2]*u2[2]+u2[3]*u2[3]); for(ii=1;ii<=3;ii++) u2[ii]=u2[ii]/my_aux; my_aux = acos((u1[1]*u2[1]+u1[2]*u2[2]+u1[3]*u2[3]))*rad2deg; CHECK_PAR("ANX velocity vector discontinuity [deg]",my_aux,0.0,0.001);END_CHECK/**************************************************************************************** * * --------- * Test case * --------- * * Test number : 01_01 * * Purpose : Nominal GENOPS operation * * Doris file : DORIS Nominal orbit 01 * (DOR_NAV_0PTCTD19940630_194000_00000000A001_RRRRR_AAAAA_0000.N1_N01) * * FOS file : Nominal FOS Predicted * (AUX_FPO_AXTFOS19970312_184232_00000000A018_00062_01000_0000.N1_bef) * (Leap second appears in 3rd orbit) * * mode : PO_ALL_REC (=0) * * choice : PO_AUTO_FILE (=0) * * time interval : --- (All values in file are used) * * Expected results : DORIS state vector expected to be returned. * Only few DORIS data filtered. Fast iteration. * * The following conditions need to be true: * o pos[2] >= -0.1 and < 0.1 (if doris result is selected) * ("pos" coordinates are in meters and a point is * considered to be an ANX when its z-coordinate is * smaller than 10 cm in absolute value) * or * o ANX latitude > -5.0 deg and < 5.0 deg (if esoc result is * selected) * * o vel[2] > 7200.0 and < 7600.0 (Ascending node) * * Plots : No * * ****************************************************************************************/#ifdef PL_WINDOWS strcpy(doris_file_path, "..\\example\\data\\"); strcpy(esoc_file_path, "..\\example\\data\\"); #else strcpy(doris_file_path, "../example/data/"); strcpy(esoc_file_path, "../example/data/"); #endif strcpy(start_check_str, "GENOPS validation example");/* strcat(start_check_str, "01");*/ strcpy (doris_file_t, doris_file_path); strcat (doris_file_t, "DOR_NAV_0PTCTD19940630_194000_00000000A001_RRRRR_AAAAA_0000.N1_N"); strcat(doris_file_t, "01"); START_CHECK(start_check_str); /* PO_Verbose();*/ /* Output file directory (and beginning of the output files name) */#ifdef PL_WINDOWS strcpy(test_name,"..\\example\\data\\validation_01_"); /* The output files are written only when an option is included in the library */#else strcpy(test_name,"../example/data/validation_01_"); /* The output files are written only when an option is included in the library */#endif strcat(test_name, "01"); /* Input variables */ choice_t = PO_AUTO_FILE; /* choice = 0 */ mode_t = PO_ALL_REC; /* mode = 0 */ strcpy (fos_file_t, esoc_file_path); strcat (fos_file_t, "AUX_FPO_AXTFOS19970312_184232_00000000A018_00062_01000_0000.N1_bef"); start_sec=72760; end_sec=78830; mjd0_t=16251.0+((start_sec-28.0)/86400.)-18262.0; mjd1_t=16251.0+((end_sec-28.0)/86400.)-18262.0; status = genops( &mode_t, &choice_t, fos_file_t, doris_file_t, &mjd0_t, &mjd1_t, mjdp_t, pos_t, vel_t, &select_t, res_t, ierr_t); mode_t=0; local_status= ppforb (&mode_t, mjdr_t, xm_t, mjdp_t, x_t, pos_t, vel_t, acc_t, res_ppforb_t, ierr_ppforb_t); if (local_status==PO_WARN) { printf("\n\n\"ppforb\" called with genops results in \"init\" mode returns WARN.\n"); } if (local_status==PO_ERR) { printf("\n\n\"ppforb\" called with genops results in \"init\" mode returns ERR.\n"); } if (status != PO_OK) { func_id = PO_PPFORB_ID; po_vector_msg(&func_id, ierr_ppforb_t, &n, msg); po_print_msg(&n, msg); if (status <= PO_ERR) return(PO_ERR); } n = 0; strcpy(msg[n++],"Violation of tight Envisat orbit constraints expected"); strcpy(msg[n++],"po_genops validation data originates from SPOT data"); po_print_msg(&n,msg); CHECK_STATUS("genops", status); printf( "\n------ time: %.12lf \n", mjdp_t[0]); printf( "------ dtime: %.6lf \n", mjdp_t[1]); printf( "------ pos: %18.12lf %18.12lf %18.12lf\n", pos_t[0], pos_t[1], pos_t[2] ); printf( "------ vel: %18.12lf %18.12lf %18.12lf\n", vel_t[0], vel_t[1], vel_t[2]); printf( "------ selected:%ld\n", select_t); if (select_t==1) /* Doris selected */ { /* status is OK or WARN, and doris result is selected */ CHECK_PAR("Checking z-coordinate of ANX", pos_t[2], 0.0, 5.0); CHECK_PAR("Checking z-coordinate of velocity at ANX", vel_t[2], 7400., +200.0); } if (select_t==2) /* ESOC selected */ { /* status is OK or WARN, and esoc result is selected */ /* pl_car_geo */ pl_car_geo(pos_t, vel_t, &lon_gen_t, &lat_gen_t, &h_gen_t, &lond_gen_t, &latd_gen_t, &hd_gen_t); CHECK_STATUS("pl_car_geo",status); CHECK_PAR("Checking latitude of the ANX", lat_gen_t, 0.0, 5.0); CHECK_PAR("Checking z-coordinate of velocity at ANX", vel_t[2], 7400., 200.0); } END_CHECK/***************************************************************************************** * * --------- * Test case * --------- * * Test number : AT-71_01 * * -------------- * Procedure * -------------- * * Test input : the following input condition is introduced: * o To check using DORIS Precise * o To check using DORIS Preliminary * o To check using FOS Restituted * o To check the INTERPOLATION mode (loop of 121 cases) * * Pass/Fail criteria : the following conditions need to be true: * o check status after calling * o check selected * o check MLST * o generate a data file with the interpolated points * ****************************************************************************************/ START_CHECK("Interpol validation example") /* Input variables */ /* Initialisation mode (DORIS Precise): */ /*--------------------------------------*/ mode = PO_INIT_FILE; choice = PO_AUTO_SELECT; ndc = 1; ndl = 0; ner = 0; mjdr0 = -2455.947; mjdr1 = -2455.886; doris_precise_file[0] = &file1[0]; doris_prelim_file[0] = dummy_file[0]; esoc_rest_file[0] = dummy_file[0]; /*strcpy( out_file, "../../acceptance/source/data/interpol/at-71_01/out.test_1" );*/ strcpy( selected_text, "Selected: DORIS Precise" ); selected_value = 1; num = 5; ppf_orb_flag = 0; TEST_INTERPOL_AUX check_mlst = 22.0; TEST_MLST_AUX /* Initialisation mode (DORIS Preliminary): */ /*------------------------------------------*/ mode = PO_INIT_FILE; choice = PO_AUTO_SELECT; ndc = 0; ndl = 1; ner = 0; mjdr0 = -2455.947; mjdr1 = -2455.886; doris_precise_file[0] = dummy_file[0]; doris_prelim_file[0] = &file2[0]; esoc_rest_file[0] = dummy_file[0]; /*strcpy( out_file, "../../acceptance/source/data/interpol/at-71_01/out.test_2" );*/ strcpy( selected_text, "Selected: DORIS Preliminary" ); selected_value = 2; num = 5; ppf_orb_flag = 0; TEST_INTERPOL_AUX check_mlst = 22.083333333; /* 22:05:00 */ TEST_MLST_AUX /* Initialisation mode (FOS Restituted): */ /*---------------------------------------*/ mode = PO_INIT_FILE; choice = PO_AUTO_SELECT; ndc = 0; ndl = 0; ner = 1; mjdr0 = -2455.947; mjdr1 = -2455.886; doris_precise_file[0] = dummy_file[0]; doris_prelim_file[0] = dummy_file[0]; esoc_rest_file[0] = &file3[0]; /* strcpy( out_file, "../../acceptance/source/data/interpol/at-71_01/out.test_3" );*/ strcpy( selected_text, "Selected: FOS Restituted" ); selected_value = 3; num = 5; ppf_orb_flag = 0; TEST_INTERPOL_AUX check_mlst = 21.916666666; /* 21:55:00 */ TEST_MLST_AUX END_CHECKEND_VALIDATION
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -