function myNotchExecuter(currentData) {
    return new Promise(function (resolve, reject) {
        let options = {
            mode: 'binary',
            args: [] 
          };  
        let results={};
        let notchShell = new PythonShell('/backend/pythonscripts/notch.py');
        // como es mucha informacion no se puede enviar por parametros sino por estandar input, en este caso options no es necesario
        // notchShell.send(JSON.stringify(currentData.channels[0]));
        // ahora enviemos los 20 canales
        notchShell.send(JSON.stringify(currentData.channels));
    
        notchShell.on('message', function (message) {
            // received a message sent from the Python script (a simple "print" statement)
            // console.log(message);
            results['channels'] = JSON.parse(message)['channels']
            results['debug'] = currentData.debug;
            results['annotations']=currentData.annotations;
            results['patientInfo']=currentData.patientInfo;
        }); 
        // end the input stream and allow the process to exit
        notchShell.end(function (err,code,signal) {
        // if (err) reject(err); se comenta porque es un warning que esta como error david debe revisar
        // Error: C:\Anaconda3\lib\site-packages\scipy\signal\_arraytools.py:45: FutureWarning: Using a non-tuple sequence for multidimensional indexing is
        // deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
        //   b = a[a_slice]
            resolve ({r: results, c: code, s: signal});
        });
    });
}
/**  
 * notch executer, eturns a promise
 * @param {Object} currentData edf object structure 
 * @returns {Promise} PythonShell execution of notch filter
 */
notch executer, eturns a promise
@param {Object} currentData edf object structure
@returns {Promise} PythonShell execution of notch filter
notch executer eturns a promise @param { Object } currentData edf object structure @returns { Promise } PythonShell execution of notch filter
function myNotchExecuter(currentData) {
    return new Promise(function (resolve, reject) {
        let options = {
            mode: 'binary',
            args: [] 
          };  
        let results={};
        let notchShell = new PythonShell('/backend/pythonscripts/notch.py');
        notchShell.send(JSON.stringify(currentData.channels));
        notchShell.on('message', function (message) {
            results['channels'] = JSON.parse(message)['channels']
            results['debug'] = currentData.debug;
            results['annotations']=currentData.annotations;
            results['patientInfo']=currentData.patientInfo;
        }); 
        notchShell.end(function (err,code,signal) {
            resolve ({r: results, c: code, s: signal});
        });
    });
}
function myNotchExecuter ( currentData ) { return new Promise ( function ( resolve , reject ) { let options = { mode : 'binary' , args : [ ] } ; let results = { } ; let notchShell = new PythonShell ( '/backend/pythonscripts/notch.py' ) ; notchShell . send ( JSON . stringify ( currentData . channels ) ) ; notchShell . on ( 'message' , function ( message ) { results [ 'channels' ] = JSON . parse ( message ) [ 'channels' ] results [ 'debug' ] = currentData . debug ; results [ 'annotations' ] = currentData . annotations ; results [ 'patientInfo' ] = currentData . patientInfo ; } ) ; notchShell . end ( function ( err , code , signal ) { resolve ( { r : results , c : code , s : signal } ) ; } ) ; } ) ; }
notch executer, eturns a promise
 @param {Object} currentData edf object structure
 @returns {Promise} PythonShell execution of notch filter
notch executer eturns a promise @param { Object } currentData edf object structure @returns { Promise } PythonShell execution of notch filter
// como es mucha informacion no se puede enviar por parametros sino por estandar input, en este caso options no es necesario // notchShell.send(JSON.stringify(currentData.channels[0])); // ahora enviemos los 20 canales // received a message sent from the Python script (a simple "print" statement) // console.log(message); // end the input stream and allow the process to exit // if (err) reject(err); se comenta porque es un warning que esta como error david debe revisar // Error: C:\Anaconda3\lib\site-packages\scipy\signal\_arraytools.py:45: FutureWarning: Using a non-tuple sequence for multidimensional indexing is // deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result. //   b = a[a_slice]