candidatsources=Import["calea catre fisier\\DataBHFilteredFluxRedshift.csv"];
Length[candidatsources]

lcand=Range[Length[candidatsources]];
bcand=Range[Length[candidatsources]];
Do[lcand[[i]]=-180+candidatsources[[i,3]],{i,Length[candidatsources]}];
Do[bcand[[i]]=candidatsources[[i,4]],{i,Length[candidatsources]}];

Max[lcand]

R=10;
rad=(Sqrt[1+Cos[bcand*Degree]*Cos[(lcand/2)*Degree]]);
x=(-2*R*Cos[bcand*Degree]*Sin[(lcand/2)*Degree])/rad;Length[x];
y=((R*Sin[bcand*Degree])/rad);
maxInterval=0.1;
(*maxInterval=2;*)
nrdeintervale=5;pasul=(maxInterval/nrdeintervale);intervalul=Table[i,{i,0.,maxInterval,pasul}]

nrdeintervale=Length[intervalul];
k=intervalul[[1]];
reprezentari=Range[nrdeintervale-1];codculoare={Black,Blue,Green,Red,Orange};
Do[deplotatcand=Flatten[Reap[
Do[If[k≤candidatsources[[j,7]]≤k+pasul,Sow[{x[[j]],y[[j]]}]],{j,Length[candidatsources]}]][[2]],1];k=k+pasul;reprezentari[[i]]=Graphics[{PointSize[0.004],codculoare[[i]],Point/@deplotatcand}],{i,Length[reprezentari]}];
reprezentari;
Show[reprezentari]
Length[deplotatcand]

b=.;l=.;R=10;
b=Range[-90,90,10];reprez1=b;
Do[rad=(Sqrt[1+Cos[b[[i]]*Degree]*Cos[(l/2)*Degree]]);reprez1[[i]]=ParametricPlot[{(-2*R*Cos[b[[i]]*Degree]*Sin[(l/2)*Degree])/rad,((R*Sin[b[[i]]*Degree])/rad)},{l,-180,180},DisplayFunction->Identity],{i,Length[b]}]
b=.;l=.;
l=Range[-180,180,10];reprez2=l;
Do[rad=(Sqrt[1+Cos[b*Degree]*Cos[(l[[i]]/2)*Degree]]);reprez2[[i]]=ParametricPlot[{(-2*R*Cos[b*Degree]*Sin[(l[[i]]/2)*Degree])/rad,((R*Sin[b*Degree])/rad)},{b,-90,90},DisplayFunction->Identity],{i,Length[l]}]

poza=Show[reprezentari,reprez1,reprez2,reprezentari,Graphics[{Text["(360^o)",{-21.0001,0},BaseStyle->{FontFamily->"Times",FontSize->16}],Text["(0^o)",{21,0},BaseStyle->{FontFamily->"Times",FontSize->16}],Text["(90^o)",{0,11},BaseStyle->{FontFamily->"Times",FontSize->16}],Text["-(90^o)",{0,-11},BaseStyle->{FontFamily->"Times",FontSize->16}]}],ImageSize->1024]

Export["calea catre fisier\\SkyPlot2micronBLSelection.pdf",poza,ImageRotated->False]