Skip to main content
Formatting
Source Link
milancurcic
  • 5k
  • 1
  • 29
  • 41

Updated:

Try NCL. It It has a package for WRF-related functions, including the bidirectional grid-coordinates conversion routine.

To convert coordinate pairs to grid indices, follow the documentation here: wrf_user_ll_to_ij. A backward (i.e. gird to coordinate) routine can be found here: wrf_user_ij_to_ll

They. They are quite handy.

For your scenario, you may load your parent domain files (either 'geo_em'geo_em or 'wrfout' ncwrfout NetCDF files), and then specify the child domain starting coordinate, you will get the results.

Here are some examples from the official documentation:

  1. conversion from coordinate to grid indices:

    load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl" a = addfile("wrfout_d01_2000-01-24_12:00:00.nc","r") loc = wrf_user_ij_to_ll(a, 10., 30., True) print("lon location is: " + loc(0)) print("lat location is: " + loc(1))

Conversion from coordinate to grid indices:

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
a   = addfile("wrfout_d01_2000-01-24_12:00:00.nc","r")
loc = wrf_user_ij_to_ll(a, 10., 30., True)
print("lon location is: " + loc(0))
print("lat location is: " + loc(1))

2.conversionConversion from grid indices to coordinate:

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl" 
a = addfile("wrfout_d01_2000-01-24_12:00:00.nc","r")
res = True
res@returnInt = False                             ; return real values
loc  = wrf_user_ll_to_ij(a, -100.0, 40.0, res)
print("X/Y location is: " + loc)

Updated:

Try NCL. It has a package for WRF-related functions, including the bidirectional grid-coordinates conversion routine.

To convert coordinate pairs to grid indices, follow the documentation here: wrf_user_ll_to_ij. A backward (i.e. gird to coordinate) routine can be found here: wrf_user_ij_to_ll

They are quite handy.

For your scenario, you may load your parent domain files (either 'geo_em' or 'wrfout' nc files), and then specify the child domain starting coordinate, you will get the results.

Here are some examples from the official documentation:

  1. conversion from coordinate to grid indices:

    load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl" a = addfile("wrfout_d01_2000-01-24_12:00:00.nc","r") loc = wrf_user_ij_to_ll(a, 10., 30., True) print("lon location is: " + loc(0)) print("lat location is: " + loc(1))

2.conversion from grid indices to coordinate:

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl" 
a = addfile("wrfout_d01_2000-01-24_12:00:00.nc","r")
res = True
res@returnInt = False                             ; return real values
loc  = wrf_user_ll_to_ij(a, -100.0, 40.0, res)
print("X/Y location is: " + loc)

Try NCL. It has a package for WRF-related functions, including the bidirectional grid-coordinates conversion routine.

To convert coordinate pairs to grid indices, follow the documentation here: wrf_user_ll_to_ij. A backward (i.e. gird to coordinate) routine can be found here: wrf_user_ij_to_ll. They are quite handy.

For your scenario, you may load your parent domain files (either geo_em or wrfout NetCDF files), and then specify the child domain starting coordinate, you will get the results.

Here are some examples from the official documentation:

Conversion from coordinate to grid indices:

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
a   = addfile("wrfout_d01_2000-01-24_12:00:00.nc","r")
loc = wrf_user_ij_to_ll(a, 10., 30., True)
print("lon location is: " + loc(0))
print("lat location is: " + loc(1))

Conversion from grid indices to coordinate:

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl" 
a = addfile("wrfout_d01_2000-01-24_12:00:00.nc","r")
res = True
res@returnInt = False                             ; return real values
loc  = wrf_user_ll_to_ij(a, -100.0, 40.0, res)
print("X/Y location is: " + loc)
added examples
Source Link
sunt05
  • 191
  • 1
  • 4

Updated:

Try NCL. It has a package for WRF-related functions, including the bidirectional grid-coordinates conversion routine.

To convert coordinate pairs to grid indices, follow the documentation here: wrf_user_ll_to_ij. A backward (i.e. gird to coordinatescoordinate) routine can be found here: wrf_user_ij_to_ll

They are quite handy.

For your scenario, you may load your parent domain files (either 'geo_em' or 'wrfout' nc files), and then specify the child domain starting coordinate, you will get the results.

Here are some examples from the official documentation:

  1. conversion from coordinate to grid indices:

    load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl" a = addfile("wrfout_d01_2000-01-24_12:00:00.nc","r") loc = wrf_user_ij_to_ll(a, 10., 30., True) print("lon location is: " + loc(0)) print("lat location is: " + loc(1))

2.conversion from grid indices to coordinate:

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl" 
a = addfile("wrfout_d01_2000-01-24_12:00:00.nc","r")
res = True
res@returnInt = False                             ; return real values
loc  = wrf_user_ll_to_ij(a, -100.0, 40.0, res)
print("X/Y location is: " + loc)

Updated:

Try NCL. It has a package for WRF-related functions, including the bidirectional grid-coordinates conversion routine.

To convert coordinate pairs to grid indices, follow the documentation here: wrf_user_ll_to_ij. A backward (i.e. gird to coordinates) routine can be found here: wrf_user_ij_to_ll

They are quite handy.

Updated:

Try NCL. It has a package for WRF-related functions, including the bidirectional grid-coordinates conversion routine.

To convert coordinate pairs to grid indices, follow the documentation here: wrf_user_ll_to_ij. A backward (i.e. gird to coordinate) routine can be found here: wrf_user_ij_to_ll

They are quite handy.

For your scenario, you may load your parent domain files (either 'geo_em' or 'wrfout' nc files), and then specify the child domain starting coordinate, you will get the results.

Here are some examples from the official documentation:

  1. conversion from coordinate to grid indices:

    load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl" a = addfile("wrfout_d01_2000-01-24_12:00:00.nc","r") loc = wrf_user_ij_to_ll(a, 10., 30., True) print("lon location is: " + loc(0)) print("lat location is: " + loc(1))

2.conversion from grid indices to coordinate:

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl" 
a = addfile("wrfout_d01_2000-01-24_12:00:00.nc","r")
res = True
res@returnInt = False                             ; return real values
loc  = wrf_user_ll_to_ij(a, -100.0, 40.0, res)
print("X/Y location is: " + loc)
added 364 characters in body
Source Link
sunt05
  • 191
  • 1
  • 4

Updated:

Try NCL. It has a package for WRF-related functions, including the bidirectional grid-coordinates conversion routine.

To convert coordinate pairs to grid indices, follow the documentation here: Theywrf_user_ll_to_ij. A backward (i.e. gird to coordinates) routine can be found here: wrf_user_ij_to_ll

They are quite handy.

Try NCL. It has a package for WRF-related functions, including the bidirectional grid-coordinates conversion routine. They are quite handy.

Updated:

Try NCL. It has a package for WRF-related functions, including the bidirectional grid-coordinates conversion routine.

To convert coordinate pairs to grid indices, follow the documentation here: wrf_user_ll_to_ij. A backward (i.e. gird to coordinates) routine can be found here: wrf_user_ij_to_ll

They are quite handy.

Source Link
sunt05
  • 191
  • 1
  • 4
Loading