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

📄 ppf_lib_c.c

📁 read envisat and analyis sar data from NASA
💻 C
📖 第 1 页 / 共 2 页
字号:
   sprintf(msg[n++], "- az2_t: %lf ", az2_t);	/* Topocentric azimuth of the geodesic line between the two points at point 2 [deg] */   pl_print_msg(&n, msg);/* From Transport to Processing and External formats *//* ------------------------------------------------- */    mjdt[0] =  -1L;				/* UTC time [integer days] */   mjdt[1] =  43200L;				/* UTC time [integer seconds] */   mjdt[2] =  0L;				/* UTC time [integer microseconds] */   mjdt[3] =  -500000L;				/* Delta UT1 [integer microseconds] */   n = 0;   sprintf(msg[n++], "\n\nPL_TMJD\n");        pl_print_msg(&n, msg);   ext_status = tmjd( mjdt, mjdp, utce, dut1e );   if (ext_status != PL_OK)   {        func_id = PL_TMJD_ID;      pl_vector_msg(&func_id, &ext_status, &n, msg);      pl_print_msg(&n, msg);           if (ext_status <= PL_ERR) return(PL_ERR);    /* CAREFUL: extended status */   }      n = 0;     sprintf(msg[n++], "- mjdp[0]: %lf ", mjdp[0] );	/* UTC time in MJD2000 [days] */   sprintf(msg[n++], "- mjdp[1]: %lf ", mjdp[1] );	/* Delta UT1 [s] */   sprintf(msg[n++], "- utce   : %s ", utce );	/* UTC time in calendar format [-] */   sprintf(msg[n++], "- dut1e  : %s ", dut1e );	/* Delta UT1 in calendar format [-] */   pl_print_msg(&n, msg);/* From External to Transport and Processing formats *//* ------------------------------------------------- */    strcpy( utce_2, utce );   strcpy( dut1e_2, dut1e );    n = 0;   sprintf(msg[n++], "\n\nPL_EMJD\n");        pl_print_msg(&n, msg);   ext_status = emjd( mjdt_2, mjdp_2, utce_2, dut1e_2 );   if (ext_status != PL_OK)   {        func_id = PL_EMJD_ID;      pl_vector_msg(&func_id, &ext_status, &n, msg);      pl_print_msg(&n, msg);           if (ext_status <= PL_ERR) return(PL_ERR);    /* CAREFUL: extended status */   }      n = 0;     sprintf(msg[n++], "- mjdt[0]: %ld ", mjdt_2[0] );   sprintf(msg[n++], "- mjdt[1]: %ld ", mjdt_2[1] );   sprintf(msg[n++], "- mjdt[2]: %ld ", mjdt_2[2] );   sprintf(msg[n++], "- mjdt[3]: %ld ", mjdt_2[3] );   sprintf(msg[n++], "- mjdp[0]: %lf ", mjdp_2[0] );   sprintf(msg[n++], "- mjdp[1]: %lf ", mjdp_2[1] );   pl_print_msg(&n, msg);/* From Processing to Transport and External formats *//* ------------------------------------------------- */    mjdp_3[0] = mjdp[0];   mjdp_3[1] = mjdp[1];    n = 0;   sprintf(msg[n++], "\n\nPL_PMJD\n");        pl_print_msg(&n, msg);   ext_status = pmjd( mjdt_3, mjdp_3, utce_3, dut1e_3 );   if (ext_status != PL_OK)   {        func_id = PL_PMJD_ID;      pl_vector_msg(&func_id, &ext_status, &n, msg);      pl_print_msg(&n, msg);           if (ext_status <= PL_ERR) return(PL_ERR);    /* CAREFUL: extended status */   }      n = 0;     sprintf(msg[n++], "- mjdt[0]: %ld ", mjdt_3[0] );   sprintf(msg[n++], "- mjdt[1]: %ld ", mjdt_3[1] );   sprintf(msg[n++], "- mjdt[2]: %ld ", mjdt_3[2] );   sprintf(msg[n++], "- mjdt[3]: %ld ", mjdt_3[3] );   sprintf(msg[n++], "- utce   : %s ", utce_3 );   sprintf(msg[n++], "- dut1e  : %s ", dut1e_3 );   pl_print_msg(&n, msg);/* Adding two times in Transport Format *//* ------------------------------------ */    mjdt_a1[0] =  1111L;   mjdt_a1[1] =  86000L;   mjdt_a1[2] =  333333L;   mjdt_a1[3] =  4444L;    mjdt_add[0] =  111L;   mjdt_add[1] =  422L;   mjdt_add[2] =  800000L;   mjdt_add[3] =  0L;    n = 0;   sprintf(msg[n++], "\n\nPL_TADD\n");        pl_print_msg(&n, msg);   ext_status = tadd( mjdt_a1, mjdt_a3, mjdt_add );   if (ext_status != PL_OK)   {        func_id = PL_TADD_ID;      pl_vector_msg(&func_id, &ext_status, &n, msg);      pl_print_msg(&n, msg);           if (ext_status <= PL_ERR) return(PL_ERR);    /* CAREFUL: extended status */   }      n = 0;     sprintf(msg[n++], "-   mjdt_1[0]: %d [1]: %d [2]: %d [3]: %d ", mjdt_a1[0], mjdt_a1[1], mjdt_a1[2], mjdt_a1[3] );   sprintf(msg[n++], "- mjdt_add[0]: %d [1]: %d [2]: %d [3]: %d ", mjdt_add[0], mjdt_add[1], mjdt_add[2], mjdt_add[3] );   sprintf(msg[n++], "-   mjdt_t[0]: %d [1]: %d [2]: %d [3]: %d ", mjdt_a3[0], mjdt_a3[1], mjdt_a3[2], mjdt_a3[3] );   pl_print_msg(&n, msg);/* Substracting two times in Transport Format *//* ------------------------------------------ */    n = 0;   sprintf(msg[n++], "\n\nPL_TSUB\n");        pl_print_msg(&n, msg);   ext_status = tsub( mjdt_a3, mjdt_a1, mjdt_sub );   if (ext_status != PL_OK)   {        func_id = PL_TSUB_ID;      pl_vector_msg(&func_id, &ext_status, &n, msg);      pl_print_msg(&n, msg);           if (ext_status <= PL_ERR) return(PL_ERR);    /* CAREFUL: extended status */   }      n = 0;     sprintf(msg[n++], "-   mjdt_t[0]: %d [1]: %d [2]: %d [3]: %d ", mjdt_a3[0], mjdt_a3[1], mjdt_a3[2], mjdt_a3[3] );   sprintf(msg[n++], "-   mjdt_1[0]: %d [1]: %d [2]: %d [3]: %d ", mjdt_a1[0], mjdt_a1[1], mjdt_a1[2], mjdt_a1[3] );   sprintf(msg[n++], "- mjdt_sub[0]: %d [1]: %d [2]: %d [3]: %d ", mjdt_sub[0], mjdt_sub[1], mjdt_sub[2], mjdt_sub[3] );   pl_print_msg(&n, msg);/* From SBT to UTC *//* --------------- */    obtm_1 =  0xABCDEF01Lu;   obtl_1 =  0x81200000Lu;	/* bits 33, 40 and 43 set, rest is zero                */   				/* effect: lower rounding to 43 (i.e. same bit values) */   				/*         lower rounding to 40 (i.e. same bit values) */   				/*         upper rounding to 32 (i.e. bit32 value +1 ) */   mjdt_s1[0] =  1111L;   mjdt_s1[1] =  86000L;   mjdt_s1[2] =  333333L;   mjdt_s1[3] =  dummy_l;   sbt0  =  0x80000000Lu;   per0  =  1.0E12 /  256.0;    mjdt_s2[3] =  123L;   n = 0;   sprintf(msg[n++], "\n\nPL_SBTUTC\n");        pl_print_msg(&n, msg);   ext_status = sbtutc( mjdt_s1, &sbt0, &per0, &obtm_1, &obtl_1, mjdt_s2 );   if (ext_status != PL_OK)   {        func_id = PL_SBTUTC_ID;      pl_vector_msg(&func_id, &ext_status, &n, msg);      pl_print_msg(&n, msg);           if (ext_status <= PL_ERR) return(PL_ERR);    /* CAREFUL: extended status */   }      n = 0;     sprintf(msg[n++], "- mjdt_1[0]: %d [1]: %d [2]: %d [3]: %d ", mjdt_s1[0], mjdt_s1[1], mjdt_s1[2], mjdt_s1[3] );   sprintf(msg[n++], "- mjdt_2[0]: %d [1]: %d [2]: %d [3]: %d ", mjdt_s2[0], mjdt_s2[1], mjdt_s2[2], mjdt_s2[3] );   pl_print_msg(&n, msg);/* From UTC to SBT *//* --------------- */    n = 0;   sprintf(msg[n++], "\n\nPL_UTCSBT\n");        pl_print_msg(&n, msg);   ext_status = utcsbt( mjdt_s1, &sbt0, &per0, &obtm_2, &obtl_2, mjdt_s2 );   if (ext_status != PL_OK)   {        func_id = PL_UTCSBT_ID;      pl_vector_msg(&func_id, &ext_status, &n, msg);      pl_print_msg(&n, msg);           if (ext_status <= PL_ERR) return(PL_ERR);    /* CAREFUL: extended status */   }       /* round to 43 bits */        dround = (double) round43;    dsbt = (double) obtm_2 + (double) obtl_2 / dwrap ;    dsbt  = (floor( dsbt * dround + 0.5)) / dround ;     sbtm43 = (unsigned long) dsbt ;    sbtl43 = (unsigned long) ((dsbt - (double)(sbtm43)) * dwrap);    /* round to 40 bits */        dround = (double) round40;    dsbt = (double) obtm_2 + (double) obtl_2 / dwrap ;    dsbt  = (floor( dsbt * dround + 0.5)) / dround ;     sbtm40 = (unsigned long) dsbt ;    sbtl40 = (unsigned long) ((dsbt - (double)(sbtm40)) * dwrap);    /* round to 32 bits */        dround = (double) round32;    dsbt = (double) obtm_2 + (double) obtl_2 / dwrap ;    dsbt  = (floor( dsbt * dround + 0.5)) / dround ;     sbtm32 = (unsigned long) dsbt ;    sbtl32 = (unsigned long) ((dsbt - (double)(sbtm32)) * dwrap);   n = 0;     sprintf(msg[n++], "- obtm_1: x%09.8lX    obtl_1: x%09.8lX ", obtm_1, obtl_1 );   sprintf(msg[n++], "- obtm_2: x%09.8lX    obtl_2: x%09.8lX ", obtm_2, obtl_2 );   sprintf(msg[n++], "  after rounding to 43 bits:" );      sprintf(msg[n++], "- obtm_2: x%09.8lX    obtl_2: x%09.8lX ", sbtm43, sbtl43 );   sprintf(msg[n++], "  after rounding to 40 bits:" );      sprintf(msg[n++], "- obtm_2: x%09.8lX    obtl_2: x%09.8lX ", sbtm40, sbtl40 );   sprintf(msg[n++], "  after rounding to 32 bits:" );      sprintf(msg[n++], "- obtm_2: x%09.8lX    obtl_2: x%09.8lX ", sbtm32, sbtl32 );   pl_print_msg(&n, msg); /* Calculating Sun position and velocity in the Mean of Date coordinate system */ /* --------------------------------------------------------------------------- */   ut1[0] =  0.0;		/* UTC time in MJD2000 [days] */   ut1[1] =  dummy_d;		/* Delta UT1 time [s] */   n = 0;   sprintf(msg[n++], "\n\nPL_SUN\n");        pl_print_msg(&n, msg);   ext_status = pl_sun(ut1, rsun, rdsun);   if (ext_status != PL_OK)   {        func_id = PL_SUN_ID;      pl_vector_msg(&func_id, &ext_status, &n, msg);      pl_print_msg(&n, msg);           if (ext_status <= PL_ERR) return(PL_ERR);    /* CAREFUL: extended status */   }      n = 0;     sprintf(msg[n++], "- rsun[0]: %lf ", rsun[0] );		/* Sun position vector in Mean of Date coordinate system (x,y,z) [m] */   sprintf(msg[n++], "- rsun[1]: %lf ", rsun[1] );   sprintf(msg[n++], "- rsun[2]: %lf ", rsun[2] );   sprintf(msg[n++], "- rdsun[0]: %lf ", rdsun[0] );		/* Sun velocity vector in Mean of Date coordinate system (x,y,z) [m/s] */   sprintf(msg[n++], "- rdsun[1]: %lf ", rdsun[1] );   sprintf(msg[n++], "- rdsun[2]: %lf ", rdsun[2] );   pl_print_msg(&n, msg);/* Calculating Moon position and velocity in the Mean of Date coordinate system */ /* --------------------------------------------------------------------------- */    n = 0;   sprintf(msg[n++], "\n\nPL_MOON\n");        pl_print_msg(&n, msg);   ext_status = pl_moon(ut1, rmoon, rdmoon);   if (ext_status != PL_OK)   {        func_id = PL_MOON_ID;      pl_vector_msg(&func_id, &ext_status, &n, msg);      pl_print_msg(&n, msg);           if (ext_status <= PL_ERR) return(PL_ERR);    /* CAREFUL: extended status */   }      n = 0;     sprintf(msg[n++], "- rmoon[0]: %lf ", rmoon[0] );           /* Moon position vector in Mean of Date coordinate system (x,y,z) [m] */   sprintf(msg[n++], "- rmoon[1]: %lf ", rmoon[1] );   sprintf(msg[n++], "- rmoon[2]: %lf ", rmoon[2] );   sprintf(msg[n++], "- rdmoon[0]: %lf ", rdmoon[0] );         /* Moon velocity vector in Mean of Date coordinate system (x,y,z) [m/s] */   sprintf(msg[n++], "- rdmoon[1]: %lf ", rdmoon[1] );   sprintf(msg[n++], "- rdmoon[2]: %lf ", rdmoon[2] );   pl_print_msg(&n, msg); /* Calculating planets position and velocity in the Heliocentric Mean of 2000.0 coordinate system */ /* ----------------------------------------------------------------------------------------------- */   planet_id = (int)PL_VENUS; 				/* Venus ID */   n = 0;   sprintf(msg[n++], "\n\nPL_PLANETS\n");        pl_print_msg(&n, msg);   ext_status = pl_planets(&planet_id, ut1, rplanet, rdplanet);   if (ext_status != PL_OK)     {        func_id = PL_PLANETS_ID;      pl_vector_msg(&func_id, &ext_status, &n, msg);      pl_print_msg(&n, msg);           if (ext_status <= PL_ERR) return(PL_ERR);    /* CAREFUL: extended status */   }      n = 0;     sprintf(msg[n++], "- rplanet[0]: %lf ", rplanet[0] );           /* Planet position vector in Heliocentric Mean of 2000.0 CS (x,y,z) [m] */   sprintf(msg[n++], "- rplanet[1]: %lf ", rplanet[1] );   sprintf(msg[n++], "- rplanet[2]: %lf ", rplanet[2] );   sprintf(msg[n++], "- rdplanet[0]: %lf ", rdplanet[0] );         /* Planet velocity vector in Heliocentric Mean of 2000.0 CS (x,y,z) [m/s] */   sprintf(msg[n++], "- rdplanet[1]: %lf ", rdplanet[1] );   sprintf(msg[n++], "- rdplanet[2]: %lf ", rdplanet[2] );   pl_print_msg(&n, msg);/* Calculating star coordinates in the Mean of Date coordinate system *//* ------------------------------------------------------------------ */    ut1[0] =  -200.0;		/* UTC time in MJD2000 [days] */   ut1[1] =  0.0;		/* Delta UT1 time [s] */   ra0     =  3.141592;		/* Star right ascension in the Barycentric Mean of 2000.0 coordinate at J2000.0 [rad] */   dec0    =  0.0;		/* Star declination in the Barycentric Mean of 2000.0 coordinate at J2000.0 [rad] */   mu_ra   = 0.0;		/* Star proper motion in the right ascension [rad/century] */   mu_dec  = 0.0;		/* Star proper motion in the declination [rad/century] */   rad_vel = 0.0;		/* Star radial velocity [au/century] */   par     = 0.0;		/* Star parallax [rad] */    n = 0;   sprintf(msg[n++], "\n\nPL_STAR_RADEC\n");        pl_print_msg(&n, msg);   ext_status = pl_star_radec(ut1, &ra0, &dec0, &mu_ra, &mu_dec, &rad_vel, &par, &ra, &dec);   if (ext_status != PL_OK)   {      func_id = PL_STAR_RADEC_ID;      pl_vector_msg(&func_id, &ext_status, &n, msg);      pl_print_msg(&n, msg);           if (ext_status <= PL_ERR) return(PL_ERR);    /* CAREFUL: extended status */   }      n = 0;      sprintf(msg[n++], "- ra: %lf ", ra );			/* Star right ascension in Mean of Date at UT1 [deg] */   sprintf(msg[n++], "- dec: %lf ", dec );			/* Star declination in Mean of Date at UT1 [deg] */   pl_print_msg(&n, msg);return(PL_OK);}

⌨️ 快捷键说明

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