If the double taxation treaty between Spain and your country of residence says otherwise, the treaty prevails over these rates. The usual IRNR self-assessment form is Modelo 210.
Rather have this calculated for you?
kontora generates your tax forms box by box, tells you how much to set aside and reminds you before every deadline.