A sheriff may, if satisfied on the application of a senior police officer ... as to the matters mentioned in subsection (2), grant a warrant authorising any constable of the Police Service of Scotland to enter premises in the sheriffdom (if necessary using reasonable force) and to examine and search them, and the things in them, for the purpose mentioned in subsection (3).
Those matters are—
That purpose is assessing the risk of the offender committing a sexual offence.
This subsection applies to the relevant offender if he is—
A sheriff is to determine an application for a warrant under subsection (1) without hearing from the relevant offender or any other person who has an interest in the premises.
A warrant under subsection (1) does not confer power to seize anything in the premises to which it relates.
A warrant under subsection (1) must be executed at a reasonable hour.
A warrant under subsection (1) continues in force until the expiry of the period of one month beginning with the date of the warrant's grant.
A warrant under subsection (1) authorises entry on one occasion only.
This section does not prejudice any other power of entry, examination, search or seizure.
In this section—
...
"senior police officer" means a constable of the Police Service of Scotland of the rank of superintendent or above; and
"sexual offence" means—
(a)an offence within any of paragraphs 36 to 59C of Schedule 3; or
(b)any other offence in circumstances in which it would be likely that a determination such as is mentioned in paragraph 60 of that Schedule would be made in relation to the offence.