FV3 Bundle
|
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include "mosaic_util.h"
#include "constant.h"
Go to the source code of this file.
Macros | |
#define | HPI (0.5*M_PI) |
#define | TPI (2.0*M_PI) |
#define | TOLORENCE (1.e-6) |
#define | EPSLN8 (1.e-8) |
#define | EPSLN10 (1.e-10) |
#define | EPSLN15 (1.e-15) |
#define | EPSLN30 (1.e-30) |
#define | SQRT_ sqrtl |
#define | ABS_ fabs |
#define | MAXNODELIST 100 |
Functions | |
void | set_reproduce_siena_true (void) |
void | set_reproduce_siena_true_ (void) |
void | error_handler (const char *msg) |
int | nearest_index (double value, const double *array, int ia) |
void | tokenize (const char *const string, const char *tokens, unsigned int varlen, unsigned int maxvar, char *pstring, unsigned int *const nstr) |
double | maxval_double (int size, const double *data) |
double | minval_double (int size, const double *data) |
double | avgval_double (int size, const double *data) |
void | latlon2xyz (int size, const double *lon, const double *lat, double *x, double *y, double *z) |
void | xyz2latlon (int np, const double *x, const double *y, const double *z, double *lon, double *lat) |
double | box_area (double ll_lon, double ll_lat, double ur_lon, double ur_lat) |
double | poly_area_dimensionless (const double x[], const double y[], int n) |
double | poly_area (const double x[], const double y[], int n) |
double | poly_area_no_adjust (const double x[], const double y[], int n) |
int | delete_vtx (double x[], double y[], int n, int n_del) |
int | insert_vtx (double x[], double y[], int n, int n_ins, double lon_in, double lat_in) |
void | v_print (double x[], double y[], int n) |
int | fix_lon (double x[], double y[], int n, double tlon) |
double | great_circle_distance (double *p1, double *p2) |
double | great_circle_area (int n, const double *x, const double *y, const double *z) |
double | spherical_angle (const double *v1, const double *v2, const double *v3) |
double | spherical_excess_area (const double *p_ll, const double *p_ul, const double *p_lr, const double *p_ur, double radius) |
void | vect_cross (const double *p1, const double *p2, double *e) |
double | dot (const double *p1, const double *p2) |
double | metric (const double *p) |
void | normalize_vect (double *e) |
void | unit_vect_latlon (int size, const double *lon, const double *lat, double *vlon, double *vlat) |
int | intersect_tri_with_line (const double *plane, const double *l1, const double *l2, double *p, double *t) |
void | mult (long double m[], long double v[], long double out_v[]) |
int | invert_matrix_3x3 (long double m[], long double m_inv[]) |
void | rewindList (void) |
struct Node * | getNext () |
void | initNode (struct Node *node) |
void | addEnd (struct Node *list, double x, double y, double z, int intersect, double u, int inbound, int inside) |
int | addIntersect (struct Node *list, double x, double y, double z, int intersect, double u1, double u2, int inbound, int is1, int ie1, int is2, int ie2) |
int | length (struct Node *list) |
int | samePoint (double x1, double y1, double z1, double x2, double y2, double z2) |
int | sameNode (struct Node node1, struct Node node2) |
void | addNode (struct Node *list, struct Node inNode) |
struct Node * | getNode (struct Node *list, struct Node inNode) |
struct Node * | getNextNode (struct Node *list) |
void | copyNode (struct Node *node_out, struct Node node_in) |
void | printNode (struct Node *list, char *str) |
int | intersectInList (struct Node *list, double x, double y, double z) |
void | insertIntersect (struct Node *list, double x, double y, double z, double u1, double u2, int inbound, double x2, double y2, double z2) |
double | gridArea (struct Node *grid) |
int | isIntersect (struct Node node) |
int | getInbound (struct Node node) |
struct Node * | getLast (struct Node *list) |
int | getFirstInbound (struct Node *list, struct Node *nodeOut) |
void | getCoordinate (struct Node node, double *x, double *y, double *z) |
void | getCoordinates (struct Node *node, double *p) |
void | setCoordinate (struct Node *node, double x, double y, double z) |
void | setInbound (struct Node *interList, struct Node *list) |
int | isInside (struct Node *node) |
int | insidePolygon (struct Node *node, struct Node *list) |
int | inside_a_polygon (double *lon1, double *lat1, int *npts, double *lon2, double *lat2) |
int | inside_a_polygon_ (double *lon1, double *lat1, int *npts, double *lon2, double *lat2) |
Variables | |
int | reproduce_siena = 0 |
struct Node * | nodeList =NULL |
int | curListPos =0 |
#define ABS_ fabs |
#define EPSLN10 (1.e-10) |
Definition at line 33 of file mosaic_util.c.
#define EPSLN15 (1.e-15) |
Definition at line 34 of file mosaic_util.c.
#define EPSLN30 (1.e-30) |
Definition at line 35 of file mosaic_util.c.
#define EPSLN8 (1.e-8) |
Definition at line 32 of file mosaic_util.c.
#define HPI (0.5*M_PI) |
Definition at line 29 of file mosaic_util.c.
#define MAXNODELIST 100 |
Definition at line 807 of file mosaic_util.c.
#define SQRT_ sqrtl |
#define TOLORENCE (1.e-6) |
Definition at line 31 of file mosaic_util.c.
#define TPI (2.0*M_PI) |
Definition at line 30 of file mosaic_util.c.
void addEnd | ( | struct Node * | list, |
double | x, | ||
double | y, | ||
double | z, | ||
int | intersect, | ||
double | u, | ||
int | inbound, | ||
int | inside | ||
) |
Definition at line 855 of file mosaic_util.c.
int addIntersect | ( | struct Node * | list, |
double | x, | ||
double | y, | ||
double | z, | ||
int | intersect, | ||
double | u1, | ||
double | u2, | ||
int | inbound, | ||
int | is1, | ||
int | ie1, | ||
int | is2, | ||
int | ie2 | ||
) |
Definition at line 894 of file mosaic_util.c.
Definition at line 987 of file mosaic_util.c.
double avgval_double | ( | int | size, |
const double * | data | ||
) |
Definition at line 193 of file mosaic_util.c.
double box_area | ( | double | ll_lon, |
double | ll_lat, | ||
double | ur_lon, | ||
double | ur_lat | ||
) |
Definition at line 258 of file mosaic_util.c.
int delete_vtx | ( | double | x[], |
double | y[], | ||
int | n, | ||
int | n_del | ||
) |
double dot | ( | const double * | p1, |
const double * | p2 | ||
) |
void error_handler | ( | const char * | msg | ) |
int fix_lon | ( | double | x[], |
double | y[], | ||
int | n, | ||
double | tlon | ||
) |
Definition at line 409 of file mosaic_util.c.
void getCoordinate | ( | struct Node | node, |
double * | x, | ||
double * | y, | ||
double * | z | ||
) |
void getCoordinates | ( | struct Node * | node, |
double * | p | ||
) |
Definition at line 1205 of file mosaic_util.c.
int getInbound | ( | struct Node | node | ) |
Definition at line 1185 of file mosaic_util.c.
struct Node* getNext | ( | ) |
Definition at line 823 of file mosaic_util.c.
Definition at line 994 of file mosaic_util.c.
double great_circle_area | ( | int | n, |
const double * | x, | ||
const double * | y, | ||
const double * | z | ||
) |
Definition at line 504 of file mosaic_util.c.
double great_circle_distance | ( | double * | p1, |
double * | p2 | ||
) |
double gridArea | ( | struct Node * | grid | ) |
Definition at line 1156 of file mosaic_util.c.
void initNode | ( | struct Node * | node | ) |
int insert_vtx | ( | double | x[], |
double | y[], | ||
int | n, | ||
int | n_ins, | ||
double | lon_in, | ||
double | lat_in | ||
) |
void insertIntersect | ( | struct Node * | list, |
double | x, | ||
double | y, | ||
double | z, | ||
double | u1, | ||
double | u2, | ||
int | inbound, | ||
double | x2, | ||
double | y2, | ||
double | z2 | ||
) |
Definition at line 1074 of file mosaic_util.c.
int inside_a_polygon | ( | double * | lon1, |
double * | lat1, | ||
int * | npts, | ||
double * | lon2, | ||
double * | lat2 | ||
) |
Definition at line 1357 of file mosaic_util.c.
int inside_a_polygon_ | ( | double * | lon1, |
double * | lat1, | ||
int * | npts, | ||
double * | lon2, | ||
double * | lat2 | ||
) |
Definition at line 1306 of file mosaic_util.c.
int intersect_tri_with_line | ( | const double * | plane, |
const double * | l1, | ||
const double * | l2, | ||
double * | p, | ||
double * | t | ||
) |
Definition at line 727 of file mosaic_util.c.
int intersectInList | ( | struct Node * | list, |
double | x, | ||
double | y, | ||
double | z | ||
) |
int invert_matrix_3x3 | ( | long double | m[], |
long double | m_inv[] | ||
) |
Definition at line 778 of file mosaic_util.c.
int isInside | ( | struct Node * | node | ) |
int isIntersect | ( | struct Node | node | ) |
void latlon2xyz | ( | int | size, |
const double * | lon, | ||
const double * | lat, | ||
double * | x, | ||
double * | y, | ||
double * | z | ||
) |
Definition at line 211 of file mosaic_util.c.
int length | ( | struct Node * | list | ) |
double maxval_double | ( | int | size, |
const double * | data | ||
) |
Definition at line 156 of file mosaic_util.c.
double metric | ( | const double * | p | ) |
double minval_double | ( | int | size, |
const double * | data | ||
) |
Definition at line 175 of file mosaic_util.c.
void mult | ( | long double | m[], |
long double | v[], | ||
long double | out_v[] | ||
) |
int nearest_index | ( | double | value, |
const double * | array, | ||
int | ia | ||
) |
void normalize_vect | ( | double * | e | ) |
double poly_area | ( | const double | x[], |
const double | y[], | ||
int | n | ||
) |
double poly_area_dimensionless | ( | const double | x[], |
const double | y[], | ||
int | n | ||
) |
double poly_area_no_adjust | ( | const double | x[], |
const double | y[], | ||
int | n | ||
) |
void printNode | ( | struct Node * | list, |
char * | str | ||
) |
Definition at line 1031 of file mosaic_util.c.
void rewindList | ( | void | ) |
Definition at line 813 of file mosaic_util.c.
int samePoint | ( | double | x1, |
double | y1, | ||
double | z1, | ||
double | x2, | ||
double | y2, | ||
double | z2 | ||
) |
void set_reproduce_siena_true | ( | void | ) |
Definition at line 42 of file mosaic_util.c.
void set_reproduce_siena_true_ | ( | void | ) |
Definition at line 48 of file mosaic_util.c.
void setCoordinate | ( | struct Node * | node, |
double | x, | ||
double | y, | ||
double | z | ||
) |
Definition at line 1242 of file mosaic_util.c.
Definition at line 1256 of file mosaic_util.c.
double spherical_angle | ( | const double * | v1, |
const double * | v2, | ||
const double * | v3 | ||
) |
Definition at line 541 of file mosaic_util.c.
double spherical_excess_area | ( | const double * | p_ll, |
const double * | p_ul, | ||
const double * | p_lr, | ||
const double * | p_ur, | ||
double | radius | ||
) |
Definition at line 606 of file mosaic_util.c.
void tokenize | ( | const char *const | string, |
const char * | tokens, | ||
unsigned int | varlen, | ||
unsigned int | maxvar, | ||
char * | pstring, | ||
unsigned int *const | nstr | ||
) |
Definition at line 112 of file mosaic_util.c.
void unit_vect_latlon | ( | int | size, |
const double * | lon, | ||
const double * | lat, | ||
double * | vlon, | ||
double * | vlat | ||
) |
Definition at line 697 of file mosaic_util.c.
void v_print | ( | double | x[], |
double | y[], | ||
int | n | ||
) |
void vect_cross | ( | const double * | p1, |
const double * | p2, | ||
double * | e | ||
) |
void xyz2latlon | ( | int | np, |
const double * | x, | ||
const double * | y, | ||
const double * | z, | ||
double * | lon, | ||
double * | lat | ||
) |
int curListPos =0 |
Definition at line 811 of file mosaic_util.c.
Definition at line 810 of file mosaic_util.c.
int reproduce_siena = 0 |
Definition at line 40 of file mosaic_util.c.