Go to the documentation of this file.
42 #define MAXLONG 2147483647.
43 #define DBLLONG 4.61168601e18
63 void p_error(
char *what,
char *where);
71 if (
fabs(con) > 1.0) {
83 double msfnz(eccent, sinphi, cosphi)
90 con = eccent * sinphi;
91 return ((cosphi / (sqrt(1.0 - con * con))));
97 double qsfnz(eccent, sinphi, cosphi)
104 if (eccent > 1.0e-7) {
105 con = eccent * sinphi;
106 return ((1.0 - eccent * eccent) * (sinphi / (1.0 - con * con) - (.5 / eccent) *
107 log((1.0 - con) / (1.0 + con))));
109 return (2.0 * sinphi);
130 phi =
asinz(.5 * qs);
133 eccnts = eccent * eccent;
134 for (
i = 1;
i <= 25;
i++) {
135 sincos(phi, &sinpi, &cospi);
136 con = eccent * sinpi;
137 com = 1.0 - con * con;
138 dphi = .5 * com * com / cospi * (qs / (1.0 - eccnts) - sinpi / com +
139 .5 / eccent * log((1.0 - con) / (1.0 + con)));
141 if (
fabs(dphi) <= 1e-7)
144 p_error(
"Convergence error",
"phi1z-conv");
167 eccnth = .5 * eccent;
169 for (
i = 0;
i <= 15;
i++) {
171 con = eccent * sinpi;
172 dphi =
HALF_PI - 2 * atan(ts * (pow(((1.0 - con) / (1.0 + con)), eccnth))) -
175 if (
fabs(dphi) <= .0000000001)
178 p_error(
"Convergence error",
"phi2z-conv");
201 for (
i = 0;
i < 15;
i++) {
202 dphi = (
ml + e1 * sin(2.0 * phi) - e2 * sin(4.0 * phi) + e3 * sin(6.0 * phi))
205 if (
fabs(dphi) <= .0000000001) {
210 p_error(
"Latitude failed to converge after 15 iterations",
"PHI3Z-CONV");
242 for (
i = 1;
i <= 15;
i++) {
245 *
c = tanphi * sqrt(1.0 - eccent * sinphi * sinphi);
246 sin2ph = sin(2.0 * *phi);
252 ml = e0 * *phi - e1 * sin2ph + e2 * sin(4.0 * *phi) - e3 *
254 mlp = e0 - 2.0 * e1 * cos(2.0 * *phi) + 4.0 * e2 *
255 cos(4.0 * *phi) - 6.0 * e3 * cos(6.0 * *phi);
256 con1 = 2.0 *
ml + *
c * (
ml *
ml +
b) - 2.0 *
a * (*
c *
ml + 1.0);
257 con2 = eccent * sin2ph * (
ml *
ml +
b - 2.0 *
a *
ml) / (2.0 * *
c);
258 con3 = 2.0 * (
a -
ml) * (*
c *
mlp - 2.0 / sin2ph) - 2.0 *
mlp;
259 dphi = con1 / (con2 + con3);
261 if (
fabs(dphi) <= .0000000001)
264 p_error(
"Lattitude failed to converge",
"phi4z-conv");
284 degs = (int32_t) ((con / 10000.0) + .001);
285 con = con - degs * 10000;
286 mins = (int32_t) ((con / 100.0) + .001);
287 secs = con - mins * 100;
288 con = (
double) (degs) * 1000000.0 + (
double) (mins) * 1000.0 + secs;
310 degs = (int32_t) (con);
311 con = (con - degs) * 60;
312 mins = (int32_t) con;
313 secs = (con - mins) * 60;
314 con = (
double) (degs) * 1000000.0 + (
double) (mins) * 1000.0 + secs;
332 con = eccent * sinphi;
334 con = pow(((1.0 - con) / (1.0 + con)), com);
335 return (tan(.5 * (
HALF_PI - phi)) / con);
342 if (
x < 0.0)
return (-1);
394 return (1.0 - 0.25 *
x * (1.0 +
x / 16.0 * (3.0 + 1.25 *
x)));
399 return (0.375 *
x * (1.0 + 0.25 *
x * (1.0 + 0.46875 *
x)));
404 return (0.05859375 *
x *
x * (1.0 + 0.75 *
x));
409 return (
x *
x *
x * (35.0 / 3072.0));
423 return (sqrt((pow(con, con))*(pow(com, com))));
429 double mlfn(e0, e1, e2, e3, phi)
double e0, e1, e2, e3, phi;
431 return (e0 * phi - e1 * sin(2.0 * phi) + e2 * sin(4.0 * phi) - e3 * sin(6.0 * phi));
438 return ((int32_t) (((
lon + 180.0) / 6.0) + 1.0));
double mlfn(double e0, double e1, double e2, double e3, double phi)
void sincos(double val, double *sin_val, double *cos_val)
double phi1z(double eccent, double qs, int32_t *flag)
int calc_utm_zone(double lon)
double adjust_lon(double x)
double qsfnz(double eccent, double sinphi, double cosphi)
double phi2z(double eccent, double ts, int32_t *flag)
double msfnz(double eccent, double sinphi, double cosphi)
double phi4z(double eccent, double e0, double e1, double e2, double e3, double a, double b, double *c, double *phi)
integer, parameter double
double tsfnz(double eccent, double phi, double sinphi)
void p_error(char *what, char *where)
double phi3z(double ml, double e0, double e1, double e2, double e3, int32_t *flag)
no change in intended resolving MODur00064 Corrected handling of bad ephemeris attitude resolving resolving GSFcd00179 Corrected handling of fill values for[Sensor|Solar][Zenith|Azimuth] resolving MODxl01751 Changed to validate LUT version against a value retrieved from the resolving MODxl02056 Changed to calculate Solar Diffuser angles without adjustment for estimated post launch changes in the MODIS orientation relative to incidentally resolving defects MODxl01766 Also resolves MODxl01947 Changed to ignore fill values in SCI_ABNORM and SCI_STATE rather than treating them as resolving MODxl01780 Changed to use spacecraft ancillary data to recognise when the mirror encoder data is being set by side A or side B and to change calculations accordingly This removes the need for seperate LUTs for Side A and Side B data it makes the new LUTs incompatible with older versions of the and vice versa Also resolves MODxl01685 A more robust GRing algorithm is being which will create a non default GRing anytime there s even a single geolocated pixel in a granule Removed obsolete messages from seed as required for compatibility with version of the SDP toolkit Corrected test output file names to end in per delivery and then split off a new MYD_PR03 pcf file for Aqua Added AssociatedPlatformInstrumentSensor to the inventory metadata in MOD01 mcf and MOD03 mcf Created new versions named MYD01 mcf and MYD03 where AssociatedPlatformShortName is rather than Terra The program itself has been changed to read the Satellite Instrument validate it against the input L1A and LUT and to use it determine the correct files to retrieve the ephemeris and attitude data from Changed to produce a LocalGranuleID starting with MYD03 if run on Aqua data Added the Scan Type file attribute to the Geolocation copied from the L1A and attitude_angels to radians rather than degrees The accumulation of Cumulated gflags was moved from GEO_validate_earth_location c to GEO_locate_one_scan c
double pakr2dm(double pak)
PGE01 indicating that PGE02 PGE01 V6 for and PGE01 V2 for MOD03 were used to produce the granule By convention adopted in all MODIS Terra PGE02 code versions are The fourth digit of the PGE02 version denotes the LUT version used to produce the granule The source of the metadata environment variable ProcessingCenter was changed from a QA LUT value to the Process Configuration A sign used in error in the second order term was changed to a