SOLPSxport.py
def plot_profiles(self):
        """
        Plot the upstream profiles from SOLPS compared to the experiment
        """
        # if 'xportCoef' not in self.data['solpsData']:
        #     print('Transport coefficients not yet calculated!! Calculating them using defaults')
        #     self.calcXportCoef(plotit = False,debug_plots = False)

        headroom = 1.04
        
        # Load SOLPS profiles and transport coefficients

        psi_solps = self.data['solpsData']['psiSOLPS']
        neold = self.data['solpsData']['last10']['ne']
        dold = self.data['solpsData']['last10']['dn']
        teold = self.data['solpsData']['last10']['te']
        keold = self.data['solpsData']['last10']['ke']
        tiold = self.data['solpsData']['last10']['ti']
        kiold = self.data['solpsData']['last10']['ki']
        
        # Load experimental profiles

        psi_data_fit = self.data['pedData']['fitPsiProf']
        neexp = 1.0e20 * self.data['pedData']['fitProfs']['neprof']
        teexp = 1.0e3*self.data['pedData']['fitProfs']['teprof']
        tiexp = 1.0e3*self.data['pedData']['fitVals']['tisplpsi']['y']
        tiexppsi = self.data['pedData']['fitVals']['tisplpsi']['x']


        dnew_ratio = self.data['solpsData']['xportCoef']['dnew_ratio']
        kenew_ratio = self.data['solpsData']['xportCoef']['kenew_ratio']
        kinew = self.data['solpsData']['xportCoef']['kinew']


        # Find limits of Te, Ti for plots
        TS_inds_in_range = np.where(psi_data_fit > np.min(psi_solps))[0]
        Ti_inds_in_range = np.where(tiexppsi > np.min(psi_solps))[0]
        max_ne = np.max([np.max(neold), np.max(neexp[TS_inds_in_range])]) / 1.0e19
        max_Te = np.max([np.max(teold), np.max(teexp[TS_inds_in_range])])
        max_Ti = np.max([np.max(tiold), np.max(tiexp[Ti_inds_in_range])])


        f, ax = plt.subplots(2, sharex = 'all')
        ax[0].plot(psi_data_fit, neexp / 1.0e19, '--bo', lw = 1, label = 'Experimental Data')
        ax[0].plot(psi_solps, neold / 1.0e19, 'xr', lw = 2, mew=2, ms=8, label = 'SOLPS')
        ax[0].set_ylabel('n$_e$ (10$^{19}$ m$^{-3}$)')
        ax[0].legend(loc = 'best')
        ax[0].set_ylim([0, max_ne * headroom])
        ax[0].grid('on')

        # ax[1, 0].plot(psi_solps, dold, '-xr', lw = 2)
        # ax[1, 0].plot(psi_solps, dnew_ratio, '-ok', lw = 2, label = 'Data')
        # ax[1, 0].set_ylabel('D')
        # ax[1, 0].set_xlabel('$\psi_N$')
        # ax[1, 0].grid('on')

        ax[1].plot(psi_data_fit, teexp, '--bo', lw = 1, label = 'Experimental Data')
        ax[1].plot(psi_solps, teold, 'xr', lw = 2, mew=2, ms=8, label = 'SOLPS')
        ax[1].set_ylabel('T$_e$ (eV)')
        ax[1].set_ylim([0, max_Te * headroom])
        ax[1].set_yticks(np.arange(0, max_Te * headroom + 200, 200))
        ax[1].grid('on')
        ax[1].set_xlabel('$\psi_N$')

        # ax[1, 1].plot(psi_solps, keold, '-xr', lw = 2)
        # ax[1, 1].plot(psi_solps, kenew_ratio, '-ok', lw = 2, label = 'Data')
        # ax[1, 1].set_ylabel('$\chi_e$')
        # ax[1, 1].set_xlabel('$\psi_N$')
        # ax[1, 1].set_xlim([np.min(psi_solps) - 0.01, np.max(psi_solps) + 0.01])
        # ax[1, 1].grid('on')

        # ax[0, 2].plot(psi_solps, tiold, 'xr', lw = 2, label = 'SOLPS')
        # ax[0, 2].plot(tiexppsi, tiexp, '--bo', lw = 1, label = 'Data')
        # ax[0, 2].set_ylabel('T$_i$ (eV)')
        # ax[0, 2].set_ylim([0, max_Ti * headroom])
        # ax[0, 2].grid('on')

        # ax[1, 2].plot(psi_solps, kiold, '-xr', lw = 2)
        # ax[1, 2].plot(psi_solps, kinew, '-ok', lw = 2, label = 'Data')
        # ax[1, 2].set_ylabel('$\chi_i$')
        # ax[1, 2].set_xlabel('$\psi_N$')
        # ax[1, 2].set_xlim([np.min(psi_solps) - 0.01, np.max(psi_solps) + 0.01])
        # ax[1, 2].grid('on')

        ax[0].set_xticks(np.arange(0.84, 1.05, 0.04))
        ax[0].set_xlim([np.min(psi_solps) - 0.01, np.max(psi_solps) + 0.01])
        plt.tight_layout()

        plt.show(block = False)

        Plot the upstream profiles from SOLPS compared to the experiment
        
Plot the upstream profiles from SOLPS compared to the experiment
Plot the upstream profiles from SOLPS compared to the experiment
def plot_profiles(self):
        headroom = 1.04
        psi_solps = self.data['solpsData']['psiSOLPS']
        neold = self.data['solpsData']['last10']['ne']
        dold = self.data['solpsData']['last10']['dn']
        teold = self.data['solpsData']['last10']['te']
        keold = self.data['solpsData']['last10']['ke']
        tiold = self.data['solpsData']['last10']['ti']
        kiold = self.data['solpsData']['last10']['ki']
        psi_data_fit = self.data['pedData']['fitPsiProf']
        neexp = 1.0e20 * self.data['pedData']['fitProfs']['neprof']
        teexp = 1.0e3*self.data['pedData']['fitProfs']['teprof']
        tiexp = 1.0e3*self.data['pedData']['fitVals']['tisplpsi']['y']
        tiexppsi = self.data['pedData']['fitVals']['tisplpsi']['x']
        dnew_ratio = self.data['solpsData']['xportCoef']['dnew_ratio']
        kenew_ratio = self.data['solpsData']['xportCoef']['kenew_ratio']
        kinew = self.data['solpsData']['xportCoef']['kinew']
        TS_inds_in_range = np.where(psi_data_fit > np.min(psi_solps))[0]
        Ti_inds_in_range = np.where(tiexppsi > np.min(psi_solps))[0]
        max_ne = np.max([np.max(neold), np.max(neexp[TS_inds_in_range])]) / 1.0e19
        max_Te = np.max([np.max(teold), np.max(teexp[TS_inds_in_range])])
        max_Ti = np.max([np.max(tiold), np.max(tiexp[Ti_inds_in_range])])
        f, ax = plt.subplots(2, sharex = 'all')
        ax[0].plot(psi_data_fit, neexp / 1.0e19, '--bo', lw = 1, label = 'Experimental Data')
        ax[0].plot(psi_solps, neold / 1.0e19, 'xr', lw = 2, mew=2, ms=8, label = 'SOLPS')
        ax[0].set_ylabel('n$_e$ (10$^{19}$ m$^{-3}$)')
        ax[0].legend(loc = 'best')
        ax[0].set_ylim([0, max_ne * headroom])
        ax[0].grid('on')
        ax[1].plot(psi_data_fit, teexp, '--bo', lw = 1, label = 'Experimental Data')
        ax[1].plot(psi_solps, teold, 'xr', lw = 2, mew=2, ms=8, label = 'SOLPS')
        ax[1].set_ylabel('T$_e$ (eV)')
        ax[1].set_ylim([0, max_Te * headroom])
        ax[1].set_yticks(np.arange(0, max_Te * headroom + 200, 200))
        ax[1].grid('on')
        ax[1].set_xlabel('$\psi_N$')
        ax[0].set_xticks(np.arange(0.84, 1.05, 0.04))
        ax[0].set_xlim([np.min(psi_solps) - 0.01, np.max(psi_solps) + 0.01])
        plt.tight_layout()
        plt.show(block = False)
def plot_profiles ( self ) : headroom = 1.04 psi_solps = self . data [ 'solpsData' ] [ 'psiSOLPS' ] neold = self . data [ 'solpsData' ] [ 'last10' ] [ 'ne' ] dold = self . data [ 'solpsData' ] [ 'last10' ] [ 'dn' ] teold = self . data [ 'solpsData' ] [ 'last10' ] [ 'te' ] keold = self . data [ 'solpsData' ] [ 'last10' ] [ 'ke' ] tiold = self . data [ 'solpsData' ] [ 'last10' ] [ 'ti' ] kiold = self . data [ 'solpsData' ] [ 'last10' ] [ 'ki' ] psi_data_fit = self . data [ 'pedData' ] [ 'fitPsiProf' ] neexp = 1.0e20 * self . data [ 'pedData' ] [ 'fitProfs' ] [ 'neprof' ] teexp = 1.0e3 * self . data [ 'pedData' ] [ 'fitProfs' ] [ 'teprof' ] tiexp = 1.0e3 * self . data [ 'pedData' ] [ 'fitVals' ] [ 'tisplpsi' ] [ 'y' ] tiexppsi = self . data [ 'pedData' ] [ 'fitVals' ] [ 'tisplpsi' ] [ 'x' ] dnew_ratio = self . data [ 'solpsData' ] [ 'xportCoef' ] [ 'dnew_ratio' ] kenew_ratio = self . data [ 'solpsData' ] [ 'xportCoef' ] [ 'kenew_ratio' ] kinew = self . data [ 'solpsData' ] [ 'xportCoef' ] [ 'kinew' ] TS_inds_in_range = np . where ( psi_data_fit > np . min ( psi_solps ) ) [ 0 ] Ti_inds_in_range = np . where ( tiexppsi > np . min ( psi_solps ) ) [ 0 ] max_ne = np . max ( [ np . max ( neold ) , np . max ( neexp [ TS_inds_in_range ] ) ] ) / 1.0e19 max_Te = np . max ( [ np . max ( teold ) , np . max ( teexp [ TS_inds_in_range ] ) ] ) max_Ti = np . max ( [ np . max ( tiold ) , np . max ( tiexp [ Ti_inds_in_range ] ) ] ) f , ax = plt . subplots ( 2 , sharex = 'all' ) ax [ 0 ] . plot ( psi_data_fit , neexp / 1.0e19 , '--bo' , lw = 1 , label = 'Experimental Data' ) ax [ 0 ] . plot ( psi_solps , neold / 1.0e19 , 'xr' , lw = 2 , mew = 2 , ms = 8 , label = 'SOLPS' ) ax [ 0 ] . set_ylabel ( 'n$_e$ (10$^{19}$ m$^{-3}$)' ) ax [ 0 ] . legend ( loc = 'best' ) ax [ 0 ] . set_ylim ( [ 0 , max_ne * headroom ] ) ax [ 0 ] . grid ( 'on' ) ax [ 1 ] . plot ( psi_data_fit , teexp , '--bo' , lw = 1 , label = 'Experimental Data' ) ax [ 1 ] . plot ( psi_solps , teold , 'xr' , lw = 2 , mew = 2 , ms = 8 , label = 'SOLPS' ) ax [ 1 ] . set_ylabel ( 'T$_e$ (eV)' ) ax [ 1 ] . set_ylim ( [ 0 , max_Te * headroom ] ) ax [ 1 ] . set_yticks ( np . arange ( 0 , max_Te * headroom + 200 , 200 ) ) ax [ 1 ] . grid ( 'on' ) ax [ 1 ] . set_xlabel ( '$\psi_N$' ) ax [ 0 ] . set_xticks ( np . arange ( 0.84 , 1.05 , 0.04 ) ) ax [ 0 ] . set_xlim ( [ np . min ( psi_solps ) - 0.01 , np . max ( psi_solps ) + 0.01 ] ) plt . tight_layout ( ) plt . show ( block = False )
Plot the upstream profiles from SOLPS compared to the experiment
Plot the upstream profiles from SOLPS compared to the experiment
"""
        Plot the upstream profiles from SOLPS compared to the experiment
        """ # if 'xportCoef' not in self.data['solpsData']: #     print('Transport coefficients not yet calculated!! Calculating them using defaults') #     self.calcXportCoef(plotit = False,debug_plots = False) # Load SOLPS profiles and transport coefficients # Load experimental profiles # Find limits of Te, Ti for plots # ax[1, 0].plot(psi_solps, dold, '-xr', lw = 2) # ax[1, 0].plot(psi_solps, dnew_ratio, '-ok', lw = 2, label = 'Data') # ax[1, 0].set_ylabel('D') # ax[1, 0].set_xlabel('$\psi_N$') # ax[1, 0].grid('on') # ax[1, 1].plot(psi_solps, keold, '-xr', lw = 2) # ax[1, 1].plot(psi_solps, kenew_ratio, '-ok', lw = 2, label = 'Data') # ax[1, 1].set_ylabel('$\chi_e$') # ax[1, 1].set_xlabel('$\psi_N$') # ax[1, 1].set_xlim([np.min(psi_solps) - 0.01, np.max(psi_solps) + 0.01]) # ax[1, 1].grid('on') # ax[0, 2].plot(psi_solps, tiold, 'xr', lw = 2, label = 'SOLPS') # ax[0, 2].plot(tiexppsi, tiexp, '--bo', lw = 1, label = 'Data') # ax[0, 2].set_ylabel('T$_i$ (eV)') # ax[0, 2].set_ylim([0, max_Ti * headroom]) # ax[0, 2].grid('on') # ax[1, 2].plot(psi_solps, kiold, '-xr', lw = 2) # ax[1, 2].plot(psi_solps, kinew, '-ok', lw = 2, label = 'Data') # ax[1, 2].set_ylabel('$\chi_i$') # ax[1, 2].set_xlabel('$\psi_N$') # ax[1, 2].set_xlim([np.min(psi_solps) - 0.01, np.max(psi_solps) + 0.01]) # ax[1, 2].grid('on')
self