How to add channels not present on DigMontage for reference

Hello!
During my data recording with the 64ch BioSemi system, I used 2 extra electrodes in the mastoids.
Now I want to re-reference my data with those 2 channels.

I checked that the standard montage for this cap on mne is ‘biosemi64’, composed by the 64 channels + 3 locations.
My code for that part is the following:

#Set electrode montage configuration
  standard = mne.channels.make_standard_montage(kind = "biosemi64")
  raw_data.set_montage(standard)
    
#Re-referencing Type: mastoids
  raw_data.set_eeg_reference(ref_channels=['EX 1','EX 3']) 
#EX 1','EX 3' are the names given by the BioSemi recording software ActiView

But I get the following error message:

ValueError: DigMontage is only a subset of info. 
There are 2 channel positions not present in the DigMontage. 
The required channels are: ['EX 1', 'EX 3'].

Consider using inst.set_channel_types if these are not EEG channels, 
or use the on_missing parameter if the channel positions are allowed 
to be unknown in your analyses.

Does someone know if there is a way I can use these two channels as references? What about the extra 3 positions of the biosemi64 montage? I am working with version 0.24 on windows

Thank you in advance!
Isa

Hello @icasso and welcome to the forum!

The error message already contains the solution for you:

Simply do

raw_data.set_montage(standard, on_missing='ignore')

See the related documentation:
https://mne.tools/stable/generated/mne.io.Raw.html#mne.io.Raw.set_montage

Best,
Richard