Trouble with threshold on my fits using jupyter notebook

Solution for Trouble with threshold on my fits using jupyter notebook
is Given Below:

Hello I am trying to threshold detect my Fit file however when I run it my kernel dies. I debug it and stop my kernel to see where is get stuck. and it usually the second line of my code. I am trying todo something similar to this: https://photutils.readthedocs.io/en/latest/segmentation.html

from photutils.segmentation import detect_threshold
threshold = photutils.detect_threshold(image_data1, 2.5)
npixels = 10  # minimum number of connected pixels
kernel_sigma = 3.0 / (2.0 * np.sqrt(2.0 * np.log(2.0)))  # FWHM = 3
kernel = Gaussian2DKernel(kernel_sigma, x_size=3, y_size=3)
kernel.normalize()
segm = photutils.detect_sources(image_data1, threshold, npixels, 
filter_kernel=kernel)

My fits file is 24000×24000 pixels Could it be that it too much and threshold is not detecting or is my sigma value wrong? image_data1 is how it reading my fits file. any advice?