Skip to content

Commit

Permalink
updated alpha.py
Browse files Browse the repository at this point in the history
  • Loading branch information
s0larish authored Jun 8, 2023
1 parent 03a7288 commit e8072f2
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions alpha.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import numpy as np
import astropy.units as u


# TODO: make sure these have up/solar north as the reference of 0 degrees


def radial90(shape):
'''
assumes solar north is to the left - useful for STEREO
creates radial polarization map
'''
x_size, y_size = shape
x = np.arange(-x_size // 2, x_size // 2)
y = np.arange(-y_size // 2, y_size // 2)
xx, yy = np.meshgrid(x, y)
return np.fliplr(np.rot90(np.arctan2(yy, xx), k=1))*u.radian


def radial_west(shape):
'''
assumes solar north is up
creates radial polarization map
'''
x_size, y_size = shape
x = np.arange(-x_size // 2, x_size // 2)
y = np.arange(-y_size // 2, y_size // 2)
xx, yy = np.meshgrid(x, y)
return np.flipud(np.fliplr(np.arctan2(yy, xx) + np.pi))*u.radian

def radial_north(shape):
'''
assumes solar north is up
creates radial polarization map
'''
x_size, y_size = shape
x = np.arange(-x_size // 2, x_size // 2)
y = np.arange(-y_size // 2, y_size // 2)
xx, yy = np.meshgrid(x, y)
# return np.fliplr(np.arctan2(yy, xx))*u.radian
return np.flipud(np.rot90(np.fliplr(np.arctan2(yy, xx) + np.pi), k=1))* u.radian
#

def zeros(shape):
return np.zeros(shape)


ALPHA_FUNCTIONS = {'radial_north': radial_north,
'radial_west': radial_west,
'radial90': radial90,
'zeros': zeros}

0 comments on commit e8072f2

Please sign in to comment.