AETA地震预测AI算法大赛训练集可视化

监测站点分布

description

每日信号值

出于数据保密的考虑,隐藏了刻度,横轴为天数,纵轴为信号值。

图中黑色虚线代表监测站点在那天有修改操作,可能会引起数据波动。

以下所有图的坐标轴是一致的。说明站点之间的数据差异较大。

地声数据

在这里插入图片描述

磁场数据

在这里插入图片描述

画图代码

from pyecharts.charts import Geo
from pyecharts import options
from pyecharts.globals import GeoType
import pandas as pd
import webbrowser
import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np

stations = pd.read_csv('../Stationid_list.csv',delimiter=',')
g = Geo().add_schema(maptype="china")
for i in stations.index:
    s = stations.iloc[i]
    g.add_coordinate(s['StationID'],s['Longitude'],s['Latitude'])
data_pair = [(stations.iloc[i]['StationID'],1) for i in stations.index]
g.add('',data_pair, type_=GeoType.EFFECT_SCATTER, symbol_size=2)
g.set_series_opts(label_opts=options.LabelOpts(is_show=False))
g.set_global_opts(title_opts=options.TitleOpts(title="监测站点分布"))
result = g.render('stations.html')
webbrowser.open_new_tab(result)
import os

path_train = '../train/data_train'
assert(len(os.listdir(path_train)) == len(stations))

def station_magn_data(id):
    df = None
    try:
        df =  pd.read_csv(path_train+'/'+str(id)+'/'+str(id)+'_finaldata_lowfreq_magn.csv')
    except Exception as e:
        print('empty folder')
    return df

def station_sound_data(id):
    df = None
    try:
        df = pd.read_csv(path_train+'/'+str(id)+'/'+str(id)+'_finaldata_lowfreq_sound.csv')
    except Exception as e:
        print('empty folder')
    return df
op = pd.read_csv('../train/op_train.csv')
op.columns=['no', 'time']
N = len(stations)
plt.figure(figsize=(20,5*N))
for i in range(N):
    id = int(stations.iloc[i]['StationID'])
    ax = plt.subplot(N,1,i+1)
    magn_data = station_sound_data(id)
    if magn_data is not None and len(magn_data)>0:
        if id in set(op['no']):
            for o in op[op['no']==id]['time']:
                 plt.vlines(o, 0, 5, colors = "k", linestyles = "dashed", linewidth=2)

        magn_data.groupby('Day')['average'].max().plot()            
        magn_data.groupby('Day')['average'].mean().plot()
        magn_data.groupby('Day')['average'].min().plot()
        plt.legend(labels=['daily max','daily mean','daily min'], loc='upper right')
    plt.title("lowfreq_sound_data from station {}".format(id))

    plt.xlim(0,920)
    plt.ylim(0,3)
    ax.set_yticks([])
#     ax.set_xticks([])
    ax.set_xlabel("")
    ax.set_ylabel("sound")
plt.show()
发布了278 篇原创文章 · 获赞 459 · 访问量 43万+
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 终极编程指南 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览