csiutils tools

csi.csiutils.colocated(point1, point2, eps=0.0)

Check if point 1 and 2 are colocated Args:

  • point1: x,y,z coordinates of point 1

  • point2: x,y,z coordinates of point 2

  • eps : tolerance value

csi.csiutils.coord2prof(csiobject, xc, yc, length, azimuth, width, minNum=5)

Routine returning the profile

Args:
  • csiobjectAn instance of a csi class that has

    x and y attributes

  • xc : X pos of center

  • yc : Y pos of center

  • length : length of the profile.

  • azimuth : azimuth of the profile.

  • width : width of the profile.

Returns:

dis : Distance from the center norm : distance perpendicular to profile ind : indexes of the points boxll : lon lat coordinates of the profile box used xe1, ye1 : coordinates (UTM) of the profile endpoint xe2, ye2 : coordinates (UTM) of the profile endpoint

csi.csiutils.intersectProfileFault(xe1, ye1, xe2, ye2, xc, yc, fault)

Gets the distance between the fault/profile intersection and the profile center. Args:

  • xe1, ye1 : X and Y coordinates of one endpoint of the profile

  • xe2, ye2 : X and Y coordinates of the other endpoint of the profile

  • xc, yc : X and Y coordinates of the centre of the profile

  • fault : CSI fault object that has a trace.

csi.csiutils.lonlatMapping(lon, lat, z, increments=None, nSamples=None, dryRun=False, noValues=nan)

Maps z onto a regular lon lat grid.

csi.csiutils.write2netCDF(filename, lon, lat, z, increments=None, nSamples=None, title='CSI product', name='z', scale=1.0, offset=0.0, mask=None, xyunits=['Lon', 'Lat'], units='None', interpolation=True, verbose=True, noValues=nan)

Creates a netCDF file with the arrays in Z. Z can be list of array or an array, the size of lon.