def _get_nrows_ncols_step_sizes(xmap):
    """Get crystal map shape and step sizes."""
    nrows, ncols = (1, 1)
    dy, dx = xmap.dy, xmap.dx
    if xmap.ndim == 1:
        ncols = xmap.shape[0]
        dy = 1
    else:  # xmap.ndim == 2:
        nrows, ncols = xmap.shape
    return nrows, ncols, dy, dx