<p>Yes! I can do it for K2 and I'm guessing it should be similar.</p>
<p>You can see with <code>fits.info(fits_file)</code> that it has the 84 extensions (21 modules * 4 channels per module) you mention.</p>
<p>Then you can select a channel, e.g. 65, and prepare also the wcs coordinates so you get the RA and dec associated with the image for the axis.</p>
<pre><code>n = 65

with fits.open(fits_file, mode = &quot;readonly&quot;) as hdulist:
    wcs_info = WCS(hdulist[n].header)
    cal_image = hdulist[n].data
    header = hdulist[n].header 
</code></pre>
<p>Then you can just plot:</p>
<pre><code>plt.figure(figsize = (15,15))

fig = plt.figure(figsize=(12, 8))
ax = fig.add_subplot(1, 1, 1, projection=wcs_info)
im = ax.imshow(cal_image, vmin = np.percentile(cal_image,1),vmax = np.percentile(cal_image, 98), origin='lower')

ax.coords[0].set_ticklabel_position('l')
ax.coords[0].grid(color='white', ls='dotted')
ax.set_ylabel('Dec')
ax.coords[1].set_ticklabel_position('b')
ax.coords[1].grid(color='white', ls='dotted')
ax.set_xlabel('RA');
</code></pre>

CC BY-SA 4.0
2021-03-17T18:54:48.557Z
2021-03-17T18:54:48.557Z
T. Silva
<p>I have downloaded the calibrated ffi(full field image) for the Kepler field, aside from the primary HDU which contains the metadata, they contain 84 channels, each in the form of an image HDU, representing a small part of the field - I want to plot the full field in astropy, how would I go about it?</p>
<p>The Kepler ffi file can be found in the link below</p>
<p><a href="https://archive.stsci.edu/missions/kepler/ffi/kplr2013098115308_ffi-cal.fits" rel="nofollow noreferrer">https://archive.stsci.edu/missions/kepler/ffi/kplr2013098115308_ffi-cal.fits</a></p>

<kepler><astropy>
Plotting The Kepler Field Full View
user38489
# Plotting The Kepler Field Full View

(Asked by: username_0 on 2021-03-15)

I have downloaded the calibrated ffi(full field image) for the Kepler field, aside from the primary HDU which contains the metadata, they contain 84 channels, each in the form of an image HDU, representing a small part of the field - I want to plot the full field in astropy, how would I go about it?

The Kepler ffi file can be found in the link below

<https://archive.stsci.edu/missions/kepler/ffi/kplr2013098115308_ffi-cal.fits>

**Tags:** kepler, astropy


---

## 1 answers

### Answer by username_1 on 2021-03-17. Score: 1

Yes! I can do it for K2 and I'm guessing it should be similar.

You can see with `fits.info(fits_file)` that it has the 84 extensions (21 modules \* 4 channels per module) you mention.

Then you can select a channel, e.g. 65, and prepare also the wcs coordinates so you get the RA and dec associated with the image for the axis.

```
n = 65

with fits.open(fits_file, mode = "readonly") as hdulist:
    wcs_info = WCS(hdulist[n].header)
    cal_image = hdulist[n].data
    header = hdulist[n].header 

```

Then you can just plot:

```
plt.figure(figsize = (15,15))

fig = plt.figure(figsize=(12, 8))
ax = fig.add_subplot(1, 1, 1, projection=wcs_info)
im = ax.imshow(cal_image, vmin = np.percentile(cal_image,1),vmax = np.percentile(cal_image, 98), origin='lower')

ax.coords[0].set_ticklabel_position('l')
ax.coords[0].grid(color='white', ls='dotted')
ax.set_ylabel('Dec')
ax.coords[1].set_ticklabel_position('b')
ax.coords[1].grid(color='white', ls='dotted')
ax.set_xlabel('RA');

```


---

