Quiet Sun Model

  |   Source
In [2]:
import pymc
import numpy as np
import matplotlib.pyplot as pl
import seaborn as sn
import ipdb
%matplotlib inline
In [ ]:
def LOS_to_LV(theta, costhetaB_LOS, sinthetaB_LOS, cosphiB_LOS, sinphiB_LOS):
	costhetaB_LV = np.cos(theta) * costhetaB_LOS - np.sin(theta) * sinthetaB_LOS * cosphiB_LOS
	sinthetaB_LV = np.sqrt(1.0-costhetaB_LV**2)
	cosphiB_LV = (np.cos(theta) * sinthetaB_LOS * cosphiB_LOS + costhetaB_LOS * np.sin(theta)) / sinthetaB_LV
	sinphiB_LV = sinthetaB_LOS * sinphiB_LOS / sinthetaB_LV
	
	return costhetaB_LV, sinthetaB_LV, cosphiB_LV, sinphiB_LV

def LV_to_LOS(theta, costhetaB_LV, sinthetaB_LV, cosphiB_LV, sinphiB_LV):
	costhetaB_LOS = np.cos(theta) * costhetaB_LV + np.sin(theta) * sinthetaB_LV * cosphiB_LV
	sinthetaB_LOS = np.sqrt(1.0-costhetaB_LOS**2)
	cosphiB_LOS = (np.cos(theta) * sinthetaB_LV * cosphiB_LV - costhetaB_LV * np.sin(theta)) / sinthetaB_LOS
	sinphiB_LOS = sinthetaB_LV * sinphiB_LV / sinthetaB_LOS
	
	return costhetaB_LOS, sinthetaB_LOS, cosphiB_LOS, sinphiB_LOS
Generate some fake data.
In [ ]:
nPatches = 10
nMax = 50
nPointsPatch = nMax * np.random.rand(nPatches)
muPatch = np.random.rand(nPatches)

for i in range(nPatches):