CA state tax tax calculation question: based in CA but live in WA.

 I know that I need to pay CA tax as nonresident in this case but I am not clear about how much income is considered as CA taxable.   Here is my tax situation. I got a CA-based job last year, but I am still living in WA right now.  I commuted to CA every several days/weeks for work and worked at home or in the WA office. I am wondering how I should calculate my CA state tax?  Do I have to use the numbers in my W2 or should I calculate the portion of days that I worked in CA over the total working days last year? What about the sign-on bonus?  Any suggestions would be appreciated.