show thermoelastic parameters for the EOS
499730
def print_parameters(self):
        
        print("Static: ", self.params_st)
        print("Thermal: ", self.params_th)
        print("Anharmonic: ", self.params_anh)
        print("Electronic: ", self.params_el)
845621
def _hugoniot_pth(self, v):
        
        temp = self._hugoniot_t(v)
        return self.cal_pth(v, temp)
386257
def fit(self, volumes, energies):
        
        eos_fit = self.model(np.array(volumes), np.array(energies))
        eos_fit.fit()
        return eos_fit
541919
def get_v_eff_stress_at_depth(self, y_c):
        
        sigma_v_c = self.get_v_total_stress_at_depth(y_c)
        pp = self.get_hydrostatic_pressure_at_depth(y_c)
        sigma_veff_c = sigma_v_c - pp
        return sigma_veff_c
719271
def _compute_heating_rates(self):
        ''''''
        (ncol, nlay, icld, permuteseed, irng, idrv, cp,
                play, plev, tlay, tlev, tsfc,
                h2ovmr, o3vmr, co2vmr, ch4vmr, n2ovmr, o2vmr,
                cfc11vmr, cfc12vmr, cfc22vmr, ccl4vmr, emis,
                inflglw, iceflglw, liqflglw,
                cldfrac, ciwp, clwp, reic, relq, tauc, tauaer,) = self._prepare_lw_arguments()
        if icld == 0:  # clear-sky only
            cldfmcl = np.zeros((ngptlw,ncol,nlay))
            ciwpmcl = np.zeros((ngptlw,ncol,nlay))
            clwpmcl = np.zeros((ngptlw,ncol,nlay))
            reicmcl = np.zeros((ncol,nlay))
            relqmcl = np.zeros((ncol,nlay))
            taucmcl = np.zeros((ngptlw,ncol,nlay))
        else:
            #  Call the Monte Carlo Independent Column Approximation (McICA, Pincus et al., JC, 2003)
            (cldfmcl, ciwpmcl, clwpmcl, reicmcl, relqmcl, taucmcl) = \
                _rrtmg_lw.climlab_mcica_subcol_lw(
                            ncol, nlay, icld,
                            permuteseed, irng, play,
                            cldfrac, ciwp, clwp, reic, relq, tauc)
            #  Call the RRTMG_LW driver to compute radiative fluxes
        (uflx, dflx, hr, uflxc, dflxc, hrc, duflx_dt, duflxc_dt) = \
            _rrtmg_lw.climlab_rrtmg_lw(ncol, nlay, icld, idrv,
                 play, plev, tlay, tlev, tsfc,
                 h2ovmr, o3vmr, co2vmr, ch4vmr, n2ovmr, o2vmr,
                 cfc11vmr, cfc12vmr, cfc22vmr, ccl4vmr, emis,
                 inflglw, iceflglw, liqflglw, cldfmcl,
                 taucmcl, ciwpmcl, clwpmcl, reicmcl, relqmcl,
                 tauaer)
        #  Output is all (ncol,nlay+1) or (ncol,nlay)
        self.LW_flux_up = _rrtm_to_climlab(uflx) + 0.*self.LW_flux_up
        self.LW_flux_down = _rrtm_to_climlab(dflx) + 0.*self.LW_flux_down
        self.LW_flux_up_clr = _rrtm_to_climlab(uflxc) + 0.*self.LW_flux_up_clr
        self.LW_flux_down_clr = _rrtm_to_climlab(dflxc) + 0.*self.LW_flux_down_clr
        #  Compute quantities derived from fluxes, including OLR
        self._compute_LW_flux_diagnostics()
        #  calculate heating rates from flux divergence
        LWheating_Wm2 = np.array(np.diff(self.LW_flux_net, axis=-1)) + 0.*self.Tatm
        LWheating_clr_Wm2 = np.array(np.diff(self.LW_flux_net_clr, axis=-1)) + 0.*self.Tatm
        self.heating_rate['Ts'] = np.array(-self.LW_flux_net[..., -1, np.newaxis]) + 0.*self.Ts
        self.heating_rate['Tatm'] = LWheating_Wm2
        #  Convert to K / day
        Catm = self.Tatm.domain.heat_capacity
        self.TdotLW = LWheating_Wm2 / Catm * const.seconds_per_day
        self.TdotLW_clr = LWheating_clr_Wm2 / Catm * const.seconds_per_day
176042
def calc_thermal_fission_functions_with_U239(t0, ts, read_data)
      read_data.theEU239 * read_data.theR * (1 - Math.exp(-read_data.lamda1 * t0)) * Math.exp(-read_data.lamda1 * ts)
    end
292482
def get_edot(F, mc, e):
    

    # chirp mass
    mc *= SOLAR2S

    dedt = -304/(15*mc) * (2*np.pi*mc*F)**(8/3) * e * \
        (1 + 121/304*e**2) / ((1-e**2)**(5/2))

    return dedt
191668
def _compute_heating_rates(self):
        ''''''
        (ncol, nlay, icld, iaer, permuteseed, irng,
         play, plev, tlay, tlev, tsfc,
         h2ovmr, o3vmr, co2vmr, ch4vmr, n2ovmr, o2vmr,
         aldif, aldir, asdif, asdir, coszen, adjes, dyofyr, scon, isolvar,
         indsolvar, bndsolvar, solcycfrac,
         inflgsw, iceflgsw, liqflgsw,
         cldfrac, ciwp, clwp, reic, relq, tauc, ssac, asmc, fsfc,
         tauaer, ssaaer, asmaer, ecaer,) = self._prepare_sw_arguments()
        if icld == 0:  # clear-sky only
            cldfmcl = np.zeros((ngptsw,ncol,nlay))
            ciwpmcl = np.zeros((ngptsw,ncol,nlay))
            clwpmcl = np.zeros((ngptsw,ncol,nlay))
            reicmcl = np.zeros((ncol,nlay))
            relqmcl = np.zeros((ncol,nlay))
            taucmcl = np.zeros((ngptsw,ncol,nlay))
            ssacmcl = np.zeros((ngptsw,ncol,nlay))
            asmcmcl = np.zeros((ngptsw,ncol,nlay))
            fsfcmcl = np.zeros((ngptsw,ncol,nlay))
        else:
            #  Call the Monte Carlo Independent Column Approximation (McICA, Pincus et al., JC, 2003)
            (cldfmcl, ciwpmcl, clwpmcl, reicmcl, relqmcl, taucmcl,
            ssacmcl, asmcmcl, fsfcmcl) = _rrtmg_sw.climlab_mcica_subcol_sw(
                            ncol, nlay, icld, permuteseed, irng, play,
                            cldfrac, ciwp, clwp, reic, relq, tauc, ssac, asmc, fsfc)
        #  Call the RRTMG_SW driver to compute radiative fluxes
        (swuflx, swdflx, swhr, swuflxc, swdflxc, swhrc) = \
            _rrtmg_sw.climlab_rrtmg_sw(ncol, nlay, icld, iaer,
                play, plev, tlay, tlev, tsfc,
                h2ovmr, o3vmr, co2vmr, ch4vmr, n2ovmr, o2vmr,
                asdir, asdif, aldir, aldif,
                coszen, adjes, dyofyr, scon, isolvar,
                inflgsw, iceflgsw, liqflgsw, cldfmcl,
                taucmcl, ssacmcl, asmcmcl, fsfcmcl,
                ciwpmcl, clwpmcl, reicmcl, relqmcl,
                tauaer, ssaaer, asmaer, ecaer,
                bndsolvar, indsolvar, solcycfrac)
        #  Output is all (ncol,nlay+1) or (ncol,nlay)
        self.SW_flux_up = _rrtm_to_climlab(swuflx) + 0.*self.SW_flux_up
        self.SW_flux_down = _rrtm_to_climlab(swdflx) + 0.*self.SW_flux_down
        self.SW_flux_up_clr = _rrtm_to_climlab(swuflxc) + 0.*self.SW_flux_up_clr
        self.SW_flux_down_clr = _rrtm_to_climlab(swdflxc) + 0.*self.SW_flux_down_clr
        #  Compute quantities derived from fluxes, including ASR
        self._compute_SW_flux_diagnostics()
        #  calculate heating rates from flux divergence
        SWheating_Wm2 = np.array(-np.diff(self.SW_flux_net, axis=-1)) + 0.*self.Tatm
        SWheating_clr_Wm2 = np.array(-np.diff(self.SW_flux_net_clr, axis=-1)) + 0.*self.Tatm
        self.heating_rate['Ts'] = np.array(self.SW_flux_net[..., -1, np.newaxis]) + 0.*self.Ts
        self.heating_rate['Tatm'] = SWheating_Wm2
        #  Convert to K / day
        Catm = self.Tatm.domain.heat_capacity
        self.TdotSW = SWheating_Wm2 / Catm * const.seconds_per_day
        self.TdotSW_clr = SWheating_clr_Wm2 / Catm * const.seconds_per_day
829374
def set_parameters(self):
        

        # declare 1D arrays of both paramters
        if self.xscale != 'lin':
            self.xvals = np.logspace(np.log10(float(self.x_low)),
                                     np.log10(float(self.x_high)),
                                     self.num_x)

        else:
            self.xvals = np.linspace(float(self.x_low),
                                     float(self.x_high),
                                     self.num_x)

        if self.yscale != 'lin':
            self.yvals = np.logspace(np.log10(float(self.y_low)),
                                     np.log10(float(self.y_high)),
                                     self.num_y)

        else:
            self.yvals = np.linspace(float(self.y_low),
                                     float(self.y_high),
                                     self.num_y)

        self.xvals, self.yvals = np.meshgrid(self.xvals, self.yvals)
        self.xvals, self.yvals = self.xvals.ravel(), self.yvals.ravel()

        for which in ['x', 'y']:
            setattr(self, getattr(self, which + 'val_name'), getattr(self, which + 'vals'))

        self.ecc = 'eccentricity' in self.__dict__
        if self.ecc:
            if 'observation_time' not in self.__dict__:
                if 'start_time' not in self.__dict__:
                    raise ValueError('If no observation time is provided, the time before'
                                     + 'merger must be the inital starting condition.')
                self.observation_time = self.start_time  # small number so it is not zero
        else:
            if 'spin' in self.__dict__:
                self.spin_1 = self.spin
                self.spin_2 = self.spin

        for key in ['redshift', 'luminosity_distance', 'comoving_distance']:
            if key in self.__dict__:
                self.dist_type = key
                self.z_or_dist = getattr(self, key)

            if self.ecc:
                for key in ['start_frequency', 'start_time', 'start_separation']:
                    if key in self.__dict__:
                        self.initial_cond_type = key.split('_')[-1]
                        self.initial_point = getattr(self, key)

        # add m1 and m2
        self.m1 = (self.total_mass / (1. + self.mass_ratio))
        self.m2 = (self.total_mass * self.mass_ratio / (1. + self.mass_ratio))
        return
817142
def _tilt(omega, b, psi):
    
    return np.cosh(psi/2.0)**b * np.exp(-psi**2/2.0 * omega)
480082
def params(self):
        
        params = dict(format=RESPONSE_FORMAT,
                      verbose=self.verbose,
                      epoch1=str(self.search_start_date),
                      epoch2=str(self.search_end_date),
                      search=self.orbit_method,
                      eunits=self.error_units,
                      eellipse=self.error_ellipse,
                      extres=self.resolve_extension,
                      xyres=self.resolve_position,
                      telinst=self.telescope_instrument)

        if self.orbit_method == 'bynameHorizons':
            params['object'] = NEW_LINE.join((str(target_name) for target_name in self.observations))
        else:
            params['obs'] = NEW_LINE.join((str(observation) for observation in self.observations))
        return params
875693
def parameters(self):
        

        try:
            return self._parameters

        except AttributeError:
            None

        parameters = []
        parameters.extend(self.grid_points.dtype.names)

        model_configuration = self._configuration.get("model", {})

        # Continuum
        # Note: continuum cannot just be 'True', it should be a dictionary
        n = len(parameters)
        continuum_config = model_configuration.get("continuum", False)
        if continuum_config is not False:
            if not isinstance(continuum_config, dict):
                raise TypeError("incorrect continuum type")
            for name in set(self.channel_names).intersection(continuum_config):
                degree = continuum_config[name]
                if degree is False:
                    continue

                # Note: N_coefficients = degree + 1
                # Example: degree = 3: a^3 + b^2 + c^1 + d 
                parameters.extend(["continuum_{0}_{1}".format(name, n) \
                    for n in range(degree + 1)])

        # Redshift
        parameters.extend(channel_parameters("z", self.channel_names,
            model_configuration.get("redshift", False)))

        # Spectral resolution
        resolution_parameters = channel_parameters(
            "resolution", self.channel_names,
            model_configuration.get("spectral_resolution", False))
        parameters.extend(resolution_parameters)

        # Underestimated variance
        parameters.extend(channel_parameters(
            "ln_f", self.channel_names,
            model_configuration.get("underestimated_variance", False)))

        # Outlier pixels
        if model_configuration.get("outlier_pixels", False):
            parameters.extend(["Po", "Vo"])

        assert len(parameters) == len(set(parameters)), "Duplicate parameters!"

        self._resolution_parameters = resolution_parameters
        self._parameters = tuple(parameters)

        return self._parameters
1246445
def solar_position_numba(unixtime, lat, lon, elev, pressure, temp, delta_t,
                         atmos_refract, numthreads, sst=False, esd=False):
    
    # these args are the same for each thread
    loc_args = np.array([lat, lon, elev, pressure, temp, delta_t,
                         atmos_refract, sst, esd])

    # construct dims x ulength array to put the results in
    ulength = unixtime.shape[0]
    if sst:
        dims = 3
    elif esd:
        dims = 1
    else:
        dims = 6
    result = np.empty((dims, ulength), dtype=np.float64)

    if unixtime.dtype != np.float64:
        unixtime = unixtime.astype(np.float64)

    if ulength < numthreads:
        warnings.warn('The number of threads is more than the length of '
                      'the time array. Only using %s threads.'.format(ulength))
        numthreads = ulength

    if numthreads <= 1:
        solar_position_loop(unixtime, loc_args, result)
        return result

    # split the input and output arrays into numthreads chunks
    split0 = np.array_split(unixtime, numthreads)
    split2 = np.array_split(result, numthreads, axis=1)
    chunks = [[a0, loc_args, split2[i]] for i, a0 in enumerate(split0)]
    # Spawn one thread per chunk
    threads = [threading.Thread(target=solar_position_loop, args=chunk)
               for chunk in chunks]
    for thread in threads:
        thread.start()
    for thread in threads:
        thread.join()
    return result
566284
def T(self):
        
        paramTemp = self.getParam('temperature')

        if not paramTemp is np.nan:
            return paramTemp
        elif ed_params.estimateMissingValues:
            self.flags.addFlag('Calculated Temperature')
            return self.calcTemperature()
        else:
            return np.nan
986940
def _parameter_constraints(self, theta_E, gamma, q, phi_G, s_scale):
        
        if theta_E < 0:
            theta_E = 0
        if s_scale < 0.00000001:
            s_scale = 0.00000001
        if gamma < 1.2:
            gamma = 1.2
            theta_E = 0
        if gamma > 2.9:
            gamma = 2.9
            theta_E = 0
        if q < 0.01:
            q = 0.01
            theta_E = 0
        if q > 1:
            q = 1.
            theta_E = 0
        return theta_E, gamma, q, phi_G, s_scale
416896
def dynacRepresentation(self):
        
        details = [
            self.energyDefnFlag.val,
            self.energy.val,
            self.phase.val,
            self.x.val,
            self.y.val,
            self.radius.val,
        ]
        return ['REJECT', [details]]
948744
def _process_flux_param(self, pval, wave):
        """"""
        if isinstance(pval, u.Quantity):
            self._validate_flux_unit(pval.unit)
            outval = units.convert_flux(self._redshift_model(wave), pval,
                                        self._internal_flux_unit).value
        else:  # Assume already in internal unit
            outval = pval
        return outval