风场数据抓取程序实现(java+python实现)

news2025/6/21 3:24:11

一、数据源参数定义

关键参数代码:

package com.grab.catchWindData.pram;

/**
 * @ClassName: DevPrams
 * @Description: TODO
 **/
public class   DevPrams  {
    public static String lev_0to0p1_m_below_ground ="lev_0-0.1_m_below_ground";
    public static String lev_0p1to0p4_m_below_ground ="lev_0.1-0.4_m_below_ground";
    public static String lev_0p33to1_sigma_layer ="lev_0.33-1_sigma_layer";
    public static String lev_0p4to1_m_below_ground ="lev_0.4-1_m_below_ground";
    public static String lev_0p44to0p72_sigma_layer ="lev_0.44-0.72_sigma_layer";
    public static String sigmaLayerlev_0p44to1 ="lev_0.44-1_sigma_layer";
    public static String mblev_0p0to0p4 ="lev_0.4_mb";
    public static String sigmaLayerlev_0p72to0p94 ="lev_0.72-0.94_sigma_layer";
    public static String sigmaLevellev_0p995="lev_0.995_sigma_level";
    public static String lev_0C_isotherm ="lev_0C_isotherm";
    public static String lev_1000_mb ="lev_1000_mb";
    public static String lev_100_m_above_ground ="lev_100_m_above_ground";
    public static String lev_100_mb ="lev_100_mb";
    public static String lev_10_m_above_ground ="lev_10_m_above_ground";
    public static String lev_10_m_above_mean_sea_level ="lev_10_m_above_mean_sea_level";
    public static String lev_10_mb ="lev_10_mb";
    public static String lev_1to2below_ground="lev_1-2_m_below_ground";
    public static String lev_150_mb ="lev_150_mb";
    public static String lev_15_mb ="lev_15_mb";
    public static String lev_180to0_mb_above_ground ="lev_180-0_mb_above_ground";
    public static String lev_1829_m_above_mean_sea_level ="lev_1829_m_above_mean_sea_level";
    public static String lev_1_hybrid_level ="lev_1_hybrid_level";
    public static String lev_1_mb ="lev_1_mb";
    public static String lev_200_mb ="lev_200_mb";
    public static String lev_20_m_above_ground ="lev_20_m_above_ground";
    public static String lev_20_mb ="lev_20_mb";
    public static String lev_250_mb ="lev_250_mb";
    public static String lev_255to0_mb_above_ground ="lev_255-0_mb_above_ground";
    public static String lev_2743_m_above_mean_sea_level ="lev_2743_m_above_mean_sea_level";
    public static String lev_2_m_above_ground ="lev_2_m_above_ground";
    public static String lev_2_mb ="lev_2_mb";
    public static String lev_3000to0_m_above_ground ="lev_3000-0_m_above_ground";
    public static String lev_300_mb ="lev_300_mb";
    public static String lev_30to0_mb_above_ground ="lev_30-0_mb_above_ground";
    public static String lev_30_m_above_ground ="lev_30_m_above_ground";
    public static String lev_30_mb ="lev_30_mb";
    public static String lev_350_mb ="lev_350_mb";
    public static String lev_3658_m_above_mean_sea_level ="lev_3658_m_above_mean_sea_level";
    public static String lev_3_mb ="lev_3_mb";
    public static String lev_400_mb ="lev_400_mb";
    public static String lev_40_m_above_ground ="lev_40_m_above_ground";
    public static String lev_40_mb ="lev_40_mb";
    public static String lev_450_mb ="lev_450_mb";
    public static String lev_500_mb ="lev_500_mb";
    public static String lev_50_m_above_ground ="lev_50_m_above_ground";
    public static String lev_50_mb ="lev_50_mb";
    public static String lev_550_mb ="lev_550_mb";
    public static String lev_5_mb ="lev_5_mb";
    public static String lev_6000to0_m_above_ground ="lev_6000-0_m_above_ground";
    public static String lev_600_mb ="lev_600_mb";
    public static String lev_650_mb ="lev_650_mb";
    public static String lev_700_mb ="lev_700_mb";
    public static String lev_70_mb ="lev_70_mb";
    public static String lev_750_mb ="lev_750_mb";
    public static String lev_7_mb ="lev_7_mb";
    public static String lev_800_mb ="lev_800_mb";
    public static String lev_80_m_above_ground ="lev_80_m_above_ground";
    public static String lev_850_mb ="lev_850_mb";
    public static String lev_900_mb ="lev_900_mb";
    public static String lev_925_mb ="lev_925_mb";
    public static String lev_950_mb ="lev_950_mb";
    public static String lev_975_mb ="lev_975_mb";
    public static String lev_boundary_layer_cloud_layer ="lev_boundary_layer_cloud_layer";
    public static String lev_convective_cloud_bottom_level ="lev_convective_cloud_bottom_level";
    public static String lev_convective_cloud_layer ="lev_convective_cloud_layer";
    public static String lev_convective_cloud_top_level ="lev_convective_cloud_top_level";
    public static String lev_entire_atmosphere ="lev_entire_atmosphere";
    public static String lev_entire_atmosphere_single ="lev_entire_atmosphere_%5C%28considered_as_a_single_layer%5C%29";
    public static String lev_high_cloud_bottom_level ="lev_high_cloud_bottom_level";
    public static String lev_high_cloud_layer ="lev_high_cloud_layer";
    public static String lev_high_cloud_top_level ="lev_high_cloud_top_level";
    public static String lev_highest_tropospheric_freezing_level ="lev_highest_tropospheric_freezing_level";
    public static String lev_low_cloud_bottom_level ="lev_low_cloud_bottom_level";
    public static String lev_low_cloud_layer ="lev_low_cloud_layer";
    public static String lev_low_cloud_top_level ="lev_low_cloud_top_level";
    public static String lev_max_wind ="lev_max_wind";
    public static String lev_mean_sea_level ="lev_mean_sea_level";
    public static String lev_middle_cloud_bottom_level ="lev_middle_cloud_bottom_level";
    public static String lev_middle_cloud_layer ="lev_middle_cloud_layer";
    public static String lev_middle_cloud_top_level ="lev_middle_cloud_top_level";
    public static String lev_planetary_boundary_layer ="lev_planetary_boundary_layer";
    public static String PVM ="lev_PV%5C%3D%5C-2e%5C-06_%5C%28Km%5C%5E2%2Fkg%2Fs%5C%29_surface";
    public static String PVADD ="lev_PV%5C%3D2e%5C-06_%5C%28Km%5C%5E2%2Fkg%2Fs%5C%29_surface";
    public static String lev_surface ="lev_surface";
    public static String lev_top_of_atmosphere ="lev_top_of_atmosphere";
    public static String lev_tropopause ="lev_tropopause";
}

二、编写抓取程序定时任务

@Value("${grab.pythonPath}")
    String pythonPath;
    static String flag="";
    @Scheduled(cron="0 0/2 * * * ?")
    void get00(){
        Date date = new Date();
        Log.info("定时任务执行了" + DateUtil.format(date, DateUtil.DATE_TIME_PATTERN));
        Log.info("flag======::::::::::::::::"+flag);
        String [] levParams={DevPrams.lev_10_m_above_ground};
        String [] varParams={VarParams.TMAX,VarParams.TMIN,VarParams.UGRD,VarParams.VGRD};
//        Core core = new Core(0,"00","70","140","0","55");
//        core.startRun(levParams,varParams);
        String[] params={"18","12","06","00"};
        int canDoPython=0;
        List<String> allList=new ArrayList<String>();
        for (int i=0;i<params.length;i++ ){
            String flagData=getDateFlag(date,params[i]);
            if(flag.equals(flagData)){
                continue;
            }
            Core core = new Core(0,params[i],"70","140","0","55");

            List<String> list = core.startRun(levParams, varParams);
            if(list!=null&&!list.isEmpty()){
                allList.addAll(list);
                this.flag=flagData;
                canDoPython++;
            }else if (params[i].equals("00")&&(list==null||list.isEmpty())){
                Core coretemp = new Core(1,"18","70","140","0","55");
                list = coretemp.startRun(levParams, varParams);
                allList.addAll(list);
                canDoPython++;
                this.flag=getDateFlag(DateUtil.addDateDays(date,-1),"18");
            }
        }

        if(canDoPython>0){
            HashSet<String> set =new HashSet<>(allList);
            for(String s: set) {
                try {
                    PythonGet.getStartPython(pythonPath,s);
                } catch (Exception e) {
                    e.printStackTrace();
                }
//                System.out.println("已完成一次");
            }
        }
    }

三、编写转换成JSON脚本python脚本

四、抓取文件及转化成果文件

转化json成果示例:

 

 

 五、前端可视化

 如果对您有帮助,请点赞打赏支持;

技术合作交流qq:2401315930

 

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/411422.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【微服务笔记08】微服务组件之Hystrix实现请求合并功能

这篇文章&#xff0c;主要介绍微服务组件之Hystrix实现请求合并功能。 目录 一、Hystrix请求合并 1.1、什么是请求合并 1.2、请求合并的实现 &#xff08;1&#xff09;引入依赖 &#xff08;2&#xff09;编写服务提供者 &#xff08;3&#xff09;消费者&#xff08;Se…

React | 认识React开发

✨ 个人主页&#xff1a;CoderHing &#x1f5a5;️ Node.js专栏&#xff1a;Node.js 初级知识 &#x1f64b;‍♂️ 个人简介&#xff1a;一个不甘平庸的平凡人&#x1f36c; &#x1f4ab; 系列专栏&#xff1a;吊打面试官系列 16天学会Vue 11天学会React Node专栏 &#x…

【分享】免梯子的GPT,玩 ChatGPT 的正确姿势

火了一周的 ChatGPT&#xff0c;HG 不允许还有小伙伴不知道这个东西是什么&#xff1f;简单来说就是&#xff0c;你可以让它扮演任何事物&#xff0c;据说已经有人用它开始了颜色文学创作。因为它太火了&#xff0c;所以&#xff0c;本周特推在几十个带有“chatgpt”的项目中选…

双交叉注意学习用于细粒度视觉分类和目标重新识别

目录Dual Cross-Attention Learning for Fine-Grained Visual Categorization and Object Re-Identification摘要本文方法消融实验Dual Cross-Attention Learning for Fine-Grained Visual Categorization and Object Re-Identification 摘要 目的&#xff1a; 探索了如何扩展…

JDK8——新增时间类、有关时间数据的交互问题

目录 一、实体类 二、数据库 三、数据交换 四、关于LocalDateTime类型 (java 8) 4.1 旧版本日期时间问题 4.2 新版日期时间API介绍 4.2.1 LocalDate、LocalTime、LocalDateTime 4.2.2 日期时间的修改与比较 4.2.3 格式化和解析操作 4.2.4 Instant: 时间戳 4.2.5 Duration 与…

Doris(6):数据导入(Load)之Stream Load

Broker load是一个同步的导入方式&#xff0c;用户通过发送HTTP协议将本地文件或者数据流导入到Doris中&#xff0c;Stream Load同步执行导入并返回结果&#xff0c;用户可以通过返回判断导入是否成功。 1 适用场景 Stream load 主要适用于导入本地文件&#xff0c;或通过程序…

小厂实习要不要去?

大家好&#xff0c;我是帅地。 最近暑假实习招聘&#xff0c;不少 训练营 学员都拿到了小厂实习来保底&#xff0c;但是很多小厂基本要求一周内给答复&#xff0c;中大厂就还在流程之中&#xff0c;所以很纠结小厂实习要不要去。 不知道你是否有这样的纠结&#xff0c;今天帅地…

【测试面试汇总2】

目录Linux操作系统1.Linux操作命令2.在Linux中find和grep的区别&#xff1f;3.绝对路径用什么符号表示&#xff1f;4.当前目录、上层目录用什么表示&#xff1f;5.主目录用什么表示&#xff1f;6.怎么查看进程信息&#xff1f;7.保存文件并退出vi 编辑?8.怎么查看当前用户id&a…

【Python从入门到进阶】15、函数的定义和使用

接上篇《14、字典高级应用》 上一篇我们学习了有关字典的高级应用操作&#xff08;字典的增删改查&#xff09;&#xff0c;本篇我们来学习Python中函数的定义和使用&#xff0c;包括函数的参数、返回值、局部变量和全景变量等操作。 一、一个思考 例如这里有一段大东北洗浴中…

2023年PMP报考时间安排攻略!

1.2023年PMP考试时间 PMP一年开考4次&#xff0c;分别为3月、6月、9月、12月&#xff0c;预计2023年PMP第一次考试时间在2023年3月左右&#xff0c;具体以基金会官方通知为准。 1&#xff09;为什么考PMP&#xff1f; 大部分人考 PMP 无非以下几个原因&#xff0c;总的来说&…

运行时内存数据区之程序计数器

内存是非常重要的系统资源&#xff0c;是硬盘和CPU的中间仓库及桥梁&#xff0c;承载着操作系统和应用程序的实时选行。JVM内存布局规定了Java在运行过程中内存申请、分配、管理的策略&#xff0c;保证了JVM的高效稳定运行。 不同的VM对于内存的划分方式和管理机制存在着部分差…

算法时间复杂度计算

目录 1.时间复杂度计算 1.1 时间复杂度例题 1.1.1例题 1.1.2例题 1.1.3例题 1.1.4例题 1.2时间复杂度leetcode例题 1.时间复杂度计算 首先&#xff0c;我们需要了解时间复杂度是什么&#xff1a;算法的时间复杂度是指算法在编写成可执行程序后&#xff0c;运行时需要耗费…

一天吃透操作系统八股文

操作系统的四个特性&#xff1f; 并发&#xff1a;同一段时间内多个程序执行&#xff08;与并行区分&#xff0c;并行指的是同一时刻有多个事件&#xff0c;多处理器系统可以使程序并行执行&#xff09; 共享&#xff1a;系统中的资源可以被内存中多个并发执行的进线程共同使…

MATLAB | 给热图整点花哨操作(三角,树状图,分组图)

前段时间写的特殊热图绘制函数迎来大更新&#xff0c;基础使用教程可以看看这一篇&#xff1a; https://slandarer.blog.csdn.net/article/details/129292679 原本的绘图代码几乎完全不变&#xff0c;主要是增添了很多新的功能&#xff01;&#xff01;&#xff01; 工具函数完…

FastChat开放,媲美ChatGPT的90%能力——从下载到安装、部署

FastChat开放&#xff0c;媲美ChatGPT的90%能力——从下载到安装、部署前言两个前置软件创建FastChat虚拟环境安装PyTorch安装 FastChat下载 LLaMA&#xff0c;并转换生成FastChat对应的模型Vicuna启动FastChat的命令行交互将模型部署为一个服务&#xff0c;提供Web GUI前言 最…

Cesium:自定义MaterialProperty

在项目中应用Cesium.js时,时常遇到需要对Cesium.js的Material材质或者MaterialProperty材质属性进行拓展的应用场景。如果对GLSL(openGL Shading Language ),即:OpenGL着色语言熟悉的话,参考Cesium官方文档,构建一个新的Material必定不是难事。而MaterialProperty材质属…

【C语言进阶:动态内存管理】动态内存函数的介绍

本节重点内容&#xff1a; malloc 和 free 函数calloc 函数realloc 函数&#x1f338;为什么存在动态内存分配 到目前为止&#xff0c;我们已经掌握的内存开辟方式有两种&#xff1a; 创建变量&#xff1a;int val 20; //在栈空间上开辟四个字节 创建数组&#xff1…

Html5钢琴块游戏制作与分享(音游可玩)

当年一款手机节奏音游&#xff0c;相信不少人都玩过或见过。最近也是将其做了出来分享给大家。 游戏的基本玩法&#xff1a;点击下落的黑色方块&#xff0c;弹奏音乐。&#xff08;下落的速度会越来越快&#xff09; 可以进行试玩&#xff0c;手机玩起来效果会更好些。 点击…

【Python】基于serial的UART串口通信(可实现AT指令自动化 以ML307A开发板为例)

【Python】基于serial的UART串口通信&#xff08;可实现AT指令自动化 以ML307A开发板为例&#xff09; Python下的串口serial库 串行口的属性&#xff1a; name:设备名字 portstr:已废弃&#xff0c;用name代替 port&#xff1a;读或者写端口 baudrate&#xff1a;波特率 byt…

Charles 安装及配置,详细步骤(不错,保存一下)

一、安装激活 1.1、下载 https://www.charlesproxy.com/download/ 1.2、激活 打开Charles > Help > Register Charles > 输入 Registered Name &#xff1a; https://zhile.io License Key&#xff1a;48891cf209c6d32bf4 二、代理配置 2.1、代理设置 Proxy > Pr…