Get barometric pressure in milibar

        :returns: The pressure in milibar as a int

        :example:

        >>> sensor = BMP180(gw)
        >>> sensor.load_calibration()
        >>> sensor.pressure()
        75216
979638
def pressure(self):
        
        ut = self.get_raw_temp()
        up = self.get_raw_pressure()
        x1 = ((ut - self.cal['AC6']) * self.cal['AC5']) >> 15
        x2 = (self.cal['MC'] << 11) // (x1 + self.cal['MD'])
        b5 = x1 + x2
        b6 = b5 - 4000
        x1 = (self.cal['B2'] * (b6 * b6) >> 12) >> 11
        x2 = (self.cal['AC2'] * b6) >> 11
        x3 = x1 + x2
        b3 = (((self.cal['AC1'] * 4 + x3) << self.mode) + 2) // 4
        x1 = (self.cal['AC3'] * b6) >> 13
        x2 = (self.cal['B1'] * ((b6 * b6) >> 12)) >> 16
        x3 = ((x1 + x2) + 2) >> 2
        b4 = (self.cal['AC4'] * (x3 + 32768)) >> 15
        b7 = (up - b3) * (50000 >> self.mode)
        if b7 < 0x80000000:
            p = (b7 * 2) // b4
        else:
            p = (b7 // b4) * 2
        x1 = (p >> 8) * (p >> 8)
        x1 = (x1 * 3038) >> 16
        x2 = (-7357 * p) >> 16
        p += (x1 + x2 + 3791) >> 4
        return p
1133881
def read_altitude(self, sealevel_pa=101325.0):
        """"""
        # Calculation taken straight from section 3.6 of the datasheet.
        pressure = float(self.read_pressure())
        altitude = 44330.0 * (1.0 - pow(pressure / sealevel_pa, (1.0/5.255)))
        self._logger.debug('Altitude {0} m'.format(altitude))
        return altitude
147764
def pressure_series(self):
        
        return [(tstamp, \
                self._station_history.get_measurements()[tstamp]['pressure']) \
                for tstamp in self._station_history.get_measurements()]
302061
def crpss(self):
        
        crps_f = self.crps()
        crps_c = self.crps_climo()
        return 1.0 - float(crps_f) / float(crps_c)
727259
def qnh_estimate(self):
        ''''''
        alt_gps = self.master.field('GPS_RAW_INT', 'alt', 0) * 0.001
        pressure2 = self.master.field('SCALED_PRESSURE', 'press_abs', 0)
        ground_temp = self.get_mav_param('GND_TEMP', 21)
        temp = ground_temp + 273.15
        pressure1 = pressure2 / math.exp(math.log(1.0 - (alt_gps / (153.8462 * temp))) / 0.190259)
        return pressure1
529173
def qhalf(self):
        
        if self.__qhalf != None:
            return self.__qhalf
        self.log("qhalf")
        self.__qhalf = self.obscov ** (-0.5)
        self.log("qhalf")
        return self.__qhalf
379438
def read_raw_pressure(self):
        """"""
        self._device.write8(BMP085_CONTROL, BMP085_READPRESSURECMD + (self._mode << 6))
        if self._mode == BMP085_ULTRALOWPOWER:
            time.sleep(0.005)
        elif self._mode == BMP085_HIGHRES:
            time.sleep(0.014)
        elif self._mode == BMP085_ULTRAHIGHRES:
            time.sleep(0.026)
        else:
            time.sleep(0.008)
        msb = self._device.readU8(BMP085_PRESSUREDATA)
        lsb = self._device.readU8(BMP085_PRESSUREDATA+1)
        xlsb = self._device.readU8(BMP085_PRESSUREDATA+2)
        raw = ((msb << 16) + (lsb << 8) + xlsb) >> (8 - self._mode)
        self._logger.debug('Raw pressure 0x{0:04X} ({1})'.format(raw & 0xFFFF, raw))
        return raw
1099446
def get_sigma(imt):
    
    if imt.period < 0.2:
        return np.log(10**0.23)
    elif imt.period > 1.0:
        return np.log(10**0.27)
    else:
        return np.log(10**(0.23 + (imt.period - 0.2)/0.8 * 0.04))
1199768
def check_weather(self):
        '''
        
        '''
        if self.station_id is None:
            # Failed to get the nearest station ID when first launched, so
            # retry it.
            self.get_station_id()

        self.data['update_error'] = ''
        try:
            query_url = STATION_QUERY_URL % (self.api_key,
                                             'conditions',
                                             self.station_id)
            try:
                response = self.api_request(query_url)['current_observation']
                self.forecast_url = response.pop('ob_url', None)
            except KeyError:
                self.logger.error('No weather data found for %s', self.station_id)
                self.data['update_error'] = self.update_error
                return

            if self.forecast:
                query_url = STATION_QUERY_URL % (self.api_key,
                                                 'forecast',
                                                 self.station_id)
                try:
                    forecast = self.api_request(query_url)['forecast']
                    forecast = forecast['simpleforecast']['forecastday'][0]
                except (KeyError, IndexError, TypeError):
                    self.logger.error(
                        'No forecast data found for %s', self.station_id)
                    # This is a non-fatal error, so don't return but do set the
                    # error flag.
                    self.data['update_error'] = self.update_error

                unit = 'celsius' if self.units == 'metric' else 'fahrenheit'
                low_temp = forecast.get('low', {}).get(unit, '')
                high_temp = forecast.get('high', {}).get(unit, '')
            else:
                low_temp = high_temp = ''

            if self.units == 'metric':
                temp_unit = 'c'
                speed_unit = 'kph'
                distance_unit = 'km'
                pressure_unit = 'mb'
            else:
                temp_unit = 'f'
                speed_unit = 'mph'
                distance_unit = 'mi'
                pressure_unit = 'in'

            def _find(key, data=None, default=''):
                if data is None:
                    data = response
                return str(data.get(key, default))

            try:
                observation_epoch = _find('observation_epoch') or _find('local_epoch')
                observation_time = datetime.fromtimestamp(int(observation_epoch))
            except (TypeError, ValueError):
                log.debug(
                    'Observation time \'%s\' is not a UNIX timestamp',
                    observation_epoch
                )
                observation_time = datetime.fromtimestamp(0)

            self.data['city'] = _find('city', response['observation_location'])
            self.data['condition'] = _find('weather')
            self.data['observation_time'] = observation_time
            self.data['current_temp'] = _find('temp_' + temp_unit).split('.')[0]
            self.data['low_temp'] = low_temp
            self.data['high_temp'] = high_temp
            self.data['temp_unit'] = '°' + temp_unit.upper()
            self.data['feelslike'] = _find('feelslike_' + temp_unit)
            self.data['dewpoint'] = _find('dewpoint_' + temp_unit)
            self.data['wind_speed'] = _find('wind_' + speed_unit)
            self.data['wind_unit'] = speed_unit
            self.data['wind_direction'] = _find('wind_dir')
            self.data['wind_gust'] = _find('wind_gust_' + speed_unit)
            self.data['pressure'] = _find('pressure_' + pressure_unit)
            self.data['pressure_unit'] = pressure_unit
            self.data['pressure_trend'] = _find('pressure_trend')
            self.data['visibility'] = _find('visibility_' + distance_unit)
            self.data['visibility_unit'] = distance_unit
            self.data['humidity'] = _find('relative_humidity').rstrip('%')
            self.data['uv_index'] = _find('UV')
        except Exception:
            # Don't let an uncaught exception kill the update thread
            self.logger.error(
                'Uncaught error occurred while checking weather. '
                'Exception follows:', exc_info=True
            )
            self.data['update_error'] = self.update_error
802785
def altitude_difference(self, pressure1, pressure2, ground_temp):
        ''''''
        scaling = pressure2 / pressure1
        temp = ground_temp + 273.15
        return 153.8462 * temp * (1.0 - math.exp(0.190259 * math.log(scaling)))
739884
public MDecimal getMCPM() {
		MDecimal result = new MDecimal(currentUnit.getConverterTo(
				CUBIC_METRE_PER_MINUTE).convert(doubleValue()));
		logger.trace(MMarker.GETTER,
				"Converting from {} to Cubic metres per minute : {}",
				currentUnit, result);
		return result;
	}
705686
def get_rmsd(self, mol1, mol2):
        
        label1, label2 = self._mapper.uniform_labels(mol1, mol2)
        if label1 is None or label2 is None:
            return float("Inf")
        return self._calc_rms(mol1, mol2, label1, label2)
974353
def getScale(self, zoom):
        """"""
        if self.unit == 'degrees':
            resolution = self.getResolution(zoom) * EPSG4326_METERS_PER_UNIT
        else:
            resolution = self.getResolution(zoom)
        return resolution / STANDARD_PIXEL_SIZE
1301879
def altimeter(alt: Number, unit: str = 'hPa') -> str:
    
    if not (alt and unit in ('hPa', 'inHg')):
        return ''
    if unit == 'hPa':
        value = alt.repr
        converted = alt.value / 33.8638866667
        converted = str(round(converted, 2)) + ' inHg'  # type: ignore
    elif unit == 'inHg':
        value = alt.repr[:2] + '.' + alt.repr[2:]
        converted = float(value) * 33.8638866667
        converted = str(int(round(converted))) + ' hPa'  # type: ignore
    return f'{value} {unit} ({converted})'
1031076
def _get_distance_scaling(self, C, mag, rhypo):
        
        return (C["a3"] * np.log(rhypo)) + (C["a4"] + C["a5"] * mag) * rhypo
1357727
def bhp2pascal(bhp, cfm, fan_tot_eff):
    """"""
    inh2o = bhp * 6356.0 * fan_tot_eff / cfm
    pascal = inh2o2pascal(inh2o)        
    m3s = cfm2m3s(cfm)
    return pascal, m3s
1016019
def load_data(self):
        
        if self.ensemble_name.upper() == "SSEF":
            if self.variable[0:2] == "rh":
                pressure_level = self.variable[2:]
                relh_vars = ["sph", "tmp"]
                relh_vals = {}
                for var in relh_vars:
                    mg = SSEFModelGrid(self.member_name,
                                       self.run_date,
                                       var + pressure_level,
                                       self.start_date,
                                       self.end_date,
                                       self.path,
                                       single_step=self.single_step)
                    relh_vals[var], units = mg.load_data()
                    mg.close()
                self.data = relative_humidity_pressure_level(relh_vals["tmp"],
                                                             relh_vals["sph"],
                                                             float(pressure_level) * 100)
                self.units = "%"
            elif self.variable == "melth":
                input_vars = ["hgtsfc", "hgt700", "hgt500", "tmp700", "tmp500"]
                input_vals = {}
                for var in input_vars:
                    mg = SSEFModelGrid(self.member_name,
                                       self.run_date,
                                       var,
                                       self.start_date,
                                       self.end_date,
                                       self.path,
                                       single_step=self.single_step)
                    input_vals[var], units = mg.load_data()
                    mg.close()
                self.data = melting_layer_height(input_vals["hgtsfc"],
                                                 input_vals["hgt700"],
                                                 input_vals["hgt500"],
                                                 input_vals["tmp700"],
                                                 input_vals["tmp500"])
                self.units = "m"
            else:
                mg = SSEFModelGrid(self.member_name,
                                   self.run_date,
                                   self.variable,
                                   self.start_date,
                                   self.end_date,
                                   self.path,
                                   single_step=self.single_step)
                self.data, self.units = mg.load_data()
                mg.close()
        elif self.ensemble_name.upper() == "NCAR":
            mg = NCARModelGrid(self.member_name,
                               self.run_date,
                               self.variable,
                               self.start_date,
                               self.end_date,
                               self.path,
                               single_step=self.single_step)
            self.data, self.units = mg.load_data()
            mg.close()
        elif self.ensemble_name.upper() == "HREFV2":
            proj_dict, grid_dict = read_ncar_map_file(self.map_file)
            mapping_data = make_proj_grids(proj_dict, grid_dict)            
           
            mg = HREFv2ModelGrid(self.member_name,
                               self.run_date,
                               self.variable,
                               self.start_date,
                               self.end_date,
                               self.path,
                               mapping_data,
                               self.sector_ind_path,
                               single_step=self.single_step)

            self.data, self.units = mg.load_data()

        elif self.ensemble_name.upper() == "VSE":
            mg = VSEModelGrid(self.member_name,
                               self.run_date,
                               self.variable,
                               self.start_date,
                               self.end_date,
                               self.path,
                               single_step=self.single_step)
            self.data, self.units = mg.load_data()
            mg.close()
        elif self.ensemble_name.upper() == "HRRR":
            mg = HRRRModelGrid(self.run_date,
                               self.variable,
                               self.start_date,
                               self.end_date,
                               self.path)
            self.data, self.units = mg.load_data()
            mg.close()
        elif self.ensemble_name.upper() == "NCARSTORM":
            mg = NCARStormEventModelGrid(self.run_date,
                                         self.variable,
                                         self.start_date,
                                         self.end_date,
                                         self.path)
            self.data, self.units = mg.load_data()
            mg.close()
        else:
            print(self.ensemble_name + " not supported.")