Python根据IGS测站信息绘制测站全球分布图

Python根据IGS测站信息绘制测站全球分布图

环境准备

软件

系统:Windows 10
版本:Python 3.8.1
需要安装三方库:Basemap,安装方法参照:Basemap库安装

数据

IGS官网全球测站信息文件IGSNetwork.json,格式为json,下载网址为:IGS测站列表
所需绘制测站列表,可存储于文本文件,格式参照如下:
测站格式

代码实现

'''
 @ This script is used for drawing the distribution map of ground stations
 @ 2021.01.15
 @ By ZWzgtx
'''

import os
import sys
import numpy as np
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
import json

def main(argv):
	'''
	argv[0]: The script file(draw_station_map.py)
	argv[1]: The working directory
	argv[2]: The name of IGS file containing all station information with json format(IGSNetwork.json, from https://www.igs.org/maps/#station-map)
	argv[3]: The station list for drawing(Optional, draw all stations if not given)
	'''
	##arg setting
	nargv = len(sys.argv)
	if nargv < 3:
		print("Wrong inputs!")
		print("Usage: python draw_station_map.py /home/data IGSNetwork.json")
		print("Usage: python draw_station_map.py /home/data IGSNetwork.json site_list")
		sys.exit()
	work_dir = sys.argv[1]
	sta_file_all = sys.argv[2]
	if nargv > 3:
		sta_file_inp = sys.argv[3]
	if not os.path.exists(work_dir):
		print("The path: " + work_dir + " does not exist!")
		print("Please check!")
		sys.exit()
	os.chdir(work_dir)
	if not os.path.exists(sta_file_all):
		print("The IGS station file : " + sta_file_all + " does not ex
  • 3
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值