def table8_X2Mg(): species = [ 'He/Mg', 'C/Mg', 'N/Mg', 'O/Mg', 'Si/Mg', 'S/Mg', 'Fe/Mg', 'Ne/Mg' ] ISSpecies = [ he2mgmedO3, c2mgmedO3, n2mgmedO3, o2mgmedO3, si2mgmedO3, s2mgmedO3, fe2mgmedO3, ne2mgmedO3 ] CHSpecies = [ he2mgmedO2, c2mgmedO2, n2mgmedO2, o2mgmedO2, si2mgmedO2, s2mgmedO2, fe2mgmedO2, ne2mgmedO2 ] ISSpeed = [ hespeedmg3, cspeedmg3, nspeedmg3, ospeedmg3, sispeedmg3, sspeedmg3, fespeedmg3, nespeedmg3 ] CHSpeed = [ hespeedmg2, cspeedmg2, nspeedmg2, ospeedmg2, sispeedmg2, sspeedmg2, fespeedmg2, nespeedmg2 ] print np.dtype(hespeedmg3) for spec, IS, CH, speedis, speedch in zip(species, ISSpecies, CHSpecies, ISSpeed, CHSpeed): print np.dtype(speedis) print speedch interstream = (IS[np.where((speedis >= 425.0) & (speedis <= 575.0))]) coronalHole = (CH[np.where((speedch >= 425.0) & (speedch <= 575.0))]) print IS print CH ISMean = pR.geoMean(interstream) CHMean = pR.geoMean(coronalHole) isErrorHigh, N1 = pR.ErrorHigh(interstream) isErrorLow = pR.ErrorLow(interstream) chErrorHigh, N2 = pR.ErrorHigh(coronalHole) chErrorLow = pR.ErrorLow(coronalHole) N = (N1 + N2) / 2 highFracUncert = pR.fracUncert(isErrorHigh, chErrorHigh, ISMean, CHMean, N) lowFracUncert = pR.fracUncert(isErrorLow, chErrorLow, ISMean, CHMean, N) highuncert = highFracUncert lowuncert = lowFracUncert IS2CH = pR.geoMean(interstream) / pR.geoMean(coronalHole) print spec + '\t' + str(np.round(IS2CH, 3)) + '\t' + '+' + str( np.round(highuncert, 5)) + '/' + '-' + str(np.round(lowuncert, 5))
def table7_X2H(): species = ['He/H', 'C/H', 'N/H', 'Mg/H', 'Si/H', 'S/H', 'Fe/H', 'Ne/H'] ISSpecies = [ he2hmed3, c2hmed3, n2hmed3, mg2hmed3, si2hmed3, s2hmed3, fe2hmed3, ne2hmed3 ] CHSpecies = [ he2hmed2, c2hmed2, n2hmed2, mg2hmed2, si2hmed2, s2hmed2, fe2hmed2, ne2hmed2 ] CMESpecies = [ he2hmed1, c2hmed1, n2hmed1, mg2hmed1, si2hmed1, s2hmed1, fe2hmed1, ne2hmed1 ] BulkSpecies = [ he2hmed0, c2hmed0, n2hmed0, mg2hmed0, si2hmed0, s2hmed0, fe2hmed0, ne2hmed0 ] #photoSpecAbund = [0.0851,0.0002692,0.00006761,0.0000398,0.0000324,0.00001318,0.000031623,0.0000851] photoSpecUncrt = [ 0.00196, 0.0000311, 0.0000078, 0.00000367, 0.0000224, 0.000000911, 0.00000292, 0.0000198 ] for name, IS, CH, CME, Bulk, PhotAbund, PhotUncrt in zip( species, ISSpecies, CHSpecies, CMESpecies, BulkSpecies, PhotoAbundH.values(), photoSpecUncrt): ISMean = pR.geoMean(IS) ISErrHigh, N1 = pR.ErrorHigh(IS) CHMean = pR.geoMean(CH) CHErrHigh, N2 = pR.ErrorHigh(CH) ISErrLow = pR.ErrorLow(IS) CHErrLow = pR.ErrorLow(CH) N = (N1 + N2) / 2 CMEMean = pR.geoMean(CME) CMEstdD, _ = pR.Error(CME) BulkMean = pR.geoMean(Bulk) BulkstdD, _ = pR.Error(Bulk) highFracUncert = pR.fracUncert(ISErrHigh, CHErrHigh, ISMean, CHMean, N) lowFracUncert = pR.fracUncert(ISErrLow, CHErrLow, ISMean, CHMean, N) highuncert = highFracUncert lowuncert = lowFracUncert photMean = PhotAbund photstdD = PhotUncrt print (name + '\t' + str(np.round(ISMean,3)) + '\t' + str(np.round(CHMean,3)) + '\t' + str(np.round(CMEMean,3)) + '\t'\ + str(np.round(BulkMean,3)) + '\t' + str(np.round(ISMean/CHMean,3)) + '(' + '+' + str(np.round(highuncert,5)) + '/' + '-' + str(np.round(lowuncert,5)) + ')'\ + '\t' + str(photMean) + '(' + str(photstdD) + ')')
def table8_X2O(): species = [ 'He/O', 'C/O', 'N/O', 'Mg/O', 'Si/O', 'S/O', 'Fe/O', 'Ne/O', 'C6/C5', 'O7/O6', 'Frac' ] ISSpecies = [ he2omedO3, c2omedO3, n2omedO3, mg2omedO3, si2omedO3, s2omedO3, fe2omedO3, ne2omedO3, c56med3, o76med3, fracmed3 ] CHSpecies = [ he2omedO2, c2omedO2, n2omedO2, mg2omedO2, si2omedO2, s2omedO2, fe2omedO2, ne2omedO2, c56med2, o76med2, fracmed2 ] ISSpeed = [ hespeed3, cspeed3, nspeed3, mgspeed3, sispeed3, sspeed3, fespeed3, nespeed3, c56speed3, o76speed3, fracspeed3 ] CHSpeed = [ hespeed2, cspeed2, nspeed2, mgspeed2, sispeed2, sspeed2, fespeed2, nespeed2, c56speed2, o76speed2, fracspeed2 ] for spec, IS, CH, speedis, speedch in zip(species, ISSpecies, CHSpecies, ISSpeed, CHSpeed): interstream = (IS[np.where((speedis >= 425.0) & (speedis <= 575.0))]) coronalHole = (CH[np.where((speedch >= 425.0) & (speedch <= 575.0))]) ISMean = pR.geoMean(interstream) CHMean = pR.geoMean(coronalHole) isErrorHigh, N1 = pR.ErrorHigh(interstream) isErrorLow = pR.ErrorLow(interstream) chErrorHigh, N2 = pR.ErrorHigh(coronalHole) chErrorLow = pR.ErrorLow(coronalHole) N = (N1 + N2) / 2 highFracUncert = pR.fracUncert(isErrorHigh, chErrorHigh, ISMean, CHMean, N) lowFracUncert = pR.fracUncert(isErrorLow, chErrorLow, ISMean, CHMean, N) highuncert = highFracUncert lowuncert = lowFracUncert IS2CH = pR.geoMean(interstream) / pR.geoMean(coronalHole) print spec + '\t' + str(np.round(IS2CH, 3)) + '\t' + '+' + str( np.round(highuncert, 5)) + '/' + '-' + str(np.round(lowuncert, 5))
def table7_X2Mg(): species = [ 'He/Mg', 'C/Mg', 'N/Mg', 'O/Mg', 'Si/Mg', 'S/Mg', 'Fe/Mg', 'Ne/Mg' ] ISSpecies = [ he2mgmedO3, c2mgmedO3, n2mgmedO3, o2mgmedO3, si2mgmedO3, s2mgmedO3, fe2mgmedO3, ne2mgmedO3 ] CHSpecies = [ he2mgmedO2, c2mgmedO2, n2mgmedO2, o2mgmedO2, si2mgmedO2, s2mgmedO2, fe2mgmedO2, ne2mgmedO2 ] CMESpecies = [ he2mgmedO1, c2mgmedO1, n2mgmedO1, o2mgmedO1, si2mgmedO1, s2mgmedO1, fe2mgmedO1, ne2mgmedO1 ] BulkSpecies = [ he2mgmedO0, c2mgmedO0, n2mgmedO0, o2mgmedO0, si2mgmedO0, s2mgmedO0, fe2mgmedO0, ne2mgmedO0 ] PhotoAbundMg = { 'he2mg': 2140.0, 'c2mg': 6.76, 'n2mg': 1.7, 'ne2mg': 2.14, 'mg2mg': 1.0, 'si2mg': 0.813, 's2mg': 0.331, 'fe2mg': 0.794 } photoSpecUncrt = [49.2, 0.780, 0.196, 1.42, 0.0562, 0.0229, 0.0733, 0.497] for name, IS, CH, CME, Bulk, PhotAbund, PhotUncrt in zip( species, ISSpecies, CHSpecies, CMESpecies, BulkSpecies, PhotoAbundMg.values(), photoSpecUncrt): ISMean = pR.geoMean(IS) ISErrHigh, N1 = pR.ErrorHigh(IS) CHMean = pR.geoMean(CH) CHErrHigh, N2 = pR.ErrorHigh(CH) ISErrLow = pR.ErrorLow(IS) CHErrLow = pR.ErrorLow(CH) N = (N1 + N2) / 2 CMEMean = pR.geoMean(CME) CMEstdD, _ = pR.Error(CME) BulkMean = pR.geoMean(Bulk) BulkstdD, _ = pR.Error(Bulk) highFracUncert = pR.fracUncert(ISErrHigh, CHErrHigh, ISMean, CHMean, N) lowFracUncert = pR.fracUncert(ISErrLow, CHErrLow, ISMean, CHMean, N) highuncert = highFracUncert lowuncert = lowFracUncert photMean = PhotAbund photstdD = PhotUncrt print (name + '\t' + str(np.round(ISMean,3)) + '\t' + str(np.round(CHMean,3)) + '\t' + str(np.round(CMEMean,3)) + '\t'\ + str(np.round(BulkMean,3)) + '\t' + str(np.round(ISMean/CHMean,3)) + '(' + '+' + str(np.round(highuncert,5)) + '/' + '-' + str(np.round(lowuncert,5)) + ')'\ + '\t' + str(photMean) + '(' + str(photstdD) + ')')
def table7_X2O(): species = [ 'He/O', 'C/O', 'N/O', 'Mg/O', 'Si/O', 'S/O', 'Fe/O', 'Ne/O', 'C6/C5', 'O7/O6', 'Frac' ] ISSpecies = [ he2omedO3, c2omedO3, n2omedO3, mg2omedO3, si2omedO3, s2omedO3, fe2omedO3, ne2omedO3, c56med3, o76med3, fracmed3 ] CHSpecies = [ he2omedO2, c2omedO2, n2omedO2, mg2omedO2, si2omedO2, s2omedO2, fe2omedO2, ne2omedO2, c56med2, o76med2, fracmed2 ] CMESpecies = [ he2omedO1, c2omedO1, n2omedO1, mg2omedO1, si2omedO1, s2omedO1, fe2omedO1, ne2omedO1, c56med1, o76med1, fracmed1 ] BulkSpecies = [ he2omedO0, c2omedO0, n2omedO0, mg2omedO0, si2omedO0, s2omedO0, fe2omedO0, ne2omedO0, c56med0, o76med0, fracmed0 ] PhotoAbundO = [ 174.0, 0.550, 0.138, 0.174, 0.0813, 0.0661, 0.0269, 0.0646, '-', '-', '-' ] photoSpecUncrt = [ 4.0, 0.0634, 0.0159, 0.0075, 0.00457, 0.00186, 0.00596, 0.0404, '--', '--', '--' ] for name, IS, CH, CME, Bulk, PhotAbund, PhotUncrt in zip( species, ISSpecies, CHSpecies, CMESpecies, BulkSpecies, PhotoAbundO, photoSpecUncrt): ISMean = pR.geoMean(IS) ISErrHigh, N1 = pR.ErrorHigh(IS) CHMean = pR.geoMean(CH) CHErrHigh, N2 = pR.ErrorHigh(CH) ISErrLow = pR.ErrorLow(IS) CHErrLow = pR.ErrorLow(CH) N = (N1 + N2) / 2 CMEMean = pR.geoMean(CME) #CMEstdD,_ = pR.stdDev(CME) BulkMean = pR.geoMean(Bulk) #BulkstdD,_ = pR.stdDev(Bulk) highFracUncert = pR.fracUncert(ISErrHigh, CHErrHigh, ISMean, CHMean, N) lowFracUncert = pR.fracUncert(ISErrLow, CHErrLow, ISMean, CHMean, N) highuncert = highFracUncert lowuncert = lowFracUncert #errorInMean = uncert/np.sqrt(N) photMean = PhotAbund photstdD = PhotUncrt print (name + '\t' + str(np.round(ISMean,3)) + '\t' + str(np.round(CHMean,3)) + '\t' + str(np.round(CMEMean,3)) + '\t'\ + str(np.round(BulkMean,3)) + '\t' + str(np.round(ISMean/CHMean,3)) + '(' + '+' + str(np.round(highuncert,5)) + '/' + '-' + str(np.round(lowuncert,5)) + ')'\ + '\t' + str(photMean) + '(' + str(photstdD) + ')')
def histWRanges(flagnum, fluence, dataLim, speed=np.arange(200, 1825, 25)): '''returns the minimum, average, and maximum variances of fluence ratios per speed bin (200km/s - 800km/s) INPUTS: speed - wind speed array to select ranges of data against. flagnum - regime number for species (1:CME, 2:CH, 3:IS, 0:bulk) fluence - name of species dataLim - scalar limit for purity of data ranges to be analyzed ''' lower = [] upper = [] ratiomean = [] xspeed = [] if fluence == 'mg2o': for i in range(1, len(speed)): ind = np.where((regime['v_p'] >= speed[i - 1] - 12.5) & (regime['v_p'] <= speed[i] - 12.5) & (regime['flag'] == flagnum) & (regime['v_p'] != np.inf)) var = np.array(sorted(abundn[ind]['mg2o'])) var = 1.0 / var if (np.size(var) != 0) & (len(var) >= dataLim): xspeed.append(np.average(regime['v_p'][ind])) try: upp = fracs([var[int(len(var) * 0.90)]], name=None) low = fracs([var[int(len(var) * 0.10)]], name=None) med = pR.geoMean(fracs(var, name=fluence)) lower.append(med - low) upper.append(upp - med) ratiomean.append(pR.geoMean(fracs(var, name=fluence))) # xspeed.append(np.average(regime['v_p'][np.where()])) except ValueError: pass elif fluence == 'o76': for i in range(1, len(speed)): ind = np.where((regime['v_p'] >= speed[i - 1] - 12.5) & (regime['v_p'] <= speed[i] - 12.5) & (regime['flag'] == flagnum)) var = sorted(abundn[ind][fluence]) #xspeed = sorted() if (np.size(var) != 0) & (len(var) >= dataLim): xspeed.append(np.average(regime['v_p'][ind])) try: upp = fracs([var[int(len(var) * 0.90)]], name=None) low = fracs([var[int(len(var) * 0.10)]], name=None) med = pR.geoMean(fracs(var, name=fluence)) lower.append(med - low) upper.append(upp - med) ratiomean.append(pR.geoMean(fracs(var, name=fluence))) # xspeed.append(np.average(regime['v_p'][np.where()])) except ValueError: pass else: for i in range(1, len(speed)): ind = np.where((regime['v_p'] >= speed[i - 1] - 12.5) & (regime['v_p'] <= speed[i] - 12.5) & (regime['flag'] == flagnum)) var = sorted(abundn[ind][fluence] / abundn[ind]['mg2o']) #xspeed = sorted() if (np.size(var) != 0) & (len(var) >= dataLim): xspeed.append(np.average(regime['v_p'][ind])) try: upp = fracs([var[int(len(var) * 0.90)]], name=None) low = fracs([var[int(len(var) * 0.10)]], name=None) med = pR.geoMean(fracs(var, name=fluence)) lower.append(med - low) upper.append(upp - med) ratiomean.append(pR.geoMean(fracs(var, name=fluence))) # xspeed.append(np.average(regime['v_p'][np.where()])) except ValueError: pass return lower, upper, ratiomean, np.array(xspeed)