Petition against risk to water supply nears 100,000 signatures
A petition aimed at demonstrating serious fears about the risk to local water supplies from oil drilling on Leith Hill is close to hundred thousand signatures. The petition, hosted by 38 Degrees, which is addressed to the Environment Agency (EA) titled ‘Don't risk water pollution from oil drilling on Leith Hill’ has been signed by over ninety-one thousand people, with more being added by the minute.
The organisers of the petition will be officially handing it in on Thursday 1 March at 6:30pm during a public consultation at the Dorking Halls, where residents have been invited to talk to EA representatives about how they will regulate the proposed oil and gas activities on Leith Hill in Surrey. The site is within an officially designated area of outstanding natural beauty (AONB).
The local resident who started the petition said, “We are encouraged that so many people agree the water pollution risks from oil drilling using acid and other chemicals are unacceptable. We call on the Environment Agency to act on our concerns by rejecting this application. Short term oil extraction is increasingly being prioritised by our Government over the protection of our water resource. Water will ultimately be much more valuable and important to our Nation than oil. It's short term thinking at it's worst.
“Water is both a vital natural resource and a heritage, which must be protected, defended and treated as such. We would like to invite any local people who have concerns over the safety of our water due to the proposed acidisation drilling process, to join us in handing in this petition. We hope it makes a difference to the EA’s decision”
Concerns were initially sparked when Sutton and East Surrey Water (SESW) spoke out during the planning appeal process against Europa’s plans, stating that an accidental spill or leak could contaminate the aquifer used for public water supply. Lester Sonden, then director of SESW, said he was concerned about the potential for long-term contamination of water sources. He said “Our objection to drilling in this location is that it will increase the risk of polluting the aquifer that is used for public water supply. Besides the risk of contaminating our borehole sources at Dorking, there is also a risk that contamination could lead to pollution of the River Mole, which in turn could affect our sources at Leatherhead.
“The EA has required additional protection against the risk in the short term, but longer term the risks are not so well understood. However well-designed, there is a risk of failure at some time in the future.”
Public confidence is also dropping in two of the companies responsible for the drilling to foot the bill should a clean up of this scale be necessary. With over £50m wiped off UKOG’s share price recently due to possible formation damage from acid at Broadford Bridge oil well in Sussex and Europa’s share price going steadily down by over 66% in 5yrs, from over 12p in April 2013 to 3.85p on Wed 21st Feb, campaigners against the drilling fear this could end up costing the tax payer a lot more than they bargained for.
For further information, comment or to arrange a photo call, please contact Serena Billinghurst on 07727 123 874 or email<EMAIL_ADDRESS>To sign the petition please visit: https://you.38degrees.org.uk/petitions/protect-leith-hill-in-surrey-from-the-risk-of-water-contamination-from-planned-oil-drilling-1
The draft environmental permit and supporting documents can be viewed here.
The EA's invitation to the 1st March public meeting at Dorking is here.


Scharr(org.opencv.core.Mat, org.opencv.core.Mat, int, int, int, double, double, int)
,
filter2D(org.opencv.core.Mat, org.opencv.core.Mat, int, org.opencv.core.Mat, org.opencv.core.Point, double, int)
public static void Sobel(Mat src, Mat dst, int ddepth, int dx, int dy, int ksize, double scale, double delta, int borderType)
Calculates the first, second, third, or mixed image derivatives using an extended Sobel operator.
In all cases except one, the ksize x
ksize separable kernel
is used to calculate the derivative. When ksize = 1, the 3 x
1 or 1 x 3 kernel is used (that is, no Gaussian smoothing is
done). ksize = 1
can only be used for the first or the second x-
or y- derivatives.
There is also the special value ksize = CV_SCHARR
(-1) that
corresponds to the 3x3 Scharr filter that may give more accurate
results than the 3x3 Sobel. The Scharr aperture is
|-3 0 3| |-10 0 10| |-3 0 3|
for the x-derivative, or transposed for the y-derivative.
The function calculates an image derivative by convolving the image with the appropriate kernel:
dst = (d^(xorder+yorder) src)/(dx^(xorder) dy^(yorder))
The Sobel operators combine Gaussian smoothing and differentiation, so the
result is more or less resistant to the noise. Most often, the function is
called with (xorder
= 1, yorder
= 0,
ksize
= 3) or (xorder
= 0, yorder
= 1,
ksize
= 3) to calculate the first x- or y- image derivative. The
first case corresponds to a kernel of:
|-1 0 1| |-2 0 2| |-1 0 1|
The second case corresponds to a kernel of:
|-1 -2 -1| |0 0 0| |1 2 1|
src
- input image.dst
- output image of the same size and the same number of channels as
src
.ddepth
- output image depth; the following combinations of
src.depth()
and ddepth
are supported:
src.depth()
= CV_8U
, ddepth
=
-1/CV_16S
/CV_32F
/CV_64F
src.depth()
= CV_16U
/CV_16S
,
ddepth
= -1/CV_32F
/CV_64F
src.depth()
= CV_32F
, ddepth
=
-1/CV_32F
/CV_64F
src.depth()
= CV_64F
, ddepth
=
-1/CV_64F
when ddepth=-1
, the destination image will have the same depth
as the source; in the case of 8-bit input images it will result in truncated
derivatives.
dx
- a dxdy
- a dyksize
- size of the extended Sobel kernel; it must be 1, 3, 5, or 7.scale
- optional scale factor for the computed derivative values; by
default, no scaling is applied (see "getDerivKernels" for details).delta
- optional delta value that is added to the results prior to
storing them in dst
.borderType
- pixel extrapolation method (see "borderInterpolate" for
details).GaussianBlur(org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Size, double, double, int)
,
Core.cartToPolar(org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Mat, boolean)
,
sepFilter2D(org.opencv.core.Mat, org.opencv.core.Mat, int, org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Point, double, int)
,
Laplacian(org.opencv.core.Mat, org.opencv.core.Mat, int, int, double, double, int)
,
Scharr(org.opencv.core.Mat, org.opencv.core.Mat, int, int, int, double, double, int)
,
filter2D(org.opencv.core.Mat, org.opencv.core.Mat, int, org.opencv.core.Mat, org.opencv.core.Point, double, int)
public static double threshold(Mat src, Mat dst, double thresh, double maxval, int type)
Applies a fixed-level threshold to each array element.
The function applies fixed-level thresholding to a single-channel array. The
function is typically used to get a bi-level (binary) image out of a
grayscale image ("compare" could be also used for this purpose) or for
removing a noise, that is, filtering out pixels with too small or too large
values. There are several types of thresholding supported by the function.
They are determined by type
:
dst(x,y) = maxval if src(x,y) > thresh; 0 otherwise
dst(x,y) = 0 if src(x,y) > thresh; maxval otherwise
dst(x,y) = threshold if src(x,y) > thresh; src(x,y) otherwise
dst(x,y) = src(x,y) if src(x,y) > thresh; 0 otherwise
dst(x,y) = 0 if src(x,y) > thresh; src(x,y) otherwise
Also, the special value THRESH_OTSU
may be combined with one of
the above values. In this case, the function determines the optimal threshold
value using the Otsu's algorithm and uses it instead of the specified
thresh
.
The function returns the computed threshold value.
Currently, the Otsu's method is implemented only for 8-bit images.
src
- input array (single-channel, 8-bit or 32-bit floating point).dst
- output array of the same size and type as src
.thresh
- threshold value.maxval
- maximum value to use with the THRESH_BINARY
and
THRESH_BINARY_INV
thresholding types.type
- thresholding type (see the details below).findContours(org.opencv.core.Mat, java.util.List<org.opencv.core.MatOfPoint>, org.opencv.core.Mat, int, int, org.opencv.core.Point)
,
Core.max(org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Mat)
,
adaptiveThreshold(org.opencv.core.Mat, org.opencv.core.Mat, double, int, int, int, double)
,
Core.compare(org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Mat, int)
,
Core.min(org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Mat)
public static void undistort(Mat src, Mat dst, Mat cameraMatrix, Mat distCoeffs)
Transforms an image to compensate for lens distortion.
The function transforms an image to compensate radial and tangential lens distortion.
The function is simply a combination of "initUndistortRectifyMap" (with unity
R
) and "remap" (with bilinear interpolation). See the former
function for details of the transformation being performed.
Those pixels in the destination image, for which there is no correspondent pixels in the source image, are filled with zeros (black color).
A particular subset of the source image that will be visible in the corrected
image can be regulated by newCameraMatrix
. You can use
"getOptimalNewCameraMatrix" to compute the appropriate newCameraMatrix
depending on your requirements.
The camera matrix and the distortion parameters can be determined using "calibrateCamera". If the resolution of images is different from the resolution used at the calibration stage, f_x, f_y, c_x and c_y need to be scaled accordingly, while the distortion coefficients remain the same.
src
- Input (distorted) image.dst
- Output (corrected) image that has the same size and type as
src
.cameraMatrix
- Input camera matrix A =
|f_x 0 c_x| |0 f_y c_y| |0 0 1|
.distCoeffs
- Input vector of distortion coefficients (k_1, k_2, p_1,
p_2[, k_3[, k_4, k_5, k_6]]) of 4, 5, or 8 elements. If the vector is
NULL/empty, the zero distortion coefficients are assumed.public static void undistort(Mat src, Mat dst, Mat cameraMatrix, Mat distCoeffs, Mat newCameraMatrix)
Transforms an image to compensate for lens distortion.
The function transforms an image to compensate radial and tangential lens distortion.
The function is simply a combination of "initUndistortRectifyMap" (with unity
R
) and "remap" (with bilinear interpolation). See the former
function for details of the transformation being performed.
Those pixels in the destination image, for which there is no correspondent pixels in the source image, are filled with zeros (black color).
A particular subset of the source image that will be visible in the corrected
image can be regulated by newCameraMatrix
. You can use
"getOptimalNewCameraMatrix" to compute the appropriate newCameraMatrix
depending on your requirements.
The camera matrix and the distortion parameters can be determined using "calibrateCamera". If the resolution of images is different from the resolution used at the calibration stage, f_x, f_y, c_x and c_y need to be scaled accordingly, while the distortion coefficients remain the same.
src
- Input (distorted) image.dst
- Output (corrected) image that has the same size and type as
src
.cameraMatrix
- Input camera matrix A =
|f_x 0 c_x| |0 f_y c_y| |0 0 1|
.distCoeffs
- Input vector of distortion coefficients (k_1, k_2, p_1,
p_2[, k_3[, k_4, k_5, k_6]]) of 4, 5, or 8 elements. If the vector is
NULL/empty, the zero distortion coefficients are assumed.newCameraMatrix
- Camera matrix of the distorted image. By default, it
is the same as cameraMatrix
but you may additionally scale and
shift the result by using a different matrix.public static void undistortPoints(MatOfPoint2f src, MatOfPoint2f dst, Mat cameraMatrix, Mat distCoeffs)
Computes the ideal point coordinates from the observed point coordinates.
The function is similar to "undistort" and "initUndistortRectifyMap" but it
operates on a sparse set of points instead of a raster image. Also the
function performs a reverse transformation to"projectPoints". In case of a 3D
object, it does not reconstruct its 3D coordinates, but for a planar object,
it does, up to a translation vector, if the proper R
is
specified.
// C++ code:
// (u,v) is the input point, (u', v') is the output point
// camera_matrix=[fx 0 cx; 0 fy cy; 0 0 1]
// P=[fx' 0 cx' tx; 0 fy' cy' ty; 0 0 1 tz]
x" = (u - cx)/fx
y" = (v - cy)/fy
(x',y') = undistort(x",y",dist_coeffs)
[X,Y,W]T = R*[x' y' 1]T
x = X/W, y = Y/W
// only performed if P=[fx' 0 cx' [tx]; 0 fy' cy' [ty]; 0 0 1 [tz]] is specified
u' = x*fx' + cx'
v' = y*fy' + cy',
where undistort()
is an approximate iterative algorithm that
estimates the normalized original point coordinates out of the normalized
distorted point coordinates ("normalized" means that the coordinates do not
depend on the camera matrix).
The function can be used for both a stereo camera head or a monocular camera (when R is empty).
src
- Observed point coordinates, 1xN or Nx1 2-channel (CV_32FC2 or
CV_64FC2).dst
- Output ideal point coordinates after undistortion and reverse
perspective transformation. If matrix P
is identity or omitted,
dst
will contain normalized point coordinates.cameraMatrix
- Camera matrix
|f_x 0 c_x| |0 f_y c_y| |0 0 1|
.distCoeffs
- Input vector of distortion coefficients (k_1, k_2, p_1,
p_2[, k_3[, k_4, k_5, k_6]]) of 4, 5, or 8 elements. If the vector is
NULL/empty, the zero distortion coefficients are assumed.public static void undistortPoints(MatOfPoint2f src, MatOfPoint2f dst, Mat cameraMatrix, Mat distCoeffs, Mat R, Mat P)
Computes the ideal point coordinates from the observed point coordinates.
The function is similar to "undistort" and "initUndistortRectifyMap" but it
operates on a sparse set of points instead of a raster image. Also the
function performs a reverse transformation to"projectPoints". In case of a 3D
object, it does not reconstruct its 3D coordinates, but for a planar object,
it does, up to a translation vector, if the proper R
is
specified.
// C++ code:
// (u,v) is the input point, (u', v') is the output point
// camera_matrix=[fx 0 cx; 0 fy cy; 0 0 1]
// P=[fx' 0 cx' tx; 0 fy' cy' ty; 0 0 1 tz]
x" = (u - cx)/fx
y" = (v - cy)/fy
(x',y') = undistort(x",y",dist_coeffs)
[X,Y,W]T = R*[x' y' 1]T
x = X/W, y = Y/W
// only performed if P=[fx' 0 cx' [tx]; 0 fy' cy' [ty]; 0 0 1 [tz]] is specified
u' = x*fx' + cx'
v' = y*fy' + cy',
where undistort()
is an approximate iterative algorithm that
estimates the normalized original point coordinates out of the normalized
distorted point coordinates ("normalized" means that the coordinates do not
depend on the camera matrix).
The function can be used for both a stereo camera head or a monocular camera (when R is empty).
src
- Observed point coordinates, 1xN or Nx1 2-channel (CV_32FC2 or
CV_64FC2).dst
- Output ideal point coordinates after undistortion and reverse
perspective transformation. If matrix P
is identity or omitted,
dst
will contain normalized point coordinates.cameraMatrix
- Camera matrix
|f_x 0 c_x| |0 f_y c_y| |0 0 1|
.distCoeffs
- Input vector of distortion coefficients (k_1, k_2, p_1,
p_2[, k_3[, k_4, k_5, k_6]]) of 4, 5, or 8 elements. If the vector is
NULL/empty, the zero distortion coefficients are assumed.R
- Rectification transformation in the object space (3x3 matrix).
R1
or R2
computed by "stereoRectify" can be passed
here. If the matrix is empty, the identity transformation is used.P
- New camera matrix (3x3) or new projection matrix (3x4).
P1
or P2
computed by "stereoRectify" can be passed
here. If the matrix is empty, the identity new camera matrix is used.public static void warpAffine(Mat src, Mat dst, Mat M, Size dsize)
Applies an affine transformation to an image.
The function warpAffine
transforms the source image using the
specified matrix:
dst(x,y) = src(M _11 x + M _12 y + M _13, M _21 x + M _22 y + M _23)
when the flag WARP_INVERSE_MAP
is set. Otherwise, the
transformation is first inverted with "invertAffineTransform" and then put in
the formula above instead of M
.
The function cannot operate in-place.
Note: cvGetQuadrangleSubPix
is similar to cvWarpAffine
,
but the outliers are extrapolated using replication border mode.
src
- input image.dst
- output image that has the size dsize
and the same
type as src
.M
- 2x 3 transformation matrix.dsize
- size of the output image.remap(org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Mat, int, int, org.opencv.core.Scalar)
,
warpPerspective(org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Size, int, int, org.opencv.core.Scalar)
,
getRectSubPix(org.opencv.core.Mat, org.opencv.core.Size, org.opencv.core.Point, org.opencv.core.Mat, int)
,
resize(org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Size, double, double, int)
,
Core.transform(org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Mat)
public static void warpAffine(Mat src, Mat dst, Mat M, Size dsize, int flags)
Applies an affine transformation to an image.
The function warpAffine
transforms the source image using the
specified matrix:
dst(x,y) = src(M _11 x + M _12 y + M _13, M _21 x + M _22 y + M _23)
when the flag WARP_INVERSE_MAP
is set. Otherwise, the
transformation is first inverted with "invertAffineTransform" and then put in
the formula above instead of M
.
The function cannot operate in-place.
Note: cvGetQuadrangleSubPix
is similar to cvWarpAffine
,
but the outliers are extrapolated using replication border mode.
src
- input image.dst
- output image that has the size dsize
and the same
type as src
.M
- 2x 3 transformation matrix.dsize
- size of the output image.flags
- combination of interpolation methods (see "resize") and the
optional flag WARP_INVERSE_MAP
that means that M
is
the inverse transformation (dst->src).remap(org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Mat, int, int, org.opencv.core.Scalar)
,
warpPerspective(org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Size, int, int, org.opencv.core.Scalar)
,
getRectSubPix(org.opencv.core.Mat, org.opencv.core.Size, org.opencv.core.Point, org.opencv.core.Mat, int)
,
resize(org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Size, double, double, int)
,
Core.transform(org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Mat)
public static void warpAffine(Mat src, Mat dst, Mat M, Size dsize, int flags, int borderMode, Scalar borderValue)
Applies an affine transformation to an image.
The function warpAffine
transforms the source image using the
specified matrix:
dst(x,y) = src(M _11 x + M _12 y + M _13, M _21 x + M _22 y + M _23)
when the flag WARP_INVERSE_MAP
is set. Otherwise, the
transformation is first inverted with "invertAffineTransform" and then put in
the formula above instead of M
.
The function cannot operate in-place.
Note: cvGetQuadrangleSubPix
is similar to cvWarpAffine
,
but the outliers are extrapolated using replication border mode.
src
- input image.dst
- output image that has the size dsize
and the same
type as src
.M
- 2x 3 transformation matrix.dsize
- size of the output image.flags
- combination of interpolation methods (see "resize") and the
optional flag WARP_INVERSE_MAP
that means that M
is
the inverse transformation (dst->src).borderMode
- pixel extrapolation method (see "borderInterpolate"); when
borderMode=BORDER_TRANSPARENT
, it means that the pixels in the
destination image corresponding to the "outliers" in the source image are not
modified by the function.borderValue
- value used in case of a constant border; by default, it is
0.remap(org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Mat, int, int, org.opencv.core.Scalar)
,
warpPerspective(org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Size, int, int, org.opencv.core.Scalar)
,
getRectSubPix(org.opencv.core.Mat, org.opencv.core.Size, org.opencv.core.Point, org.opencv.core.Mat, int)
,
resize(org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Size, double, double, int)
,
Core.transform(org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Mat)
public static void warpPerspective(Mat src, Mat dst, Mat M, Size dsize)
Applies a perspective transformation to an image.
The function warpPerspective
transforms the source image using
the specified matrix:
dst(x,y) = src((M_11 x + M_12 y + M_13)/(M_(31) x + M_32 y + M_33),
(M_21 x + M_22 y + M_23)/(M_(31) x + M_32 y + M_33))
when the flag WARP_INVERSE_MAP
is set. Otherwise, the
transformation is first inverted with "invert" and then put in the formula
above instead of M
.
The function cannot operate in-place.
src
- input image.dst
- output image that has the size dsize
and the same
type as src
.M
- 3x 3 transformation matrix.dsize
- size of the output image.warpAffine(org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Size, int, int, org.opencv.core.Scalar)
,
remap(org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Mat, int, int, org.opencv.core.Scalar)
,
Core.perspectiveTransform(org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Mat)
,
getRectSubPix(org.opencv.core.Mat, org.opencv.core.Size, org.opencv.core.Point, org.opencv.core.Mat, int)
,
resize(org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Size, double, double, int)
public static void warpPerspective(Mat src, Mat dst, Mat M, Size dsize, int flags)
Applies a perspective transformation to an image.
The function warpPerspective
transforms the source image using
the specified matrix:
dst(x,y) = src((M_11 x + M_12 y + M_13)/(M_(31) x + M_32 y + M_33),
(M_21 x + M_22 y + M_23)/(M_(31) x + M_32 y + M_33))
when the flag WARP_INVERSE_MAP
is set. Otherwise, the
transformation is first inverted with "invert" and then put in the formula
above instead of M
.
The function cannot operate in-place.
src
- input image.dst
- output image that has the size dsize
and the same
type as src
.M
- 3x 3 transformation matrix.dsize
- size of the output image.flags
- combination of interpolation methods (INTER_LINEAR
or INTER_NEAREST
) and the optional flag WARP_INVERSE_MAP
,
that sets M
as the inverse transformation (dst->src).warpAffine(org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Size, int, int, org.opencv.core.Scalar)
,
remap(org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Mat, int, int, org.opencv.core.Scalar)
,
Core.perspectiveTransform(org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Mat)
,
getRectSubPix(org.opencv.core.Mat, org.opencv.core.Size, org.opencv.core.Point, org.opencv.core.Mat, int)
,
resize(org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Size, double, double, int)
public static void warpPerspective(Mat src, Mat dst, Mat M, Size dsize, int flags, int borderMode, Scalar borderValue)
Applies a perspective transformation to an image.
The function warpPerspective
transforms the source image using
the specified matrix:
dst(x,y) = src((M_11 x + M_12 y + M_13)/(M_(31) x + M_32 y + M_33),
(M_21 x + M_22 y + M_23)/(M_(31) x + M_32 y + M_33))
when the flag WARP_INVERSE_MAP
is set. Otherwise, the
transformation is first inverted with "invert" and then put in the formula
above instead of M
.
The function cannot operate in-place.
src
- input image.dst
- output image that has the size dsize
and the same
type as src
.M
- 3x 3 transformation matrix.dsize
- size of the output image.flags
- combination of interpolation methods (INTER_LINEAR
or INTER_NEAREST
) and the optional flag WARP_INVERSE_MAP
,
that sets M
as the inverse transformation (dst->src).borderMode
- pixel extrapolation method (BORDER_CONSTANT
or
BORDER_REPLICATE
).borderValue
- value used in case of a constant border; by default, it
equals 0.warpAffine(org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Size, int, int, org.opencv.core.Scalar)
,
remap(org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Mat, int, int, org.opencv.core.Scalar)
,
Core.perspectiveTransform(org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Mat)
,
getRectSubPix(org.opencv.core.Mat, org.opencv.core.Size, org.opencv.core.Point, org.opencv.core.Mat, int)
,
resize(org.opencv.core.Mat, org.opencv.core.Mat, org.opencv.core.Size, double, double, int)
public static void watershed(Mat image, Mat markers)
Performs a marker-based image segmentation using the watershed algorithm.
The function implements one of the variants of watershed, non-parametric marker-based segmentation algorithm, described in [Meyer92].
Before passing the image to the function, you have to roughly outline the
desired regions in the image markers
with positive
(>0
) indices. So, every region is represented as one or more
connected components with the pixel values 1, 2, 3, and so on. Such markers
can be retrieved from a binary mask using "findContours" and "drawContours"
(see the watershed.cpp
demo). The markers are "seeds" of the
future image regions. All the other pixels in markers
, whose
relation to the outlined regions is not known and should be defined by the
algorithm, should be set to 0's. In the function output, each pixel in
markers is set to a value of the "seed" components or to -1 at boundaries
between the regions.
Visual demonstration and usage example of the function can be found in the
OpenCV samples directory (see the watershed.cpp
demo).
Note: Any two neighbor connected components are not necessarily separated by a watershed boundary (-1's pixels); for example, they can touch each other in the initial marker image passed to the function.
Note:
image
- Input 8-bit 3-channel image.markers
- Input/output 32-bit single-channel image (map) of markers. It
should have the same size as image
.findContours(org.opencv.core.Mat, java.util.List<org.opencv.core.MatOfPoint>, org.opencv.core.Mat, int, int, org.opencv.core.Point)


| DOSE: |
11 mg |
insufflated |
2C-P |
(powder / crystals) |
Its right after school around 3 oíclock and my friend texts me. Wanna trip? I call him and say yeah I have money and head over to his house. I cough up 20 bucks and he gives me a little clear capsule. I was immediatlly pissed off because it felt and looked empty. he promised it wasnít and split it apart on a cd case. There it was, a fine white powder about 1/4 the size of an eraser on a pencil.
So I got a dollar bill and snorted it. The first and only thing I notice it the burn. My nose burns so hard I tear for 10 minutes and my throat burns terribly for another 20.  I lay back, still tearing, to notice the ceiling swirling like food coloring in water. I feel a certain haze come over my body.
Everything is so interesting. Smooth has never been this smooth before, red has never been this red before. There is motion blur and trails when I look around. The sun outside looked beautiful.  My thoughts were noticablly high too, I couldnít make a straight sentence, but my actuall ideas were genious and inciteful.
Certain sounds I didnít hear at all, while the softest ones were the most prevalent. I could tell my friends amps were on in the garadge when I was upstairs. And that was me hearing the barely auidable static. When I had to leave and I was in public, it looked as if everybody knew I was high. But thatís just paranoia I guess.
Itís 8 oíclock and Iím eating alone wondering when I would stop tripping balls. I go upstairs to my room alone. I draw pictures for hours. I usually donít draw that much, but last time I did shrooms I couldnít remember all my deep thoughts so I felt like recording them. I stopped tripping hard at around 4 am. So I had a complete 12 hour trip.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


|
Class Summary |
| AbstractAttributeData<T extends AbstractAttributeData<?>> |
The class is used to define all types of attributes, to create them and test
the result. |
| AbstractAttributeData.AbstractRange |
Used to define ranges with one value. |
| AbstractAttributeData.RangeBetween |
Between range definition. |
| AbstractAttributeData.RangeEqual |
Equal range definition. |
| AbstractAttributeData.RangeGreaterEqualThan |
Greater equal than range definition. |
| AbstractAttributeData.RangeGreaterThan |
Greater than range definition. |
| AbstractAttributeData.RangeLessEqualThan |
Less equal than range definition. |
| AbstractAttributeData.RangeLessThan |
Less than range definition. |
| AbstractAttributeData.RangeMatch |
Match range definition. |
| AbstractAttributeData.RangeNotEqual |
Not equal range definition. |
| AbstractAttributeData.RangeNotMatch |
Not match range definition. |
| AbstractAttributeData.RangeNotSMatch |
Not smatch range definition. |
| AbstractAttributeData.RangeProgram |
Program range definition. |
| AbstractAttributeData.RangeSMatch |
SMatch range definition. |
| AbstractDataWithAttribute<DATAWITHATTRIBUTE extends AbstractDataWithAttribute<?>> |
The class is used to define all administration objects which could have
attributes used to create / update and to export. |
| AbstractDataWithTrigger<DATAWITHTRIGGERS extends AbstractDataWithTrigger<?>> |
The class is used to define all administration objects which could have
triggers used to create / update and to export. |
| AbstractDataWithTrigger.AbstractTrigger<T extends AbstractDataWithTrigger.AbstractTrigger<?>> |
Defines a common interface for triggers. |
| AbstractDataWithTrigger.TriggerAction |
Used to define action triggers. |
| AbstractDataWithTrigger.TriggerCheck |
Used to define check triggers. |
| AbstractDataWithTrigger.TriggerOverride |
Used to define override triggers. |
| AttributeBooleanData |
Used to define a boolean attribute, create them and test the result. |
| AttributeDateData |
Used to define a string attribute, create them and test the result. |
| AttributeIntegerData |
Used to define a string attribute, create them and test the result. |
| AttributeRealData |
Used to define a string attribute, create them and test the result. |
| AttributeStringData |
Used to define a string attribute, create them and test the result. |
| ExpressionData |
Used to define an expression, create them and test the result. |
| FormatData |
Used to define a format, create them and test the result. |
| InterfaceData |
Used to define an interface, create them and test the result. |
| NotificationData |
Used to define an notification object, create them and test the result. |
| PolicyData |
Used to define a policy, create them and test the result. |
| PolicyData.Access<PARENT> |
One access definition for all states or one state. |
| PolicyData.AccessFilterDouble<AF extends PolicyData.AccessFilterDouble<?>> |
Holds the double information about allowed access and filter. |
| PolicyData.UserAccessFilter |
Access definition for one user. |
| RelationshipData |
Used to define a relationship, create them and test the result. |
| RuleData |
Used to define a rule, create them and test the result. |
| TypeData |
Used to define a type, create them and test the result. |


--- layout: page title: permalink: /contact/ main_image_path: main_image_caption: frontpage: false homepage_description_markdown: frontpagetitle: show_form: true show_mailchimp: true _options: layout: hidden: true permalink: hidden: true image_path: uploads_dir: assets/images/:year width: 1200 height: 1200 resize_style: contain mime_type: image/jpeg main_image_path: uploads_dir: assets/images/:year width: 1200 height: 1200 resize_style: contain mime_type: image/jpeg content: uploads_dir: assets/:year _comments: title: Page title main_image_path: Image used to represent your page show_form: Do you want to show a contact form? show_mailchimp: Show the MailChimp signup form? frontpage: Show this page on the homepage homepage_description_markdown: Text used on homepage if shown frontpagetitle: Alternative title for home page use ---
For any enquiries, or if you would like to purchase or commission a papercut, please get in touch using the form below or email me - k.hipkiss[at]hotmail.co.uk


from statsmodels.compat.python import lzip
import numpy as np
from scipy import stats
from statsmodels.regression.linear_model import OLS
from statsmodels.tools.tools import add_constant
from statsmodels.tools.decorators import cache_readonly
from statsmodels.distributions import ECDF
from . import utils
__all__ = ['qqplot', 'qqplot_2samples', 'qqline', 'ProbPlot']
[docs]class ProbPlot(object):
"""
Q-Q and P-P Probability Plots
Can take arguments specifying the parameters for dist or fit them
automatically. (See fit under kwargs.)
Parameters
----------
data : array_like
A 1d data array
dist : callable
Compare x against dist. A scipy.stats or statsmodels distribution. The
default is scipy.stats.distributions.norm (a standard normal).
fit : bool
If fit is false, loc, scale, and distargs are passed to the
distribution. If fit is True then the parameters for dist
are fit automatically using dist.fit. The quantiles are formed
from the standardized data, after subtracting the fitted loc
and dividing by the fitted scale.
distargs : tuple
A tuple of arguments passed to dist to specify it fully
so dist.ppf may be called. distargs must not contain loc
or scale. These values must be passed using the loc or
scale inputs.
a : float
Offset for the plotting position of an expected order
statistic, for example. The plotting positions are given
by (i - a)/(nobs - 2*a + 1) for i in range(0,nobs+1)
loc : float
Location parameter for dist
scale : float
Scale parameter for dist
See Also
--------
scipy.stats.probplot
Notes
-----
1) Depends on matplotlib.
2) If `fit` is True then the parameters are fit using the
distribution's `fit()` method.
3) The call signatures for the `qqplot`, `ppplot`, and `probplot`
methods are similar, so examples 1 through 4 apply to all
three methods.
4) The three plotting methods are summarized below:
ppplot : Probability-Probability plot
Compares the sample and theoretical probabilities (percentiles).
qqplot : Quantile-Quantile plot
Compares the sample and theoretical quantiles
probplot : Probability plot
Same as a Q-Q plot, however probabilities are shown in the scale of
the theoretical distribution (x-axis) and the y-axis contains
unscaled quantiles of the sample data.
Examples
--------
The first example shows a Q-Q plot for regression residuals
>>> # example 1
>>> import statsmodels.api as sm
>>> from matplotlib import pyplot as plt
>>> data = sm.datasets.longley.load(as_pandas=False)
>>> data.exog = sm.add_constant(data.exog)
>>> model = sm.OLS(data.endog, data.exog)
>>> mod_fit = model.fit()
>>> res = mod_fit.resid # residuals
>>> probplot = sm.ProbPlot(res)
>>> fig = probplot.qqplot()
>>> h = plt.title('Ex. 1 - qqplot - residuals of OLS fit')
>>> plt.show()
qqplot of the residuals against quantiles of t-distribution with 4
degrees of freedom:
>>> # example 2
>>> import scipy.stats as stats
>>> probplot = sm.ProbPlot(res, stats.t, distargs=(4,))
>>> fig = probplot.qqplot()
>>> h = plt.title('Ex. 2 - qqplot - residuals against quantiles of t-dist')
>>> plt.show()
qqplot against same as above, but with mean 3 and std 10:
>>> # example 3
>>> probplot = sm.ProbPlot(res, stats.t, distargs=(4,), loc=3, scale=10)
>>> fig = probplot.qqplot()
>>> h = plt.title('Ex. 3 - qqplot - resids vs quantiles of t-dist')
>>> plt.show()
Automatically determine parameters for t distribution including the
loc and scale:
>>> # example 4
>>> probplot = sm.ProbPlot(res, stats.t, fit=True)
>>> fig = probplot.qqplot(line='45')
>>> h = plt.title('Ex. 4 - qqplot - resids vs. quantiles of fitted t-dist')
>>> plt.show()
A second `ProbPlot` object can be used to compare two separate sample
sets by using the `other` kwarg in the `qqplot` and `ppplot` methods.
>>> # example 5
>>> import numpy as np
>>> x = np.random.normal(loc=8.25, scale=2.75, size=37)
>>> y = np.random.normal(loc=8.75, scale=3.25, size=37)
>>> pp_x = sm.ProbPlot(x, fit=True)
>>> pp_y = sm.ProbPlot(y, fit=True)
>>> fig = pp_x.qqplot(line='45', other=pp_y)
>>> h = plt.title('Ex. 5 - qqplot - compare two sample sets')
>>> plt.show()
In qqplot, sample size of `other` can be equal or larger than the first.
In case of larger, size of `other` samples will be reduced to match the
size of the first by interpolation
>>> # example 6
>>> x = np.random.normal(loc=8.25, scale=2.75, size=37)
>>> y = np.random.normal(loc=8.75, scale=3.25, size=57)
>>> pp_x = sm.ProbPlot(x, fit=True)
>>> pp_y = sm.ProbPlot(y, fit=True)
>>> fig = pp_x.qqplot(line='45', other=pp_y)
>>> title = 'Ex. 6 - qqplot - compare different sample sizes'
>>> h = plt.title(title)
>>> plt.show()
In ppplot, sample size of `other` and the first can be different. `other`
will be used to estimate an empirical cumulative distribution function
(ECDF). ECDF(x) will be plotted against p(x)=0.5/n, 1.5/n, ..., (n-0.5)/n
where x are sorted samples from the first.
>>> # example 7
>>> x = np.random.normal(loc=8.25, scale=2.75, size=37)
>>> y = np.random.normal(loc=8.75, scale=3.25, size=57)
>>> pp_x = sm.ProbPlot(x, fit=True)
>>> pp_y = sm.ProbPlot(y, fit=True)
>>> fig = pp_y.ppplot(line='45', other=pp_x)
>>> h = plt.title('Ex. 7A- ppplot - compare two sample sets, other=pp_x')
>>> fig = pp_x.ppplot(line='45', other=pp_y)
>>> h = plt.title('Ex. 7B- ppplot - compare two sample sets, other=pp_y')
>>> plt.show()
The following plot displays some options, follow the link to see the
code.
.. plot:: plots/graphics_gofplots_qqplot.py
"""
def __init__(self, data, dist=stats.norm, fit=False, distargs=(), a=0,
loc=0, scale=1):
self.data = data
self.a = a
self.nobs = data.shape[0]
self.distargs = distargs
self.fit = fit
if isinstance(dist, str):
dist = getattr(stats, dist)
if fit:
self.fit_params = dist.fit(data)
self.loc = self.fit_params[-2]
self.scale = self.fit_params[-1]
if len(self.fit_params) > 2:
self.dist = dist(*self.fit_params[:-2],
**dict(loc=0, scale=1))
else:
self.dist = dist(loc=0, scale=1)
elif distargs or loc != 0 or scale != 1:
try:
self.dist = dist(*distargs, **dict(loc=loc, scale=scale))
except Exception:
distargs = ', '.join([str(da) for da in distargs])
cmd = 'dist({distargs}, loc={loc}, scale={scale})'
cmd = cmd.format(distargs=distargs, loc=loc, scale=scale)
raise TypeError('Initializing the distribution failed. This '
'can occur if distargs contains loc or scale. '
'The distribution initialization command '
'is:\n{cmd}'.format(cmd=cmd))
self.loc = loc
self.scale = scale
self.fit_params = np.r_[distargs, loc, scale]
else:
self.dist = dist
self.loc = loc
self.scale = scale
self.fit_params = np.r_[loc, scale]
# propertes
self._cache = {}
@cache_readonly
def theoretical_percentiles(self):
"""Theoretical percentiles"""
return plotting_pos(self.nobs, self.a)
@cache_readonly
def theoretical_quantiles(self):
"""Theoretical quantiles"""
try:
return self.dist.ppf(self.theoretical_percentiles)
except TypeError:
msg = '%s requires more parameters to ' \
'compute ppf'.format(self.dist.name,)
raise TypeError(msg)
except:
msg = 'failed to compute the ppf of {0}'.format(self.dist.name,)
raise
@cache_readonly
def sorted_data(self):
"""sorted data"""
sorted_data = np.array(self.data, copy=True)
sorted_data.sort()
return sorted_data
@cache_readonly
def sample_quantiles(self):
"""sample quantiles"""
if self.fit and self.loc != 0 and self.scale != 1:
return (self.sorted_data-self.loc)/self.scale
else:
return self.sorted_data
@cache_readonly
def sample_percentiles(self):
"""Sample percentiles"""
quantiles = \
(self.sorted_data - self.fit_params[-2])/self.fit_params[-1]
return self.dist.cdf(quantiles)
[docs] def ppplot(self, xlabel=None, ylabel=None, line=None, other=None,
ax=None, **plotkwargs):
"""
Plot of the percentiles of x versus the percentiles of a distribution.
Parameters
----------
xlabel : str or None, optional
User-provided labels for the x-axis. If None (default),
other values are used depending on the status of the kwarg `other`.
ylabel : str or None, optional
User-provided labels for the y-axis. If None (default),
other values are used depending on the status of the kwarg `other`.
line : {None, '45', 's', 'r', q'}, optional
Options for the reference line to which the data is compared:
- '45': 45-degree line
- 's': standardized line, the expected order statistics are
scaled by the standard deviation of the given sample and have
the mean added to them
- 'r': A regression line is fit
- 'q': A line is fit through the quartiles.
- None: by default no reference line is added to the plot.
other : ProbPlot, array_like, or None, optional
If provided, ECDF(x) will be plotted against p(x) where x are
sorted samples from `self`. ECDF is an empirical cumulative
distribution function estimated from `other` and
p(x) = 0.5/n, 1.5/n, ..., (n-0.5)/n where n is the number of
samples in `self`. If an array-object is provided, it will be
turned into a `ProbPlot` instance default parameters. If not
provided (default), `self.dist(x)` is be plotted against p(x).
ax : AxesSubplot, optional
If given, this subplot is used to plot in instead of a new figure
being created.
**plotkwargs
Additional arguments to be passed to the `plot` command.
Returns
-------
Figure
If `ax` is None, the created figure. Otherwise the figure to which
`ax` is connected.
"""
if other is not None:
check_other = isinstance(other, ProbPlot)
if not check_other:
other = ProbPlot(other)
p_x = self.theoretical_percentiles
ecdf_x = ECDF(other.sample_quantiles)(self.sample_quantiles)
fig, ax = _do_plot(p_x, ecdf_x, self.dist, ax=ax, line=line,
**plotkwargs)
if xlabel is None:
xlabel = 'Probabilities of 2nd Sample'
if ylabel is None:
ylabel = 'Probabilities of 1st Sample'
else:
fig, ax = _do_plot(self.theoretical_percentiles,
self.sample_percentiles,
self.dist, ax=ax, line=line,
**plotkwargs)
if xlabel is None:
xlabel = "Theoretical Probabilities"
if ylabel is None:
ylabel = "Sample Probabilities"
ax.set_xlabel(xlabel)
ax.set_ylabel(ylabel)
ax.set_xlim([0.0, 1.0])
ax.set_ylim([0.0, 1.0])
return fig
[docs] def qqplot(self, xlabel=None, ylabel=None, line=None, other=None,
ax=None, **plotkwargs):
"""
Plot of the quantiles of x versus the quantiles/ppf of a distribution.
Can also be used to plot against the quantiles of another `ProbPlot`
instance.
Parameters
----------
xlabel : {None, str}
User-provided labels for the x-axis. If None (default),
other values are used depending on the status of the kwarg `other`.
ylabel : {None, str}
User-provided labels for the y-axis. If None (default),
other values are used depending on the status of the kwarg `other`.
line : {None, '45', 's', 'r', q'}, optional
Options for the reference line to which the data is compared:
- '45' - 45-degree line
- 's' - standardized line, the expected order statistics are scaled
by the standard deviation of the given sample and have the mean
added to them
- 'r' - A regression line is fit
- 'q' - A line is fit through the quartiles.
- None - by default no reference line is added to the plot.
other : {ProbPlot, array_like, None}, optional
If provided, the sample quantiles of this `ProbPlot` instance are
plotted against the sample quantiles of the `other` `ProbPlot`
instance. Sample size of `other` must be equal or larger than
this `ProbPlot` instance. If the sample size is larger, sample
quantiles of `other` will be interpolated to match the sample size
of this `ProbPlot` instance. If an array-like object is provided,
it will be turned into a `ProbPlot` instance using default
parameters. If not provided (default), the theoretical quantiles
are used.
ax : AxesSubplot, optional
If given, this subplot is used to plot in instead of a new figure
being created.
**plotkwargs
Additional arguments to be passed to the `plot` command.
Returns
-------
Figure
If `ax` is None, the created figure. Otherwise the figure to which
`ax` is connected.
"""
if other is not None:
check_other = isinstance(other, ProbPlot)
if not check_other:
other = ProbPlot(other)
s_self = self.sample_quantiles
s_other = other.sample_quantiles
if len(s_self) > len(s_other):
raise ValueError("Sample size of `other` must be equal or " +
"larger than this `ProbPlot` instance")
elif len(s_self) < len(s_other):
# Use quantiles of the smaller set and interpolate quantiles of
# the larger data set
p = plotting_pos(self.nobs, self.a)
s_other = stats.mstats.mquantiles(s_other, p)
fig, ax = _do_plot(s_other, s_self, self.dist, ax=ax, line=line,
**plotkwargs)
if xlabel is None:
xlabel = 'Quantiles of 2nd Sample'
if ylabel is None:
ylabel = 'Quantiles of 1st Sample'
else:
fig, ax = _do_plot(self.theoretical_quantiles,
self.sample_quantiles,
self.dist, ax=ax, line=line,
**plotkwargs)
if xlabel is None:
xlabel = "Theoretical Quantiles"
if ylabel is None:
ylabel = "Sample Quantiles"
ax.set_xlabel(xlabel)
ax.set_ylabel(ylabel)
return fig
[docs] def probplot(self, xlabel=None, ylabel=None, line=None,
exceed=False, ax=None, **plotkwargs):
"""
Plot of unscaled quantiles of x against the prob of a distribution.
The x-axis is scaled linearly with the quantiles, but the probabilities
are used to label the axis.
Parameters
----------
xlabel : {None, str}, optional
User-provided labels for the x-axis. If None (default),
other values are used depending on the status of the kwarg `other`.
ylabel : {None, str}, optional
User-provided labels for the y-axis. If None (default),
other values are used depending on the status of the kwarg `other`.
line : {None, '45', 's', 'r', q'}, optional
Options for the reference line to which the data is compared:
- '45' - 45-degree line
- 's' - standardized line, the expected order statistics are scaled
by the standard deviation of the given sample and have the mean
added to them
- 'r' - A regression line is fit
- 'q' - A line is fit through the quartiles.
- None - by default no reference line is added to the plot.
exceed : bool, optional
If False (default) the raw sample quantiles are plotted against
the theoretical quantiles, show the probability that a sample will
not exceed a given value. If True, the theoretical quantiles are
flipped such that the figure displays the probability that a
sample will exceed a given value.
ax : AxesSubplot, optional
If given, this subplot is used to plot in instead of a new figure
being created.
**plotkwargs
Additional arguments to be passed to the `plot` command.
Returns
-------
Figure
If `ax` is None, the created figure. Otherwise the figure to which
`ax` is connected.
"""
if exceed:
fig, ax = _do_plot(self.theoretical_quantiles[::-1],
self.sorted_data,
self.dist, ax=ax, line=line,
**plotkwargs)
if xlabel is None:
xlabel = 'Probability of Exceedance (%)'
else:
fig, ax = _do_plot(self.theoretical_quantiles,
self.sorted_data,
self.dist, ax=ax, line=line,
**plotkwargs)
if xlabel is None:
xlabel = 'Non-exceedance Probability (%)'
if ylabel is None:
ylabel = "Sample Quantiles"
ax.set_xlabel(xlabel)
ax.set_ylabel(ylabel)
_fmt_probplot_axis(ax, self.dist, self.nobs)
return fig
[docs]def qqplot(data, dist=stats.norm, distargs=(), a=0, loc=0, scale=1, fit=False,
line=None, ax=None, **plotkwargs):
"""
Q-Q plot of the quantiles of x versus the quantiles/ppf of a distribution.
Can take arguments specifying the parameters for dist or fit them
automatically. (See fit under Parameters.)
Parameters
----------
data : array_like
A 1d data array.
dist : callable
Comparison distribution. The default is
scipy.stats.distributions.norm (a standard normal).
distargs : tuple
A tuple of arguments passed to dist to specify it fully
so dist.ppf may be called.
a : float
Offset for the plotting position of an expected order statistic, for
example. The plotting positions are given by (i - a)/(nobs - 2*a + 1)
for i in range(0,nobs+1)
loc : float
Location parameter for dist
scale : float
Scale parameter for dist
fit : bool
If fit is false, loc, scale, and distargs are passed to the
distribution. If fit is True then the parameters for dist
are fit automatically using dist.fit. The quantiles are formed
from the standardized data, after subtracting the fitted loc
and dividing by the fitted scale.
line : {None, '45', 's', 'r', q'}
Options for the reference line to which the data is compared:
- '45' - 45-degree line
- 's' - standardized line, the expected order statistics are scaled
by the standard deviation of the given sample and have the mean
added to them
- 'r' - A regression line is fit
- 'q' - A line is fit through the quartiles.
- None - by default no reference line is added to the plot.
ax : AxesSubplot, optional
If given, this subplot is used to plot in instead of a new figure being
created.
**plotkwargs
Additional matplotlib arguments to be passed to the `plot` command.
Returns
-------
Figure
If `ax` is None, the created figure. Otherwise the figure to which
`ax` is connected.
See Also
--------
scipy.stats.probplot
Notes
-----
Depends on matplotlib. If `fit` is True then the parameters are fit using
the distribution's fit() method.
Examples
--------
>>> import statsmodels.api as sm
>>> from matplotlib import pyplot as plt
>>> data = sm.datasets.longley.load(as_pandas=False)
>>> data.exog = sm.add_constant(data.exog)
>>> mod_fit = sm.OLS(data.endog, data.exog).fit()
>>> res = mod_fit.resid # residuals
>>> fig = sm.qqplot(res)
>>> plt.show()
qqplot of the residuals against quantiles of t-distribution with 4 degrees
of freedom:
>>> import scipy.stats as stats
>>> fig = sm.qqplot(res, stats.t, distargs=(4,))
>>> plt.show()
qqplot against same as above, but with mean 3 and std 10:
>>> fig = sm.qqplot(res, stats.t, distargs=(4,), loc=3, scale=10)
>>> plt.show()
Automatically determine parameters for t distribution including the
loc and scale:
>>> fig = sm.qqplot(res, stats.t, fit=True, line='45')
>>> plt.show()
The following plot displays some options, follow the link to see the code.
.. plot:: plots/graphics_gofplots_qqplot.py
"""
probplot = ProbPlot(data, dist=dist, distargs=distargs,
fit=fit, a=a, loc=loc, scale=scale)
fig = probplot.qqplot(ax=ax, line=line, **plotkwargs)
return fig
[docs]def qqplot_2samples(data1, data2, xlabel=None, ylabel=None, line=None,
ax=None):
"""
Q-Q Plot of two samples' quantiles.
Can take either two `ProbPlot` instances or two array-like objects. In the
case of the latter, both inputs will be converted to `ProbPlot` instances
using only the default values - so use `ProbPlot` instances if
finer-grained control of the quantile computations is required.
Parameters
----------
data1 : {array_like, ProbPlot}
Data to plot along x axis.
data2 : {array_like, ProbPlot}
Data to plot along y axis.
xlabel : {None, str}
User-provided labels for the x-axis. If None (default),
other values are used.
ylabel : {None, str}
User-provided labels for the y-axis. If None (default),
other values are used.
line : {None, '45', 's', 'r', q'}
Options for the reference line to which the data is compared:
- '45' - 45-degree line
- 's' - standardized line, the expected order statistics are scaled
by the standard deviation of the given sample and have the mean
added to them
- 'r' - A regression line is fit
- 'q' - A line is fit through the quartiles.
- None - by default no reference line is added to the plot.
ax : AxesSubplot, optional
If given, this subplot is used to plot in instead of a new figure being
created.
Returns
-------
Figure
If `ax` is None, the created figure. Otherwise the figure to which
`ax` is connected.
See Also
--------
scipy.stats.probplot
Notes
-----
1) Depends on matplotlib.
2) If `data1` and `data2` are not `ProbPlot` instances, instances will be
created using the default parameters. Therefore, it is recommended to use
`ProbPlot` instance if fine-grained control is needed in the computation
of the quantiles.
Examples
--------
>>> import statsmodels.api as sm
>>> import numpy as np
>>> import matplotlib.pyplot as plt
>>> from statsmodels.graphics.gofplots import qqplot_2samples
>>> x = np.random.normal(loc=8.5, scale=2.5, size=37)
>>> y = np.random.normal(loc=8.0, scale=3.0, size=37)
>>> pp_x = sm.ProbPlot(x)
>>> pp_y = sm.ProbPlot(y)
>>> qqplot_2samples(pp_x, pp_y)
>>> plt.show()
.. plot:: plots/graphics_gofplots_qqplot_2samples.py
>>> fig = qqplot_2samples(pp_x, pp_y, xlabel=None, ylabel=None, \
... line=None, ax=None)
"""
if not isinstance(data1, ProbPlot):
data1 = ProbPlot(data1)
if not isinstance(data2, ProbPlot):
data2 = ProbPlot(data2)
fig = data1.qqplot(xlabel=xlabel, ylabel=ylabel,
line=line, other=data2, ax=ax)
return fig
[docs]def qqline(ax, line, x=None, y=None, dist=None, fmt='r-'):
"""
Plot a reference line for a qqplot.
Parameters
----------
ax : matplotlib axes instance
The axes on which to plot the line
line : str {'45','r','s','q'}
Options for the reference line to which the data is compared.:
- '45' - 45-degree line
- 's' - standardized line, the expected order statistics are scaled by
the standard deviation of the given sample and have the mean
added to them
- 'r' - A regression line is fit
- 'q' - A line is fit through the quartiles.
- None - By default no reference line is added to the plot.
x : ndarray
X data for plot. Not needed if line is '45'.
y : ndarray
Y data for plot. Not needed if line is '45'.
dist : scipy.stats.distribution
A scipy.stats distribution, needed if line is 'q'.
fmt : str, optional
Line format string passed to `plot`.
Notes
-----
There is no return value. The line is plotted on the given `ax`.
Examples
--------
Import the food expenditure dataset. Plot annual food expenditure on x-axis
and household income on y-axis. Use qqline to add regression line into the
plot.
>>> import statsmodels.api as sm
>>> import numpy as np
>>> import matplotlib.pyplot as plt
>>> from statsmodels.graphics.gofplots import qqline
>>> foodexp = sm.datasets.engel.load(as_pandas=False)
>>> x = foodexp.exog
>>> y = foodexp.endog
>>> ax = plt.subplot(111)
>>> plt.scatter(x, y)
>>> ax.set_xlabel(foodexp.exog_name[0])
>>> ax.set_ylabel(foodexp.endog_name)
>>> qqline(ax, 'r', x, y)
>>> plt.show()
.. plot:: plots/graphics_gofplots_qqplot_qqline.py
"""
if line == '45':
end_pts = lzip(ax.get_xlim(), ax.get_ylim())
end_pts[0] = min(end_pts[0])
end_pts[1] = max(end_pts[1])
ax.plot(end_pts, end_pts, fmt)
ax.set_xlim(end_pts)
ax.set_ylim(end_pts)
return # does this have any side effects?
if x is None and y is None:
raise ValueError("If line is not 45, x and y cannot be None.")
elif line == 'r':
# could use ax.lines[0].get_xdata(), get_ydata(),
# but do not know axes are 'clean'
y = OLS(y, add_constant(x)).fit().fittedvalues
ax.plot(x,y,fmt)
elif line == 's':
m,b = y.std(), y.mean()
ref_line = x*m + b
ax.plot(x, ref_line, fmt)
elif line == 'q':
_check_for_ppf(dist)
q25 = stats.scoreatpercentile(y, 25)
q75 = stats.scoreatpercentile(y, 75)
theoretical_quartiles = dist.ppf([0.25, 0.75])
m = (q75 - q25) / np.diff(theoretical_quartiles)
b = q25 - m*theoretical_quartiles[0]
ax.plot(x, m*x + b, fmt)
# about 10x faster than plotting_position in sandbox and mstats
def plotting_pos(nobs, a):
"""
Generates sequence of plotting positions
Parameters
----------
nobs : int
Number of probability points to plot
a : float
Offset for the plotting position of an expected order statistic, for
example.
Returns
-------
plotting_positions : ndarray
The plotting positions
Notes
-----
The plotting positions are given by (i - a)/(nobs - 2*a + 1) for i in
range(0,nobs+1)
See Also
--------
scipy.stats.mstats.plotting_positions
"""
return (np.arange(1., nobs + 1) - a)/(nobs - 2 * a + 1)
def _fmt_probplot_axis(ax, dist, nobs):
"""
Formats a theoretical quantile axis to display the corresponding
probabilities on the quantiles' scale.
Parameteters
------------
ax : AxesSubplot, optional
The axis to be formatted
nobs : scalar
Numbero of observations in the sample
dist : scipy.stats.distribution
A scipy.stats distribution sufficiently specified to impletment its
ppf() method.
Returns
-------
There is no return value. This operates on `ax` in place
"""
_check_for_ppf(dist)
if nobs < 50:
axis_probs = np.array([1, 2, 5, 10, 20, 30, 40, 50, 60,
70, 80, 90, 95, 98, 99, ]) / 100.0
elif nobs < 500:
axis_probs = np.array([0.1, 0.2, 0.5, 1, 2, 5, 10, 20, 30, 40, 50, 60,
70, 80, 90, 95, 98, 99, 99.5, 99.8,
99.9]) / 100.0
else:
axis_probs = np.array([0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10,
20, 30, 40, 50, 60, 70, 80, 90, 95, 98, 99,
99.5, 99.8, 99.9, 99.95, 99.98, 99.99]) / 100.0
axis_qntls = dist.ppf(axis_probs)
ax.set_xticks(axis_qntls)
ax.set_xticklabels(axis_probs*100, rotation=45,
rotation_mode='anchor',
horizontalalignment='right',
verticalalignment='center')
ax.set_xlim([axis_qntls.min(), axis_qntls.max()])
def _do_plot(x, y, dist=None, line=False, ax=None, fmt='bo', **kwargs):
"""
Boiler plate plotting function for the `ppplot`, `qqplot`, and
`probplot` methods of the `ProbPlot` class
Parameteters
------------
x, y : array_like
Data to be plotted
dist : scipy.stats.distribution
A scipy.stats distribution, needed if `line` is 'q'.
line : str {'45', 's', 'r', q'} or None
Options for the reference line to which the data is compared.
ax : AxesSubplot, optional
If given, this subplot is used to plot in instead of a new figure being
created.
fmt : str, optional
matplotlib-compatible formatting string for the data markers
kwargs : keywords
These are passed to matplotlib.plot
Returns
-------
fig : Figure
The figure containing `ax`.
ax : AxesSubplot
The original axes if provided. Otherwise a new instance.
"""
fig, ax = utils.create_mpl_ax(ax)
ax.set_xmargin(0.02)
ax.plot(x, y, fmt, **kwargs)
if line:
if line not in ['r','q','45','s']:
msg = "%s option for line not understood" % line
raise ValueError(msg)
qqline(ax, line, x=x, y=y, dist=dist)
return fig, ax
def _check_for_ppf(dist):
if not hasattr(dist, 'ppf'):
raise ValueError("distribution must have a ppf method")


signal-to-noise ratio
`Prev `__
S
`Next `__
--------------
**signal-to-noise ratio**: n.
[from analog electronics] Used by hackers in a generalization of its
technical meaning. ‘Signal’ refers to useful information conveyed by
some communications medium, and ‘noise’ to anything else on that medium.
Hence a low ratio implies that it is not worth paying attention to the
medium in question. Figures for such metaphorical ratios are never
given. The term is most often applied to `*Usenet* <../U/Usenet.html>`__
newsgroups during `*flame war* <../F/flame-war.html>`__\ s. Compare
`*bandwidth* <../B/bandwidth.html>`__. See also `*coefficient of
X* <../C/coefficient-of-X.html>`__, `*lost in the
noise* <../L/lost-in-the-noise.html>`__.
--------------
+-------------------------------+----------------------------+----------------------------+
| `Prev `__ | `Up <../S.html>`__ | `Next `__ |
+-------------------------------+----------------------------+----------------------------+
| sigmonster | `Home <../index.html>`__ | silicon |
+-------------------------------+----------------------------+----------------------------+


An ini file is segmented into Sections, declared by the following syntax:
[Section Name]
i.e. the section name enclosed in square brackets, alone on a line. Sections names are allowed to contain any character but square brackets or linefeeds. Slashes (/) are also reserved for hierarchical sections (see below).
In any section are zero or more variables, declared with the following syntax:
Key = value ; comment
The key is any string (possibly containing blanks). The value is any character on the right side of the equal sign. Values can be given enclosed with quotes. If no quotes are present, the value is understood as containing all characters between the first and the last non-blank characters. The following declarations are identical:
Hello = "this is a long string value" ; comment Hello = this is a long string value ; comment
The semicolon and comment at the end of the line are optional. If there is a comment, it starts from the first character after the semicolon up to the end of the line.
Comments in an ini file are:
ar
program on your machine to build a library (.a) from a set of object (.o) files.Defaults are set for the gcc compiler and the standard ar library builder.
Type 'make', that should do it.
To use the library in your programs, add the following line on top of your module:
#include "iniparser.h"
And link your program with the iniparser library by adding -liniparser
.a to the compile line.
See the file test/initest.c for an example.
[Section] Keyword = value ; comment
is converted to the following key pair:
("section:keyword", "value")
This means that if you want to retrieve the value that was stored in the section called Pizza
, in the keyword Cheese
, you would make a request to the dictionary for "pizza:cheese"
. All section and keyword names are converted to lowercase before storage in the structure. The value side is conserved as it has been parsed, though.
Section names are also stored in the structure. They are stored using as key the section name, and a NULL associated value. They can be queried through iniparser_find_entry().
To launch the parser, simply use the function called iniparser_load(), which takes an input file name and returns a newly allocated dictionary structure. This latter object should remain opaque to the user and only accessed through the following accessor functions:
Finally, discard this structure using iniparser_freedict().
All values parsed from the ini file are stored as strings. The getint, getdouble and getboolean accessors are just converting these strings to the requested type on the fly, but you could basically perform this conversion by yourself after having called the getstr accessor.
Notice that the iniparser_getboolean() function will return an integer (0 or 1), trying to make sense of what was found in the file. Strings starting with "y", "Y", "t", "T" or "1" are considered true values (return 1), strings starting with "n", "N", "f", "F", "0" are considered false (return 0). This allows flexible handling of boolean answers.
If you want to add extra information into the structure that was not present in the ini file, you can use iniparser_setstr() to insert a string.
A section depends on another section if it contains its name as a prefix, separated by slashes (/). For example: we have 2 main sections in the ini file. The first one is called Pizza
and has two child subsections called Cheese
and Ham
. The second main section in the ini file is called Wine
and has two child subsections called Year
and Grape
. As a tree, this could appear as:
| +-- Pizza | +-- Cheese | +-- Ham +-- Wine +--- Year +--- Grape
In an ini file, that would be converted to:
[Pizza] [Pizza/Cheese] Name = Gorgonzola ; Origin = Italy ; [Pizza/Ham] Name = Parma ; Origin = Italy ; [Wine] [Wine/Year] Value = 1998 ; [Wine/Grape] Name = Cabernet Sauvignon ; Origin = Chile ;
This proposal is actually more related to the way people write ini files, more than the parser presented here. But it is certainly a useful way of making tree-like data declarations without going through painful formats like XML.
Accessing the above tree would give something like (error checking removed for clarity sake):
dictionary * d ; d = iniparser_load("example.ini"); printf("cheese name is %s\n", iniparser_getstr(d, "pizza/cheese:name")); printf("grape name is %s\n", iniparser_getstr(d, "wine/grape:name")); iniparser_freedict(d);
The whole ini file above is represented in the dictionary as the following list of pairs:
key value "pizza" NULL "pizza/cheese" NULL "pizza/cheese:name" "Gorgonzola" "pizza/cheese:origin" "Italy" "pizza/ham" NULL "pizza/ham:name" "Parma" "pizza/ham:origin" "Italy" "wine" NULL "wine/year" NULL "wine/year:value" "1998" "wine/grape" NULL "wine/grape:name" "Cabernet Sauvignon" "wine/grape:origin" "Chile"


Every zebkit UI component is fully rendered on (HTML5) Canvas. The rendering is implemented with number of special methods component abstraction provides. In most cases developers have to follow number of simple rules:
For instance:
zebkit.require("ui", "layout", function(ui, layout) {
var MyUIComponent = zebkit.Class(ui.Panel, [
function paint(g) {
// draw something with the given color
g.setColor(this.color);
g.drawLine(...);
...
},
// define "color" visual property
function setColor(c) {
this.color = c;
this.repaint(); // force the component repainting
// since its visual state has been
// updated
}
]);
...
})
Every zebkit UI component has number of predefined decorative elements that can be customized:
Or it is possible to pass something more complex (instances of "zebkit.draw.View" class) like gradient, pattern, anything what can be rendered.
* border
* Children UI components It could be a good idea to construct UI component from other UI components, since every UI component is a container that layouts its children components.
The picture below shows side view of UI component. The rectangular parts express different painted component areas:
The painting process is split to sequence of steps that are demonstrated at the picture above:
Step I Draw component background view if it has been defined for the given UI component. Background view can be clipped by border view. It happens if: border view has been specified and border view implements "outline(...)" method
Step II Draw component border view if it has been defined for the given UI component
Step III If UI component implements "update(...)" method call it to fill background with a custom content. The clipping area is set to full UI component size
Step IV If UI component implements "paint(...)" method call it to render the component "face" content. The clipping area is cut by the the component border gaps and paddings
Step V Recursively paints all children components following the sequence of steps listed above
Step VI If component implements "paintOnTop(...)" method, call it to render necessary decorative elements over component surface and its rendered children components. The clipping area is set to full UI component size
Step VII That is all ! :)
Component rendering customization is quite simple thing. Let's implement step by step al these three methods to draw gray cross on red background marked with white border:
paint(g)
Inherit the basic top level "zebra.ui.Panel" UI component class and implement "paint(g)" method that draws gray cross:
|
|
|
zebkit.require("ui", "layout", function(ui, layout) {
// inherit "zebkit.ui.Panel" and implement "paint()"
ui.PaintComponent=zebkit.Class(ui.Panel,[
function paint(g) {
g.setColor("lightGray");
g.fillRect(8,this.height/3,
this.width-16,this.height/4);
g.fillRect(this.width/3,8,
this.width/4,this.height-16);
}
]);
// create canvas and add just developed component
var c = new ui.zCanvas(150,150);
c.root.setLayout(new layout.BorderLayout());
c.root.add("center", new ui.PaintComponent());
});
update(g)
Inherit developed on previous step "PaintComponent" class and extend it with "update(g)" method that fills the component background with red color:
zebkit.require("ui", "layout", function(ui, layout) {
// extend "PaintComponent" class with "update" method
ui.UpdateComponent=zebra.Class(ui.PaintComponent,[
function update(g) {
g.setColor("red");
g.fillRect(0,0,this.width, this.height);
}
]);
// create canvas and add just developed component
var c = new ui.zCanvas(150,150);
c.root.setLayout(new layout.BorderLayout());
c.root.add("center", new ui.UpdateComponent());
});
paintOnTop(g)
Inherit developed on previous step "UpdateComponent" class and extend it with "paintOnTop(g)" method that draws white rectangle over gray cross:
zebkit.require("ui", "layout", function(ui, layout) {
// extend "UpdateComponent" class with "paintOnTop"
// method
ui.PaintOnTopComponent=zebkit.Class(ui.UpdateComponent,[
function paintOnTop(g) {
g.setColor("white");
g.lineWidth = 3;
g.rect(3,3,this.width-6, this.height-6);
g.stroke();
}
]);
// create canvas and add just developed component
var c = new ui.zCanvas(150,150);
c.root.setLayout(new layout.BorderLayout());
c.root.add("center", new ui.PaintOnTopComponent());
});


{% set user = result.user %} {% set error = result.error %} {% macro description() -%} This is an example usage of the Authomatic Python library. {% endmacro -%} {% macro providers(providers) %}
{{ description() }}
You can see the source code of this app
here.
None of your private data will be saved to any kind of persistent storage like database or session.
{{ user.content if user }}


Notice
Summary of the FE Commissioner's intervention report on Tresham College and the Apprenticeships and Skills Minister’s response.
PDF , 186KB , 10 pages
A summary of the former Further Education (FE) Commissioner Sir David Collins’ findings and recommendations following his intervention visit to Tresham College.
Apprenticeships and Skills Minister Robert Halfon’s letter to the chair of Tresham College sets out the outcome of the intervention assessment and confirms the next steps to be taken.
We produce these reports in line with our commitment to intervention in further education .
Published: 21 November 2016


Purpose
Discover the trend in businesses and customer reviews. Might be able to provide insight in future business decisions.
Visualization Breakdown
- Regions breakdown:
- Popularity of different types of businesses across different states in the US
- Idea for visualization: map of US states with different shades of same color
- US map containing 6 cities that can be clicked on
- Once click on one particular city, it will show the summary information about the region’s business
- Season breakdown:
- Popularity of different types of businesses at different seasons
- Popular categories:
- Extract the most popular categories
- Popular individual businesses:
- Extract the most popular individual businesses
- Reviews Analysis:
- Analyze the review over the time (rating vs time )
- Review distribution
- Extract most frequent words in user review data
- Comparing different shops(may be restaurants)
- Price
- Facilities
- Ratings(May use review trend)
- Photos(* Maybe?)
Tools and Technique
- D3.js: JavaScript library for visualizing data
- NodeJS: JavaScript runtime environment
- Clusterfck: JavaScript library for K-means and hierarchical clustering


Your browser does not support HTML 5 Canvas.
Text:
Text Font:
serif
sans-serif
cursive
fantasy
monospace
Text Size:
Text Color:
Font Weight:
normal
bold
bolder
lighter
StartHeight:
Speed:
slow
medium
fast


R/shade_confidence_interval.R
shade_confidence_interval.Rd
shade_confidence_interval()
plots a confidence interval region on top of
visualize()
output. The output is a ggplot2 layer that can be added with
+
. The function has a shorter alias, shade_ci()
.
Learn more in vignette("infer")
.
shade_confidence_interval(
endpoints,
color = "mediumaquamarine",
fill = "turquoise",
...
)
shade_ci(endpoints, color = "mediumaquamarine", fill = "turquoise", ...)
| endpoints | The lower and upper bounds of the interval to be plotted.
Likely, this will be the output of |
|---|---|
| color | A character or hex string specifying the color of the end points as a vertical lines on the plot. |
| fill | A character or hex string specifying the color to shade the
confidence interval. If |
| ... | Other arguments passed along to \ggplot2\ functions. |
If added to an existing infer visualization, a \ggplot2\
object displaying the supplied intervals on top of its corresponding
distribution. Otherwise, an infer_layer
list.
Other visualization functions:
shade_p_value()
# find the point estimate---mean number of hours worked per week
point_estimate <- gss %>%
specify(response = hours) %>%
calculate(stat = "mean")
# ...and a bootstrap distribution
boot_dist <- gss %>%
# ...we're interested in the number of hours worked per week
specify(response = hours) %>%
# generating data points
generate(reps = 1000, type = "bootstrap") %>%
# finding the distribution from the generated data
calculate(stat = "mean")
# find a confidence interval around the point estimate
ci <- boot_dist %>%
get_confidence_interval(point_estimate = point_estimate,
# at the 95% confidence level
level = .95,
# using the standard error method
type = "se")
# and plot it!
boot_dist %>%
visualize() +
shade_confidence_interval(ci)
# or just plot the bounds
boot_dist %>%
visualize() +
shade_confidence_interval(ci, fill = NULL)
# you can shade confidence intervals on top of
# theoretical distributions, too---the theoretical
# distribution will be recentered and rescaled to
# align with the confidence interval
sampling_dist <- gss %>%
specify(response = hours) %>%
assume(distribution = "t")
visualize(sampling_dist) +
shade_confidence_interval(ci)
# \donttest{
# to visualize distributions of coefficients for multiple
# explanatory variables, use a `fit()`-based workflow
# fit 1000 linear models with the `hours` variable permuted
null_fits <- gss %>%
specify(hours ~ age + college) %>%
hypothesize(null = "independence") %>%
generate(reps = 1000, type = "permute") %>%
fit()
null_fits
#> # A tibble: 3,000 × 3
#> # Groups: replicate [1,000]
#> replicate term estimate
#> <int> <chr> <dbl>
#> 1 1 intercept 42.1
#> 2 1 age -0.0141
#> 3 1 collegedegree -0.414
#> 4 2 intercept 37.8
#> 5 2 age 0.0809
#> 6 2 collegedegree 0.881
#> 7 3 intercept 41.8
#> 8 3 age 0.00730
#> 9 3 collegedegree -2.07
#> 10 4 intercept 41.6
#> # … with 2,990 more rows
# fit a linear model to the observed data
obs_fit <- gss %>%
specify(hours ~ age + college) %>%
fit()
obs_fit
#> # A tibble: 3 × 2
#> term estimate
#> <chr> <dbl>
#> 1 intercept 40.6
#> 2 age 0.00596
#> 3 collegedegree 1.53
# get confidence intervals for each term
conf_ints <-
get_confidence_interval(
null_fits,
point_estimate = obs_fit,
level = .95
)
# visualize distributions of coefficients
# generated under the null
visualize(null_fits)
# add a confidence interval shading layer to juxtapose
# the null fits with the observed fit for each term
visualize(null_fits) +
shade_confidence_interval(conf_ints)
# }
# more in-depth explanation of how to use the infer package
if (FALSE) {
vignette("infer")
}


Home
Configuring
Brokers
Clients
Callbacks
Monitoring
Controls
Records
Messages
Reporting
Clients
Account
Settings
Disconnect
EMIT
a supervisory & control system for networks of MQTT clients
Update your password
Reset
Submit
×


Landing Page
Special Projects
This story is part of a series of specially designed stories that represents some of the best journalism The Post has to offer. Check out the rest of the special projects here.
EMMA HOWELLS
Mitch McKay, the Athens High School Head Athletic Trainer and second year graduate student, works with an Athens High School athlete to relieve the shoulder pain and tightness they have been experiencing.
08.31.16
Amidst all the commotion of a high school wrestling match, Annabelle Herron stands calm as she observes, ready to assist if needed.
She is the sole athletic trainer for Nelsonville-York High School.
Toward the end of the wrestling meet, an athlete remains on the mat, in too much pain to stand. Herron walks onto the mat and talks to the athlete for a few minutes before helping him to his knees, and then gradually to his feet.
“I am that person making the decisions, it forces me to be confident in what I'm saying and what I've learned,” Herron, who is from Westminster, South Carolina, said.
She is a first-year graduate student who is one of 45 students in Ohio University’s graduate program for athletic training. Having a college student work as a high school athletic trainer is not uncommon in southeast Ohio.
OU students in the athletic training program are able to gain educational experience in their field while providing a service to an area that lacks medical care. In several counties throughout southeast Ohio, about 11 percent of the population that is 64 years old or younger do not have health insurance, according to 2016 County Profiles from the Ohio Development Services Agency.
Emma Howells
Annabelle Herron, a first-year graduate student in the athletic training program, stands between two teams' benches, on alert for athlete injuries during a high school wrestling meet at Nelsonville-York High School on January 25, 2017.
Forty-three of the students in the graduate program have graduate assistantships in which OU provides athletic trainers to local high schools, intercollegiate athletics and campus recreation, Chad Starkey, a professor in the School of Applied Health Sciences and Wellness, said.
"All the graduate students are licensed athletic trainers which means that technically they could go work full-time any place they want,” Starkey said.
As part of the graduate assistantship, which started in 1977, 20 high schools in the area have athletic trainers. Each high school receives one athletic trainer who is a graduate student, Starkey said.
The graduate students work for 30 hours a week total. They are paid for 20 hours a week and receive academic credit for the other 10 hours a week. The stipends range from $9,000 to $13,000 for Athens-based students, Starkey said. The graduate students are paid every two weeks, and they are paid on a ten month cycle.
The paid 20 hours per week is fixed and earns the graduate student their stipend, Starkey said. During busy weeks, a graduate student may work 35 hours in total, but OU’s program ensures that is then offset with a 25-hour week, Starkey said.
“In rare cases where a student is over-worked the program intervenes on their behalf,” Starkey said in an email.
The clinical coordinator organizes the learning environment, and makes sure students stay within the hour range, Starkey said.
When a player is injured, it is up to the athletic trainers to decide if he or she can play.
"Sometimes it's hard (and) sometimes I struggle with it,” Emily Manfresca, the athletic trainer at Trimble High School, said. “I'll look at what's wrong and talk to them, obviously, and see where they are not just physically, but mentally.”
If an athlete is injured, Manfresca will modify what he or she can do, such as shooting baskets but not sprinting in practice. Manfresca, a Steubenville native, said she sometimes notices a difference between working with high school students and college athletes.
"Sometimes it's frustrating because I have to remember that they're minors,” Manfresca, a first-year graduate student in the athletic training program, said. “Sometimes you can talk to a college athlete a little differently than you can a high school athlete."
Herron is cautious when it comes to making decisions about an athlete’s injury because she is still in her first year of graduate school, she said.
“Hopefully I'll be more decisive (in the future), but … sometimes it terrifies me knowing that I'm 23 making health care decisions for these kids,” Herron said.
She said the emergency cases are easier to treat.
“The (cases) that you think you would literally just break down and freak out about, those are the easy ones because you know your steps, you know what you're supposed to do,” Herron said.
Athens High School baseball coach Chris Stewart said the athletic trainers from OU’s athletic training program have been “absolutely phenomenal.”
“They’ve all worked well with the kids and that’s one of the things that I really enjoy watching is the relationship the kids developed with (the trainers) that are still students,” Stewart said.
Emma Howells
Mitch McKay, the Athens High School Head Athletic Trainer and second year graduate student in the athletic training program, advises a student on further treatment on January 27, 2017.
Mitchell McKay, the athletic trainer for Athens High School, knows firsthand how important his job can be.
During the homecoming football game his senior year of high school in Ogden, Utah, he sustained a concussion.
“When I got tackled it was like an electrical shock straight down my head all the way to my tailbone,” McKay, a second year graduate student in the athletic training program, said. “The next thing I remember was being in the ER, finding out it was 36 hours later."
Up until that hit, McKay said he had aspirations to play football beyond high school, but that injury changed everything.
“I sustained a severe concussion … which basically made me not want to play football in college, but I wanted to be around sports,” McKay said.
After recovering from his concussion, he started a job shadowing one of his athletic trainers.
“I really liked the idea of not being stuck in a cubicle all day, being able to be on a court or a football field,” McKay said.
A love of medicine attracts some athletic trainers to the job. Though Herron discovered that passion, she was not set on medical school.
"Being at a high school where we had an athletic trainer, it kind of bridged that gap to where it wasn't necessarily med school, but it was medicine,” Herron said. “I love the atmosphere of athletics.”
The athletic trainers at the high schools are the “primary health care providers” for athletes, Starkey said.
"Southeast Ohio is one of the most medically underserved (region) in the nation,” Starkey said. “The kids at most of these high schools would not have these types of health care without this program."
Manfresca said during her third week on the job, a mother of a student came up to her and said “I think my daughter's foot is broken. We don't have insurance. Can you look at her and tell me what you think?”
Emma Howells
Mitch McKay, the Athens High School Head Athletic Trainer and second year graduate student in the athletic training program, tells a story to students and staff in his office on January 27, 2017.
She said she has also noticed “little things” about the way athletes approach medical care.
"Even if it's (saying) something as simple as ‘go back to your doctor to get your stitches removed,’ ” Manfresca said. “They'll be like 'oh my dad will just cut them out.’ "
At Nelsonville, when Herron tells an athlete to see a doctor they usually have the opportunity to seek that care, but not all athletes in the high school have that option, she said.
"I exhaust every limit that I have until I'm out of answers,” Herron said.
Financial struggles, not having healthcare coverage or having a “rub some (dirt) on it" mentality” are some of reasons her athletes are not able to seek medical attention, Herron said.
Medical care in southeast Ohio can be scarce and is not always the best options for the athletes, Herron said. She added that sometimes athletes would have to travel to Columbus for care.
McKay said one of the most rewarding parts about being an athletic trainer is when a parent or athlete is grateful for the trainer’s service. He likes seeing a previously injured athlete fully recovered, due to treatment.
Aside from treating injured athletes, it is also the athletic trainers’ job to keep the coaches updated on the status of athletes who may not be able to play yet.
"(The coaches have) been very willing to work with me and trust my opinion,” McKay said.
Stewart said having an athletic trainer helps to calm his nerves. McKay is the fourth athletic trainer Stewart has gotten to know during his 12-year career on the baseball staff.
“One thing for me personally as a baseball coach is that it gives me extreme peace of mind knowing that there’s someone more qualified than myself or my staff to handle injuries and issues that the players are dealing with physically,” Stewart said.
Landing Page
This story is part of a series of specially designed stories that represents some of the best journalism The Post has to offer. Check out the rest of the special projects here.


Home
Twitter
Contact
Web Performance for mobile users
Overview
Comparison
Http-Archive stats
Average site weight: Data from
httpArchive
Mar 1 - 2015: Top 1000 Sites
Legende:
Images
HTML
Flash
CSS
JS
other
Total Site Size in Kilobytes: Data from
Bigquery
Legende:
10th
Median
90th


AlmaLinux Accounts
{{_("Hello %(name)s,", name=user.name)}}
{{_("To validate the email address %(address)s, click on the link below:", address=address)}}
{{_("If you did not set the email address %(address)s in your account %(username)s, you can ignore this email.", username=user.username, address=address)}}
{{_("The AlmaLinux Team")}}


Important note: If you are new to UEFI please read this 30min article to understand what’s happening: UEFI boot: how does that actually work, then?
The goal of this note is to fix the UEFI Boot Manager (located in the NVRAM) for a Debian installation, by using a Debian Live image to mount a broken system via chroot and then reinstall grub-efi. This will recreate the boot loader for grub2-efi in the EFI System Partition (as /boot/efi) and add an entry for it in the boot manager. A possible scenario to execute this workaround is when your current Linux installation dissapeared from the UEFI Boot Manager. The instructions here were executed on a Debian Jessie box.
Steps summary:
- Download Debian Live
- Burn it to an USB drive
- Fix UEFI on the USB drive
- Boot Debian Live
- Verify Debian Live was loaded with UEFI
- Review devices location and current configuration
- Mount broken system (via chroot)
- Reinstall grub-efi
- Verify configuration
- Logout from chroot and reboot
Download Debian Live
Download it from Debian Live.
Important: At this point, UEFI support exists only in Debian’s installation images. The Live images do not have support for UEFI boot.
Burn it to an USB drive
As stated in the initial recommended reading, UEFI works best with FAT32 and GPT partition table. However, Debian Live does not support it yet so any method could be chosen. However, be sure to format the USB drive as FAT32. Recommended tools:
- For Debian Linux, Ether. Note that in the instructions use the retired site pgp.mit.edu, therefore use hkp://pool.sks-keyservers.net instead.
- For Windows, Rufus. It has the advantage of clearly allow to select the Partition scheme and system type.
Fix UEFI on the USB drive
- Dowload Shell.efi from UEFI Shell.
- On the USB drive create a EFI folder and a BOOT sub folder, then copy Shell.efi to EFI\BOOT\ and rename it to Bootx64.efi.
- Using a text editor, create a file called liveboot.nsh on the root of the USB drive and paste the following into the file:
live\vmlinuz initrd=live\initrd.img append boot=live components
Boot Debian Live
Reboot the computer and hit F8 or F12 to bring the UEFI Boot Menu, and select your USB Drive. If it is shown more than one time, ensure to select the one that mentions UEFI. After UEFI Shell loads, type liveboot.nsh and press Enter.
Verify Debian Live was loaded with UEFI
When Debian Live finishes loading, verify it it was loaded with UEFI with two basic methods:
- Checking dmesg output you should see many lines related to EFI or UEFI.
$ dmesg | grep -i efi
- Check the EFI vars are correctly loaded
$ ls -l /sys/firmware/efi | grep vars
Review devices location and current configuration
- Identify the root, boot and EFI partitions from the broken system. Use fdisk -l to survey the current partition. EFI normally goes into /dev/sdX1. Mount one by one trying to identify which is the correct one. As a reference, /boot would normally look like:
$ ls -l /boot
total 21581
-rw-r--r-- 1 root root 157721 Oct 19 03:45 config-3.16.0-4-amd64
drwxr-xr-x 5 root root 1024 Apr 5 15:26 grub
-rw-r--r-- 1 root root 16023698 Dec 5 09:50 initrd.img-3.16.0-4-amd64
-rw-r--r-- 1 root root 2679264 Oct 19 03:45 System.map-3.16.0-4-amd64
-rw-r--r-- 1 root root 3126448 Oct 19 03:41 vmlinuz-3.16.0-4-amd64
Note: In the case of lvm volumes, you might need to download the lvm2 package and expose the volumes before mounting:
# apt-get install lvm2
# vgscan
# vgchange -a -y
# mount /dev/volumegroup/logicalvolume /mnt
- Download efibootmgr and review current UEFI Boot Manager configuration
# apt-get install efibootmgr
# efibootmgr -v
Mount broken system (via chroot)
Mounting another system via chroot is the usual procedure to recover broken system’s. Once the chroot comand is issues, Debian Live will treat the broken system’s “/” (root) as its own. Commands run in a chroot environment will affect the broken systems filesystems and not those of the Debian Live.
- Mount root partition (for example an lvm)
# mount /dev/volumegroup/logicalvolume /mnt
- Mount boot partition (F.e. in drive sda)
# mount /dev/sda2 /mnt/boot
- Mount the EFI System Partition (usually in /dev/sda1)
# mount /dev/sda1 /mnt/boot/efi
- Mount the critical virtual filesystems with the following single command:
# for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
- Chroot to your normal (and broken) system device
# chroot /mnt
Important: From now on your changes will affect your normal system.
Note for Raspberry Pi OS (previously called Raspbian)
Nathan sent below comment from his experience running these notes, thanks!
For Raspbian LVM (Logical Volumes) are not used. There is no need to create directories for mounting a standard install. Once the partition called Linux Filesystem is mounted in /mnt, you have the /boot/efi folders, but efi is more like a placeholder where the EFI volume is mounted. Thus:
# sudo mount /dev/mmcblk0p# /mnt (# = partition number with Linux filesystem) # sudo mount /dev/mmcblk0p# /mnt/boot/efi (# = partition number with EFI System)
Reinstall grub-efi
Download and Install grub-efi package, set the debian bootloader and create a grub config file based on your disk partitioning schema
- Install grub-efi package
# apt-get install --reinstall grub-efi
- Put the debian bootloader in /boot/efi and create an appropiate entry in the computer’s UEFI Boot Manager
# grub-install /dev/sda
- Re create a grub config file based on your disk partitioning schema
# update-grub
Verify configuration
- Bootloader exists
# file /boot/efi/EFI/debian/grubx64.efi
/boot/efi/EFI/debian/grubx64.efi: PE32+ executable (EFI application) x86-64
(stripped to external PDB), for MS Windows
- NVRAM entry was properly created
# efibootmgr -v | grep debian
Logout from chroot and reboot
Type ctrl+d or exit to quit the chroot session, and reboot.


Graph TV
Enter the name of a TV show to get metrics about it. It'll graph IMDB ratings over time, with different seasons in different colors. You can hover over the data points for additional info about each episode.
Graph
Loading...
TV show not found.
Written in JavaScript
Wanna see the code?


| 99 | (A) | Thare was a lede in oure lande while þat he lyffe hade |
| 94 | (C) | Ther was a lede in our lawe . whyle he lyf hadde |
| 95 | (D) | þer was a lord in our lande while he lyve mygħt |
| 93 | (E) | ther was a man in owre lond . while he leeue mygħt |
| (Ex) | ---- no text ---- | |
| 98 | (L) | þer was a lede in our londe while he lif hadde |
| 93 | (P) | þare was a lorde in oure lande whiles he lyf had |
| 94 | (U) | There was a leed in oure lawe / whiles he lyf hadde |
| (V) | ---- no text ---- |


Let's suppose that I want to represent a matrix of integers in C++. The best way to do that, is to use a vector of integer vectors.
First, let me introduce you to typedef. It is a way in C/C++ to rename a data type with your own name. For example, take a look at fred.cpp:
#include <iostream> using namespace std; typedef int Fred; main() { Fred i; i = 5; cout << "The Fred named i is equal to " << i << endl; } |
The typedef statement says that you can declare a variable to be of type "Fred," and that when you do it, it will be an int. Thus, when we declare "Fred i", that is the same as saying "int i":
UNIX> fred The Fred named i is equal to 5 UNIX>While Fred's aren't very useful, typedef's are extremely useful. The program vdm.cpp shows how we can use a typedef to declare a vector of integer vectors:
#include <vector> #include <iostream> #include <sstream> #include <cstdlib> #include <cstdio> using namespace std; typedef vector <int> IVec; main(int argc, char **argv) { int r, c, p, i, j, base, val; istringstream ss; vector <IVec> vdm; if (argc != 4) { cerr << "usage: vdm rows cols prime\n"; exit(1); } ss.clear(); ss.str(argv[1]); if (!(ss >> r)) { cerr << "Bad rows\n"; exit(1); } ss.clear(); ss.str(argv[2]); if (!(ss >> c)) { cerr << "Bad cols\n"; exit(1); } ss.clear(); ss.str(argv[3]); if (!(ss >> p)) { cerr << "Bad prime\n"; exit(1); } vdm.resize(r); for (i = 0; i < vdm.size(); i++) { base = i+1; val = 1; for (j = 0; j < c; j++) { vdm[i].push_back(val); val = (val * base) % p; } } for (i = 0; i < vdm.size(); i++) { for (j = 0; j < vdm[i].size(); j++) printf(" %4d", vdm[i][j]); cout << endl; } } |
This program takes three command line arguments: r, c and p. It then creates a r * c "Vandermonde" matrix over the field defined by the prime number p? What's a "field?" In this case, it is the numbers 0 through p-1, where addition, subtraction and multiplication are all modulo p. Division is defined to be the inverse of multiplication, but don't worry about it, since it doesn't really matter in this lecture.
A Vandermonde matrix is one that has the value (i+1)j in row i and column j (everything is zero-indexed). It has some very special properties concerning invertibility of submatrices, but again, we don't care too much -- we just want to create one and print it.
Take a look at how vdm is defined: vector
UNIX> vdm 1 1 101 1 UNIX> vdm 3 3 101 1 1 1 1 2 4 1 3 9 UNIX> vdm 3 5 101 1 1 1 1 1 1 2 4 8 16 1 3 9 27 81 UNIX> vdm 3 5 7 1 1 1 1 1 1 2 4 1 2 1 3 2 6 4 UNIX>You should be able to verify to yourselves that all of the above matrices are Vandermonde matrices in their given fields.
The numbers are arranged in rows, where row i has i+1 elements (as always, our lives are zero-indexed). The first and last element in each row is equal to one. Each other element is the sum of the two elements above it. Suppose we want to write a program to generate Pascal's triangle in a data structure. One easy way to do this is to generate it as a vector of integer vectors, where element i of the vector is a vector containing the elements of row i. We can visualize it below:
Scanning for a pattern, let's consider the j-th element in row i. If it is the first or last element in the row, it will equal one. Otherwise, you can see from the picture that it is equal to the sum of elements j-1 and j in row i-1. That gives us a nice way to construct the triangle. The code is in pascal.cpp:
#include <vector> #include <iostream> #include <sstream> #include <cstdlib> #include <cstdio> using namespace std; typedef vector <int> IVec; main(int argc, char **argv) { int r, i, j; istringstream ss; vector <IVec> pascal; if (argc != 2) { cerr << "usage: pascal rows\n"; exit(1); } ss.clear(); ss.str(argv[1]); if (!(ss >> r)) { cerr << "Bad rows\n"; exit(1); } pascal.resize(r); for (i = 0; i < pascal.size(); i++) { for (j = 0; j <= i; j++) { if (j == 0 || j == i) { pascal[i].push_back(1); } else { pascal[i].push_back(pascal[i-1][j-1] + pascal[i-1][j]); } } } for (i = 0; i < pascal.size(); i++) { for (j = 0; j < pascal[i].size(); j++) printf(" %4d", pascal[i][j]); cout << endl; } } |
When we run it, it's pictured a little differently than above, but you should see that it is clearly the same triangle:
UNIX> pascal 10 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1 1 7 21 35 35 21 7 1 1 8 28 56 70 56 28 8 1 1 9 36 84 126 126 84 36 9 1 UNIX>
#include <cstdio> #include <cstdlib> #include <vector> #include <iostream> using namespace std; typedef vector <double> DVec; main() { vector <DVec> v1, v2; DVec dv; int i, j; srand48(100); for (i = 0; i < 4; i++) { dv.clear(); for (j = 0; j < 5; j++) dv.push_back(drand48()*10); v1.push_back(dv); } v2 = v1; for (i = 0; i < v2.size(); i++) { for (j = 0; j < v2[i].size(); j += 2) v2[i][j] = 0; } printf("V1:\n\n"); for (i = 0; i < v1.size(); i++) { for (j = 0; j < v1[i].size(); j++) printf("%8.3lf", v1[i][j]); printf("\n"); } printf("\nV2:\n\n"); for (i = 0; i < v2.size(); i++) { for (j = 0; j < v2[i].size(); j++) printf("%8.3lf", v2[i][j]); printf("\n"); } } |
The first few lines create a vector of vectors of doubles. We can think of it as a (4 * 5) matrix of doubles. The next statement: "v2 = v1" is one that is not legal in C. It is in C++ though -- it makes a copy of v1 and puts it into v2. You can see that in the subsequent code that sets all the even indexed columns of v2 to zero, and then prints out both matrices:
UNIX> vcopy V1: 2.511 2.089 9.409 4.225 3.959 3.826 2.317 5.355 5.332 8.629 9.624 3.154 7.360 6.547 0.503 4.538 8.065 6.558 8.119 8.299 V2: 0.000 2.089 0.000 4.225 0.000 0.000 2.317 0.000 5.332 0.000 0.000 3.154 0.000 6.547 0.000 0.000 8.065 0.000 8.119 0.000 UNIX>Since v2 is a copy of v1, changing v2 does not affect v1. You'll hear me prattle on about memory a lot in this class, and this feature of C++ is in my opinion a very dangerous one, because it allows you to consume tons of memory with very simple statements. If v1 were a (1024 * 1024) matrix instead of a (4 * 5) matrix, that one statement would consume 8 MB of memory. In one operation! I bring it up because I want you to pay attention to the memory usage of your programs!
There is another large copy operation in vcopy.cpp:
for (i = 0; i < 4; i++) { dv.clear(); for (j = 0; j < 5; j++) dv.push_back(drand48()*10); v1.push_back(dv); } |
That v1.push_back(dv) call makes a copy of dv. If it didn't make a copy, all of the rows of v1 would be the same.


Renewable Energy
Home
Visualization
About
Countries
×
The selected country has no available data.
Map of Europe in 2007
Barchart of European Union in 2007
Line graph of European Union 2007-2016


{{Extend "#shared/layout"}} {{Block "header"}}{{/Block}} {{Block "content"}} Go Back To Home Page {{/Block}}


{% extends 'study/study_detail.html' %}
{% block content %}
{{ block.super }}
{% include "hawc/_delete_block.html" with name="study" notes="This will remove all data associated with this study, including study evaluations, data extractions, BMD-modeling runs, etc. It will also delete the related reference from the literature module, including searches, imports, and associated tags." confirm=True %}
{% endblock content %}


Can be used with GoPro® HERO9 and HERO10 cameras. You must include the following text on every page where it can be seen by someone purchasing such an item: "This product and/or service is not affiliated with, endorsed by or in any way associated with GoPro Inc. or its products and services. GoPro, HERO, and their respective logos are trademarks or registered trademarks of GoPro, Inc."


EBD - Easton Bible DIctionary
Worshipper
WORSHIPPER
"WORSHIPPER "(Gr. neocoros = temple-sweeper (
Acts 19:35
) of the great goddess Diana). This name neocoros appears on most of the extant Ephesian coins
"WORSHIPPER "(Gr. neocoros = temple-sweeper (Acts 19:35) of the great goddess Diana). This name neocoros appears on most of the extant Ephesian coins