Expand |
---|
title | 11.1 Coordinate System Conversion (CSC) Tools Overview |
---|
| Expand |
---|
| These tools are used to manipulate various position and velocity coordinates in several reference frames. Use of them is optional. The tools divide into two sections: tools that perform reference frame coordinate transformations directly, and tools that perform various other functions involving coordinate transformations. Before discussing what the tools do, we give brief descriptions of the different reference frames used. Reference Frames Earth Centered Inertial (ECI)Inertial frame centered on earth, with Z axis along the rotational axis, and X axis directed toward vernal equinox. Epoch for all ECS data is J2000.Earth Centered Rotating (ECR)Frame with axes fixed in the earth, described by Cartesian coordinates. Z axis is along geographic North, and X axis is directed toward the Greenwich meridian.Geodetic (GEO)Frame with axes fixed in the earth, using geodetic latitude, longitude and altitude as coordinates.Orbital (ORB)Frame centered on the spacecraft, with the X-Z plane in the spacecraft orbital plane, and the Z axis directed toward geocentric nadir.Spacecraft (SC)Frame with axes fixed in the spacecraft. Coincides with Orbital frame when roll, pitch, and yaw are zero. All toolkit functions use geodetic latitude for their latitude argument, if any. Geodetic latitude is defined as the angle a normal to the earth ellipsoid (earth model) makes with the equatorial plane, as opposed to the geocentric latitude, which is the angle that the vector to the center of the earth makes with the equatorial plane. The earth models, or reference ellipsoids, used by some of these tools are defined in the "earth axis data file" $PGSHOME/lib/database/CSC/earthfigure.dat. You may edit this text file to add your own ellipsoid, if you like. The principal reference for the values supplied with the Toolkit is Astronomical Almanac for the Year 1994, U.S. Naval Observatory, 1993, p. K13, "Geodetic Reference Spheroids." The book is available from the Superintendent of Documents, U.S. Government Printing Office, Washington, DC 20402. Many of the tools use time as an input. In the Toolkit, time is specified as UTC in CCSDS ASCII Time Code format, with optional offsets in seconds. See section 9.1.2, " Definition of Time Scales and Formats Used", under the "UTC: Universal Coordinated Time" entry, for details of this format. |
Expand |
---|
title | 11.1.2 Direct reference frame coordinate transformations |
---|
| These tools perform coordinate transformations to and from the ECI, ECR, SC and ORB frames described above. There are 10 of these. The function of each one is obvious from its name. Other transforms are possible using combinations of these. The transforms between Earth centered and spacecraft coordinate systems will produce only a rotation when the input vector is a unit vector, but will introduce the appropriate translation when the input is a vector in meters. Tools that directly transform between reference frames - PGS_CSC_ECItoECR
- PGS_CSC_ECItoORB
- PGS_CSC_ECItoSC
- PGS_CSC_ECRtoECI
- PGS_CSC_ECRtoGEO
- PGS_CSC_GEOtoECR
- PGS_CSC_ORBtoECI
- PGS_CSC_ORBtoSC
- PGS_CSC_SCtoECI
- PGS_CSC_SCtoORB
Note: In the May 1994 Toolkit delivery (TK2), some of these tools were combined in a single tool, PGS_CSC_FrameChange. |
Expand |
---|
title | 11.1.3 Other tools that involve coordinate systems |
---|
| This section contains tools that perform various other functions involving coordinate transformations. It includes: PGS_CSC_DayNightDetermines whether a given surface location at a given time is in day or night.PGS_CSC_Earthpt_FOVDetermines whether a given surface or atmosphere location at a given time is within a given field-of-view.PGS_CSC_GetFOV_PixelDetermines the footprint of an instrument field-of-view on the earth, and also returns some other related data.PGS_CSC_GreenwichHourFinds the hour angle of the vernal equinox at the Greenwich meridian.PGS_CSC_nutate2000Transforms a vector under nutation from Celestial Coordinates of date in Barycentric Dynamical Time (TDB) to J2000 coordinates or from J2000 coordinates to Celestial Coordinates of date.PGS_CSC_precs2000Precesses a vector from Celestial Coordinates of date in Barycentric Dynamical Time (TDB) to J2000 coordinates or from J2000 coordinates to Celestial Coordinates of date in Barycentric Dynamical Time (TDB).PGS_CSC_SpaceRefractEstimates the refraction for a ray incident from space or a line of sight from space to the Earth's surface, based on the unrefracted zenith angle.PGS_CSC_SubSatPointFinds the position and velocity of the sub-satellite point and rate of change of spacecraft altitude off the ellipsoid.PGS_CSC_wahr2Calculates nutation angles delta psi and delta epsilon, and their rates of change, referred to the ecliptic of date, from the Wahr series.PGS_CSC_ZenithAzimuthDetermines zenith angle and azimuth of instrument look vector or vector to a celestial body. Information about the theoretical basis of these tools is available in " Theoretical Basis of the SDP Toolkit Geolocation Package for the ECS Project" |
|
Expand |
---|
title | 11.2 Coordinate System Conversion (CSC) Tool Descriptions |
---|
| This section contains an alphabetical listing of the descriptions of the individual PGS_CSC_* tools. Expand |
---|
title | 11.2.1 PGS_CSC_DayNight |
---|
| Short explanation of what it's for: Determine whether a given latitude/longitude at a given time is in day or night. This function is in file: $PGSSRC/CBP/PGS_CSC_DayNight.c Examples: Whether two earth positions are in day or night is determined. The "NauticalNight" definition of day/night is used. C example: #include <PGS_CSC.h>
PGSt_integer numValues;
char asciiUTC_A[28];
PGSt_double time_offset[2];
PGSt_double latitude[2];
PGSt_double longitude[2];
PGSt_tag day_night_model;
PGSt_boolean is_dark[2];
PGSt_SMF_status returnStatus;
/*
Begin example
*/
/* Define time of the input lats/longs */
numValues = 2;
strcpy( asciiUTC_A, "1998-06-30T10:51:28.320000Z" );
time_offset[0] = 0.0;
time_offset[1] = 0.0;
/* Fill input vectors */
latitude[0] = -0.603131 /* radians */
longitude[0] = 2.440543 /* radians */
latitude[1] = -0.603131
longitude[1] = 0.870543
/* Define day/night model
See Notes for other possible values */
day_night_model = PGSd_NauticalNight;
/* Get day/night flags */
returnStatus = PGS_CSC_DayNight( numValues, asciiUTC_A,
time_offset, latitude, longitude, day_night_model,
is_dark );
/* Array is_dark now contains the following values:
is_dark[0] = PGS_TRUE; This point is in the dark
is_dark[1] = PGS_FALSE; This point is in the daylight
*/
FORTRAN example: IMPLICIT NONE
INCLUDE 'PGS_SMF.f'
INCLUDE 'PGS_TD_3.f'
INCLUDE 'PGS_CBP_6.f'
INCLUDE 'PGS_CSC.f'
INCLUDE 'PGS_CSC_4.f'
INTEGER pgs_csc_daynight
INTEGER numvalues
CHARACTER*27 asciiutc_a
DOUBLE PRECISION time_offset(2)
DOUBLE PRECISION latitude(2)
DOUBLE PRECISION longitude(2)
INTEGER day_night_model
INTEGER is_dark(2)
INTEGER returnstatus
!
! Begin example
!
! Define time of the input lat/long
numvalues = 2
asciiutc_a = '1998-06-30T10:51:28.320000Z'
time_offset(1) = 0.0
time_offset(2) = 0.0
latitude(1) = -0.603131 ! radians
longitude(1) = 2.440543 ! radians
latitude(2) = -0.603131
longitude(2) = 0.870543
! Define day/night model
! See Notes for other possible values
day_night_model = PGSd_NauticalNight
! Get day/night flags
returnstatus = pgs_csc_daynight( numvalues, asciiutc_a,
. time_offset, latitude, longitude, day_night_model,
. is_dark )
! Array is_dark now contains the following values:
! is_dark(1) = PGS_TRUE This point is in the dark
! is_dark(2) = PGS_FALSE This point is in the daylight
Notes: Allowed values of the 6th argument in the calling sequence day_night_model: PGSd_CivilTwilight(end of day) Sun deemed to set within 90 degrees 50 arc minutes from zenith.PGSd_CivilNight(end of civil twilight) Sun more than 96 degrees from zenith.(same as start of Nautical twilight)PGSd_NauticalNight(end of Nautical twilight) Sun more than 102 degrees from zenith.PGSd_AstronNight(end of Astronomical Twilight) Sun more than 108 degrees from zenith A value other than PGS_TRUE or PGS_FALSE may be returned in the variable is_dark of the example. This indicates an error determining that value only; other elements of the output array are unaffected. Files: This tool accesses the following files: - leap seconds
- polar motion and UT1-UTC
- earth model tags
- JPL planetary ephemeris
The physical references to these files are defined in the Process Control File (PCF) template supplied with the Toolkit, $PGSRUN/PCF.v5. If you are using a PCF derived from that template, you need not do anything extra to enable access to these files. See sec. 3.1.2, Constructing your Process Control file, for information about PCF entries.
|
Expand |
---|
title | 11.2.2 PGS_CSC_Earthpt_FOV |
---|
| Short explanation of what it's for: Determine whether a given lat/long is within the field-of-view (FOV), and return the S/C frame vector to that point. This function is in file: $PGSSRC/CBP/PGS_CSC_Earthpt_FOV.c Examples: It is determined whether a point is within the LIS instrument FOV, at a single time. C example: #include <PGS_CSC.h>
PGSt_integer nTimePts;
char asciiUTC_A[28];
PGSt_double time_offset[1];
PGSt_tag spacecraftID;
char earthModel[21];
PGSt_double latitude;
PGSt_double longitude;
PGSt_double altitude;
PGSt_double fov_inside_vector[1][3];
PGSt_integer numFovPerim;
PGSt_double fov_perim_vector[1][4][3];
PGSt_boolean ptInFov_flag[1];
PGSt_double sc_earthPt_vector[1][3];
PGSt_SMF_status returnStatus;
/* Begin example */
/* Define base time and offsets desired.
Base time is given in CCSDS ASCII Time code A format;
CCSDS ASCII Time code B format is also allowed.
Offsets are in seconds.
Offsets are useful if you want to determine whether a
given point is in the FOV over some time interval.
Here we process for a single time. */
nTimePts = 1;
strcpy( asciiUTC_A, "1998-06-30T10:51:28.320000Z");
time_offset[0] = 0.0;
/* Assign spacecraft ID tag
PGSd_EOS_AM and PGSd_EOS_PM are also allowed */
spacecraftID = PGSd_TRMM;
/* Define earth reference model */
strcpy( earthModel, "WGS84" );
/* Fill S/C frame vectors that define the field-of-view.
Also supply a single arbitrary vector that is inside the FOV. */
numFovPerim = 4;
fov_perim_vector[0][0][0] = -0.534711; /* S/C frame X component */
fov_perim_vector[0][0][1] = 0.534711; /* S/C frame Y component */
fov_perim_vector[0][0][2] = 0.654345; /* S/C frame Z component */
fov_perim_vector[0][1][0] = -0.534711;
fov_perim_vector[0][1][1] = -0.534711;
fov_perim_vector[0][1][2] = 0.654345;
fov_perim_vector[0][2][0] = 0.534711;
fov_perim_vector[0][2][1] = -0.534711;
fov_perim_vector[0][2][2] = 0.654345;
fov_perim_vector[0][3][0] = 0.534711;
fov_perim_vector[0][3][1] = 0.534711;
fov_perim_vector[0][3][2] = 0.654345;
fov_inside_vector[0][0] = 0.0;
fov_inside_vector[0][1] = 0.0;
fov_inside_vector[0][2] = 0.654345;
/* Define the point for which you want to determine
whether it is in the FOV */
latitude = -.64;
longitude = 2.46;
altitude = 0.0;
/* Determine whether the point is in the FOV */
returnStatus = PGS_CSC_Earthpt_FOV( nTimePts,
asciiUTC_A, time_offset, spacecraftID, earthModel,
latitude, longitude, altitude,
fov_inside_vector, numFovPerim, fov_perim_vector,
ptInFov_flag, sc_earthPt_vector );
/* The following values are returned:
Flag that indicates if given earth point is within the FOV
ptInFov_flag[0] = PGS_FALSE
Unit vector from S/C to earth point in S/C frame coords
sc_earthPt_vector[0,0] = -0.867 X coordinate
sc_earthPt_vector[0,1] = 0.031 Y coordinate
sc_earthPt_vector[0,2] = 0.497 Z coordinate
*/
FORTRAN example: IMPLICIT NONE
INCLUDE 'PGS_TD.f'
INCLUDE 'PGS_TD_3.f'
INCLUDE 'PGS_CSC_4.f'
INCLUDE 'PGS_EPH_5.f'
INCLUDE 'PGS_MEM_7.f'
INCLUDE 'PGS_SMF.f'
INTEGER pgs_csc_earthpt_fov
INTEGER ntimepts
CHARACTER*27 asciiutc_a
DOUBLE PRECISION time_offset(1)
INTEGER spacecraftid
CHARACTER*20 earthmodel
DOUBLE PRECISION latitude
DOUBLE PRECISION longitude
DOUBLE PRECISION altitude
DOUBLE PRECISION fov_inside_vector(3,1)
INTEGER numfovperim
DOUBLE PRECISION fov_perim_vector(3,4,1)
INTEGER ptinfov_flag(1)
DOUBLE PRECISION sc_earthpt_vector(3,1)
INTEGER returnstatus
!
! Begin example
!
! Define base time and offsets desired.
! Base time is given in CCSDS ASCII Time code A format;
! CCSDS ASCII Time code B format is also allowed.
! Offsets are in seconds.
! Offsets are useful if you want to determine whether a
! given point is in the FOV over some time interval.
! Here we process for a single time.
ntimepts = 1
asciiutc_a = '1998-06-30T10:51:28.320000Z'
time_offset(1) = 0.0
! Assign spacecraft ID tag
! PGSd_EOS_AM and PGSd_EOS_PM are also allowed
!
spacecraftid = PGSd_TRMM
! Define earth reference model
earthModel = 'WGS84'
! Fill S/C frame vectors that define the field-of-view.
! Also supply a single arbitrary vector that is inside the FOV.
fov_perim_vector(1,1,1) = -0.534711 ! S/C frame X pos
fov_perim_vector(2,1,1) = 0.534711 ! S/C frame Y pos
fov_perim_vector(3,1,1) = 0.654345 ! S/C frame Z pos
fov_perim_vector(1,2,1) = -0.534711
fov_perim_vector(2,2,1) = -0.534711
fov_perim_vector(3,2,1) = 0.654345
fov_perim_vector(1,3,1) = 0.534711
fov_perim_vector(2,3,1) = -0.534711
fov_perim_vector(3,3,1) = 0.654345
fov_perim_vector(1,4,1) = 0.534711
fov_perim_vector(2,4,1) = 0.534711
fov_perim_vector(3,4,1) = 0.654345
fov_inside_vector(1,1) = 0.0
fov_inside_vector(2,1) = 0.0
fov_inside_vector(3,1) = 0.654345
! Define the point for which you want to determine
! whether it is in the FOV
latitude = -0.64
longitude = 2.46
altitude = 0.0
! Determine whether the point is in the FOV
returnstatus = pgs_csc_earthpt_fov( ntimepts,
+ asciiutc_a, time_offset, spacecraftid, earthmodel,
+ latitude, longitude, altitude,
+ fov_inside_vector, numfovperim, fov_perim_vector,
+ ptinfov_flag, sc_earthpt_vector )
! The following values are returned:
! Flag that indicates if given earth point is within the FOV
! ptInFov_flag(1) = PGS_FALSE
! Unit vector from S/C to earth point in S/C frame coords
! sc_earthPt_vector(1,1) = -0.867 X coordinate
! sc_earthPt_vector(2,1) = 0.031 Y coordinate
! sc_earthPt_vector(3,1) = 0.497 Z coordinate
Notes: If errors in processing occur, the value PGSd_GEO_ERROR_VALUE is returned in the corresponding element of array sc_earthPt_vector. The number of points defining the FOV perimeter numFovPerim must be at least 3. The perimeter vector points must be sequential around the FOV perimeter. Files: This tool accesses the following files: - leap seconds
- polar motion and UT1-UTC
- earth axis data
- spacecraft ephemeris/attitude
The physical references to these files are defined in the Process Control File (PCF) template supplied with the Toolkit, $PGSRUN/PCF.v5. If you are using a PCF derived from that template, you need not do anything extra to enable access to these files. See sec. 3.1.2, Constructing your Process Control file, for information about PCF entries. The exception is the spacecraft ephemeris/attitude file, which must be created by you for testing purposes at the SCF. Simulated files may be prepared through use of the orbsim utility; (sec. 7.1.2.1); alternatively, you may prepare them yourself (sec. 7.1.2.2). This file must follow the ephemeris file naming convention, and must reside in directory $PGSDAT/EPH. This directory is specified in $PGSRUN/PCF.v5; individual spacecraft ephemeris/attitude filenames are not entered in the PCF.
|
Expand |
---|
title | 11.2.3 PGS_CSC_ECItoECR |
---|
| Short explanation of what it's for: Convert a vector in Earth Centered Inertial (ECI) coordinates to Earth Centered Rotating (ECR) coordinates . This function is in file: $PGSSRC/CBP/PGS_CSC_ECItoECR.c Examples: Two ECI vectors containing position and velocity are converted to two ECR vectors. C example: #include <PGS_CSC.h>
PGSt_integer numValues;
char asciiUTC_A[28];
PGSt_double time_offset[2];
PGSt_double eci_vector[2][6];
PGSt_double ecr_vector[2][6];
PGSt_SMF_status returnStatus;
/*
Begin example
*/
/* Define base time and offsets desired
Base time is given in CCSDS ASCII Time code A format;
CCSDS ASCII Time code B format is also allowed
Offsets are in seconds */
numValues = 2;
strcpy( asciiUTC_A, "1998-06-30T10:51:28.320000Z");
time_offset[0] = 0.0;
time_offset[1] = 1.0;
/* Fill input vectors */
eci_vector[0][0] = -4191102.083176; /* ECI X pos, meters */
eci_vector[0][1] = -3647080.063050; /* ECI Y pos, meters */
eci_vector[0][2] = -3803463.200778; /* ECI Z pos, meters */
eci_vector[0][3] = 5402.13704; /* ECI X vel, meters/sec */
eci_vector[0][4] = -5411.637312; /* ECI Y vel, meters/sec */
eci_vector[0][5] = -764.857061; /* ECI Z vel, meters/sec */
eci_vector[1][0] = -4185697.218627;
eci_vector[1][1] = -3652489.325640;
eci_vector[1][2] = -3804225.574655;
eci_vector[1][3] = 5407.590883;
eci_vector[1][4] = -5406.886691;
eci_vector[1][5] = -759.890523;
/* Get ECR vector */
returnStatus = PGS_CSC_ECItoECR( numValues, asciiUTC_A,
time_offset, eci_vector, ecr_vector );
/* Matrix ecr_vector now contains the following values:
ecr_vector[0][0] = -4245958.362002 ECR X pos, meters
ecr_vector[0][1] = 3583944.541294 ECR Y pos, meters
ecr_vector[0][2] = -3802636.071286 ECR Z pos, meters
ecr_vector[0][3] = -4259.539749 ECR X vel, meters/sec
ecr_vector[0][4] = -5857.188662 ECR Y vel, meters/sec
ecr_vector[0][5] = -765.490907 ECR Z vel, meters/sec
ecr_vector[1][0] = -4250215.575857
ecr_vector[1][1] = 3578085.340407
ecr_vector[1][2] = -3803399.079548
ecr_vector[1][3] = -4254.887147
ecr_vector[1][4] = -5861.211973
ecr_vector[1][5] = -760.525446
*/ FORTRAN example:
IMPLICIT NONE
INCLUDE 'PGS_SMF.f'
INCLUDE 'PGS_TD_3.f'
INCLUDE 'PGS_CSC_4.f'
INTEGER pgs_csc_ecitoecr
INTEGER numvalues
CHARACTER*27 asciiutc_a
DOUBLE PRECISION time_offset(2)
DOUBLE PRECISION eci_vector(6,2)
DOUBLE PRECISION ecr_vector(6,2)
INTEGER returnstatus
!
! Begin example
!
! Define base time and offsets desired
! Base time is given in CCSDS ASCII Time code A format;
! CCSDS ASCII Time code B format is also allowed
! Offsets are in seconds
!
numvalues = 2
asciiutc_a = '1998-06-30T10:51:28.320000Z'
time_offset(1) = 0.0
time_offset(2) = 1.0
! Fill input vectors
eci_vector(1,1) = -4191102.083176 ! ECI X pos, meters
eci_vector(2,1) = -3647080.063050 ! ECI Y pos, meters
eci_vector(3,1) = -3803463.200778 ! ECI Z pos, meters
eci_vector(4,1) = 5402.137043 ! ECI X vel, meters/sec
eci_vector(5,1) = -5411.637312 ! ECI Y vel, meters/sec
eci_vector(6,1) = -764.857061 ! ECI Z vel, meters/sec
eci_vector(1,2) = -4185697.218627
eci_vector(2,2) = -3652489.325640
eci_vector(3,2) = -3804225.574655
eci_vector(4,2) = 5407.590883
eci_vector(5,2) = -5406.886691
eci_vector(6,2) = -759.890523
! Get ECR vector
returnstatus = pgs_csc_ecitoecr( numvalues, asciiutc_a,
. time_offset, eci_vector, ecr_vector )
! Matrix ecr_vector now contains the following values:
! ecr_vector(1,1) = -4245958.362002 ECR X pos, meters
! ecr_vector(2,1) = 3583944.541294 ECR Y pos, meters
! ecr_vector(3,1) = -3802636.071286 ECR Z pos, meters
! ecr_vector(4,1) = -4259.539749 ECR X vel, meters/sec
! ecr_vector(5,1) = -5857.188662 ECR Y vel, meters/sec
! ecr_vector(6,1) = -765.490907 ECR Z vel, meters/sec
! ecr_vector(1,2) = -4250215.575857
! ecr_vector(2,2) = 3578085.340407
! ecr_vector(3,2) = -3803399.079548
! ecr_vector(4,2) = -4254.887147
! ecr_vector(5,2) = -5861.211973
! ecr_vector(6,2) = -760.525446 Notes:
Epoch for the ECI input vector must be J2000. Precession, nutation, and polar motion are all taken into account in the transformation. Files: This tool accesses the following files: - leap seconds
- polar motion and UT1-UTC
The physical references to these files are defined in the Process Control File (PCF) template supplied with the Toolkit, $PGSRUN/PCF.v5. If you are using a PCF derived from that template, you need not do anything extra to enable access to these files. See sec. 3.1.2, Constructing your Process Control file, for information about PCF entries.
|
Expand |
---|
title | 11.2.4 PGS_CSC_ECItoORB |
---|
| Short explanation of what it's for: Convert a vector in Earth Centered Inertial (ECI) coordinates to Orbital (ORB) reference frame coordinates . This function is in file: $PGSSRC/CBP/PGS_CSC_ECItoORB.c Examples: Two ECI vectors containing position are converted to two ORB vectors. The first is a spacecraft ephemeris ECI vector in meters; the second is a unit vector. C example: #include <PGS_CSC.h>
PGSt_tag spacecraftID;
PGSt_integer numValues;
char asciiUTC_A[28];
PGSt_double time_offset[2];
PGSt_double eci_vector[2][3];
PGSt_double orb_vector[2][3];
PGSt_SMF_status returnStatus;
/*
Begin example
*/
/* Assign spacecraft ID tag
PGSd_EOS_AM and PGSd_EOS_PM are also allowed */
spacecraftID = PGSd_TRMM;
/* Define base time and offsets desired
Base time is given in CCSDS ASCII Time code A format;
CCSDS ASCII Time code B format is also allowed
Offsets are in seconds */
numValues = 2;
strcpy( asciiUTC_A, "1998-06-30T10:51:28.320000Z");
time_offset[0] = 0.0;
time_offset[1] = 0.0;
/* Fill input vectors */
eci_vector[0][0] = 1413531.574; /* ECI X pos, meters */
eci_vector[0][1] = -6005427.214; /* ECI Y pos, meters */
eci_vector[0][2] = -2693615.671; /* ECI Z pos, meters */
eci_vector[1][0] = -0.153457; /* ECI unit vector */
eci_vector[1][1] = 0.482829;
eci_vector[1][2] = 0.862164;
/* Get ORB vector */
returnStatus = PGS_CSC_ECItoORB( spacecraftID, numValues,
asciiUTC_A, time_offset, eci_vector,
orb_vector );
/* Matrix orb_vector now contains the following values:
Since the first input vector was a spacecraft ephemeris
ECI vector, the ORB frame vector is the zero vector:
orb_vector[0][0] = 0.000 ORB X pos, meters
orb_vector[0][1] = 0.000 ORB Y pos, meters
orb_vector[0][2] = 0.000 ORB Z pos, meters
The second vector is a unit vector:
orb_vector[1][0] = 0.228986
orb_vector[1][1] = -0.545405
orb_vector[1][2] = 0.806287
*/
FORTRAN example: IMPLICIT NONE
INCLUDE 'PGS_CSC_4.f'
INCLUDE 'PGS_EPH_5.f'
INCLUDE 'PGS_SMF.f'
INCLUDE 'PGS_TD.f'
INCLUDE 'PGS_TD_3.f'
INTEGER pgs_csc_ecitoorb
INTEGER spacecraftid
INTEGER numvalues
CHARACTER*27 asciiutc_a
DOUBLE PRECISION time_offset(2)
DOUBLE PRECISION eci_vector(3,2)
DOUBLE PRECISION orb_vector(3,2)
INTEGER returnstatus
!
! Begin example
!
! Assign spacecraft ID tag
! PGSd_EOS_AM and PGSd_EOS_PM are also allowed
!
spacecraftid = PGSd_TRMM
! Define base time and offsets desired
! Base time is given in CCSDS ASCII Time code A format;
! CCSDS ASCII Time code B format is also allowed
! Offsets are in seconds
!
numvalues = 2
asciiutc_a = '1998-06-30T10:51:28.320000Z'
time_offset(1) = 0.0
time_offset(2) = 0.0
! Fill input vectors
eci_vector(1,1) = 1413531.574 ! ECI X pos, meters
eci_vector(2,1) = -6005427.214 ! ECI Y pos, meters
eci_vector(3,1) = -2693615.671 ! ECI Z pos, meters
eci_vector(1,2) = -0.153457 ! ECI unit vector
eci_vector(2,2) = 0.482829
eci_vector(3,2) = 0.862164
! Get ORB vector
returnstatus = pgs_csc_ecitoorb( spacecraftid, numvalues,
+ asciiutc_a, time_offset, eci_vector,
+ orb_vector )
! Matrix orb_vector now contains the following values:
! Since the first input vector was a spacecraft ephemeris
! ECI vector, the ORB frame vector is the zero vector:
! orb_vector(1,1) = 0.000 ORB X pos, meters
! orb_vector(2,1) = 0.000 ORB Y pos, meters
! orb_vector(3,1) = 0.000 ORB Z pos, meters
! The second vector is a unit vector:
! orb_vector(1,2) = 0.228986
! orb_vector(2,2) = -0.545405
! orb_vector(3,2) = 0.806287
Files: This tool accesses the following files: - leap seconds
- spacecraft ephemeris/attitude
The physical references to these files are defined in the Process Control File (PCF) template supplied with the Toolkit, $PGSRUN/PCF.v5. If you are using a PCF derived from that template, you need not do anything extra to enable access to these files. See sec. 3.1.2, Constructing your Process Control file, for information about PCF entries. The exception is the spacecraft ephemeris/attitude file, which must be created by you for testing purposes at the SCF. Simulated files may be prepared through use of the orbsim utility; (sec. 7.1.2.1); alternatively, you may prepare them yourself (sec. 7.1.2.2). This file must follow the ephemeris file naming convention, and must reside in directory $PGSDAT/EPH. This directory is specified in $PGSRUN/PCF.v5; individual spacecraft ephemeris/attitude filenames are not entered in the PCF.
|
Expand |
---|
title | 11.2.5 PGS_CSC_ECItoSC |
---|
| Short explanation of what it's for: Convert a vector in Earth Centered Inertial (ECI) coordinates to Spacecraft (SC) reference frame coordinates . This function is in file: $PGSSRC/CSC/PGS_CSC_ECItoSC.c Examples: Two ECI vectors containing position are converted to two SC vectors. The first is a spacecraft ephemeris ECI vector in meters; the second is a unit vector. C example: #include <PGS_CSC.h>
PGSt_tag spacecraftID;
PGSt_integer numValues;
char asciiUTC_A[28];
PGSt_double time_offset[2];
PGSt_double eci_vector[2][3];
PGSt_double sc_vector[2][3];
PGSt_SMF_status returnStatus;
/*
Begin example
*/
/* Assign spacecraft ID tag
PGSd_EOS_AM and PGSd_EOS_PM are also allowed */
spacecraftID = PGSd_TRMM;
/* Define base time and offsets desired
Base time is given in CCSDS ASCII Time code A format;
CCSDS ASCII Time code B format is also allowed
Offsets are in seconds */
numValues = 2;
strcpy( asciiUTC_A, "1998-06-30T10:51:28.320000Z");
time_offset[0] = 0.0;
time_offset[1] = 0.0;
/* Fill input vectors */
eci_vector[0][0] = 1413531.574; /* ECI X pos, meters */
eci_vector[0][1] = -6005427.214; /* ECI Y pos, meters */
eci_vector[0][2] = -2693615.671; /* ECI Z pos, meters */
eci_vector[1][0] = -0.153457; /* ECI unit vector */
eci_vector[1][1] = 0.482829;
eci_vector[1][2] = 0.862164;
/* Get SC vector */
returnStatus = PGS_CSC_ECItoSC( spacecraftID, numValues,
asciiUTC_A, time_offset, eci_vector,
sc_vector );
/* Matrix sc_vector now contains the following values:
Since the first input vector was a spacecraft ephemeris
ECI vector, the S/C frame vector is the zero vector:
sc_vector[0][0] = 0.000 SC X pos, meters
sc_vector[0][1] = 0.000 SC Y pos, meters
sc_vector[0][2] = 0.000 SC Z pos, meters
The second vector is a unit vector:
sc_vector[1][0] = 0.228986
sc_vector[1][1] = -0.545405
sc_vector[1][2] = 0.806287
*/
FORTRAN example: IMPLICIT NONE
INCLUDE 'PGS_CSC_4.f'
INCLUDE 'PGS_EPH_5.f'
INCLUDE 'PGS_SMF.f'
INCLUDE 'PGS_TD.f'
INCLUDE 'PGS_TD_3.f'
INTEGER pgs_csc_ecitosc
INTEGER spacecraftid
INTEGER numvalues
CHARACTER*27 asciiutc_a
DOUBLE PRECISION time_offset(2)
DOUBLE PRECISION eci_vector(3,2)
DOUBLE PRECISION sc_vector(3,2)
INTEGER returnstatus
!
! Begin example
!
! Assign spacecraft ID tag
! PGSd_EOS_AM and PGSd_EOS_PM are also allowed
!
spacecraftid = PGSd_TRMM
! Define base time and offsets desired
! Base time is given in CCSDS ASCII Time code A format;
! CCSDS ASCII Time code B format is also allowed
! Offsets are in seconds
!
numvalues = 2
asciiutc_a = '1998-06-30T10:51:28.320000Z'
time_offset(1) = 0.0
time_offset(2) = 0.0
! Fill input vectors
eci_vector(1,1) = 1413531.574 ! ECI X pos, meters
eci_vector(2,1) = -6005427.214 ! ECI Y pos, meters
eci_vector(3,1) = -2693615.671 ! ECI Z pos, meters
eci_vector(1,2) = -0.153457 ! ECI unit vector
eci_vector(2,2) = 0.482829
eci_vector(3,2) = 0.862164
! Get SC vector
returnstatus = pgs_csc_ecitosc( spacecraftid, numvalues,
+ asciiutc_a, time_offset, eci_vector,
+ sc_vector )
! Matrix sc_vector now contains the following values:
! Since the first input vector was a spacecraft ephemeris
! ECI vector, the S/C frame vector is the zero vector:
! sc_vector(1,1) = 0.000 SC X pos, meters
! sc_vector(2,1) = 0.000 SC Y pos, meters
! sc_vector(3,1) = 0.000 SC Z pos, meters
! The second vector is a unit vector:
! sc_vector(1,2) = 0.228986
! sc_vector(2,2) = -0.545405
! sc_vector(3,2) = 0.806287
Notes: Aberration is taken into account in the transformation. When the input vector is in meters, translation from earth center to spacecraft origin is accounted for. No translation is done when the input vector is a unit vector. Files: This tool accesses the following files: - leap seconds
- spacecraft ephemeris/attitude
The physical references to these files are defined in the Process Control File (PCF) template supplied with the Toolkit, $PGSRUN/PCF.v5. If you are using a PCF derived from that template, you need not do anything extra to enable access to these files. See sec. 3.1.2, Constructing your Process Control file, for information about PCF entries. The exception is the spacecraft ephemeris/attitude file, which must be created by you for testing purposes at the SCF. Simulated files may be prepared through use of the orbsim utility; (sec. 7.1.2.1); alternatively, you may prepare them yourself (sec. 7.1.2.2). This file must follow the ephemeris file naming convention, and must reside in directory $PGSDAT/EPH. This directory is specified in $PGSRUN/PCF.v5; individual spacecraft ephemeris/attitude filenames are not entered in the PCF.
|
Expand |
---|
title | 11.2.6 PGS_CSC_ECRtoECI |
---|
| Short explanation of what it's for: Convert a vector in Earth Centered Rotating (ECR) coordinates to Earth Centered Inertial (ECI) coordinates . This function is in file: $PGSSRC/CBP/PGS_CSC_ECRtoECI.c Examples: Two ECR vectors containing position and velocity are converted to two ECI vectors. C example: #include <PGS_CSC.h>
PGSt_integer numValues;
char asciiUTC_A[28];
PGSt_double time_offset[2];
PGSt_double ecr_vector[2][6];
PGSt_double eci_vector[2][6];
PGSt_SMF_status returnStatus;
/*
Begin example
*/
/* Define base time and offsets desired
Base time is given in CCSDS ASCII Time code A format;
CCSDS ASCII Time code B format is also allowed
Offsets are in seconds */
numValues = 2;
strcpy( asciiUTC_A, "1998-06-30T10:51:28.320000Z");
time_offset[0] = 0.0;
time_offset[1] = 1.0;
/* Fill input vectors */
ecr_vector[0][0] = -4245958.362002; /* ECR X pos, meters */
ecr_vector[0][1] = 3583944.541294; /* ECR Y pos, meters */
ecr_vector[0][2] = -3802636.071286; /* ECR Z pos, meters */
ecr_vector[0][3] = -4259.539749; /* ECR X vel, meters/sec */
ecr_vector[0][4] = -5857.188662; /* ECR X vel, meters/sec */
ecr_vector[0][5] = -765.490907 ; /* ECR Z vel, meters/sec */
ecr_vector[1][0] = -4250215.575857
ecr_vector[1][1] = 3578085.340407
ecr_vector[1][2] = -3803399.079548
ecr_vector[1][3] = -4254.887147
ecr_vector[1][4] = -5861.211973
ecr_vector[1][5] = -760.525446
/* Get ECI vector */
returnStatus = PGS_CSC_ECRtoECI( numValues, asciiUTC_A,
time_offset, ecr_vector, eci_vector );
/* Matrix eci_vector now contains the following values:
eci_vector[0][0] = -4191102.083176 ECI X pos, meters
eci_vector[0][1] = -3647080.063050 ECI Y pos, meters
eci_vector[0][2] = -3803463.200778 ECI Z pos, meters
eci_vector[0][3] = 5402.13704 ECI X vel, meters/sec
eci_vector[0][4] = -5411.637312 ECI Y vel, meters/sec
eci_vector[0][5] = -764.857061 ECI Z vel, meters/sec
eci_vector[1][0] = -4185697.218627
eci_vector[1][1] = -3652489.325640
eci_vector[1][2] = -3804225.574655
eci_vector[1][3] = 5407.590883
eci_vector[1][4] = -5406.886691
eci_vector[1][5] = -759.890523
*/
FORTRAN example: IMPLICIT NONE
INCLUDE 'PGS_SMF.f'
INCLUDE 'PGS_TD_3.f'
INCLUDE 'PGS_CSC_4.f'
INTEGER pgs_csc_ecrtoeci
INTEGER numvalues
CHARACTER*27 asciiutc_a
DOUBLE PRECISION time_offset(2)
DOUBLE PRECISION ecr_vector(6,2)
DOUBLE PRECISION eci_vector(6,2)
INTEGER returnstatus
!
! Begin example
!
! Define base time and offsets desired
! Base time is given in CCSDS ASCII Time code A format;
! CCSDS ASCII Time code B format is also allowed
! Offsets are in seconds
!
numvalues = 2
asciiutc_a = '1998-06-30T10:51:28.320000Z'
time_offset(1) = 0.0
time_offset(2) = 1.0
! Fill input vectors
ecr_vector(1,1) = -4245958.362002 ! ECR X pos, meters
ecr_vector(2,1) = 3583944.541294 ! ECR Y pos, meters
ecr_vector(3,1) = -3802636.071286 ! ECR Z pos, meters
ecr_vector(4,1) = -4259.539749 ! ECR X vel, meters/sec
ecr_vector(5,1) = -5857.188662 ! ECR Y vel, meters/sec
ecr_vector(6,1) = -765.490907 ! ECR Z vel, meters/sec
ecr_vector(1,2) = -4250215.575857
ecr_vector(2,2) = 3578085.340407
ecr_vector(3,2) = -3803399.079548
ecr_vector(4,2) = -4254.887147
ecr_vector(5,2) = -5861.211973
ecr_vector(6,2) = -760.525446
! Get ECI vector
returnstatus = pgs_csc_ecrtoeci( numvalues, asciiutc_a,
+ time_offset, ecr_vector, eci_vector )
! Matrix eci_vector now contains the following values:
! eci_vector(1,1) = -4191102.083176 ECI X pos, meters
! eci_vector(2,1) = -3647080.063050 ECI Y pos, meters
! eci_vector(3,1) = -3803463.200778 ECI Z pos, meters
! eci_vector(4,1) = 5402.137043 ECI X vel, meters/sec
! eci_vector(5,1) = -5411.637312 ECI Y vel, meters/sec
! eci_vector(6,1) = -764.857061 ECI Z vel, meters/sec
! eci_vector(1,2) = -4185697.218627
! eci_vector(2,2) = -3652489.325640
! eci_vector(3,2) = -3804225.574655
! eci_vector(4,2) = 5407.590883
! eci_vector(5,2) = -5406.886691
! eci_vector(6,2) = -759.890523
Notes: Epoch for the ECI output vector is J2000. Precession, nutation, and polar motion are all taken into account in the transformation. Files: This tool accesses the following files: - leap seconds
- polar motion and UT1-UTC
The physical references to these files are defined in the Process Control File (PCF) template supplied with the Toolkit, $PGSRUN/PCF.v5. If you are using a PCF derived from that template, you need not do anything extra to enable access to these files. See sec. 3.1.2, Constructing your Process Control file, for information about PCF entries.
|
Expand |
---|
title | 11.2.7 PGS_CSC_ECRtoGEO |
---|
| Short explanation of what it's for: Convert a vector in Earth Centered Rotating (ECR) coordinates to Geodetic (GEO) coordinates: latitude, longitude, and altitude. This function is in file: $PGSSRC/CBP/PGS_CSC_ECRtoGEO.c Examples: A single ECR position vector is converted to geodetic coordinates. C example: #include <PGS_CSC.h>
PGSt_double ecr_vector[3];
char earthModel[21];
PGSt_double longitude;
PGSt_double latitude;
PGSt_double altitude;
PGSt_SMF_status returnStatus;
/*
Begin example
*/
/* Fill input vector */
ecr_vector[0] = -4245958.362002; /* ECR X pos, meters */
ecr_vector[1] = 3583944.541294; /* ECR Y pos, meters */
ecr_vector[2] = -3802636.071286; /* ECR Z pos, meters */
/* Define earth reference model */
strcpy( earthModel, "WGS84" );
/* Get long, lat, alt */
returnStatus = PGS_CSC_ECRtoGEO( ecr_vector, earthModel,
&longitude, &latitude, &altitude );
/* The following values are returned:
longitude = 2.440543 radians
latitude = -0.603131 radians
altitude = 361674.209546 meters
*/
FORTRAN example: IMPLICIT NONE
INCLUDE 'PGS_SMF.f'
INCLUDE 'PGS_CSC_4.f'
INTEGER pgs_csc_ecrtogeo
DOUBLE PRECISION ecr_vector(3)
CHARACTER*20 earthmodel
DOUBLE PRECISION longitude
DOUBLE PRECISION latitude
DOUBLE PRECISION altitude
INTEGER returnstatus
!
! Begin example
!
! Fill input vector
ecr_vector(1) = -4245958.362002 ! ECR X pos, meters
ecr_vector(2) = 3583944.541294 ! ECR Y pos, meters
ecr_vector(3) = -3802636.071286 ! ECR Z pos, meters
! Define earth reference model
earthmodel = 'WGS84'
! Get long, lat, alt
returnstatus = pgs_csc_ecrtogeo( ecr_vector, earthmodel,
+ longitude, latitude, altitude )
! The following values are returned:
! longitude = 2.440543 radians
! latitude = -0.603131 radians
! altitude = 361674.209546 meters
Notes: Input ECR vector must be in meters; it may not be a unit vector. Files: This tool accesses the following file: The physical reference to this file is defined in the Process Control File (PCF) template supplied with the Toolkit, $PGSRUN/PCF.v5. If you are using a PCF derived from that template, you need not do anything extra to enable access to this file. See sec. 3.1.2, Constructing your Process Control file, for information about PCF entries.
|
Expand |
---|
title | 11.2.8 PGS_CSC_GEOtoECR |
---|
| Short explanation of what it's for: Convert a vector in Geodetic (GEO) coordinates (latitude, longitude, and altitude) to Earth Centered Rotating (ECR) coordinates . This function is in file: $PGSSRC/CBP/PGS_CSC_GEOtoECR.c Examples: A single set of geodetic latitude, longitude, and altitude is converted to an ECR position vector. C example: #include <PGS_CSC.h>
PGSt_double longitude;
PGSt_double latitude;
PGSt_double altitude;
char earthModel[21];
PGSt_double ecr_vector[3];
PGSt_SMF_status returnStatus;
/*
Begin example
*/
/* Define input values */
longitude = 2.440543 /* radians */
latitude = -0.603131 /* radians */
altitude = 361674.209546 /* meters */
/* Define earth reference model */
strcpy( earthModel, "WGS84" );
/* Get ECR coordinates */
returnStatus = PGS_CSC_GEOtoECR( longitude, latitude,
altitude, earthmodel, ecr_vector );
/* Vector ecr_vector now contains the following values:
ecr_vector[0] = -4245955.860673 ECR X pos, meters
ecr_vector[1] = 3583944.676007 ECR Y pos, meters
ecr_vector[2] = -3802638.720370 ECR Z pos, meters
*/
FORTRAN example: IMPLICIT NONE
INCLUDE 'PGS_SMF.f'
INCLUDE 'PGS_CSC_4.f'
INTEGER pgs_csc_geotoecr
DOUBLE PRECISION longitude
DOUBLE PRECISION latitude
DOUBLE PRECISION altitude
CHARACTER*20 earthmodel
DOUBLE PRECISION ecr_vector(3)
INTEGER returnstatus
!
! Begin example
!
! Define input values
longitude = 2.440543 ! radians
latitude = -0.603131 ! radians
altitude = 361674.209546 ! meters
! Define earth reference model
earthmodel = 'WGS84'
! Get ECR coordinates
returnstatus = pgs_csc_geotoecr( longitude, latitude,
+ altitude, earthmodel, ecr_vector )
! Vector ecr_vector now contains the following values:
! ecr_vector(1) = -4245955.860673 ECR X pos, meters
! ecr_vector(2) = 3583944.676007 ECR Y pos, meters
! ecr_vector(3) = -3802638.720370 ECR Z pos, meters
Files: This tool accesses the following file: The physical reference to this file is defined in the Process Control File (PCF) template supplied with the Toolkit, $PGSRUN/PCF.v5. If you are using a PCF derived from that template, you need not do anything extra to enable access to this file. See sec. 3.1.2, Constructing your Process Control file, for information about PCF entries.
|
Expand |
---|
title | 11.2.9 PGS_CSC_GetFOV_Pixel |
---|
| Short explanation of what it's for: Determine where a field-of-view (FOV) projects on the earth's surface. Also return the pixel vectors in ECR for further use in the tool PGS_CSC_ZenithAzimuth() if desired. The field-of-view is specified by spacecraft frame pixel vectors. This function is in file: $PGSSRC/CBP/PGS_CSC_GetFOV_Pixel.c Examples: Data about the earth projection of a square field of view is computed; taken from the LIS instrument. C example: #include <PGS_CSC.h>
PGSt_tag spacecraftID;
PGSt_integer numValues;
char asciiUTC_A[28];
PGSt_double time_offset[4];
char earthModel[21];
PGSt_boolean accuracy_flag;
PGSt_double sc_look_vector[4][3];
PGSt_double sc_offset[4][3];
PGSt_double latitude[4];
PGSt_double longitude[4];
PGSt_double ecr_unit_vector[4][3];
PGSt_double range[4];
PGSt_double range_rate[4];
PGSt_SMF_status returnStatus;
PGSt_integer i,j;
/*
Begin example
*/
/* Assign spacecraft ID tag
PGS_dEOS_AM and PGSd_EOS_PM are also allowed */
spacecraftID = PGSd_TRMM;
/* Define base time and offsets desired.
Base time is given in CCSDS ASCII Time code A format;
CCSDS ASCII Time code B format is also allowed.
Offsets in seconds are all set to 0.0 as we want a
snapshot of the FOV. In general, when many times are to
be processed, for staring instruments, the individual
pixel vectors will still be fixed in the spacecraft
frame, while for slewing instruments they must accurately
reflect the scan */
numValues = 4;
strcpy( asciiUTC_A, "1998-06-30T10:51:28.320000Z");
for (i=0;i<numValues;i++) time_offset[i] = 0.0;
/* Define earth reference model */
strcpy( earthModel, "WGS84" );
/* Set accuracy flag:
Use PGS_FALSE for faster computation if you
don't care either about Earth rotation during the light
travel time or your instrument's offset from Spacecraft
center.
Use PGS_TRUE if you want to account for the
earth's rotation during the light travel time. */
accuracy_flag = PGS_TRUE;
/* Fill S/C frame vectors that define the field-of-view.
You could also use this to refer to individual pixels of
your instrument. */
sc_look_vector[0][0] = -0.534711; /* S/C frame X component */
sc_look_vector[0][1] = 0.534711; /* S/C frame Y component */
sc_look_vector[0][2] = 0.654345; /* S/C frame Z component */
sc_look_vector[1][0] = -0.534711;
sc_look_vector[1][1] = -0.534711;
sc_look_vector[1][2] = 0.654345;
sc_look_vector[2][0] = 0.534711;
sc_look_vector[2][1] = -0.534711;
sc_look_vector[2][2] = 0.654345;
sc_look_vector[3][0] = 0.534711;
sc_look_vector[3][1] = 0.534711 ;
sc_look_vector[3][2] = 0.654345;
/* Set the pixel offsets. These are for high accuracy; they locate
the origin of a pixel with respect to the center-of-mass of the
spacecraft. Here we assume the instrument boresight is 15 meters
off nominal center in the -y (orbit normal) direction. This array
is used only if accuracy_flag is equal to PGS_TRUE.
Naturally, only the part of the offset perpendicular to the
boresight direction itself matters. */
for (i=0;i<4;i++)
{
sc_offset[i][0] = 0.0;
sc_offset[i][1] = -15.0;
sc_offset[i][2] = 0.0;
}
/* When accuracy_flag = PGS_FALSE you can Zero out instrument
offsets, as they are not used, or you can ignore them and (in C)
pass in a NULL pointer for the boresight offsets. (In FORTRAN
pass in anything - for example, 0.0 )*/
/* Get data about the FOV projection on the earth */
returnStatus = PGS_CSC_GetFOV_Pixel( spacecraftID, numValues,
asciiUTC_A, time_offset, earthModel,
accuracy_flag, sc_look_vector, sc_offset,
latitude, longitude, ecr_unit_vector,
range, range_rate );
/* The following values are returned:
Latitudes of the FOV projection on the earth (radians):
latitude[0] = -0.478822
latitude[1] = -0.392320
latitude[2] = -0.350126
latitude[3] = -0.434660
Longitudes of the FOV projection on the earth (radians):
longitude[0] = -2.780467
longitude[1] = -2.825456
longitude[2] = -2.734285
longitude[3] = -2.685652
ECR reference frame representation of the input FOV vectors
ecr_unit_vector[0][0] = 0.73373160233 ECR X component
ecr_unit_vector[0][1] = 0.55040569686 ECR Y component
ecr_unit_vector[0][2] = -0.39836102296 ECR Z component
ecr_unit_vector[1][0] = 0.20219599731
ecr_unit_vector[1][1] = 0.85458983269
ecr_unit_vector[1][2] = 0.47832310892
ecr_unit_vector[2][0] = 0.38065007636
ecr_unit_vector[2][1] = -0.10337164875
ecr_unit_vector[2][2] = 0.91892318591
ecr_unit_vector[3][0] = 0.91220027384
ecr_unit_vector[3][1] = -0.40756416996
ecr_unit_vector[3][2] = 0.04221501817
Distance from spacecraft to earth intersection pt, meters
range[0] = 570980.678
range[1] = 564761.571
range[2] = 565402.381
range[3] = 571415.889
Velocity of the intersection pt in the ECR frame,
projected along the look vector direction, meters/sec
range_rate[0] = 3991.164
range_rate[1] = 3786.974
range_rate[2] = -4008.894
range_rate[3] = -3804.699
*/
FORTRAN example: IMPLICIT NONE
INCLUDE 'PGS_SMF.f'
INCLUDE 'PGS_TD.f'
INCLUDE 'PGS_TD_3.f'
INCLUDE 'PGS_CSC_4.f'
INCLUDE 'PGS_EPH_5.f'
INTEGER pgs_csc_getfov_pixel
INTEGER spacecraftid
INTEGER numvalues
CHARACTER*27 asciiutc_a
DOUBLE PRECISION time_offset(4)
CHARACTER*20 earthmodel
INTEGER accuracy_flag
DOUBLE PRECISION sc_look_vector(3,4)
DOUBLE PRECISION sc_offset(3,4)
DOUBLE PRECISION latitude(4)
DOUBLE PRECISION longitude(4)
DOUBLE PRECISION ecr_unit_vector(3,4)
DOUBLE PRECISION range(4)
DOUBLE PRECISION range_rate(4)
INTEGER returnstatus
INTEGER i,j
!
! Begin example
!
! Assign spacecraft ID tag
! PGSd_EOS_AM and PGSd_EOS_PM are also allowed
!
spacecraftid = PGSd_TRMM
! Define base time and offsets desired.
! Base time is given in CCSDS ASCII Time code A format;
! CCSDS ASCII Time code B format is also allowed.
! Offsets are in seconds.
numvalues = 4
asciiutc_a = '1998-06-30T10:51:28.320000Z'
do i=1,numvalues
time_offset(i) = 0.0
enddo
! Define earth reference model
earthModel = 'WGS84'
! Set accuracy flag
! Use PGS_TRUE if you want to account for the
! earth's rotation during the
! time it takes light to travel
accuracy_flag = PGS_FALSE
! Fill S/C frame vectors that define the field-of-view.
! You could also use this to refer to individual pixels of
! your instrument.
sc_look_vector(1,1) = -0.534711 ! S/C frame X pos
sc_look_vector(2,1) = 0.534711 ! S/C frame Y pos
sc_look_vector(3,1) = 0.654345 ! S/C frame Z pos
sc_look_vector(1,2) = -0.534711
sc_look_vector(2,2) = -0.534711
sc_look_vector(3,2) = 0.654345
sc_look_vector(1,3) = 0.534711
sc_look_vector(2,3) = -0.534711
sc_look_vector(3,3) = 0.654345
sc_look_vector(1,4) = 0.534711
sc_look_vector(2,4) = 0.534711
sc_look_vector(3,4) = 0.654345
! If the accuracy flag is set to PGS_FALSE, zero out instrument
! offsets, as they are not used, and you can even leave out the
! storage allocation and pass in anything.
! Set the pixel offsets. The are for high accuracy; they locate
! the origin of a pixel with respect to the center-of-mass of the
! spacecraft. Here we assume the instrument boresight is 15 meters
! off nominal center in the -y (orbit normal) direction. This array
! is used only if accuracy_flag is equal to PGS_TRUE.
do j=1,4
sc_offset(1,j) = 0.0
sc_offset(2,j) = -15.0
sc_offset(3,j) = 0.0
enddo
! Get earth intersection point data
returnstatus = pgs_csc_getfov_pixel(spacecraftid, numvalues,
. asciiutc_a, time_offset, earthmodel,
. latitude, longitude, ecr_unit_vector,
. range, range_rate )
! The following values are returned:
! Latitudes of the FOV projection on the earth (radians):
! latitude(1) = -0.478822
! latitude(2) = -0.392320
! latitude(3) = -0.350126
! latitude(4) = -0.434660
! Longitudes of the FOV projection on the earth (radians):
! longitude(1) = -2.780467
! longitude(2) = -2.825456
! longitude(3) = -2.734285
! longitude(4) = -2.685652
! ECR reference frame representation of the input FOV vectors
! ecr_unit_vector(1,1) = 0.73373160233 ECR X component
! ecr_unit_vector(2,1) = 0.55040569686 ECR Y component
! ecr_unit_vector(3,1) = -0.39836102296 ECR Z component
! ecr_unit_vector(1,2) = 0.20219599731
! ecr_unit_vector(2,2) = 0.85458983269
! ecr_unit_vector(3,2) = 0.47832310892
! ecr_unit_vector(1,3) = 0.38065007636
! ecr_unit_vector(2,3) = -0.10337164875
! ecr_unit_vector(3,3) = 0.91892318591
! ecr_unit_vector(1,4) = 0.91220027384
! ecr_unit_vector(2,4) = -0.40756416996
! ecr_unit_vector(3,4) = 0.04221501817
! Distance from spacecraft to earth intersection pt, meters
! range(1) = 570980.678
! range(2) = 564761.571
! range(3) = 565402.381
! range(4) = 571415.889
! Velocity of the intersection pt in the ECR frame,
! projected along the look vector direction, meters/sec
! range_rate(1) = 3991.164
! range_rate(2) = 3786.974
! range_rate(3) = -4008.894
! range_rate(4) = -3804.699
Notes: For more information about the accuracy_flag argument, see the Notes section of the Toolkit Users Guide entry for this tool (sec. 6.3.3). The output value ecr_unit_vector, the ECR frame representation of the input SC frame look vector, may be useful for several things, including use as input to the tool PGS_CSC_ZenithAzimuth . The values range and range_rate returned by this function are measures of the same data measured by Doppler radar instruments. Files: This tool accesses the following files: - leap seconds
- polar motion and UT1-UTC
- earth model tags
- spacecraft ephemeris/attitude
The physical references to these files are defined in the Process Control File (PCF) template supplied with the Toolkit, $PGSRUN/PCF.v5. If you are using a PCF derived from that template, you need not do anything extra to enable access to these files. See sec. 3.1.2, Constructing your Process Control file, for information about PCF entries. The exception is the spacecraft ephemeris/attitude file, which must be created by you for testing purposes at the SCF. Simulated files may be prepared through use of the orbsim utility; (sec. 7.1.2.1); alternatively, you may prepare them yourself (sec. 7.1.2.2). This file must follow the ephemeris file naming convention, and must reside in directory $PGSDAT/EPH. This directory is specified in $PGSRUN/PCF.v5; individual spacecraft ephemeris/attitude filenames are not entered in the PCF.
|
Expand |
---|
title | 11.2.10 PGS_CSC_GreenwichHour |
---|
| Short explanation of what it's for: Determine the hour angle of the vernal equinox at the Greenwich meridian. This function is in file: $PGSSRC/CBP/PGS_CSC_GreenwichHour.c Examples: Two Greenwich hour angles are determined. C example: #include <PGS_CSC.h>
PGSt_integer numValues;
char asciiUTC_A[28];
PGSt_double time_offset[2];
PGSt_double Greenwich_Hour_Angle[2];
PGSt_SMF_status returnStatus;
/*
Begin example
*/
/* Define time requested */
numValues = 2;
strcpy( asciiUTC_A, "1998-06-30T10:51:28.320000Z" );
time_offset[0] = 0.0;
time_offset[1] = 1.0;
/* Get Greenwich hour angles */
returnStatus = PGS_CSC_GreenwichHour( numValues, asciiUTC_A,
time_offset, Greenwich_Hour_Angle );
/* Array Greenwich_Hour_Angle now contains the following values:
Greenwich_Hour_Angle[0] = 5.411645; hours
Greenwich_Hour_Angle[1] = 5.411923; hours
*/
FORTRAN example: IMPLICIT NONE
INCLUDE 'PGS_SMF.f'
INCLUDE 'PGS_CSC_4.f'
INCLUDE 'PGS_TD_3.f'
INTEGER pgs_csc_greenwichhour
INTEGER numvalues
CHARACTER*27 asciiutc_a
DOUBLE PRECISION time_offset(2)
DOUBLE PRECISION greenwich_hour_angle(2)
INTEGER returnstatus
!
! Begin example
!
! Define time requested
numvalues = 2
asciiutc_a = '1998-06-30T10:51:28.320000Z'
time_offset(1) = 0.0
time_offset(2) = 1.0
! Get Greenwich hour angles
returnstatus = pgs_csc_greenwichhour( numvalues, asciiutc_a,
. time_offset, greenwich_hour_angle )
! Array greenwich_hour_angle now contains the following values:
! greenwich_hour_angle(1) = 5.411645; hours
! greenwich_hour_angle(2) = 5.411923; hours
Notes: A value PGSd_GEO_ERROR_VALUE may be returned in the variable Greenwich_Hour_Angle of the example. This indicates an error determining that value only; other elements of the output array are unaffected. Files: This tool accesses the following files: - leap seconds
- polar motion and UT1-UTC
The physical reference to this file is defined in the Process Control File (PCF) template supplied with the Toolkit, $PGSRUN/PCF.v5. If you are using a PCF derived from that template, you need not do anything extra to enable access to this file. See sec. 3.1.2, Constructing your Process Control file, for information about PCF entries.
|
Expand |
---|
title | 11.2.11 PGS_CSC_nutate2000 |
---|
| Short explanation of what it's for: Nutate State Vector Between J2000 and Ephemeris Time (ET). This function is in file: $PGSSRC/CBP/PGS_CSC_nutate2000.c Examples: Nutate a vector from J2000 to celestial coordinates of date.. C example: #include <PGS_CSC.h>
PGSt_SMF_status returnStatus;
PGSt_double jedTDB[2];
PGSt_double dvnut[4];
PGSt_double posVel[6];
jedTDB[0] = 2449720.5;
jedTDB[1] = 0.25;
posVel[0] = 6400000.0;
posVel[1] = -5000000.0;
posVel[2] = 40000.0;
posVel[3] = 4000.0;
posVel[4] = 7000.0;
posVel[5] = -6000.0;
/* get the nutation angles and rates */
PGS_CSC_wahr2(jedTDB,dvnut);
/* nutate the vector */
returnStatus = PGS_CSC_nutate2000(6,jedTDB,dvnut,PGS_TRUE,posVel);
/* The input vector "posVel" has been overwritten with the nutated value:
posVel[0] = 6400276.14364
posVel[1] = -4999643.83137
posVel[2] = 40334.16248
posVel[3] = 3999.75622
posVel[4] = 7000.00525
posVel[5] = -6000.15643
*/
FORTRAN example: implicit none
INCLUDE 'PGS_SMF.f'
INCLUDE 'PGS_CSC_4.f'
integer pgs_csc_nutate2000
integer pgs_csc_wahr2
integer returnstatus
integer threeor6
double precision jedtdb(2)
double precision dvnut(4)
double precision frwd
double precision posvel(6)
data jedtdb/2449720.5,0.25/
data posvel/6400000.0,-5000000.0,40000.0,4000.0,7000.0,-6000.0/
threeor6 = 6
frwd = PGS_TRUE
! get the nutation angles and rates
returnstatus = pgs_csc_wahr2(jedtdb,dvnut)
! nutate the vector
returnstatus = pgs_csc_nutate2000(threeor6,jedtdb,dvnut,frwd,
+ posvel)
! the input vector "posvel" has been overwritten with the nutated value:
! posVel(1) = 6400276.14364
! posVel(2) = -4999643.83137
! posVel(3) = 40334.16248
! posVel(4) = 3999.75622
! posVel(5) = 7000.00525
! posVel(6) = -6000.15643
Notes: Purpose: In the case of transforming from J2000, this function transforms a vector (position and velocity) after precession from J2000 to the correctly nutated coordinates -- i.e. the rotation (or Z) axis is along the Earth's angular velocity and the X axis is toward the equinox of date. (Precession gives the mean equinox of date and the program rotates a vector either to or from J2000, depending on the input flag.) In the opposite case, in going from arbitrary epoch to J2000, this function nutates the vector to the "un-nutated" axis of date, after which it must be precessed to J2000 by the function PGS_CSC_precs2000(). This code was modified so it now takes either a 3 or 6 dimensional vector. When 6 dimensions are used, they must be in the order (position, velocity) because the transformation of velocity is slightly different. This function produces an output vector that overwrites the input vector. The code was kept this way to preserve its heritage. The user is cautioned that her/his input vector will therefore be altered by this function. The underlying rotation functions do not have this property.
|
Expand |
---|
title | 11.2.12 PGS_CSC_ORBtoECI |
---|
| Short explanation of what it's for: Convert a vector in Orbital (ORB) reference frame coordinates to Earth Centered Inertial (ECI) coordinates . This function is in file: $PGSSRC/CBP/PGS_CSC_ORBtoECI.c Examples: Two ORB vectors containing position are converted to two ECI vectors. The first is a spacecraft ephemeris ECI vector in meters; the second is a unit vector. C example: #include <PGS_CSC.h>
PGSt_tag spacecraftID;
PGSt_integer numValues;
char asciiUTC_A[28];
PGSt_double time_offset[2];
PGSt_double orb_vector[2][3];
PGSt_double eci_vector[2][3];
PGSt_SMF_status returnStatus;
/*
Begin example
*/
/* Assign spacecraft ID tag
PGSd_EOS_AM and PGSd_EOS_PM are also allowed */
spacecraftID = PGSd_TRMM;
/* Define base time and offsets desired
Base time is given in CCSDS ASCII Time code A format;
CCSDS ASCII Time code B format is also allowed
Offsets are in seconds */
numValues = 2;
strcpy( asciiUTC_A, "1998-06-30T10:51:28.320000Z");
time_offset[0] = 0.0;
time_offset[1] = 0.0;
/* Fill input vectors */
orb_vector[0][0] = 0.000; /* ORB X pos, meters */
orb_vector[0][1] = 0.000; /* ORB Y pos, meters */
orb_vector[0][2] = 0.000; /* ORB Z pos, meters */
orb_vector[1][0] = 0.228986;
orb_vector[1][1] = -0.545405;
orb_vector[1][2] = 0.806287;
/* Get ECI vector */
returnStatus = PGS_CSC_ORBtoECI( spacecraftID, numValues,
asciiUTC_A, time_offset, orb_vector,
eci_vector );
/* Matrix eci_vector now contains the following values:
eci_vector[0][0] = 1413531.574 ECI X pos, meters
eci_vector[0][1] = -6005427.214 ECI Y pos, meters
eci_vector[0][2] = -2693615.671 ECI Z pos, meters
eci_vector[1][0] = -0.153457 ECI unit vector
eci_vector[1][1] = 0.482829
eci_vector[1][2] = 0.862164
*/
FORTRAN example: IMPLICIT NONE
INCLUDE 'PGS_SMF.f'
INCLUDE 'PGS_TD.f'
INCLUDE 'PGS_TD_3.f'
INCLUDE 'PGS_CSC_4.f'
INCLUDE 'PGS_EPH_5.f'
INTEGER pgs_csc_orbtoeci
INTEGER spacecraftid
INTEGER numvalues
CHARACTER*27 asciiutc_a
DOUBLE PRECISION time_offset(2)
DOUBLE PRECISION orb_vector(3,2)
DOUBLE PRECISION eci_vector(3,2)
INTEGER returnstatus
!
! Begin example
!
! Assign spacecraft ID tag
! PGSd_EOS_AM and PGSd_EOS_PM are also allowed
!
spacecraftid = PGSd_TRMM
! Define base time and offsets desired
! Base time is given in CCSDS ASCII Time code A format;
! CCSDS ASCII Time code B format is also allowed
! Offsets are in seconds
!
numvalues = 2
asciiutc_a = '1998-06-30T10:51:28.320000Z'
time_offset(1) = 0.0
time_offset(2) = 0.0
! Fill input vectors
orb_vector(1,1) = 0.000 ! ORB X pos, meters
orb_vector(2,1) = 0.000 ! ORB Y pos, meters
orb_vector(3,1) = 0.000 ! ORB Z pos, meters
orb_vector(1,2) = 0.228986
orb_vector(2,2) = -0.545405
orb_vector(3,2) = 0.806287
! Get SC vector
returnstatus = pgs_csc_orbtoeci( spacecraftid, numvalues,
+ asciiutc_a, time_offset, orb_vector,
+ eci_vector )
! Matrix eci_vector now contains the following values:
! eci_vector(1,1) = 1413531.574 ECI X pos, meters
! eci_vector(2,1) = -6005427.214 ECI Y pos, meters
! eci_vector(3,1) = -2693615.671 ECI Z pos, meters
! eci_vector(1,2) = -0.153457 ECI unit vector
! eci_vector(2,2) = 0.482829
! eci_vector(3,2) = 0.862164
Files: This tool accesses the following files: - leap seconds
- spacecraft ephemeris/attitude
The physical references to these files are defined in the Process Control File (PCF) template supplied with the Toolkit, $PGSRUN/PCF.v5. If you are using a PCF derived from that template, you need not do anything extra to enable access to these files. See sec. 3.1.2, Constructing your Process Control file, for information about PCF entries. The exception is the spacecraft ephemeris/attitude file, which must be created by you for testing purposes at the SCF. Simulated files may be prepared through use of the orbsim utility; (sec. 7.1.2.1); alternatively, you may prepare them yourself (sec. 7.1.2.2). This file must follow the ephemeris file naming convention, and must reside in directory $PGSDAT/EPH. This directory is specified in $PGSRUN/PCF.v5; individual spacecraft ephemeris/attitude filenames are not entered in the PCF.
|
Expand |
---|
title | 11.2.13 PGS_CSC_ORBtoSC |
---|
| Short explanation of what it's for: Convert a vector in Orbital (ORB) reference frame coordinates to Spacecraft (SC) reference frame coordinates . This function is in file: $PGSSRC/CBP/PGS_CSC_ORBtoSC.c Examples: Two ORB vectors containing position are converted to two SC vectors. C example: #include <PGS_CSC.h>
PGSt_tag spacecraftID;
PGSt_integer numValues;
char asciiUTC_A[28];
PGSt_double time_offset[2];
PGSt_double orb_vector[2][3];
PGSt_double sc_vector[2][3];
PGSt_SMF_status returnStatus;
/*
Begin example
*/
/* Assign spacecraft ID tag
PGSd_EOS_AM and PGSd_EOS_PM are also allowed */
spacecraftID = PGSd_TRMM;
/* Define base time and offsets desired
Base time is given in CCSDS ASCII Time code A format;
CCSDS ASCII Time code B format is also allowed
Offsets are in seconds */
numValues = 2;
strcpy( asciiUTC_A, "1998-06-30T10:51:28.320000Z");
time_offset[0] = 0.0;
time_offset[1] = 0.0;
/* Fill input vectors */
orb_vector[0][0] = 0.000; /* ORB X pos, meters */
orb_vector[0][1] = 0.000; /* ORB Y pos, meters */
orb_vector[0][2] = 0.000; /* ORB Z pos, meters */
orb_vector[1][0] = 0.228986;
orb_vector[1][1] = -0.545405;
orb_vector[1][2] = 0.806287;
/* Get SC vector */
returnStatus = PGS_CSC_ORBtoSC( spacecraftID, numValues,
asciiUTC_A, time_offset, orb_vector,
sc_vector );
/* Matrix sc_vector now contains the following values:
sc_vector[0][0] = 0.000 SC frame X pos, meters
sc_vector[0][1] = 0.000 SC frame Y pos, meters
sc_vector[0][2] = 0.000 SC frame Z pos, meters
sc_vector[1][0] = 0.228544 SC unit vector
sc_vector[1][1] = -0.548002
sc_vector[1][2] = 0.804649
*/
FORTRAN example: IMPLICIT NONE
INCLUDE 'PGS_SMF.f'
INCLUDE 'PGS_TD.f'
INCLUDE 'PGS_TD_3.f'
INCLUDE 'PGS_CSC_4.f'
INCLUDE 'PGS_EPH_5.f'
INTEGER pgs_csc_orbtosc
INTEGER spacecraftid
INTEGER numvalues
CHARACTER*27 asciiutc_a
DOUBLE PRECISION time_offset(2)
DOUBLE PRECISION orb_vector(3,2)
DOUBLE PRECISION sc_vector(3,2)
INTEGER returnstatus
!
! Begin example
!
! Assign spacecraft ID tag
! PGSd_EOS_AM and PGSd_EOS_PM are also allowed
!
spacecraftid = PGSd_TRMM
! Define base time and offsets desired
! Base time is given in CCSDS ASCII Time code A format;
! CCSDS ASCII Time code B format is also allowed
! Offsets are in seconds
!
numvalues = 2
asciiutc_a = '1998-06-30T10:51:28.320000Z'
time_offset(1) = 0.0
time_offset(2) = 0.0
! Fill input vectors
orb_vector(1,1) = 0.000 ! ORB X pos, meters
orb_vector(2,1) = 0.000 ! ORB Y pos, meters
orb_vector(3,1) = 0.000 ! ORB Z pos, meters
orb_vector(1,2) = 0.228986
orb_vector(2,2) = -0.545405
orb_vector(3,2) = 0.806287
! Get SC vector
returnstatus = pgs_csc_orbtosc( spacecraftid, numvalues,
+ asciiutc_a, time_offset, orb_vector,
+ sc_vector )
! Matrix sc_vector now contains the following values:
! sc_vector(1,1) = 0.000 SC X pos, meters
! sc_vector(2,1) = 0.000 SC Y pos, meters
! sc_vector(3,1) = 0.000 SC Z pos, meters
! sc_vector(1,2) = 0.228544 SC unit vector
! sc_vector(2,2) = -0.548002
! sc_vector(3,2) = 0.804649
Files: This tool accesses the following files: - leap seconds
- spacecraft ephemeris/attitude
The physical references to these files are defined in the Process Control File (PCF) template supplied with the Toolkit, $PGSRUN/PCF.v5. If you are using a PCF derived from that template, you need not do anything extra to enable access to these files. See sec. 3.1.2, Constructing your Process Control file, for information about PCF entries. The exception is the spacecraft ephemeris/attitude file, which must be created by you for testing purposes at the SCF. Simulated files may be prepared through use of the orbsim utility; (sec. 7.1.2.1); alternatively, you may prepare them yourself (sec. 7.1.2.2). This file must follow the ephemeris file naming convention, and must reside in directory $PGSDAT/EPH. This directory is specified in $PGSRUN/PCF.v5; individual spacecraft ephemeris/attitude filenames are not entered in the PCF.
|
Expand |
---|
title | 11.2.14 PGS_CSC_precs2000 |
---|
| Short explanation of what it's for: Precesses a vector between TDB Julian Date and J2000 Coordinates. This function is in file: $PGSSRC/CBP/PGS_CSC_precs2000.c Examples: Precess a vector from J2000 to celestial coordinates of date.. C example: #include <PGS_CSC.h>
PGSt_SMF_status returnStatus;
PGSt_double jedTDB[2];
PGSt_double posVel[6];
jedTDB[0] = 2449720.5;
jedTDB[1] = 0.25;
posVel[0] = 6400000.0;
posVel[1] = -5000000.0;
posVel[2] = 40000.0;
posVel[3] = 4000.0;
posVel[4] = 7000.0;
posVel[5] = -6000.0;
/* precess the vector */
returnStatus = PGS_CSC_precs2000(6,jedTDB,PGS_TRUE,posVel);
/* The input vector "posVel" has been overwritten with the nutated value:
posVel[0] = 6394430.44572
posVel[1] = -5007144.69703
posVel[2] = 36895.22797
posVel[3] = 4004.90299
posVel[4] = 6995.52993
posVel[5] = -6001.94250
*/
FORTRAN example: implicit none
INCLUDE 'PGS_SMF.f'
INCLUDE 'PGS_CSC_4.f'
integer pgs_csc_precs2000
integer returnstatus
integer threeor6
double precision jedtdb(2)
double precision frwd
double precision posvel(6)
data jedtdb/2449720.5,0.25/
data posvel/6400000.0,-5000000.0,40000.0,4000.0,7000.0,-6000.0/
threeor6 = 6
frwd = PGS_TRUE
! nutate the vector
returnstatus = pgs_csc_nutate2000(threeor6,jedtdb,frwd,posvel)
! the input vector "posvel" has been overwritten with the nutated value:
! posVel(1) = 6394430.44572
! posVel(2) = -5007144.69703
! posVel(3) = 36895.22797
! posVel(4) = 4004.90299
! posVel(5) = 6995.52993
! posVel(6) = -6001.94250
Notes: This function is a simplified version of its precursor: PGS_CSC_precs3or6(). This function is specific to the case of precessing to or from the epoch of J2000. The various coefficients used are the constants that result for this epoch. This function produces an output vector that overwrites the input vector. The code was kept this way to preserve its heritage. The user is cautioned that her/his input vector will be therefore be altered by this function. The underlying rotation functions do not have this property. |
Expand |
---|
title | 11.2.15 PGS_CSC_SCtoECI |
---|
| Short explanation of what it's for: Convert a vector in Spacecraft (SC) reference frame coordinates to Earth Centered Inertial (ECI) coordinates . This function is in file: $PGSSRC/CSC/PGS_CSC_SCtoECI.c Examples: Two SC vectors containing position are converted to two ECI vectors. The first is a spacecraft ephemeris SC vector in meters; the second is a unit vector (directional data). C example: #include <PGS_CSC.h>
PGSt_tag spacecraftID;
PGSt_integer numValues;
char asciiUTC_A[28];
PGSt_double time_offset[2];
PGSt_double sc_vector[2][3];
PGSt_double eci_vector[2][3];
PGSt_SMF_status returnStatus;
/*
Begin example
*/
/* Assign spacecraft ID tag
PGSd_EOS_AM and PGSd_EOS_PM are also allowed */
spacecraftID = PGSd_TRMM;
/* Define base time and offsets desired
Base time is given in CCSDS ASCII Time code A format;
CCSDS ASCII Time code B format is also allowed
Offsets are in seconds */
numValues = 2;
strcpy( asciiUTC_A, "1998-06-30T10:51:28.320000Z");
time_offset[0] = 0.0;
time_offset[1] = 0.0;
/* Fill input vectors */
sc_vector[0][0] = 0.000; /* SC X pos, meters */
sc_vector[0][1] = 0.000; /* SC Y pos, meters */
sc_vector[0][2] = 0.000; /* SC Z pos, meters */
sc_vector[1][0] = 0.228986; /* SC frame X direction cosine */
sc_vector[1][1] = -0.545405; /* SC frame Y direction cosine */
sc_vector[1][2] = 0.806287; /* SC frame Z direction cosine */
/* Get ECI vector */
returnStatus = PGS_CSC_SCtoECI( spacecraftID, numValues,
asciiUTC_A, time_offset, sc_vector,
eci_vector );
/* Matrix eci_vector now contains the following values:
eci_vector[0][0] = 1413531.574 ECI X pos, meters
eci_vector[0][1] = -6005427.214 ECI Y pos, meters
eci_vector[0][2] = -2693615.671 ECI Z pos, meters
eci_vector[1][0] = -0.153457 ECI X direction cosine
eci_vector[1][1] = 0.482829 ECI Y direction cosine
eci_vector[1][2] = 0.862164 ECI Z direction cosine
*/
FORTRAN example: IMPLICIT NONE
INCLUDE 'PGS_SMF.f'
INCLUDE 'PGS_TD.f'
INCLUDE 'PGS_TD_3.f'
INCLUDE 'PGS_CSC_4.f'
INCLUDE 'PGS_EPH_5.f'
INTEGER pgs_csc_sctoeci
INTEGER spacecraftid
INTEGER numvalues
CHARACTER*27 asciiutc_a
DOUBLE PRECISION time_offset(2)
DOUBLE PRECISION sc_vector(3,2)
DOUBLE PRECISION eci_vector(3,2)
INTEGER returnstatus
!
! Begin example
!
! Assign spacecraft ID tag
! PGSd_EOS_AM and PGSd_EOS_PM are also allowed
!
spacecraftid = PGSd_TRMM
! Define base time and offsets desired
! Base time is given in CCSDS ASCII Time code A format;
! CCSDS ASCII Time code B format is also allowed
! Offsets are in seconds
!
numvalues = 2
asciiutc_a = '1998-06-30T10:51:28.320000Z'
time_offset(1) = 0.0
time_offset(2) = 0.0
! Fill input vectors
sc_vector(1,1) = 0.000 ! SC X pos, meters
sc_vector(2,1) = 0.000 ! SC Y pos, meters
sc_vector(3,1) = 0.000 ! SC Z pos, meters
sc_vector(1,2) = 0.228986 ! SC frame X direction cosine
sc_vector(2,2) = -0.545405 ! SC frame Y direction cosine
sc_vector(3,2) = 0.806287 ! SC frame Z direction cosine
! Get ECI vector
returnstatus = pgs_csc_sctoeci( spacecraftid, numvalues,
+ asciiutc_a, time_offset, sc_vector,
+ eci_vector )
! Matrix eci_vector now contains the following values:
! eci_vector(1,1) = 1413531.574 ECI X pos, meters
! eci_vector(2,1) = -6005427.214 ECI Y pos, meters
! eci_vector(3,1) = -2693615.671 ECI Z pos, meters
! eci_vector(1,2) = -0.153457 ECI X direction cosine
! eci_vector(2,2) = 0.482829 ECI Y direction cosine
! eci_vector(3,2) = 0.862164 ECI Z direction cosine
Notes:
Aberration is taken into account in the transformation. The input vector may be given in meters or may be a unit vector. If the input vector is not a unit vector, translation from earth center to spacecraft origin is accounted for. No translation is done when the input vector is a unit vector. Files: This tool accesses the following files: - leap seconds
- spacecraft ephemeris/attitude
The physical references to these files are defined in the Process Control File (PCF) template supplied with the Toolkit, $PGSRUN/PCF.v5. If you are using a PCF derived from that template, you need not do anything extra to enable access to these files. See sec. 3.1.2, Constructing your Process Control file, for information about PCF entries. The exception is the spacecraft ephemeris/attitude file, which must be created by you for testing purposes at the ECIF. Simulated files may be prepared through use of the orbsim utility; (sec. 7.1.2.1); alternatively, you may prepare them yourself (sec. 7.1.2.2). This file must follow the ephemeris file naming convention, and must reside in directory $PGSDAT/EPH. This directory is specified in $PGSRUN/PCF.v5; individual spacecraft ephemeris/attitude filenames are not entered in the PCF.
|
Expand |
---|
title | 11.2.16 PGS_CSC_SCtoORB |
---|
| Short explanation of what it's for: Convert a vector in Spacecraft (SC) reference frame coordinates to Orbital (ORB) reference frame coordinates . This function is in file: $PGSSRC/CSC/PGS_CSC_SCtoORB.c Examples: Two SC unit vectors containing position are converted to two ORB vectors. C example: #include <PGS_CSC.h>
PGSt_tag spacecraftID;
PGSt_integer numValues;
char asciiUTC_A[28];
PGSt_double UTC_offset[2];
PGSt_double sc_vector[2][3];
PGSt_double orb_vector[2][3];
PGSt_SMF_status returnStatus;
/*
Begin example
*/
/* Assign spacecraft ID tag
PGSd_EOS_AM and PGSd_EOS_PM are also allowed */
spacecraftID = PGSd_TRMM;
/* Define base time and offsets desired
Base time is given in CCSDS ASCII Time code A format;
CCSDS ASCII Time code B format is also allowed
Offsets are in seconds */
numValues = 2;
strcpy( asciiUTC_A, "1998-06-30T10:51:28.320000Z");
time_offset[0] = 0.0;
time_offset[1] = 0.0;
/* Fill input vectors */
sc_vector[0][0] = 0.000; /* SC frame X pos, meters */
sc_vector[0][1] = 0.000; /* SC frame Y pos, meters */
sc_vector[0][2] = 0.000; /* SC frame Z pos, meters */
sc_vector[1][0] = 0.228544; /* SC unit vector */
sc_vector[1][1] = -0.548002;
sc_vector[1][2] = 0.804649;
/* Get ORB vector */
returnStatus = PGS_CSC_SCtoORB( spacecraftID, numValues,
asciiUTC_A, UTC_offset, sc_vector,
orb_vector );
/* Matrix orb_vector now contains the following values:
orb_vector[0][0] = 0.000 ORB X pos, meters
orb_vector[0][1] = 0.000 ORB Y pos, meters
orb_vector[0][2] = 0.000 ORB Z pos, meters
orb_vector[1][0] = 0.228986
orb_vector[1][1] = -0.545405
orb_vector[1][2] = 0.806287
*/
FORTRAN example: IMPLICIT NONE
INCLUDE 'PGS_SMF.f'
INCLUDE 'PGS_TD.f'
INCLUDE 'PGS_TD_3.f'
INCLUDE 'PGS_CSC_4.f'
INCLUDE 'PGS_EPH_5.f'
INTEGER pgs_csc_sctoorb
INTEGER spacecraftid
INTEGER numvalues
CHARACTER*27 asciiutc_a
DOUBLE PRECISION utc_offset(2)
DOUBLE PRECISION sc_vector(3,2)
DOUBLE PRECISION orb_vector(3,2)
INTEGER returnstatus
!
! Begin example
!
! Assign spacecraft ID tag
! PGSd_EOS_AM and PGSd_EOS_PM are also allowed
!
spacecraftid = PGSd_TRMM
! Define base time and offsets desired
! Base time is given in CCSDS ASCII Time code A format;
! CCSDS ASCII Time code B format is also allowed
! Offsets are in seconds
!
numvalues = 2
asciiutc_a = '1998-06-30T10:51:28.320000Z'
time_offset(1) = 0.0
time_offset(2) = 0.0
! Fill input vectors
sc_vector(1,1) = 0.000 ! SC X pos, meters
sc_vector(2,1) = 0.000 ! SC Y pos, meters
sc_vector(3,1) = 0.000 ! SC Z pos, meters
sc_vector(1,2) = 0.228544 ! SC unit vector
sc_vector(2,2) = -0.548002
sc_vector(3,2) = 0.804649
! Get ORB vector
returnstatus = pgs_csc_sctoorb( spacecraftid, numvalues,
+ asciiutc_a, utc_offset, sc_vector,
+ orb_vector )
! Matrix orb_vector now contains the following values:
! orb_vector(1,1) = 0.000 ORB X pos, meters
! orb_vector(2,1) = 0.000 ORB Y pos, meters
! orb_vector(3,1) = 0.000 ORB Z pos, meters
! orb_vector(1,2) = 0.228986
! orb_vector(2,2) = -0.545405
! orb_vector(3,2) = 0.806287
Files: This tool accesses the following files: - leap seconds
- spacecraft ephemeris/attitude
The physical references to these files are defined in the Process Control File (PCF) template supplied with the Toolkit, $PGSRUN/PCF.v5. If you are using a PCF derived from that template, you need not do anything extra to enable access to these files. See sec. 3.1.2, Constructing your Process Control file, for information about PCF entries. The exception is the spacecraft ephemeris/attitude file, which must be created by you for testing purposes at the SCF. Simulated files may be prepared through use of the orbsim utility; (sec. 7.1.2.1); alternatively, you may prepare them yourself (sec. 7.1.2.2). This file must follow the ephemeris file naming convention, and must reside in directory $PGSDAT/EPH. This directory is specified in $PGSRUN/PCF.v5; individual spacecraft ephemeris/attitude filenames are not entered in the PCF.
|
Expand |
---|
title | 11.2.17 PGS_CSC_PGS_CSC_SpaceRefract |
---|
| Short explanation of what it's for: Estimate the refraction for a ray incident from space or a line of sight from space to the Earth's surface, based on the unrefracted zenith angle. This function is in file: $PGSSRC/CBP/PGS_CSC_SpaceRefract.c Examples: Estimate the refraction for a ray incident from space. C example #include <PGS_CSC.h>
PGSt_SMF_status returnStatus;
PGSt_double spaceZenith;
PGSt_double altitude;
PGSt_double latitude; /* not implemented at present */
PGSt_double surfaceZenith;
PGSt_double displacement;
/*
Begin example
*/
spaceZenith = 0.4; /* radians */
altitude = 5000.0; /* meters */
returnStatus = PGS_CSC_SpaceRefract(spaceZenith,altitude,latitude,
&surfaceZenith,&displacement)
/* The following values are returned:
surfaceZenith = 0.3999259828 Refracted Zenith Angle
displacement = 0.0000001245
*/
FORTRAN example INCLUDE 'PGS_SMF.f'
INCLUDE 'PGS_TD.f'
INCLUDE 'PGS_CSC_4.f'
implicit none
integer pgs_csc_spacerefract
integer returnstatus
double precision spacezenith
double precision altitude
double precision latitude ! not implemented at present
double precision surfacezenith
double precision displacement
!
! Begin example
!
spacezenith = 0.4 ! radians
altitude = 5000.0 ! meters
returnstatus = pgs_csc_spacerefract(spacezenith,altitude,latitude,
+ surfacezenith,displacement)
! The following values are returned:
! surfacezenith = 0.3999259828 Refracted Zenith Angle
! displacement = 0.0000001245
Notes:
This algorithm is intended as a mean-atmosphere approximation, valid for white light (for example, sunlight). Refraction is quite wavelength dependent, and in the atmosphere it will also depend strongly on local conditions (the weather, e.g.). The present algorithm is intended to be a reasonable approximation such that to do better one would need local and, for large zenith angles, regional weather. The atmosphere model is used only to get the index of refraction at sea level. Latitude dependence is not implemented in the present version. Later, the sea level temperature and mean scale height will be altered to become functions of latitude. |
Expand |
---|
title | 11.2.18 PGS_CSC_SubSatPoint |
---|
| Short explanation of what it's for: Determine where a vector to the spacecraft normal to the earth ellipsoid intersects the earth's surface. This point is called the sub-satellite point. Velocity of this point is optionally determined along with the rate of change of altitude off the ellipsoid . This function is in file: $PGSSRC/CBP/PGS_CSC_SubSatPoint.c Examples: Two intersection point coordinates and velocities are determined, one second of spacecraft ephemeris apart. C example: #include <PGS_CSC.h>
PGSt_tag spacecraftID;
PGSt_integer numValues;
char asciiUTC_A[28];
PGSt_double time_offset[2];
char earthModel[21];
PGSt_boolean velocity_flag;
PGSt_double latitude[2];
PGSt_double longitude[2];
PGSt_double altitude[2];
PGSt_double velocity[2][3];
PGSt_SMF_status returnStatus;
/*
Begin example
*/
/* Assign spacecraft ID tag
PGSd_EOS_AM and PGSd_EOS_PM are also allowed */
spacecraftID = PGSd_TRMM;
/* Define base time and offsets desired
Base time is given in CCSDS ASCII Time code A format;
CCSDS ASCII Time code B format is also allowed
Offsets are in seconds */
numValues = 2;
strcpy( asciiUTC_A, "1998-06-30T10:51:28.320000Z");
time_offset[0] = 0.0;
time_offset[1] = 1.0;
/* Define earth reference model */
strcpy( earthModel, "WGS84" );
/* Set velocity flag to PGS_FALSE if you do not need the
velocity of the sub-satellite point */
velocity_flag = PGS_TRUE;
/* Get earth intersection point data */
returnStatus = PGS_CSC_SubSatPoint( spacecraftID, numValues,
asciiUTC_A, time_offset, earthModel, velocity_flag,
latitude, longitude, altitude, velocity );
/* The following values are returned:
latitude[0] = -0.413986 Intersection pt latitude, radians
longitude[0] = -2.756803 Intersection pt longitude, radians
altitude[0] = 357223.526 Distance from spacecraft to
intersection pt, meters
Velocity of the intersection pt on the ellipsoid, meters/sec:
velocity[0][0] = 3268.458 North component
velocity[0][1] = 6082.756 East component
velocity[0][2] = -11.045 Rate of change of spacecraft
altitude relative to nadir
One second later:
latitude[1] = -0.413471
longitude[1] = -2.755762
altitude[1] = 357212.480
velocity[1][0] = 3271.369
velocity[1][1] = 6081.213
velocity[1][2] = -11.046
*/
FORTRAN example: IMPLICIT NONE
INCLUDE 'PGS_SMF.f'
INCLUDE 'PGS_TD.f'
INCLUDE 'PGS_TD_3.f'
INCLUDE 'PGS_CSC_4.f'
INCLUDE 'PGS_EPH_5.f'
INTEGER pgs_csc_SubSatPoint
INTEGER spacecraftid
INTEGER numvalues
CHARACTER*27 asciiutc_a
DOUBLE PRECISION time_offset(2)
CHARACTER*20 earthmodel
INTEGER velocity_flag
DOUBLE PRECISION latitude(2)
DOUBLE PRECISION longitude(2)
DOUBLE PRECISION altitude(2)
DOUBLE PRECISION velocity(3,2)
INTEGER returnstatus
INTEGER i,j
!
! Begin example
!
! Assign spacecraft ID tag
! PGSd_EOS_AM and PGSd_EOS_PM are also allowed
!
spacecraftid = PGSd_TRMM
! Define base time and offsets desired
! Base time is given in CCSDS ASCII Time code A format;
! CCSDS ASCII Time code B format is also allowed
! Offsets are in seconds
!
numvalues = 2
asciiutc_a = '1998-06-30T10:51:28.320000Z'
time_offset(1) = 0.0
time_offset(2) = 1.0
! Define earth reference model
earthModel = 'WGS84'
! Set velocity flag to PGS_FALSE if you do not need the
! velocity of the sub-satellite point
velocity_flag = PGS_TRUE
! Get earth intersection point data
returnstatus = pgs_csc_SubSatPoint( spacecraftid, numvalues,
+ asciiutc_a, time_offset, earthmodel, velocity_flag,
+ latitude, longitude, altitude, velocity )
! The following values are returned:
! latitude(1) = -0.413986 Intersection pt latitude, radians
! longitude(1) = -2.756803 Intersection pt longitude, radians
! altitude(1) = 357223.526 Distance from spacecraft to
! intersection pt, meters
! Velocity of the intersection pt on the ellipsoid, meters/sec:
! velocity(1,1) = 3268.458 North component
! velocity(2,1) = 6082.756 East component
! velocity(3,1) = -11.045 Rate of change of spacecraft
! altitude relative to nadir
! One second later:
! latitude(2) = -0.413471
! longitude(2) = -2.755762
! altitude(2) = 357212.480
! velocity(1,2) = 3271.369
! velocity(2,2) = 6081.213
! velocity(3,2) = -11.046
Notes: This function returns an error value if any of the input values are invalid. Returned values are all set to PGSd_GEO_ERROR_VALUE in this case. The intersection of the vector in question with the Earth's equatorial plane defines the geodetic latitude. Files: This tool accesses the following files: - leap seconds
- polar motion and UT1-UTC
- earth axis data
- spacecraft ephemeris/attitude
The physical references to these files are defined in the Process Control File (PCF) template supplied with the Toolkit, $PGSRUN/PCF.v5. If you are using a PCF derived from that template, you need not do anything extra to enable access to these files. See sec. 3.1.2, Constructing your Process Control file, for information about PCF entries. The exception is the spacecraft ephemeris/attitude file, which must be created by you for testing purposes at the SCF. Simulated files may be prepared through use of the orbsim utility; (sec. 7.1.2.1); alternatively, you may prepare them yourself (sec. 7.1.2.2). This file must follow the ephemeris file naming convention, and must reside in directory $PGSDAT/EPH. This directory is specified in $PGSRUN/PCF.v5; individual spacecraft ephemeris/attitude filenames are not entered in the PCF.
|
Expand |
---|
title | 11.2.19 PGS_CSC_wahr2 |
---|
| Short explanation of what it's for: Calculate Nutation Angles This function is in file: $PGSSRC/CBP/PGS_CSC_wahr2.c Examples: Calculate Nutation Angles. C example: #include <PGS_CSC.h>
PGSt_SMF_status returnStatus;
PGSt_double jedTDB[2];
PGSt_double dvnut[4];
jedTDB[0] = 2449720.5;
jedTDB[1] = 0.25;
/* get the nutation angles and rates */
PGS_CSC_wahr2(jedTDB,dvnut);
/* Array dvnut now contains the following values:
dvnut[0] = 0.00006040835 Nutation in Longitude, radians
dvnut[1] = -0.00003607640 Nutation in Obliquity, radians
dvnut[2] = 0.00000000000333 Nutation rate in Longitude, radians/sec
dvnut[3] = 0.00000000000259 Nutation rate in Obliquity, radians/sec
*/
FORTRAN example: implicit none
INCLUDE 'PGS_SMF.f'
INCLUDE 'PGS_CSC_4.f'
integer pgs_csc_wahr2
integer returnstatus
double precision jedtdb(2)
double precision dvnut(4)
data jedtdb/2449720.5,0.25/
! get the nutation angles and rates
returnstatus = pgs_csc_wahr2(jedtdb,dvnut)
! Array dvnut now contains the following values:
! dvnut(1) = 0.00006040835 Nutation in Longitude, radians
! dvnut(2) = -0.00003607640 Nutation in Obliquity, radians
! dvnut(3) = 0.00000000000333 Nutation rate in Longitude, radians/sec
! dvnut(4) = 0.00000000000259 Nutation rate in Obliquity, radians/sec
|
Expand |
---|
title | 11.2.20 PGS_CSC_PGS_CSC_ZenithAzimuth |
---|
| Short explanation of what it's for: Determines zenith angle and azimuth of an arbitrary vector at a given geographic position. The vector may be either a look vector from the spacecraft to the earth, or the position vector of a celestial body . This function is in file: $PGSSRC/CBP/PGS_CSC_ZenithAzimuth.c Examples: Two examples are given: (1) For a single point on the earth, the zenith angle and azimuth of a spacecraft look vector are computed. Atmospheric refraction is accounted for. This example assumes that the example given in tool PGS_CSC_GetFOV_Pixel has been run first. (2) The zenith angle of the Sun at a surface point is calculated. To get the Sun ECR input vector, tools PGS_CBP_Earth_CB_Vector and PGS_CSC_ECItoECR are called successively before the call to PGS_CSC_ZenithAzimuth. C example 1: Zenith and azimuth of spacecraft look vector #include <PGS_CSC.h>
PGSt_double ecr_vector[3];
PGSt_double latitude;
PGSt_double longitude;
PGSt_double altitude;
PGSt_tag vector_type;
PGSt_boolean zenith_only;
PGSt_boolean refraction;
PGSt_double zenith_angle;
PGSt_double azimuthal_angle;
PGSt_double refraction_decrease;
PGSt_SMF_status returnStatus;
/*
Begin example
*/
/***** Data from the example output of PGS_CSC_GetFOV_Pixel *****/
/* Define spacecraft look vector in ECR frame. */
ecr_vector[0] = 0.20219599731;
ecr_vector[1] = 0.85458983269;
ecr_vector[2] = 0.47832310892;
/* Define earth location for which zenith and azimuthal
angles desired */
latitude = -0.392320; /* geodetic latitude, radians */
longitude = -2.825456; /* longitude, radians */
/****** End data from PGS_CSC_GetFOV_Pixel ******/
/* Now set the altitude of surface point off the geoid, in
meters (used only to estimate refraction, except in the
case of the Moon, where it slightly affects the parallax)
- user responsibility to provide this altitude (Toolkit
provides DEM access in the AA tools) */
altitude = 0.0; /* altitude of surface point, meters off geoid */
/* Indicate that ecr_vector is a look vector
from the spacecraft.
See Notes for other possible values. */
vector_type = PGSd_LOOK;
/* We want both zenith and azimuthal angles in this example */
zenith_only = PGS_FALSE;
/* Enable atmospheric refraction correction */
refraction = PGS_TRUE;
/* Get zenith and azimuthal angles */
returnStatus = PGS_CSC_ZenithAzimuth( ecr_vector, latitude,
longitude, altitude, vector_type,
zenith_only, refraction,
&zenith_angle, &azimuthal_angle,
&refraction_decrease );
/* The following values are returned:
zenith_angle = 0.919446 refracted angle in radians
azimuthal_angle = 1.912980 radians
refraction_decrease = 0.000381 decrease in zenith angle
due to refraction, radians
*/
FORTRAN example 1: Zenith and azimuth of spacecraft look vector IMPLICIT NONE
INCLUDE 'PGS_SMF.f'
INCLUDE 'PGS_CSC.f'
INCLUDE 'PGS_CSC_4.f'
INCLUDE 'PGS_CBP.f'
INTEGER pgs_csc_zenithazimuth
DOUBLE PRECISION ecr_vector(3)
DOUBLE PRECISION latitude
DOUBLE PRECISION longitude
DOUBLE PRECISION altitude
INTEGER vector_type
INTEGER zenith_only
INTEGER refraction
DOUBLE PRECISION zenith_angle
DOUBLE PRECISION azimuthal_angle
DOUBLE PRECISION refraction_decrease
INTEGER returnstatus
!
! Begin example
!
! **** Data taken from the example output of PGS_CSC_GetFOV_Pixel
! Define spacecraft look vector in ECR frame.
ecr_vector(1) = 0.20219599731
ecr_vector(2) = 0.85458983269
ecr_vector(3) = 0.47832310892
! Define earth location for which zenith and azimuthal
! angles desired
latitude = -0.392320 ! radians
longitude = -2.825456 ! radians
! **** End data from PGS_CSC_GetFOV_Pixel ******
altitude = 0.0 ! altitude of surface point in meters off the geoid
! Indicate that ecr_vector is a look vector
! from the spacecraft.
! See Notes for other possible values.
vector_type = PGSd_LOOK
! We want both zenith and azimuthal angles in this example
zenith_only = PGS_FALSE
! Enable atmospheric refraction correction
refraction = PGS_TRUE
! Get zenith and azimuthal angles
returnStatus = pgs_csc_zenithazimuth( ecr_vector, latitude,
+ longitude, altitude, vector_type,
+ zenith_only, refraction,
+ zenith_angle, azimuthal_angle,
+ refraction_decrease );
! The following values are returned:
! zenith_angle = 0.919446 refracted angle in radians
! azimuthal_angle = 1.912980 radians
! refraction_decrease = 0.0003815 decrease in zenith angle
! due to refraction, radians
C example 2: Zenith angle of Sun #include <PGS_CSC.h>
/* Needed for other Toolkit calls in this example: */
#include <PGS_CBP.h>
char asciiUTC_A[28];
PGSt_double time_offset[1];
PGSt_double eci_vector_1[1][3];
PGSt_double eci_vector_2[1][6];
PGSt_double ecr_vector_2[1][6];
PGSt_double ecr_vector_1[3];
PGSt_double latitude;
PGSt_double longitude;
PGSt_double altitude;
PGSt_tag vector_type;
PGSt_boolean zenith_only;
PGSt_boolean refraction;
PGSt_double zenith_angle;
PGSt_double azimuthal_angle;
PGSt_double refraction_decrease;
PGSt_SMF_status returnStatus;
/*
Begin example
*/
/* First get ECI vector of Sun at the given time */
strcpy( asciiUTC_A, "1998-06-30T10:51:28.320000Z" );
time_offset[0] = 0.0;
returnStatus = PGS_CBP_Earth_CB_Vector( 1, asciiUTC_A,
time_offset, PGSd_SUN, eci_vector_1 );
/* Returned ECI vector in meters is
eci_vector_1[0][0] = -22436733432.493786
eci_vector_1[0][1] = 138013995777.10355
eci_vector_1[0][2] = 59837305848.062561
*/
/* Next translate this vector to ECR coordinates */
/* First copy it over into the correct form */
eci_vector_2[0][0] = eci_vector_1[0][0];
eci_vector_2[0][1] = eci_vector_1[0][1];
eci_vector_2[0][2] = eci_vector_1[0][2];
eci_vector_2[0][3] = 0.0; /* velocity unused here */
eci_vector_2[0][4] = 0.0;
eci_vector_2[0][5] = 0.0;
returnStatus = PGS_CSC_ECItoECR( 1, asciiUTC_A,
time_offset, eci_vector_2, ecr_vector_2 );
/* Returned ECR vector in meters is
ecr_vector_2[0][0] = 132956286704.040
ecr_vector_2[0][1] = 43291706842.577
ecr_vector_2[0][2] = 59834999399.742
ecr_vector_2[0][3] = 0.0 velocity unused here
ecr_vector_2[0][4] = 0.0
ecr_vector_2[0][5] = 0.0
*/
/* Copy Sun ECR vector over into the correct form */
ecr_vector_1[0] = ecr_vector_2[0][0];
ecr_vector_1[1] = ecr_vector_2[0][1];
ecr_vector_1[2] = ecr_vector_2[0][2];
/* Define earth location for which zenith and azimuthal
angles desired */
latitude = -.547103859146; /* geodetic latitude, radians */
longitude = -.75014; /* longitude, radians */
altitude = 0.0; /* altitude of surface point, meters */
/* Define type of input ecr_vector
(see Notes) */
vector_type = PGSd_SUN;
/* We want only zenith angle in this example */
zenith_only = PGS_TRUE;
/* Enable atmospheric refraction correction. */
refraction = PGS_TRUE;
/* Get zenith and azimuthal angles */
returnStatus = PGS_CSC_ZenithAzimuth( ecr_vector_1, latitude,
longitude, altitude, vector_type,
zenith_only, refraction,
&zenith_angle, &azimuthal_angle,
&refraction_decrease );
/* The following values are returned:
zenith_angle = 1.392450 refracted angle in radians
azimuthal_angle = 0.0
refraction_decrease = 0.001619 decrease in zenith angle
due to refraction, radians
*/
FORTRAN example 2: Zenith angle of Sun IMPLICIT NONE
INCLUDE 'PGS_SMF.f'
INCLUDE 'PGS_CSC.f'
INCLUDE 'PGS_CSC_4.f'
INCLUDE 'PGS_CBP.f'
! Needed for other Toolkit calls in this example:
INCLUDE 'PGS_TD_3.f'
INCLUDE 'PGS_CBP_6.f'
INTEGER pgs_csc_zenithazimuth
CHARACTER*28 asciiutc_a
DOUBLE PRECISION time_offset(1)
DOUBLE PRECISION eci_vector_1(3,1)
DOUBLE PRECISION eci_vector_2(6,1)
DOUBLE PRECISION ecr_vector_2(6,1)
DOUBLE PRECISION ecr_vector_1(3)
DOUBLE PRECISION latitude
DOUBLE PRECISION longitude
DOUBLE PRECISION altitude
INTEGER vector_type
INTEGER zenith_only
INTEGER refraction
DOUBLE PRECISION zenith_angle
DOUBLE PRECISION azimuthal_angle
DOUBLE PRECISION refraction_decrease
INTEGER returnstatus
!
! Begin example
!
! First get ECI vector of Sun at the given time
asciiutc_a = '1998-06-30T10:51:28.320000Z'
time_offset(1) = 0.0
returnstatus = pgs_cbp_earth_cb_vector( 1, asciiutc_a,
+ time_offset, PGSd_SUN, eci_vector_1 )
! Returned ECI vector in meters is
eci_vector_1(1,1) = -22436733432.493786
eci_vector_1(2,1) = 138013995777.10355
eci_vector_1(3,1) = 59837305848.062561
! Next translate this vector to ECR coordinates
! First copy it over into the correct form
eci_vector_2(1,1) = eci_vector_1(1,1)
eci_vector_2(2,1) = eci_vector_1(2,1)
eci_vector_2(3,1) = eci_vector_1(3,1)
eci_vector_2(4,1) = 0.0 ! velocity unused here
eci_vector_2(5,1) = 0.0
eci_vector_2(6,1) = 0.0
returnStatus = pgs_csc_ecitoecr( 1, asciiutc_a,
. time_offset, eci_vector_2, ecr_vector_2 )
! Returned ECR vector in meters is
! ecr_vector_2(1,1) = 132956286704.040
! ecr_vector_2(2,1) = 43291706842.577
! ecr_vector_2(3,1) = 59834999399.742
! ecr_vector_2(4,1) = 0.0 velocity unused here
! ecr_vector_2(5,1) = 0.0
! ecr_vector_2(6,1) = 0.0
! Copy Sun ECR vector over into the correct form
ecr_vector_1(1) = ecr_vector_2(1,1)
ecr_vector_1(2) = ecr_vector_2(2,1)
ecr_vector_1(3) = ecr_vector_2(3,1)
! Define earth location for which zenith and azimuthal
! angles desired
latitude = -.547103859146 ! radians
longitude = -.75014 ! radians
altitude = 0.0 ! altitude of surface point off geoid, in meters
! Define type of input ecr_vector
! PGSd_MOON is also possible; other values are ignored
! (see Notes)
vector_type = PGSd_SUN
! We want only zenith angle in this example
zenith_only = PGS_TRUE
! Enable atmospheric refraction correction
refraction = PGS_TRUE
! Get zenith and azimuthal angles
returnStatus = pgs_csc_zenithazimuth( ecr_vector_1, latitude,
+ longitude, altitude, vector_type,
+ zenith_only, refraction,
+ zenith_angle, azimuthal_angle,
+ refraction_decrease );
! The following values are returned:
! zenith_angle = 1.392450 refracted angle in radians
! azimuthal_angle = 0.0
! refraction_decrease = 0.001619 decrease in zenith angle
! due to refraction, radians
Notes: Input vector must be in ECR reference frame coordinates. 5th argument in calling sequence vector_type may be one of the following: PGSd_LOOKUse this for a spacecraft look vector. A special value is necessary here because the direction of this vector is opposite that of a celestial body vector.PGSd_MOONUse this if the celestial body in question is the Moon. In this case parallax is taken into account and the input ECR vector must be in meters (not a unit vector). The cb_id PGSd_MOON can be used for any near-Earth body (such as another spacecraft) ; it simply turns on the parallax correction based on the WGS84 ellipsoid and the altitude. For this purpose, altitude ought to be off the ellipsoid, but use altitude from the geoid if the refraction correction is turned on.PGSd_CB, or any other valid celestial body identifierUse this for any celestial body but the Moon. Parallax is not taken into account. Other celestial body identifiers are given in the Notes section of PGS_CBP_Earth_CB_Vector (sec. 11.2.2). |
|
|