<p>I have a FITS file, let us say file A. I have another FITS file, file B. File B has a smaller footprint than file A. I want to crop file A in shape of file B. How do I go about doing that?</p>

CC BY-SA 4.0
2023-10-12T13:21:29.073Z
Do both files have the same pixel scale?
Roy Smart
CC BY-SA 4.0
2023-10-16T06:08:54.693Z
No. They are of different pixel scales.
SlightDecoy
CC BY-SA 4.0
2023-10-16T18:37:54.217Z
I think the easiest way is to use the [reproject package](https://reproject.readthedocs.io/en/stable/#) which I showed you how to use in a [previous answer](https://astronomy.stackexchange.com/a/51772/35318) to a question you asked. Does that help?
Roy Smart
<astrophysics><astropy><fits>
Crop a FITS file in shape of another
SlightDecoy
# Crop a FITS file in shape of another

(Asked by: username_0 on 2023-10-11)

I have a FITS file, let us say file A. I have another FITS file, file B. File B has a smaller footprint than file A. I want to crop file A in shape of file B. How do I go about doing that?

**Tags:** astrophysics, astropy, fits
> **Comments:**
> **username_1**: Do both files have the same pixel scale?  
> **username_0**: No. They are of different pixel scales.  
> **username_1**: I think the easiest way is to use the [reproject package](https://reproject.readthedocs.io/en/stable/#) which I showed you how to use in a [previous answer](https://astronomy.stackexchange.com/a/51772/35318) to a question you asked. Does that help?  

---

## 0 answers

