In[]:=
1+1
Out[]=
2
In[]:=
MinGen[X_]:=If[FreeQ[X,Around],Min[X],Min[#["Value"]&/@X]];MaxGen[X_]:=If[FreeQ[X,Around],Max[X],Max[#["Value"]&/@X]]
In[]:=
MinVal[L_,n_]:=MinGen[Transpose[L][[n]]];
In[]:=
MaxVal[L_,n_]:=MaxGen[Transpose[L][[n]]];
In[]:=
MinGen[{Around[1,0.1],Around[3,0.2]}]
Out[]=
1.
In[]:=
MinGen[{1,0.1,3,0.2}]
Out[]=
0.1
In[]:=
MyDnSample[L_,n_]:=L[[#]]&/@Range[1,Length[L],n];
In[]:=
DataWithErrors[data_,n_,bins_]:=Around[#[[1]],#[[2]]]&/@Transpose[{Mean[#],StandardDeviation[#]/Sqrt[bins]}]&/@Partition[Sort[data,#1[[n]]<#2[[n]]&],bins];
In[]:=
DataWithErrors[data_,bins_]:=Around[#[[1]],#[[2]]]&/@Transpose[{Mean[#],StandardDeviation[#]/Sqrt[bins]}]&/@Partition[data,bins];
In[]:=
DataWithWeights[data_,bins_]:={Mean[#],Sqrt[bins]/StandardDeviation[#]}&/@Partition[data,bins];
In[]:=
{dd,ww}=Transpose[DataWithWeights[Table[N[{x,Sin[Pix]}],{x,-1,1,1/1000}],100]]
Out[]=
{{{-0.9505,-0.154247},{-0.8505,-0.450732},{-0.7505,-0.703096},{-0.6505,-0.886636},{-0.5505,-0.983386},{-0.4505,-0.983876},{-0.3505,-0.888056},{-0.2505,-0.705308},{-0.1505,-0.453519},{-0.0505,-0.157337},{0.0495,0.154247},{0.1495,0.450732},{0.2495,0.703096},{0.3495,0.886636},{0.4495,0.983386},{0.5495,0.983876},{0.6495,0.888056},{0.7495,0.705308},{0.8495,0.453519},{0.9495,0.157337}},{{344.691,111.331},{344.691,123.319},{344.691,155.178},{344.691,240.772},{344.691,674.834},{344.691,687.491},{344.691,242.249},{344.691,155.665},{344.691,123.517},{344.691,111.386},{344.691,111.331},{344.691,123.319},{344.691,155.178},{344.691,240.772},{344.691,674.834},{344.691,687.491},{344.691,242.249},{344.691,155.665},{344.691,123.517},{344.691,111.386}}}
In[]:=
dd[[;;5]]
Out[]=
{{-0.9505,-0.154247},{-0.8505,-0.450732},{-0.7505,-0.703096},{-0.6505,-0.886636},{-0.5505,-0.983386}}
In[]:=
ww[[;;5]]
Out[]=
{{344.691,111.331},{344.691,123.319},{344.691,155.178},{344.691,240.772},{344.691,674.834}}
In[]:=
Around[#[[1]],#[[2]]]&/@Transpose[{{m,m,m},{s,s,s}}]
Out[]=
{m
±
s
,m±
s
,m±
s
}In[]:=
ttt=Transpose[{Table[RandomReal[],4],Table[RandomReal[],4],Table[RandomReal[],4]}]
Out[]=
{{0.264197,0.0974231,0.612537},{0.6036,0.41246,0.913453},{0.900021,0.486454,0.599607},{0.637353,0.573351,0.338789}}
In[]:=
Mean[#]&/@Partition[ttt,2]
Out[]=
{{0.433899,0.254942,0.762995},{0.768687,0.529902,0.469198}}
In[]:=
In[]:=
ttt[[;;3]]
Out[]=
{{0.264197,0.0974231,0.612537},{0.6036,0.41246,0.913453},{0.900021,0.486454,0.599607}}
In[]:=
Transpose[{{1,2},{a,b},{x,y}}]
Out[]=
{{1,a,x},{2,b,y}}
In[]:=
test=Transpose[{ttt}];
In[]:=
Dimensions[ttt]
Out[]=
{4,3}
In[]:=
test=DataWithErrors[ArrayReshape[Sort[Table[RandomReal[],256]],{64,4}],4]
Out[]=
{{0.041
±
0.011
,0.048±
0.013
,0.051±
0.013
,0.056±
0.012
},{0.105±
0.007
,0.107±
0.007
,0.111±
0.009
,0.115±
0.011
},{0.163±
0.007
,0.164±
0.007
,0.168±
0.008
,0.172±
0.007
},{0.220±
0.011
,0.223±
0.011
,0.225±
0.011
,0.231±
0.010
},{0.286±
0.014
,0.290±
0.013
,0.293±
0.013
,0.299±
0.013
},{0.356±
0.010
,0.361±
0.010
,0.364±
0.010
,0.369±
0.009
},{0.420±
0.011
,0.422±
0.012
,0.428±
0.011
,0.431±
0.011
},{0.487±
0.011
,0.495±
0.010
,0.498±
0.011
,0.501±
0.011
},{0.549±
0.008
,0.554±
0.006
,0.560±
0.010
,0.564±
0.011
},{0.615±
0.009
,0.617±
0.009
,0.619±
0.009
,0.623±
0.009
},{0.664±
0.008
,0.667±
0.008
,0.670±
0.006
,0.672±
0.006
},{0.713±
0.008
,0.716±
0.009
,0.720±
0.010
,0.723±
0.010
},{0.772±
0.010
,0.776±
0.009
,0.779±
0.009
,0.784±
0.008
},{0.826±
0.010
,0.832±
0.010
,0.836±
0.011
,0.837±
0.011
},{0.885±
0.013
,0.893±
0.013
,0.896±
0.012
,0.900±
0.013
},{0.961±
0.014
,0.965±
0.013
,0.969±
0.013
,0.975±
0.012
}}In[]:=
ListPlot[test]
Out[]=
In[]:=
In[]:=
ShowFitModel[data_,model_,Xlabel_,Ylabel_,title_,dcol_,mcol_]:=Show[ListPlot[data,PlotStyle->{dcol},PlotLegends->{"data"}],Plot[model[x],{x,MinVal[data,1],MaxVal[data,1]},PlotStyle->{mcol,Thick},PlotLegends->{N[model[Xlabel],7]},PlotRange->All],PlotLabel->title,AxesLabel->{Xlabel,Ylabel}];ShowLogFitModel[data_,model_,Xlabel_,Ylabel_,title_,dcol_,mcol_]:=Show[ListPlot[data,PlotStyle->{dcol},PlotLegends->{Ylabel}],Plot[model[x],{x,MinVal[data,1],MaxVal[data,1]},PlotStyle->{mcol,PointSize[0.5]},PlotLegends->{N[FullSimplify[Exp[model[Log[x]]]],7]},PlotRange->All],PlotLabel->title,AxesLabel->{Xlabel,Ylabel}];
In[]:=
ShowLogFitModelBin[data_,bins_,model_,Xlabel_,Ylabel_,title_,dcol_,mcol_]:=ShowLogFitModel[DataWithErrors[data,1,bins],model,Xlabel,Ylabel,title,dcol,mcol];
In[]:=
ClearAll[NumericalVector];
In[]:=
NumericalVector[{}]=False;
In[]:=
NumericVector[X_]:=And@@(NumericQ/@X);
In[]:=
NumericVector[{1,2,3}]
Out[]=
True
In[]:=
testP0=BinaryReadList[StringJoin["/Users/am10485/Downloads/ClusterDataGPU3.5e8/FDBins.pos.np"],"Real64"];
In[]:=
Length[testP0]
Out[]=
9437184
In[]:=
Length[testP0]/9
Out[]=
1048576
In[]:=
testP1=ArrayReshape[testP0,{Length[testP0]/9,9}];
In[]:=
testP1[[;;10]]
Out[]=
{{79.,-37.0511,0.00249031,-1.30961,6.65985,-30.2679,9.1074,19.6716,0.00102788},{80.,-37.0423,0.00269321,3.09146,5.65301,-25.6765,6.19809,19.6708,0.00254805},{80.,-37.0393,0.000700362,1.21001,5.71869,-29.3531,6.19273,19.6704,0.0023382},{80.,-37.0375,0.000281742,-2.95787,6.46685,-34.7171,7.08438,19.6673,0.00277539},{80.,-37.0353,0.000975252,-6.11647,3.26839,-37.6957,3.26679,19.6693,0.00422344},{80.,-37.0327,0.000759641,-0.661525,6.1476,-32.1861,7.16255,19.6665,0.00351841},{80.,-37.0292,0.000524082,5.7356,3.96352,-22.1335,5.13682,19.6681,0.00536917},{80.,-37.0271,0.000974516,-2.40324,6.40072,-32.6765,7.67925,19.665,0.00426429},{80.,-37.0251,0.000518028,3.06648,7.11045,-26.5904,7.74396,19.6624,0.00382987},{80.,-37.0234,0.000681262,-5.30434,4.76965,-37.2745,5.93136,19.6683,0.00535847}}
In[]:=
testP1[[-10;;]]
Out[]=
{{80.,-2.28946,3.79351×,4.7924,6.1661,-24.6917,5.50386,19.6592,0.00533973},{80.,-2.28946,9.6716×,5.60464,3.01512,-24.7656,2.71437,19.6593,0.00625429},{80.,-2.28946,Indeterminate,5.14831,5.37237,-25.5214,6.70366,19.6631,0.00441451},{80.,-2.28946,1.19961×,5.86272,3.73824,-24.0897,4.62344,19.6606,0.00766855},{80.,-2.28946,8.04726×,8.09272,1.09883,-23.4093,2.70498,19.658,0.00542425},{80.,-2.28946,Indeterminate,5.63448,4.76442,-24.6374,4.99622,19.6594,0.00780381},{80.,-2.28946,Indeterminate,6.71203,2.79081,-22.1278,4.17532,19.6613,0.00801127},{80.,-2.28946,1.00367×,4.83477,5.14462,-26.2079,5.40614,19.6629,0.00569355},{80.,-2.28946,Indeterminate,3.5661,6.22347,-26.0212,5.66634,19.6643,0.00721161},{80.,-2.28946,8.48255×,4.64783,5.32865,-25.6138,5.46877,19.6608,0.00672703}}
-8
10
-8
10
-7
10
-8
10
-7
10
-8
10