Skip to content

Commit

Permalink
Extra help in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
zemogle committed Jan 11, 2024
1 parent a6d7826 commit cb0524e
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,34 @@ ref_image = img_list[0]
images_to_align = img_list[1:]

identifications = make_transforms(ref_image, images_to_align)
```
If you have FITS files with image data you could use the following to reproject them.

```python
aligned_images = [ref_image]
for id in identifications:
if id.ok:
alignedimg = affineremap(id.ukn.filepath, id.trans, outdir=tmpdir)
aligned_images.append(alignedimg)
```

If you have FITS files *without* image data
If you just have FITS files which contain on photometry catalogues, which have pixel coordinate values (e.g. x, y) that you want to align (ie. no image data):

```python
import pandas as pd

identifications = make_transforms(img_list[0], img_list[1:], hdu='CAT')
catalogues = []
for i, catfile in enumerate(img_list):
with fits.open(catfile) as hdul:
data = pd.DataFrame.from_records(hdul['CAT'].data)
if i != 0:
(matrix, offset) = identifications[i-1].trans.matrixform()
newcoords = np.dot(data[['x','y']], matrix) + offset
(x,y) = np.transpose(newcoords)
data.update({'x':x, 'y':y})
catalogues.append(data)
```

## About

Expand Down

0 comments on commit cb0524e

Please sign in to comment.