1 ChatGPT助力科研

1.1 绝对湿度相对湿度转换

1.1 绝对湿度相对湿度转换

1.1.1概述

博主近期在运行[盘古气象大模型],使用[ERA5数据]作为输入。 但是发现下载错了变量,误将绝对下载成了相对湿度。因此,博主使用ChatGPT获得了转换公式。

1.1.2使用过程

  • Prompt
    • 由绝对湿度,气压,温度计算相对湿度的python代码
  • Reply
    • img.png
  • 经过验证后的代码
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
    def calculate_relative_humidity(temperature, specific_humidity, pressure):
      # temperature代表温度(单位:开尔文),specific_humidity代表绝对湿度(单位:千克/千克),pressure代表气压(单位:帕斯卡)。
      # 函数将返回相对湿度(以百分比表示)
      # 首先,将温度转换为摄氏度
      temperature_celsius = temperature - 273.15
    
      # 计算饱和水汽压力(根据温度)
      saturated_vapor_pressure = 6.112 * 10 ** ((17.67 * temperature_celsius) / (temperature_celsius + 243.5))
    
      # 计算实际水汽压力
      actual_vapor_pressure = specific_humidity * pressure / (0.622 + 0.378 * specific_humidity)
    
      # 计算相对湿度(以百分比表示)
      relative_humidity = (actual_vapor_pressure / saturated_vapor_pressure) * 100
      return relative_humidity
1.2 实现自动化定时运行

1.2 实现自动化定时运行

1.2.1概述

如题

1.2.2使用过程

  • Prompt
    • 我现在需要在bash terminal 中执行python代码,当检查到数据存在的时候,并且gpu memery空闲超过2000m时执行,每五分钟检查一次
  • Reply
    • img_1.png
  • 经过验证后的代码
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash

# 定义数据文件路径
data_file="/path/to/your/data.txt"

# 设置GPU内存阈值
threshold=2000

while true; do
    # 检查数据文件是否存在
    if [ -e "$data_file" ]; then
        # 获取GPU空闲内存(以MB为单位)
        gpu_free_memory=$(nvidia-smi --query-gpu=memory.free --format=csv,noheader,nounits | awk '{print $1}')

        # 检查GPU空闲内存是否超过阈值
        if [ "$gpu_free_memory" -gt "$threshold" ]; then
            echo "Data file found and GPU free memory exceeds $threshold MB. Executing Python script..."
            # 执行Python脚本
            python3 /path/to/your/python/script.py
            break  # 执行后退出循环
        else
            echo "Data file found, but GPU free memory is below $threshold MB. Skipping execution."
        fi
    else
        echo "Data file not found. Skipping execution."
    fi

    # 等待五分钟
    sleep 300
done

2 气象相关工具总结

2.1 可视化工具

2.1 可视化工具

3 气象数据网站总结

3.1 开源数据下载网站

3.1 开源数据下载网站