The following procedures shall be observed in compliance with a legal removal order wherein a prisoner is taken from the jail or other place of confinement to another specified place for a specified reason.
Section 4004 of the Penal Code states that a prisoner committed to the county jail for examination or upon conviction for a public offense, must be confined in the jail until he is legally discharged. During the pendency of a criminal proceeding, the superior court, municipal court, or a justice court, before which said proceeding is pending, may make a legal order, for good cause, for the removal in the custody of the Sheriff. After conviction, only the superior court may make a legal order, for good cause, for the removal.