9/18/2023 0 Comments Polar to cartesian in pythonReturns - output : 2D np.array the polar image (r, theta) r_grid : 2D np.array meshgrid of radial coordinates theta_grid : 2D np.array meshgrid of angular coordinates Notes - Adapted from: """ ny, nx = data. If ``None``, the number of angular grid points will be set to the largest dimension (the height or the width) of the image. dt : float or None angular coordinate spacing (in radians). Tests show that there is not much point in going below 0.5. dr : float radial coordinate spacing for the grid interpolation. This should be included to account for the changing pixel size that occurs during the transform. Jacobian : bool Include `r` intensity scaling in the coordinate transform. If ``None``, the geometric center of the image is used. Parameters - data : 2D np.array the image array origin : tuple or None (row, column) coordinates of the image origin. The resulting array has rows corresponding to the radial grid, and columns corresponding to the angular grid. Def reproject_image_into_polar ( data, origin = None, Jacobian = False, dr = 1, dt = None ): """ Reprojects a 2D numpy array (**data**) into a polar coordinate system, with the pole placed at **origin** and the angle measured clockwise from the upward direction.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |