<p>I resolved it by creating a copy of the fits file and then using the update mode in fits.</p>
<pre><code># Create a copy of the original FITS file
shutil.copy2(original_file, copy_file)

# Open the copied FITS file in update mode
with fits.open(copy_file, mode='update') as hdul: 
</code></pre>

CC BY-SA 4.0
2024-08-26T03:59:26.610Z
2024-08-26T03:59:26.610Z
Walker
<p>I had a catalogue of sources extracted by Sextractor from the CEERS field. I selected few sources (approximately 10 (which have high snr and class_star value)) and create a fits ldac file and ran PSFEx on this new fits file I produced , But I got Segmentation fault (core dumped) error</p>
<pre><code>&gt; WARNING: This executable has been compiled using a version of the ATLAS library without support for multithreading. Performance will be degraded.

----- PSFEx 3.24.2 started on 2024-08-15 at 18:57:34 with 12 threads

----- 1 input catalogues:
Segmentation fault (core dumped)
</code></pre>
<p>when I ran PSFEx using the initial fits_ldac file I got from Sextractor , it is working and giving output.</p>
<pre><code>&gt; WARNING: This executable has been compiled using a version of the ATLAS library without support for multithreading. Performance will be degraded.

----- PSFEx 3.24.2 started on 2024-08-15 at 18:37:05 with 12 threads

----- 1 input catalogues:
catalogue.cat       :  &quot;no ident        &quot;    1 extension   11044 detections

   filename      [ext] accepted/total samp. chi2/dof FWHM ellip. resi. asym.
catalogue                    6/6       1.20   0.26   3.05  0.12  0.28  0.43
&gt; All done (in 0.0 s)
</code></pre>
<p>can somebody give me an insight of why this happens?</p>

CC BY-SA 4.0
2024-08-15T14:54:50.163Z
run it in a debugger (e.g. gdb), get a backtrace and use that to talk to the developers of the software. A segmentation fault is often indicative of faulty memory access, i.e. read or write beyond bounds (or could be caused by faulty hardware)
planetmaker
CC BY-SA 4.0
2024-08-15T19:06:22.967Z
The only obvious possibility is that there's something wrong with your new ldac fits file, something that PSFEx's file-reading or file-processing code can't handle. Since the full catalog file was processed OK, it's unlikely to be a hardware problem.
Peter Erwin
CC BY-SA 4.0
2024-08-17T10:04:01.900Z
@Walker If you solved your problem could you flesh out your solution (from your comment) and post it as an answer for future reference?
GrapefruitIsAwesome
<software>
Segmentation fault (core dumped) while runnning PSFEx
Walker
# Segmentation fault (core dumped) while runnning PSFEx

(Asked by: username_0 on 2024-08-15)

I had a catalogue of sources extracted by Sextractor from the CEERS field. I selected few sources (approximately 10 (which have high snr and class_star value)) and create a fits ldac file and ran PSFEx on this new fits file I produced , But I got Segmentation fault (core dumped) error
> WARNING: This executable has been compiled using a version of the ATLAS library without support for multithreading. Performance will be degraded.

----- PSFEx 3.24.2 started on 2024-08-15 at 18:57:34 with 12 threads

----- 1 input catalogues:
Segmentation fault (core dumped)

when I ran PSFEx using the initial fits_ldac file I got from Sextractor , it is working and giving output.
> WARNING: This executable has been compiled using a version of the ATLAS library without support for multithreading. Performance will be degraded.

----- PSFEx 3.24.2 started on 2024-08-15 at 18:37:05 with 12 threads

----- 1 input catalogues:
catalogue.cat       :  "no ident        "    1 extension   11044 detections

   filename      [ext] accepted/total samp. chi2/dof FWHM ellip. resi. asym.
catalogue                    6/6       1.20   0.26   3.05  0.12  0.28  0.43
> All done (in 0.0 s)

can somebody give me an insight of why this happens?

**Tags:** software
> **Comments:**
> **username_1**: run it in a debugger (e.g. gdb), get a backtrace and use that to talk to the developers of the software. A segmentation fault is often indicative of faulty memory access, i.e. read or write beyond bounds (or could be caused by faulty hardware)  
> **username_2**: The only obvious possibility is that there's something wrong with your new ldac fits file, something that PSFEx's file-reading or file-processing code can't handle. Since the full catalog file was processed OK, it's unlikely to be a hardware problem.  
> **username_3**: @Walker If you solved your problem could you flesh out your solution (from your comment) and post it as an answer for future reference?  

---

## 1 answers

### Answer by username_0 on 2024-08-26. Score: 3

I resolved it by creating a copy of the fits file and then using the update mode in fits.
# Create a copy of the original FITS file
shutil.copy2(original_file, copy_file)

# Open the copied FITS file in update mode
with fits.open(copy_file, mode='update') as hdul:


---

