BUG: Fix lombscargle ZeroDivisionError
BUG: Fix lombscargle ZeroDivisionError

Change calculation of tau to use atan2 function instead of atan.

closes gh-3787

sauliusl/scipy,woodscn/scipy,WarrenWeckesser/scipy,bkendzior/scipy,tylerjereddy/scipy,rmcgibbo/scipy,maciejkula/scipy,dominicelse/scipy,Shaswat27/scipy,FRidh/scipy,haudren/scipy,ilayn/scipy,Newman101/scipy,endolith/scipy,zaxliu/scipy,hainm/scipy,dominicelse/scipy,Eric89GXL/scipy,aman-iitj/scipy,WarrenWeckesser/scipy,aeklant/scipy,perimosocordiae/scipy,vberaudi/scipy,richardotis/scipy,sauliusl/scipy,aarchiba/scipy,zaxliu/scipy,apbard/scipy,surhudm/scipy,nmayorov/scipy,endolith/scipy,zaxliu/scipy,zaxliu/scipy,cpaulik/scipy,surhudm/scipy,newemailjdm/scipy,haudren/scipy,gfyoung/scipy,jseabold/scipy,gdooper/scipy,fernand/scipy,felipebetancur/scipy,jor-/scipy,jonycgn/scipy,sriki18/scipy,pyramania/scipy,mgaitan/scipy,argriffing/scipy,anielsen001/scipy,grlee77/scipy,anntzer/scipy,jonycgn/scipy,rgommers/scipy,fernand/scipy,mgaitan/scipy,hainm/scipy,jonycgn/scipy,futurulus/scipy,anielsen001/scipy,scipy/scipy,witcxc/scipy,argriffing/scipy,nvoron23/scipy,jakevdp/scipy,vigna/scipy,rmcgibbo/scipy,njwilson23/scipy,bkendzior/scipy,Shaswat27/scipy,fredrikw/scipy,kalvdans/scipy,dominicelse/scipy,dch312/scipy,WillieMaddox/scipy,felipebetancur/scipy,piyush0609/scipy,tylerjereddy/scipy,nonhermitian/scipy,pbrod/scipy,trankmichael/scipy,josephcslater/scipy,chatcannon/scipy,Stefan-Endres/scipy,mtrbean/scipy,jakevdp/scipy,behzadnouri/scipy,njwilson23/scipy,mortonjt/scipy,richardotis/scipy,scipy/scipy,trankmichael/scipy,raoulbq/scipy,perimosocordiae/scipy,richardotis/scipy,nvoron23/scipy,FRidh/scipy,anntzer/scipy,Srisai85/scipy,befelix/scipy,woodscn/scipy,nonhermitian/scipy,efiring/scipy,ndchorley/scipy,jakevdp/scipy,maniteja123/scipy,gertingold/scipy,arokem/scipy,rgommers/scipy,behzadnouri/scipy,pyramania/scipy,gdooper/scipy,niknow/scipy,FRidh/scipy,sriki18/scipy,jamestwebber/scipy,felipebetancur/scipy,raoulbq/scipy,njwilson23/scipy,kleskjr/scipy,woodscn/scipy,fredrikw/scipy,cpaulik/scipy,befelix/scipy,njwilson23/scipy,giorgiop/scipy,mortada/scipy,richardotis/scipy,arokem/scipy,ales-erjavec/scipy,Eric89GXL/scipy,sauliusl/scipy,raoulbq/scipy,zerothi/scipy,pyramania/scipy,gef756/scipy,jseabold/scipy,apbard/scipy,matthew-brett/scipy,arokem/scipy,person142/scipy,cpaulik/scipy,matthewalbani/scipy,anntzer/scipy,aeklant/scipy,rmcgibbo/scipy,woodscn/scipy,Kamp9/scipy,jjhelmus/scipy,vberaudi/scipy,rmcgibbo/scipy,gfyoung/scipy,raoulbq/scipy,pizzathief/scipy,mikebenfield/scipy,Dapid/scipy,minhlongdo/scipy,futurulus/scipy,fernand/scipy,vberaudi/scipy,trankmichael/scipy,vberaudi/scipy,mortonjt/scipy,jseabold/scipy,anielsen001/scipy,Newman101/scipy,fredrikw/scipy,Srisai85/scipy,matthew-brett/scipy,gef756/scipy,apbard/scipy,vanpact/scipy,aman-iitj/scipy,trankmichael/scipy,Shaswat27/scipy,mortada/scipy,josephcslater/scipy,nvoron23/scipy,ortylp/scipy,WillieMaddox/scipy,vanpact/scipy,grlee77/scipy,sonnyhu/scipy,lhilt/scipy,njwilson23/scipy,jor-/scipy,sonnyhu/scipy,jjhelmus/scipy,rgommers/scipy,mortada/scipy,zerothi/scipy,raoulbq/scipy,gef756/scipy,petebachant/scipy,mikebenfield/scipy,ortylp/scipy,nonhermitian/scipy,person142/scipy,sriki18/scipy,pnedunuri/scipy,kalvdans/scipy,kalvdans/scipy,Kamp9/scipy,kleskjr/scipy,maciejkula/scipy,kleskjr/scipy,sriki18/scipy,arokem/scipy,e-q/scipy,nmayorov/scipy,mtrbean/scipy,dominicelse/scipy,nonhermitian/scipy,mortada/scipy,kleskjr/scipy,pnedunuri/scipy,mikebenfield/scipy,ChanderG/scipy,Gillu13/scipy,maniteja123/scipy,person142/scipy,chatcannon/scipy,nmayorov/scipy,gef756/scipy,aeklant/scipy,Srisai85/scipy,nvoron23/scipy,grlee77/scipy,e-q/scipy,ndchorley/scipy,vanpact/scipy,ChanderG/scipy,WarrenWeckesser/scipy,ndchorley/scipy,niknow/scipy,hainm/scipy,hainm/scipy,kleskjr/scipy,mtrbean/scipy,bkendzior/scipy,befelix/scipy,ales-erjavec/scipy,endolith/scipy,newemailjdm/scipy,pschella/scipy,apbard/scipy,dch312/scipy,zxsted/scipy,Eric89GXL/scipy,ortylp/scipy,ilayn/scipy,grlee77/scipy,Dapid/scipy,Stefan-Endres/scipy,niknow/scipy,perimosocordiae/scipy,sauliusl/scipy,WillieMaddox/scipy,pschella/scipy,ChanderG/scipy,andyfaff/scipy,andim/scipy,befelix/scipy,mtrbean/scipy,maniteja123/scipy,haudren/scipy,ales-erjavec/scipy,ales-erjavec/scipy,larsmans/scipy,pyramania/scipy,FRidh/scipy,cpaulik/scipy,argriffing/scipy,piyush0609/scipy,matthew-brett/scipy,rmcgibbo/scipy,pbrod/scipy,vhaasteren/scipy,rmcgibbo/scipy,mdhaber/scipy,mingwpy/scipy,mikebenfield/scipy,fredrikw/scipy,Shaswat27/scipy,Gillu13/scipy,woodscn/scipy,aman-iitj/scipy,mingwpy/scipy,chatcannon/scipy,pschella/scipy,lukauskas/scipy,jjhelmus/scipy,pizzathief/scipy,trankmichael/scipy,sauliusl/scipy,jsilter/scipy,felipebetancur/scipy,zxsted/scipy,josephcslater/scipy,efiring/scipy,fernand/scipy,Gillu13/scipy,bkendzior/scipy,befelix/scipy,efiring/scipy,ChanderG/scipy,matthew-brett/scipy,pyramania/scipy,sonnyhu/scipy,pizzathief/scipy,pnedunuri/scipy,aman-iitj/scipy,maciejkula/scipy,pbrod/scipy,argriffing/scipy,jseabold/scipy,felipebetancur/scipy,mortonjt/scipy,aarchiba/scipy,jor-/scipy,efiring/scipy,Stefan-Endres/scipy,vhaasteren/scipy,anielsen001/scipy,sriki18/scipy,ndchorley/scipy,cpaulik/scipy,witcxc/scipy,woodscn/scipy,larsmans/scipy,gertingold/scipy,scipy/scipy,mgaitan/scipy,ndchorley/scipy,Kamp9/scipy,mdhaber/scipy,jamestwebber/scipy,aeklant/scipy,andyfaff/scipy,jseabold/scipy,witcxc/scipy,giorgiop/scipy,maciejkula/scipy,efiring/scipy,mingwpy/scipy,jjhelmus/scipy,endolith/scipy,jsilter/scipy,lukauskas/scipy,matthew-brett/scipy,ortylp/scipy,Dapid/scipy,andyfaff/scipy,vanpact/scipy,perimosocordiae/scipy,Newman101/scipy,WarrenWeckesser/scipy,jsilter/scipy,pizzathief/scipy,Stefan-Endres/scipy,vberaudi/scipy,ChanderG/scipy,larsmans/scipy,apbard/scipy,Kamp9/scipy,andyfaff/scipy,sonnyhu/scipy,mhogg/scipy,ilayn/scipy,minhlongdo/scipy,futurulus/scipy,dch312/scipy,ales-erjavec/scipy,minhlongdo/scipy,mortada/scipy,newemailjdm/scipy,futurulus/scipy,matthewalbani/scipy,mortada/scipy,argriffing/scipy,andim/scipy,scipy/scipy,vanpact/scipy,hainm/scipy,mhogg/scipy,andim/scipy,FRidh/scipy,minhlongdo/scipy,matthewalbani/scipy,lukauskas/scipy,futurulus/scipy,jsilter/scipy,surhudm/scipy,zaxliu/scipy,WillieMaddox/scipy,fredrikw/scipy,zerothi/scipy,mhogg/scipy,person142/scipy,cpaulik/scipy,larsmans/scipy,anntzer/scipy,zerothi/scipy,futurulus/scipy,pnedunuri/scipy,pschella/scipy,tylerjereddy/scipy,aman-iitj/scipy,mortonjt/scipy,Newman101/scipy,surhudm/scipy,dch312/scipy,mdhaber/scipy,pnedunuri/scipy,WillieMaddox/scipy,andim/scipy,mhogg/scipy,fredrikw/scipy,andim/scipy,jakevdp/scipy,Shaswat27/scipy,zerothi/scipy,surhudm/scipy,niknow/scipy,ndchorley/scipy,vhaasteren/scipy,josephcslater/scipy,mingwpy/scipy,maniteja123/scipy,pbrod/scipy,pnedunuri/scipy,vhaasteren/scipy,pbrod/scipy,pschella/scipy,piyush0609/scipy,mdhaber/scipy,mtrbean/scipy,petebachant/scipy,Dapid/scipy,WarrenWeckesser/scipy,gertingold/scipy,grlee77/scipy,vigna/scipy,Gillu13/scipy,aarchiba/scipy,andim/scipy,lhilt/scipy,richardotis/scipy,zxsted/scipy,jor-/scipy,trankmichael/scipy,WillieMaddox/scipy,jamestwebber/scipy,mhogg/scipy,minhlongdo/scipy,Kamp9/scipy,gertingold/scipy,ortylp/scipy,hainm/scipy,Gillu13/scipy,piyush0609/scipy,Dapid/scipy,zerothi/scipy,rgommers/scipy,surhudm/scipy,jamestwebber/scipy,maciejkula/scipy,gdooper/scipy,ilayn/scipy,jjhelmus/scipy,jamestwebber/scipy,bkendzior/scipy,nmayorov/scipy,vigna/scipy,Shaswat27/scipy,chatcannon/scipy,giorgiop/scipy,haudren/scipy,vigna/scipy,kalvdans/scipy,scipy/scipy,jonycgn/scipy,behzadnouri/scipy,kleskjr/scipy,aeklant/scipy,rgommers/scipy,mingwpy/scipy,vhaasteren/scipy,mgaitan/scipy,person142/scipy,mortonjt/scipy,Eric89GXL/scipy,nvoron23/scipy,josephcslater/scipy,newemailjdm/scipy,tylerjereddy/scipy,gdooper/scipy,aarchiba/scipy,lukauskas/scipy,Eric89GXL/scipy,nonhermitian/scipy,sonnyhu/scipy,Srisai85/scipy,sriki18/scipy,mhogg/scipy,Stefan-Endres/scipy,tylerjereddy/scipy,Srisai85/scipy,raoulbq/scipy,giorgiop/scipy,matthewalbani/scipy,matthewalbani/scipy,behzadnouri/scipy,anielsen001/scipy,jonycgn/scipy,Eric89GXL/scipy,endolith/scipy,chatcannon/scipy,mdhaber/scipy,mortonjt/scipy,gfyoung/scipy,niknow/scipy,mgaitan/scipy,ortylp/scipy,gef756/scipy,pizzathief/scipy,felipebetancur/scipy,andyfaff/scipy,efiring/scipy,sauliusl/scipy,scipy/scipy,andyfaff/scipy,endolith/scipy,zxsted/scipy,lhilt/scipy,e-q/scipy,giorgiop/scipy,ChanderG/scipy,Newman101/scipy,FRidh/scipy,dch312/scipy,piyush0609/scipy,lukauskas/scipy,piyush0609/scipy,ilayn/scipy,vberaudi/scipy,anielsen001/scipy,lhilt/scipy,maniteja123/scipy,Stefan-Endres/scipy,nmayorov/scipy,perimosocordiae/scipy,aarchiba/scipy,niknow/scipy,petebachant/scipy,witcxc/scipy,richardotis/scipy,petebachant/scipy,WarrenWeckesser/scipy,Srisai85/scipy,arokem/scipy,anntzer/scipy,njwilson23/scipy,newemailjdm/scipy,nvoron23/scipy,behzadnouri/scipy,lukauskas/scipy,Kamp9/scipy,Dapid/scipy,Newman101/scipy,behzadnouri/scipy,vanpact/scipy,petebachant/scipy,petebachant/scipy,jakevdp/scipy,e-q/scipy,minhlongdo/scipy,haudren/scipy,larsmans/scipy,zxsted/scipy,gef756/scipy,fernand/scipy,mdhaber/scipy,sonnyhu/scipy,maniteja123/scipy,witcxc/scipy,larsmans/scipy,gdooper/scipy,anntzer/scipy,jseabold/scipy,lhilt/scipy,jsilter/scipy,fernand/scipy,gfyoung/scipy,ales-erjavec/scipy,mgaitan/scipy,ilayn/scipy,mtrbean/scipy,mingwpy/scipy,perimosocordiae/scipy,e-q/scipy,chatcannon/scipy,haudren/scipy,zxsted/scipy,mikebenfield/scipy,vhaasteren/scipy,argriffing/scipy,Gillu13/scipy,zaxliu/scipy,newemailjdm/scipy,pbrod/scipy,jonycgn/scipy,aman-iitj/scipy,vigna/scipy,gfyoung/scipy,giorgiop/scipy,gertingold/scipy,kalvdans/scipy,jor-/scipy,dominicelse/scipy