爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 5994|回复: 5

【已解决】

[复制链接]

新浪微博达人勋

发表于 2022-2-27 18:12:50 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
本帖最后由 阿羊出没请注意 于 2022-4-1 10:12 编辑

不知道怎么删帖子
06_02_08_skewt_(40,125).png
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2022-2-27 18:14:59 | 显示全部楼层
数据信息如下

Variable: f
Type: file
filename:        download_pre_2021_05_31_19
path:        D:/1aaa研究生/work3_dblw_LLP/data/20210531-0603_ERA5/download_pre_2021_05_31_19.grib
   file global attributes:
   dimensions:
      initial_time0_hours = 1
      lv_ISBL1 = 37
      g0_lat_2 = 361
      g0_lon_3 = 721
   variables:
      float Z_GDS0_ISBL ( initial_time0_hours, lv_ISBL1, g0_lat_2, g0_lon_3 )
         center :        European Center for Medium-Range Weather Forecasts (RSMC)
         long_name :        Geopotential
         units :        m**2 s**-2
         _FillValue :        1e+20
         level_indicator :        100
         gds_grid_type :        0
         parameter_table_version :        128
         parameter_number :        129
         forecast_time :        0
         forecast_time_units :        hours

      float T_GDS0_ISBL ( initial_time0_hours, lv_ISBL1, g0_lat_2, g0_lon_3 )
         center :        European Center for Medium-Range Weather Forecasts (RSMC)
         long_name :        Temperature
         units :        K
         _FillValue :        1e+20
         level_indicator :        100
         gds_grid_type :        0
         parameter_table_version :        128
         parameter_number :        130
         forecast_time :        0
         forecast_time_units :        hours

      float U_GDS0_ISBL ( initial_time0_hours, lv_ISBL1, g0_lat_2, g0_lon_3 )
         center :        European Center for Medium-Range Weather Forecasts (RSMC)
         long_name :        U velocity
         units :        m s**-1
         _FillValue :        1e+20
         level_indicator :        100
         gds_grid_type :        0
         parameter_table_version :        128
         parameter_number :        131
         forecast_time :        0
         forecast_time_units :        hours

      float V_GDS0_ISBL ( initial_time0_hours, lv_ISBL1, g0_lat_2, g0_lon_3 )
         center :        European Center for Medium-Range Weather Forecasts (RSMC)
         long_name :        V velocity
         units :        m s**-1
         _FillValue :        1e+20
         level_indicator :        100
         gds_grid_type :        0
         parameter_table_version :        128
         parameter_number :        132
         forecast_time :        0
         forecast_time_units :        hours

      float Q_GDS0_ISBL ( initial_time0_hours, lv_ISBL1, g0_lat_2, g0_lon_3 )
         center :        European Center for Medium-Range Weather Forecasts (RSMC)
         long_name :        Specific humidity
         units :        kg kg**-1
         _FillValue :        1e+20
         level_indicator :        100
         gds_grid_type :        0
         parameter_table_version :        128
         parameter_number :        133
         forecast_time :        0
         forecast_time_units :        hours

      float W_GDS0_ISBL ( initial_time0_hours, lv_ISBL1, g0_lat_2, g0_lon_3 )
         center :        European Center for Medium-Range Weather Forecasts (RSMC)
         long_name :        Vertical velocity
         units :        Pa s**-1
         _FillValue :        1e+20
         level_indicator :        100
         gds_grid_type :        0
         parameter_table_version :        128
         parameter_number :        135
         forecast_time :        0
         forecast_time_units :        hours

      float R_GDS0_ISBL ( initial_time0_hours, lv_ISBL1, g0_lat_2, g0_lon_3 )
         center :        European Center for Medium-Range Weather Forecasts (RSMC)
         long_name :        Relative humidity
         units :        %
         _FillValue :        1e+20
         level_indicator :        100
         gds_grid_type :        0
         parameter_table_version :        128
         parameter_number :        157
         forecast_time :        0
         forecast_time_units :        hours

      double initial_time0_hours ( initial_time0_hours )
         long_name :        initial time
         units :        hours since 1800-01-01 00:00

      double initial_time0_encoded ( initial_time0_hours )
         long_name :        initial time encoded as double
         units :        yyyymmddhh.hh_frac

      float g0_lat_2 ( g0_lat_2 )
         long_name :        latitude
         GridType :        Cylindrical Equidistant Projection Grid
         units :        degrees_north
         Dj :        0.25
         Di :        0.25
         Lo2 :        180
         La2 :         0
         Lo1 :         0
         La1 :        90

      float g0_lon_3 ( g0_lon_3 )
         long_name :        longitude
         GridType :        Cylindrical Equidistant Projection Grid
         units :        degrees_east
         Dj :        0.25
         Di :        0.25
         Lo2 :        180
         La2 :         0
         Lo1 :         0
         La1 :        90

      integer lv_ISBL1 ( lv_ISBL1 )
         long_name :        isobaric level
         units :        hPa

      string initial_time0 ( initial_time0_hours )
         long_name :        Initial time of first record
         units :        mm/dd/yyyy (hh:mm)


密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2022-2-28 10:23:47 | 显示全部楼层
图片为什么加载不出来 06_02_08_skewt_(40,125).png
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2022-3-27 10:19:13 | 显示全部楼层
大佬所以是怎么画的,我的数据也是这样的,可以分享吗我是小白不会啊,感谢感谢
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2022-3-27 19:56:09 | 显示全部楼层
小雨啊丫 发表于 2022-3-27 10:19
大佬所以是怎么画的,我的数据也是这样的,可以分享吗我是小白不会啊,感谢感谢

t-logp图吗?
这是脚本,我写的很乱的,你凑合看

;**************************************************
; skewt_6.ncl
;
; Concepts illustrated:
;   - Reading RUC (Rapid Update Cycle)  GRIB data
;   - Using getind_latlon2d to determine grid locations
;   - Drawing Skew-T plots at nearest grid locations  
;                    to user specified locations
;**************************************************
;
; These files are loaded by default in NCL V6.2.0 and newer
; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
;
; This file still has to be loaded manually
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/skewt_func.ncl"
;***********************************************
; RUC Data downloaded from:
;     http://nomads.ncdc.noaa.gov/data ... es_weather_datasets
; RUC-ANL: http
;     Specifically: http://nomads.ncdc.noaa.gov/data/rucanl/201205/20120501/
;***********************************************
; The GRIB file's contents can be examined via:
;     ncl_filedump -itime ruc2anl_130_20120501_0000_000.grb2  | less
;***********************************************
begin

; --- Read RUC GRIB file------------;
  diri  = "D:/1aaa研究生/work3_dblw_LLP/data/20210531-0603_ERA5/"
  fili  = "download_pre_2021_06_02_06.grib"

                                    ; force a 'time' dimension
  setfileoption("grb","SingleElementDimensions","Initial_time")
  f     = addfile(diri+fili,"r")
  p     = f->lv_ISBL1               ;  ( lv_ISBL0 )
  p@units = "hPa"                   ; skewT, mixhum_ptrh use mb (hPa)
  time  = f->initial_time0  ; yyyymmddhh.hh_frac

                                    ; RUC grid point locations
  lat2d = f->g0_lat_2              ; ( ygrid_0, xgrid_0 )
  lon2d = f->g0_lon_3
  print("lat2d: min="+min(lat2d)+"  ;  max="+max(lat2d))
  print("lon2d: min="+min(lon2d)+"  ;  max="+max(lon2d))
; --- Specify one or more locations

  ; lat   = (/ 25    , 55 /)   
  ; lon   = (/110 ,140   /)   
  ; npts  = dimsizes(lat)
  ; lat=42
  ; lon=121   ;dry
  lat=45
  lon=122.5   ;rainy
  ; lat=50
  ; lon=125
  ; (47,132)
  ; lat=47
  ; lon=132

;*************************
; create plot(s)
;*************************

  skewtOpts                 = True
  skewtOpts@DrawColAreaFill = True    ; default is False
   
  dataOpts   = True
  dataOpts@PrintZ = True


  ; do n=0,npts-1           ; loop over each grid pt

         ; find grid point nearest the user specified location
     ; nm  = getind_latlon2d (lat2d,lon2d, lat, lon)   ;查找最接近用户指定的纬度/经度坐标对的索引(下标)
     ; nn  = nm(0,0)
     ; mm  = nm(0,1)
     ; print("location=("+lat(n)+","+lon(n)+")  grid=("+lat2d(nn,mm)+","+lon2d(nn,mm)+")")
  ; (40,125)
     tk   = f->T_GDS0_ISBL(0,:,200,500)      
     z    = f->Z_GDS0_ISBL(0,:,200,500)   ;位势高度,需要/9.8得到m
     rh   = f->R_GDS0_ISBL(0,:,200,500)
     u    = f->U_GDS0_ISBL(0,:,200,500)
     v    = f->V_GDS0_ISBL(0,:,200,500)
  ; (47,132)
     ; tk   = f->T_GDS0_ISBL(0,:,172,528)      
     ; z    = f->Z_GDS0_ISBL(0,:,172,528)
     ; rh   = f->R_GDS0_ISBL(0,:,172,528)
     ; u    = f->U_GDS0_ISBL(0,:,172,528)
     ; v    = f->V_GDS0_ISBL(0,:,172,528)


         ; change units and calculate needed variables
     z    =z/9.8
     z@units="m"
     ;print(z)

     tc   = tk - 273.15
     tc@units= "degC"            

     q    = mixhum_ptrh (p, tk, rh, 2)
      ; q    =q*1000
     q@units = "kg/kg"

     tdc  = dewtemp_trh(tk,rh) - 273.15
     tdc@units = "degC"            

     wspd = sqrt(u^2 + v^2)
     wdir = wind_direction(u,v,0)

     itime= toint(time)
     skewtOpts@tiMainString    = time+"    ("+lat+","+lon+")"
          ; each location will have a different file name      
     wks  = gsn_open_wks ("png", "06_02_06_skewt_("+lat2d(200)+","+lon2d(500)+")")
     skewt_bkgd = skewT_BackGround (wks, skewtOpts)
     skewt_data = skewT_PlotData   (wks, skewt_bkgd, p,tc,tdc,z \
                                       , wspd,wdir, dataOpts)
     draw (skewt_bkgd)
     draw (skewt_data)
     frame(wks)
  ; end do

end
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2022-3-28 13:32:35 | 显示全部楼层
是的是的,太感谢大佬了
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表