In any proceeding before the director, and in any proceeding instituted by the supervisor for the purpose of enforcing or carrying out the provisions of this division, or for the purpose of holding an investigation to ascertain the condition of any well or wells complained of, or which in the opinion of the supervisor may reasonably be presumed to be improperly located, drilled, operated, maintained, or conducted, the supervisor and the director shall have the power to administer oaths and may apply to a judge of the superior court of the county in which the proceeding or investigation is pending for a subpoena for witnesses to attend the proceeding or investigation. Upon the application of the supervisor or the director, the judge of the superior court shall issue a subpoena directing the witness to attend the proceeding or investigation, and such person shall be required to produce, when directed, all records, surveys, documents, books, or accounts in the witness’ custody or under the witness’ control; except that no person shall be required to attend upon such proceeding unless the person resides within the same county or within 100 miles of the place of attendance. The supervisor or the director may in such case cause the depositions of witnesses residing within or without the state to be taken in the manner prescribed by law for like depositions in civil actions in superior courts of this state under Title 4 (commencing with Section 2016.010) of Part 4 of the Code of Civil Procedure, and may, upon application to a judge of the superior court of the county within which the proceeding or investigation is pending, obtain a subpoena compelling the attendance of witnesses and the production of records, surveys, documents, books, or accounts at such places as the judge may designate within the limits prescribed in this section.