(*Read Data from File*)
dateBH=Import["C:\\Users\\Laurentiu\\Google Drive\\Proiecte\\FractalSky\\2micron\\2RedshiftLimit\\BHCatalog\\DataBHFilteredFluxRedshiftNew.csv"];
Length[dateBH]
BminusV=Flatten[Reap[Do[If[dateBH[[i,22]]>0,Sow[dateBH[[i,22]]]],{i,Length[dateBH]}]][[2]],1];
FIRoverRation=Flatten[Reap[Do[If[dateBH[[i,23]]>0,Sow[dateBH[[i,23]]]],{i,Length[dateBH]}]][[2]],1];
Length[FIRoverRation]
FIR=Flatten[Reap[Do[If[dateBH[[i,20]]>0&&dateBH[[i,21]]>0,Sow[dateBH[[i,20]]]],{i,Length[dateBH]}]][[2]],1];
Radio=Flatten[Reap[Do[If[dateBH[[i,21]]>0&&dateBH[[i,20]]>0,Sow[dateBH[[i,21]]]],{i,Length[dateBH]}]][[2]],1];

(*Read Data from File*)
α×(a^β)
deExportat=Histogram[BminusV,Frame->True, PlotRange->All,FrameLabel->{"B-V", "N"},FrameStyle->Directive[Black,FontFamily->"Times",FontSize->30],FrameTicksStyle->Thick]
Export["C:\\Users\\Laurentiu\\Google Drive\\Proiecte\\FractalSky\\2micron\\2RedshiftLimit\\BHCatalog\\\\BminusVDistribution.pdf",deExportat];

N[Log[10,300]]

(*Read Data from File*)
deExportat=Histogram[Log[10,FIRoverRation],Frame->True, PlotRange->All,FrameLabel->{"Log FIR/Radio", "N"},FrameStyle->Directive[Black,FontFamily->"Times",FontSize->30],FrameTicksStyle->Thick]
Export["C:\\Users\\Laurentiu\\Google Drive\\Proiecte\\FractalSky\\2micron\\2RedshiftLimit\\BHCatalog\\\\FIRoverRadionistribution.pdf",deExportat];

(*------------ Log N Log z -------------*)
intervalNr=10;
numarSelectieCompleta=Range[intervalNr];numar=numarSelectieCompleta;
minInterval=Log[10,Min[redshiftDistribution]]
maxInterval=Log[10,Max[redshiftDistribution]]
flux=Drop[Table[(10^i),{i,minInterval,maxInterval,((maxInterval-minInterval)/intervalNr)}],1]
Do[numarSelectieCompleta[[i]]=Flatten[Reap[Do[If[dateBH[[j,7]]≥flux[[i]],Sow[dateBH[[j]]]],{j,Length[dateBH]}]][[2]],1],{i,Length[flux]}];
Do[numar[[i]]=Length[numarSelectieCompleta[[i]]],{i,Length[numar]}]
numar

(*------------ Log N Log S -------------*)
datele=Transpose[{flux,numar}]
La2microni=ListPlot[datele,Frame->True, PlotRange->All,FrameLabel->{"(Subscript[S, 2  μm])(Jy)", "N"},PlotStyle->{PointSize[0.01],RGBColor[0,0,0]}]

(*------------ Select down to 0.03 Jy and redshift 2 -------------*)
dateBHSelected=Flatten[Reap[Do[If[dateBH[[i,14]]>0.03&&dateBH[[i,7]]<2,Sow[dateBH[[i]]]],{i,Length[dateBH]}]][[2]],1];
Length[dateBHSelected]

(*------------ SRedshift vs Log Mass -------------*)
datele=Transpose[{redshiftDistribution,Log[10,massDistribution]}];
redshiftVSMassBH=ListPlot[datele,Frame->True, PlotRange->All,FrameLabel->{"redshift", "Log M [(Subscript[M, ⊙])]"},PlotStyle->{PointSize[0.004],RGBColor[0,0.5,1]},FrameStyle->Directive[Black,FontFamily->"Times",FontSize->20],FrameTicksStyle->Thick]