@classmethod
def fromRecArray(cls, recArray, srcType='primary'):
    "\n        Class method that reads in a numpy record array to NSEMdata object.\n\n        :param recArray: Record array with the data. Has to have ('freq','x','y','z') columns and some ('zxx','zxy','zyx','zyy','tzx','tzy')\n        :type recArray: numpy.recarray\n\n        :param srcType: The type of SimPEG.EM.NSEM.SrcNSEM to be used\n        :type srcType: str, optional\n\n        "
    if (srcType == 'primary'):
        src = Planewave_xy_1Dprimary
    elif (srcType == 'total'):
        src = Planewave_xy_1DhomotD
    else:
        raise NotImplementedError('{:s} is not a valid source type for NSEMdata')
    uniFreq = np.unique(recArray['freq'].copy())
    srcList = []
    dataList = []
    for freq in uniFreq:
        rxList = []
        dFreq = recArray[(recArray['freq'] == freq)].copy()
        rxTypes = [comp for comp in recArray.dtype.names if (((len(comp) == 4) or (len(comp) == 3)) and ('z' in comp))]
        for rxType in rxTypes:
            notNaNind = (~ np.isnan(dFreq[rxType].copy()))
            if np.any(notNaNind):
                locs = _rec_to_ndarr(dFreq[['x', 'y', 'z']][notNaNind].copy())
                if (dFreq[rxType].dtype.name in 'complex128'):
                    if ('t' in rxType):
                        rxList.append(Point3DTipper(locs, rxType[1:3], 'real'))
                        dataList.append(dFreq[rxType][notNaNind].real.copy())
                        rxList.append(Point3DTipper(locs, rxType[1:3], 'imag'))
                        dataList.append(dFreq[rxType][notNaNind].imag.copy())
                    elif ('z' in rxType):
                        rxList.append(Point3DImpedance(locs, rxType[1:3], 'real'))
                        dataList.append(dFreq[rxType][notNaNind].real.copy())
                        rxList.append(Point3DImpedance(locs, rxType[1:3], 'imag'))
                        dataList.append(dFreq[rxType][notNaNind].imag.copy())
                else:
                    component = ('real' if ('r' in rxType) else 'imag')
                    if ('z' in rxType):
                        rxList.append(Point3DImpedance(locs, rxType[1:3], component))
                        dataList.append(dFreq[rxType][notNaNind].copy())
                    if ('t' in rxType):
                        rxList.append(Point3DTipper(locs, rxType[1:3], component))
                        dataList.append(dFreq[rxType][notNaNind].copy())
        srcList.append(src(rxList, freq))
    survey = Survey(srcList)
    dataVec = np.hstack(dataList)
    return cls(survey, dataVec)
Class method that reads in a numpy record array to NSEMdata object.

:param recArray: Record array with the data. Has to have ('freq','x','y','z') columns and some ('zxx','zxy','zyx','zyy','tzx','tzy')
:type recArray: numpy.recarray

:param srcType: The type of SimPEG.EM.NSEM.SrcNSEM to be used
:type srcType: str, optional
@classmethod
def fromRecArray(cls, recArray, srcType='primary'):
    "\n        Class method that reads in a numpy record array to NSEMdata object.\n\n        :param recArray: Record array with the data. Has to have ('freq','x','y','z') columns and some ('zxx','zxy','zyx','zyy','tzx','tzy')\n        :type recArray: numpy.recarray\n\n        :param srcType: The type of SimPEG.EM.NSEM.SrcNSEM to be used\n        :type srcType: str, optional\n\n        "
    if (srcType == 'primary'):
        src = Planewave_xy_1Dprimary
    elif (srcType == 'total'):
        src = Planewave_xy_1DhomotD
    else:
        raise NotImplementedError('{:s} is not a valid source type for NSEMdata')
    uniFreq = np.unique(recArray['freq'].copy())
    srcList = []
    dataList = []
    for freq in uniFreq:
        rxList = []
        dFreq = recArray[(recArray['freq'] == freq)].copy()
        rxTypes = [comp for comp in recArray.dtype.names if (((len(comp) == 4) or (len(comp) == 3)) and ('z' in comp))]
        for rxType in rxTypes:
            notNaNind = (~ np.isnan(dFreq[rxType].copy()))
            if np.any(notNaNind):
                locs = _rec_to_ndarr(dFreq[['x', 'y', 'z']][notNaNind].copy())
                if (dFreq[rxType].dtype.name in 'complex128'):
                    if ('t' in rxType):
                        rxList.append(Point3DTipper(locs, rxType[1:3], 'real'))
                        dataList.append(dFreq[rxType][notNaNind].real.copy())
                        rxList.append(Point3DTipper(locs, rxType[1:3], 'imag'))
                        dataList.append(dFreq[rxType][notNaNind].imag.copy())
                    elif ('z' in rxType):
                        rxList.append(Point3DImpedance(locs, rxType[1:3], 'real'))
                        dataList.append(dFreq[rxType][notNaNind].real.copy())
                        rxList.append(Point3DImpedance(locs, rxType[1:3], 'imag'))
                        dataList.append(dFreq[rxType][notNaNind].imag.copy())
                else:
                    component = ('real' if ('r' in rxType) else 'imag')
                    if ('z' in rxType):
                        rxList.append(Point3DImpedance(locs, rxType[1:3], component))
                        dataList.append(dFreq[rxType][notNaNind].copy())
                    if ('t' in rxType):
                        rxList.append(Point3DTipper(locs, rxType[1:3], component))
                        dataList.append(dFreq[rxType][notNaNind].copy())
        srcList.append(src(rxList, freq))
    survey = Survey(srcList)
    dataVec = np.hstack(dataList)
    return cls(survey, dataVec)