FV3 Bundle
mosaic_util.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Node
 

Macros

#define RANGE_CHECK_CRITERIA   0.05
 
#define min(a, b)   (a<b ? a:b)
 
#define max(a, b)   (a>b ? a:b)
 
#define SMALL_VALUE   ( 1.e-10 )
 

Functions

void error_handler (const char *msg)
 
int nearest_index (double value, const double *array, int ia)
 
int lon_fix (double *x, double *y, int n_in, double tlon)
 
double minval_double (int size, const double *data)
 
double maxval_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 size, 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 (const double lon[], const double lat[], 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)
 
double poly_area_dimensionless (const double lon[], const double lat[], int n)
 
double poly_area_no_adjust (const double x[], const double y[], int n)
 
int fix_lon (double lon[], double lat[], int n, double tlon)
 
void tokenize (const char *const string, const char *tokens, unsigned int varlen, unsigned int maxvar, char *pstring, unsigned int *const nstr)
 
double great_circle_distance (double *p1, double *p2)
 
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 spherical_angle (const double *v1, const double *v2, const double *v3)
 
void normalize_vect (double *e)
 
void unit_vect_latlon (int size, const double *lon, const double *lat, double *vlon, double *vlat)
 
double great_circle_area (int n, const double *x, const double *y, const double *z)
 
double * cross (const double *p1, const double *p2)
 
double dot (const double *p1, const double *p2)
 
int intersect_tri_with_line (const double *plane, const double *l1, const double *l2, double *p, double *t)
 
int invert_matrix_3x3 (long double m[], long double m_inv[])
 
void mult (long double m[], long double v[], long double out_v[])
 
double metric (const double *p)
 
int insidePolygon (struct Node *node, struct Node *list)
 
int inside_a_polygon (double *lon1, double *lat1, int *npts, double *lon2, double *lat2)
 
void rewindList (void)
 
struct NodegetNext ()
 
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 nodeIn)
 
struct NodegetNode (struct Node *list, struct Node inNode)
 
struct NodegetNextNode (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)
 
void insertAfter (struct Node *list, double x, double y, double z, int intersect, double u, int inbound, double x2, double y2, double z2)
 
double gridArea (struct Node *grid)
 
int isIntersect (struct Node node)
 
int getInbound (struct Node node)
 
struct NodegetLast (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)
 
void set_reproduce_siena_true (void)
 
void set_reproduce_siena_true_ (void)
 
int inside_a_polygon_ (double *lon1, double *lat1, int *npts, double *lon2, double *lat2)
 

Macro Definition Documentation

◆ max

#define max (   a,
 
)    (a>b ? a:b)

Definition at line 33 of file mosaic_util.h.

◆ min

#define min (   a,
 
)    (a<b ? a:b)

Definition at line 32 of file mosaic_util.h.

◆ RANGE_CHECK_CRITERIA

#define RANGE_CHECK_CRITERIA   0.05

Definition at line 29 of file mosaic_util.h.

◆ SMALL_VALUE

#define SMALL_VALUE   ( 1.e-10 )

Definition at line 34 of file mosaic_util.h.

Function Documentation

◆ addEnd()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addIntersect()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addNode()

void addNode ( struct Node list,
struct Node  nodeIn 
)

Definition at line 987 of file mosaic_util.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ avgval_double()

double avgval_double ( int  size,
const double *  data 
)

Definition at line 193 of file mosaic_util.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ box_area()

double box_area ( double  ll_lon,
double  ll_lat,
double  ur_lon,
double  ur_lat 
)

Definition at line 258 of file mosaic_util.c.

◆ copyNode()

void copyNode ( struct Node node_out,
struct Node  node_in 
)

Definition at line 1017 of file mosaic_util.c.

Here is the caller graph for this function:

◆ cross()

double* cross ( const double *  p1,
const double *  p2 
)

◆ delete_vtx()

int delete_vtx ( double  x[],
double  y[],
int  n,
int  n_del 
)

Definition at line 376 of file mosaic_util.c.

Here is the caller graph for this function:

◆ dot()

double dot ( const double *  p1,
const double *  p2 
)

Definition at line 663 of file mosaic_util.c.

Here is the caller graph for this function:

◆ error_handler()

void error_handler ( const char *  msg)

Definition at line 55 of file mosaic_util.c.

Here is the caller graph for this function:

◆ fix_lon()

int fix_lon ( double  lon[],
double  lat[],
int  n,
double  tlon 
)

Definition at line 409 of file mosaic_util.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCoordinate()

void getCoordinate ( struct Node  node,
double *  x,
double *  y,
double *  z 
)

Definition at line 1222 of file mosaic_util.c.

Here is the caller graph for this function:

◆ getCoordinates()

void getCoordinates ( struct Node node,
double *  p 
)

Definition at line 1232 of file mosaic_util.c.

Here is the caller graph for this function:

◆ getFirstInbound()

int getFirstInbound ( struct Node list,
struct Node nodeOut 
)

Definition at line 1205 of file mosaic_util.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getInbound()

int getInbound ( struct Node  node)

Definition at line 1185 of file mosaic_util.c.

◆ getLast()

struct Node* getLast ( struct Node list)

Definition at line 1190 of file mosaic_util.c.

Here is the caller graph for this function:

◆ getNext()

struct Node* getNext ( )

Definition at line 823 of file mosaic_util.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNextNode()

struct Node* getNextNode ( struct Node list)

Definition at line 1012 of file mosaic_util.c.

Here is the caller graph for this function:

◆ getNode()

struct Node* getNode ( struct Node list,
struct Node  inNode 
)

Definition at line 994 of file mosaic_util.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ great_circle_area()

double great_circle_area ( int  n,
const double *  x,
const double *  y,
const double *  z 
)

Definition at line 504 of file mosaic_util.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ great_circle_distance()

double great_circle_distance ( double *  p1,
double *  p2 
)

Definition at line 488 of file mosaic_util.c.

Here is the caller graph for this function:

◆ gridArea()

double gridArea ( struct Node grid)

Definition at line 1156 of file mosaic_util.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initNode()

void initNode ( struct Node node)

Definition at line 841 of file mosaic_util.c.

Here is the caller graph for this function:

◆ insert_vtx()

int insert_vtx ( double  x[],
double  y[],
int  n,
int  n_ins,
double  lon_in,
double  lat_in 
)

Definition at line 386 of file mosaic_util.c.

Here is the caller graph for this function:

◆ insertAfter()

void insertAfter ( struct Node list,
double  x,
double  y,
double  z,
int  intersect,
double  u,
int  inbound,
double  x2,
double  y2,
double  z2 
)

◆ insertIntersect()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ inside_a_polygon()

int inside_a_polygon ( double *  lon1,
double *  lat1,
int *  npts,
double *  lon2,
double *  lat2 
)

Definition at line 1357 of file mosaic_util.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ inside_a_polygon_()

int inside_a_polygon_ ( double *  lon1,
double *  lat1,
int *  npts,
double *  lon2,
double *  lat2 
)

Definition at line 1402 of file mosaic_util.c.

Here is the call graph for this function:

◆ insidePolygon()

int insidePolygon ( struct Node node,
struct Node list 
)

Definition at line 1306 of file mosaic_util.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ intersect_tri_with_line()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ intersectInList()

int intersectInList ( struct Node list,
double  x,
double  y,
double  z 
)

Definition at line 1047 of file mosaic_util.c.

Here is the call graph for this function:

◆ invert_matrix_3x3()

int invert_matrix_3x3 ( long double  m[],
long double  m_inv[] 
)

Definition at line 778 of file mosaic_util.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isInside()

int isInside ( struct Node node)

Definition at line 1296 of file mosaic_util.c.

Here is the call graph for this function:

◆ isIntersect()

int isIntersect ( struct Node  node)

Definition at line 1178 of file mosaic_util.c.

Here is the caller graph for this function:

◆ latlon2xyz()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ length()

int length ( struct Node list)

Definition at line 951 of file mosaic_util.c.

Here is the caller graph for this function:

◆ lon_fix()

int lon_fix ( double *  x,
double *  y,
int  n_in,
double  tlon 
)

◆ maxval_double()

double maxval_double ( int  size,
const double *  data 
)

Definition at line 156 of file mosaic_util.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ metric()

double metric ( const double *  p)

Definition at line 671 of file mosaic_util.c.

Here is the caller graph for this function:

◆ minval_double()

double minval_double ( int  size,
const double *  data 
)

Definition at line 175 of file mosaic_util.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mult()

void mult ( long double  m[],
long double  v[],
long double  out_v[] 
)

Definition at line 768 of file mosaic_util.c.

Here is the caller graph for this function:

◆ nearest_index()

int nearest_index ( double  value,
const double *  array,
int  ia 
)

Definition at line 80 of file mosaic_util.c.

Here is the call graph for this function:

◆ normalize_vect()

void normalize_vect ( double *  e)

Definition at line 679 of file mosaic_util.c.

Here is the caller graph for this function:

◆ poly_area()

double poly_area ( const double  lon[],
const double  lat[],
int  n 
)

Definition at line 314 of file mosaic_util.c.

Here is the caller graph for this function:

◆ poly_area_dimensionless()

double poly_area_dimensionless ( const double  lon[],
const double  lat[],
int  n 
)

Definition at line 277 of file mosaic_util.c.

Here is the caller graph for this function:

◆ poly_area_no_adjust()

double poly_area_no_adjust ( const double  x[],
const double  y[],
int  n 
)

Definition at line 351 of file mosaic_util.c.

Here is the caller graph for this function:

◆ printNode()

void printNode ( struct Node list,
char *  str 
)

Definition at line 1031 of file mosaic_util.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rewindList()

void rewindList ( void  )

Definition at line 813 of file mosaic_util.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sameNode()

int sameNode ( struct Node  node1,
struct Node  node2 
)

Definition at line 978 of file mosaic_util.c.

Here is the caller graph for this function:

◆ samePoint()

int samePoint ( double  x1,
double  y1,
double  z1,
double  x2,
double  y2,
double  z2 
)

Definition at line 968 of file mosaic_util.c.

Here is the caller graph for this function:

◆ set_reproduce_siena_true()

void set_reproduce_siena_true ( void  )

Definition at line 42 of file mosaic_util.c.

◆ set_reproduce_siena_true_()

void set_reproduce_siena_true_ ( void  )

Definition at line 48 of file mosaic_util.c.

◆ setCoordinate()

void setCoordinate ( struct Node node,
double  x,
double  y,
double  z 
)

Definition at line 1242 of file mosaic_util.c.

◆ setInbound()

void setInbound ( struct Node interList,
struct Node list 
)

Definition at line 1256 of file mosaic_util.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ spherical_angle()

double spherical_angle ( const double *  v1,
const double *  v2,
const double *  v3 
)

Definition at line 541 of file mosaic_util.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ spherical_excess_area()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tokenize()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unit_vect_latlon()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vect_cross()

void vect_cross ( const double *  p1,
const double *  p2,
double *  e 
)

Definition at line 648 of file mosaic_util.c.

Here is the caller graph for this function:

◆ xyz2latlon()

void xyz2latlon ( int  size,
const double *  x,
const double *  y,
const double *  z,
double *  lon,
double *  lat 
)

Definition at line 227 of file mosaic_util.c.

Here is the caller graph for this function: