;PURPOSE
;
;To make a 2-d radial profile of a star
pro plot_radial_star, image, Radii, Int, RjctOut=RjctOut

If N_Elements(RjctOut) eq 0 then RjctOut = 0

;Set up the coordinates to handle
Naxis1 = (Size(Image))[1] & Naxis2 = (Size(Image))[2]
RelXCoords = Indgen(Naxis1,Naxis2) mod Naxis1
RelXCoords = RelXCoords - Mean(RelXCoords)
RelYCoords = reverse(Indgen(Naxis1,Naxis2),2) / Naxis1
RelYCoords = RelYCoords - Mean(RelYCoords)
RsqCoords  = RelXCoords^2+RelYCoords^2
RadMax     = max(sqrt(RsqCoords))
Radii=[0] & Int = [0]

For Rad = 0, RadMax-1 do begin
    RelPixInRad = where(sqrt(RsqCoords) ge Rad $
                        and sqrt(RsqCoords) lt Rad+1)
    ThisRad = RsqCoords(RelPixInRad) 
    ThisInt = Image(RelPixInRad)
    If RjctOut and Rad gt 0 then begin
       Djs_Iterstat, ThisInt, mask = ImMask
       ThisRad = ThisRad(where(ImMask eq 1))
       ThisInt = ThisInt(where(ImMask eq 1))
    EndIf
    Radii = [Radii, ThisRad]
    Int   = [Int, ThisInt]

EndFor

End
