Cal. Penal Code § 1203.1i
(a) In any case in which a defendant is convicted of a violation of any building standards adopted by a local entity by ordinance or resolution, including, but not limited to, local health, fire, building, or safety ordinances or resolutions, or any other ordinance or resolution relating to the health and safety of occupants of buildings, by maintaining a substandard building, as specified in Section 17920.3 of the Health and Safety Code, the court, or judge thereof, in making an order granting probation, in addition to any other orders, may order the defendant placed under house confinement, or may order the defendant to serve both a term of imprisonment in the county jail and to be placed under house confinement.
This section only applies to violations involving a dwelling unit occupied by persons specified in subdivision (a) of Section 1940 of the Civil Code who are not excluded by subdivision (b) of that section.