Esempio n. 1
0
import numpy as np
import pandas as pd
from pathlib import Path
from geoist.pfm.hawaii_gravity import fetch_hawaii_gravity
from geoist.pfm import normgra, GRS80

lat = 45.0
height = 1000.0
grav = 976783.05562266  #mGal

datapath = Path(normgra.__file__).parent
filename = Path(datapath, 'data', 'yngravity.csv')
gradata = pd.read_csv(filename)
print(gradata.keys())

gamma0 = normgra.gamma_closed_form(lat, 0)
gamma = normgra.gamma_closed_form(lat, height)
gamma1 = normgra.gamma_closed_form(lat, height, ellipsoid=GRS80)

somi0 = normgra.gamma_somigliana_free_air(lat, 0)
somi = normgra.gamma_somigliana_free_air(lat, height)
somi1 = normgra.gamma_somigliana_free_air(lat, height, ellipsoid=GRS80)
bug = normgra.bouguer_plate(height)
print(gamma, gamma1)
print(somi, somi1)
print(bug)
print(gamma, somi, gamma - gamma0)
print(gamma1, somi1, somi - somi0)
# Use a Bouguer plate to remove the effect of topography
bouguer = grav - gamma - bug
print(bouguer, bug)
Esempio n. 2
0
raw gravity data from Hawaii.

"""
import matplotlib.pyplot as plt
import numpy as np
from geoist.pfm.hawaii_gravity import fetch_hawaii_gravity
from geoist.pfm import normgra


# Load gravity data from Hawaii
data = fetch_hawaii_gravity()

# Use the closed form of the normal gravity to calculate
# it at the observation height. This is better than using
# the free-air approximation.
gamma = normgra.gamma_closed_form(data['lat'], data['height'])
disturbance = data['gravity'] - gamma
# Use a Bouguer plate to remove the effect of topography
bouguer = disturbance - normgra.bouguer_plate(data['topography'])

# Plot the data using the UTM coordinates (x is North and y is East)
shape = data['shape']
x, y = data['x'].reshape(shape), data['y'].reshape(shape)

fig, axes = plt.subplots(2, 2, figsize=(10, 9))
plt.rcParams['font.size'] = 10

ax = axes[0, 0]
ax.set_title('Raw gravity of Hawaii')
tmp = ax.contourf(y/1000, x/1000, data['gravity'].reshape(shape), 60,
                  cmap='Reds')
"""

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from pathlib import Path
from geoist.pfm import normgra
from geoist import DATA_PATH
# 1.读取数据
datapath = Path(Path(normgra.__file__).parent, 'data')
filename = Path(datapath, 'ynyx_grav.csv')  #'ynyx_grav.csv') #ynp1_grav.csv
gradata = pd.read_csv(filename)
print('1. 重力数据已经读入,格式为:{}'.format(gradata.keys()))

# 2. 计算FGA
gradata['freeair'] = normgra.gamma_closed_form(gradata['lat'], gradata['elev'])
gradata['buglayer'] = normgra.bouguer_plate(gradata['elev'])
gradata['FGA'] = gradata['grav'] - gradata['freeair']
gradata['BGA_s'] = gradata['grav'] - gradata['freeair'] - gradata['buglayer']

# 2.1 正常场计算方法不同
#gradata['BGA_s1']  = gradata['grav'] - normgra.gamma_somigliana_free_air(gradata['lat'], gradata['elev']) - gradata['buglayer']

# 2.2 输出结果

print('2. 重力异常计算完成,已保存到:{}'.format(Path(DATA_PATH, 'ynp1_grav_anomaly.csv')))

# 3. 投影变换
import pyproj
p_jw = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"
p_lcc = "+proj=lcc +lon_0=102.5 +lat_0=24.38 +lat_1=45 +ellps=WGS84 +datum=WGS84 +no_defs"