## AstroPy - findlimb.py

Description

This program looks for the bright limb of a planet in the rows of a raw image. It depends upon the saturated crescent having negative values. This program is used in the alignment programs which follow.

Usage

```findlimb.py fits-file [thresh dir interval0 interval1 min_count]

'thresh' is the fraction (0.0 to 1.0) of the row max that a peak must be.
Default = 0.75.

'dir' is the orientation of the bright limb. 0 = sun to the right, 1 = sun to the left.
Default = 0.

'interval0' is the number of pixels to the left of each peak.
'interval1' is the number of pixels to the right of each peak.
Default = [50, 5].

'min_count' is the minimum number of negative values which must be in the crescent side of the peak.
Default = 5.
```

The program looks for peaks in each interval = [peak-interval0, peak+interval1] that are >= thresh * row.max(), and such that there are no negative values in the sun side of the interval, and >= min_count negatives in the planet (crescent) side. The program contains a function which can be called from other programs:

```findLimbInRow(row, thresh=0.75, dir=0, interval=(50, 5), minCount=5)
row is a 1d numpy array.
```

Examples

This program works reasonably well on most raw images having the sun on either side:

```> findlimb.py 090807/raw/im1648.a.fits 0.75 1 5 50 5
Row   0: []
Row  32: []
Row  64: []
Row  96: []
Row 128: 
Row 160: 
Row 192: 
Row 224: 
Row 256: 
Row 288: 
Row 320: 
Row 352: 
Row 384: 
Row 416: 
Row 448: []
Row 480: []
``` To use on an image with the other orientation (sun at right), set dir = 0 and reverse the values of interval0 and interval1 (or use the default values):

```> findlimb.py 072407/raw/im0215.a.fits 0.75 0 50 5 5
Row   0: []
Row  32: []
Row  64: []
Row  96: 
Row 128: 
Row 160: 
Row 192: 
Row 224: 
Row 256: 
Row 288: 
Row 320: 
Row 352: 
Row 384: []
Row 416: []
Row 448: []
Row 480: []
``` 