
206 Cal.App.3d 1565 (1989)
254 Cal. Rptr. 504
THE PEOPLE, Plaintiff and Respondent,
v.
JOHN LEMONT BRANDON, Defendant and Appellant.
Docket No. C004009.
Court of Appeals of California, Third District.
January 6, 1989.
*1567 COUNSEL
Frances C. Huey, under appointment by the Court of Appeal, for Defendant and Appellant.
John K. Van de Kamp, Attorney General, Steve White, Chief Assistant Attorney General, and Wanda Hill Rouzan, Deputy Attorney General, for Plaintiff and Respondent.
OPINION
SIMS, J.
In this case, we hold that where a defendant pleads guilty to a felony before a municipal court judge sitting as a magistrate, the defendant has not been convicted "in a municipal ... court" within the meaning of section 3050 of the Welfare and Institutions Code,[1] specifying procedures to *1568 determine eligibility for commitment to the California Rehabilitation Center (CRC). (Further statutory references are to the Welfare and Institutions Code unless otherwise indicated.) Rather, the defendant has been convicted in superior court, so that section 3051 specifies the appropriate procedures.[2]

PROCEDURAL BACKGROUND
In exchange for a low term ceiling on sentencing and no enhancements for prior convictions, on January 12, 1988, defendant pled guilty before a municipal court judge sitting as a magistrate to unlawful possession of a controlled substance. (Health & Saf. Code, § 11350.)
Because the charge was a felony, the matter was certified to the superior court for sentencing pursuant to Penal Code section 859a.[3] The probation *1569 report stated that defendant began smoking cocaine two years earlier, felt that cocaine was becoming a problem, and would use cocaine daily if he could afford it. At sentencing, defendant requested probation and placement in a special drug treatment program which had previously accepted him. The superior court denied the request and sentenced defendant to state prison. The trial court stated: "... I certainly hope you do get over any problems that you might have with drugs; ..." The court also stated it hoped defendant "will be able to take care of the problem; I am sure they will in prison."
Defendant appeals claiming the trial court did not acquire enough information about his addiction status to make a reasoned decision about a commitment to CRC. (See People v. Davis (1984) 160 Cal. App.3d 970, 980 [207 Cal. Rptr. 18].)

DISCUSSION
(1) Defendant made no request for CRC commitment. Therefore, absent a contrary showing in the record, it is presumed the court properly exercised its discretion to conclude defendant was not eligible. (People v. Flower (1976) 62 Cal. App.3d 904, 909-910 [133 Cal. Rptr. 455].)
The Attorney General argues we should presume the trial court declined to initiate CRC proceedings because defendant was ineligible on account of a pattern of criminality under section 3051. That statute disqualifies a defendant from CRC where, "... in the opinion of the judge, the defendant's record and probation report indicate such a pattern of criminality that he or she does not constitute a fit subject for commitment under this section." (See fn. 2, ante.) Since 1977 defendant had been convicted of at least five theft-related offenses for which he had been sentenced to prison several times. Because defendant's pattern of criminality would preclude commitment even if defendant were addicted to narcotics, then a fortiori the trial court would need to make no further inquiry into the status of defendant's possible addiction.
(2a) Defendant asserts that a pattern of criminality cannot bar his CRC commitment. He notes that the "pattern-of-criminality" bar appears in selection 3051, applicable to defendants convicted in superior court. He contends he was convicted in municipal court, not superior court, so that section 3050, not section 3051, applies to his case. (See fn. 1, ante.) He correctly notes that section 3050 contains no bar to CRC commitment premised on a pattern of criminality. (Ibid.)
*1570 The fallacy in defendant's argument is his premise that he was convicted in municipal court for purposes of section 3050.
Defendant entered his plea before a magistrate pursuant to Penal Code section 859a. (See fn. 3, ante.) The fact that the magistrate was a municipal court judge does not mean that defendant was convicted "in a municipal court."
(3) This is so for reasons detailed in People v. Hawkins (1978) 85 Cal. App.3d 960 [149 Cal. Rptr. 855]: "A magistrate is defined by the Legislature as `an officer having power to issue a warrant for the arrest of a person charged with a public offense.' (§ 807.) All judges of courts of record and justice courts are authorized to perform the functions of a magistrate (§ 808) whose duties and authority are specifically designated and limited by statute. [Citations.] (4) Whenever a municipal court judge acts in the capacity of a magistrate, the judge possesses only the limited jurisdiction and magistral powers conferred by the state Constitution and statute. [Citations.] The basic distinction between a municipal court judge sitting as a magistrate (as here) and sitting as a municipal court has been emphasized by our reviewing courts on numerous occasions as recently summarized in the opinion in Koski v. James, [(1975) 47 Cal. App.3d 349 [120 Cal. Rptr. 754]] at pages 354-355: `... when a felony complaint is filed a preliminary examination is held before a magistrate, not a judge. [Citations.] (5) The cases and statute hold that a felony complaint may be filed in any judicial district in the county in which the offense was committed, and the magistrate of the court in which the complaint is on file may conduct the preliminary examination. [Citations.] A magistrate is purely a creature of statute, the holder of a statutory office separate and distinct from the elective office of judge. [Citations.] A preliminary hearing is not a trial and a magistrate presiding at the hearing does not sit as a judge of a court and exercises none of the powers of a judge in a court proceeding. [Citations.] [¶] "When a judge of a particular judicial district acts in the capacity of a magistrate, he does not do so as a judge of a particular court but rather as one who derives his powers from the provisions of Penal Code, sections 807 and 808. [Citation.] By initiating proceedings before magistrates, no trial jurisdiction of any court is invoked." [Citation.]'" (Id., at pp. 965-966, fn. omitted.)
(2b) Here, the magistrate merely accepted defendant's plea and certified the matter to the superior court where Penal Code section 859a, subdivision (a) commands that "proceedings shall be had as if such defendant had pleaded in such court...." (See fn. 3, ante.) Defendant was therefore convicted in the superior court.
We are aware that, on occasion, a statute referring to the power of a "court" to undertake an act will be construed to include a magistrate, where *1571 the applicable statutory scheme compels such a construction. (See, e.g., Landrum v. Superior Court (1981) 30 Cal.3d 1, 13 [177 Cal. Rptr. 325, 634 P.2d 352], and authorities cited therein.) However, nothing in sections 3050 or 3051 compels that conclusion here. The "pattern of criminality" bar of section 3051 is intended to screen out defendants who are unfit for CRC commitment. (People v. Urdiain (1986) 179 Cal. App.3d 330, 332-333 [225 Cal. Rptr. 1]; see People v. Sateriale (1966) 247 Cal. App.2d 314, 316-317 [55 Cal. Rptr. 500].) It would be anomalous to apply that bar to defendants convicted of felonies depending on whether they entered their guilty pleas before a magistrate or in superior court, since the location of the entry of their pleas has nothing to do with their suitability for CRC treatment. Moreover, where a defendant convicted in municipal court is certified to superior court for CRC evaluation, and the superior court determines the defendant is not addicted nor in imminent danger of addiction, section 3050 commands the superior court to return the defendant to municipal court "for such further proceedings as the judge of such municipal ... court deems warranted." (See fn. 1, ante.) However, where a defendant has been convicted by plea under Penal Code section 859a, the only act for the magistrate to undertake upon such a return from superior court would be certification of the cause back to superior court. (See fn. 3, ante.) We shall not presume the Legislature intended this nonsensical yo-yo procedure.
Since section 3051 applies to defendant's case, and since the trial court had before it a record showing defendant's significant pattern of criminality, no abuse of the trial court's discretion has been shown in its refusal to initiate proceedings to determine whether defendant was addicted to or in imminent danger of addiction to narcotics. (See People v. Flores (1971) 6 Cal.3d 305, 309-310 [98 Cal. Rptr. 822, 491 P.2d 406].)

DISPOSITION
The judgment is affirmed.
Puglia, P.J., and Carr, J., concurred.
NOTES
[1]  Welfare and Institutions Code section 3050 provides: "Upon conviction of a defendant of any crime in a municipal or justice court, or following revocation of probation previously granted, whether or not sentence has been imposed, if it appears to the judge that the defendant may be addicted or by reason of repeated use of narcotics may be in imminent danger of becoming addicted to narcotics, such judge shall adjourn the proceedings or suspend the imposition or execution of the sentence, certify the defendant to the superior court and order the district attorney to file a petition for a commitment of the defendant to the Director of Corrections for confinement in the narcotic detention, treatment and rehabilitation facility.

"Upon the filing of such a petition, the superior court shall order the defendant to be examined by one physician. At the request of the defendant, the court shall order the defendant to be examined by a second physician. At least one day before the time of the examination as fixed by the court order, a copy of the petition and order for examination shall be personally delivered to the defendant. A written report of the examination by the physician or physicians shall be delivered to the court, and if the report is to the effect that the person is not addicted nor in imminent danger of addiction, it shall so certify and return the defendant to the municipal or justice court which certified such defendant to the superior court for such further proceedings as the judge of such municipal or justice court deems warranted. If the report is to the effect that the defendant is addicted or is by reason of the repeated use of narcotics in imminent danger of addiction, further proceedings shall be conducted in compliance with Sections 3104, 3105, 3106, and 3107.
"If, after a hearing, the judge finds that the defendant is a narcotic addict, or is by reason of the repeated use of narcotics in imminent danger of becoming addicted thereto, and is not ineligible for the program under the application of Section 3052, he or she shall make an order committing such defendant to the custody of the Director of Corrections for confinement in the facility until such time as he or she is discharged pursuant to Article 5 (commencing with Section 3200), except as this chapter permits earlier discharge. If, upon the hearing, the judge shall find that the defendant is not a narcotic addict and is not in imminent danger of becoming addicted to narcotics, the judge shall so certify and return the defendant to the municipal or justice court which certified the defendant to the superior court for such further proceedings as the judge of the municipal or justice court deems warranted.
"If a person committed pursuant to this section is dissatisfied with the order of commitment, he or she may within 10 days after the making of such order, file a written demand for a jury trial in compliance with Section 3108."
[2]  Section 3051 provides in relevant part: "Upon conviction of a defendant for any crime in any superior court, or following revocation of probation previously granted, and upon imposition of sentence, if it appears to the judge that the defendant may be addicted or by reason of repeated use of narcotics may be in imminent danger of becoming addicted to narcotics the judge shall suspend the execution of the sentence and order the district attorney to file a petition for commitment of the defendant to the Director of Corrections for confinement in the narcotic detention, treatment, and rehabilitation facility unless, in the opinion of the judge, the defendant's record and probation report indicate such a pattern of criminality that he or she does not constitute a fit subject for commitment under this section."
[3]  Penal Code, § 859a provides in relevant part: "(a) If the public offense charged is a felony not punishable with death, the magistrate shall immediately upon the appearance of counsel for the defendant read the complaint to the defendant and ask him whether he pleads guilty or not guilty to the offense charged therein and to a previous conviction or convictions of crime if charged; thereupon, or at any time thereafter, while the charge remains pending before the magistrate and when his counsel is present, the defendant may plead guilty to the offense charged, ... and upon such plea of guilty or nolo contendere, the magistrate may then fix a reasonable bail as provided by this code, and upon failure to deposit such bail or surety, shall immediately commit the defendant to the sheriff and certify the case, including a copy of all proceedings therein and such testimony as in his discretion he may require to be taken, to the superior court, and thereupon such proceedings shall be had as if such defendant had pleaded guilty in such court...."
