Dear NCL talk,
I have some problem in zooming into a polar stereographic projection
over Southern Hemisphere by specifying a "Corner" Limit.
I read an array of binary data in native AMPS grid, then read a
auxiliary netcdf file to retrieve latitude and longitude. I then use the
function /gsn_csm_contour_map_polar/ with "opts" options where I set up
mpLimitMode to be Corners and mp Right/Left Corner Lat/Lon F to be the
values at the corners of the netcdf file. I got a message of
warning:MapSetTrans: map limits invalid - using maximal area such that
I've done something wrong and I need your help to solve it!
My check is that mpLeftCornerLonF < mpRightCornerLonF, and that
mpLeftCornerLatF and mpRightCornerLatF look correct, so I don't know...
Many thanks!
Yann MICHEL
Description of opts:
Variable: opts
Type: logical
Total Size: 4 bytes
1 values
Number of Dimensions: 1
Dimensions and sizes: [1]
Coordinates:
Number Of Attributes: 19
mpCenterLonF : 180
mpRightCornerLonF : 215.9594
mpRightCornerLatF : -22.03884
mpLeftCornerLonF : 38.3541
mpLeftCornerLatF : -24.93765
mpLimitMode : Corners
sfYArray : <ARRAY of 63291 elements>
sfXArray : <ARRAY of 63291 elements>
mpFillOn : False
gsnPolar : SH
mpProjection : Stereographic
cnLinesOn : True
cnFillOn : False
cnLevelSelectionMode : ExplicitLevels
cnLevels : ( 0.01, 0.05, 0.2, 0.5, 0.8 )
gsnDraw : False
gsnFrame : False
gsnMaximize : True
gsnContourLineThicknessesScale : 1
(0) True
warning:MapSetTrans: map limits invalid - using maximal area
Script:
; ----------------------------------------------*
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
;------------------------------------------------
begin
;------------------------------------------------
; read in data
;------------------------------------------------
works="ps" ; open a ps file
domain = "d01"
type="tau"
region = "ampsrt_"+domain
dir = "/ptmp/yann/data/ampsrt/Oct2008_NL"+domain+"/working/"
N_imp = 25
;----------------------------------------------------------------------------
; control_variables_3d=(/"psi","chi_u","t_u","rh", "ps_u"/)
control_variables_3d=(/"ps_u"/)
Nb_vars=dimsizes(control_variables_3d)
;----------------------------------------------------------------------------
wks = gsn_open_wks (works,"impulse_recf_"+region+"_"+type) ; open
workstation
res = True ; plot mods desired
res_at_cnFillOn = False ; fill contour intervals
res_at_cnLevelSelectionMode = "ExplicitLevels"
res_at_cnLevels=(/10^(-2),0.05,0.2,0.5,0.8/)
res_at_gsnDraw = False ; (a) donnot draw
res_at_gsnFrame = False ; (b) donnot advance 'frame'
res_at_gsnMaximize = True
res_at_gsnContourLineThicknessesScale = 1.0 ; thickness
; create map from a given Netcdf auxiliary file
nc_file =
addfile("/ptmp/yann/data/ampsrt/rc/2009052400/wrfinput_"+domain+".nc","r")
lat = nc_file->XLAT(0,:,:)
lon = nc_file->XLONG(0,:,:)
print("netcdf size")
print(dimsizes(lat))
print(dimsizes(lon))
;----------------------------------------------------------------------------
do kvar=0,Nb_vars-1
filename =
dir+control_variables_3d(kvar)+"/impulse_response_"+type+"_"+control_variables_3d(kvar)+".dat"
do l = 0, N_imp-1
dim = fbinrecread (filename,2*l,4,"integer")
ii = dim(0)
jj = dim(1)
ni = dim(2)
nj = dim(3)
print("test function at "+ii+","+jj+" size "+ni+" "+nj)
test_function = fbinrecread (filename, 2*l+1, (/nj,ni/),"double")
opts = res
opts_at_cnLinesOn = True ; contour lines
opts_at_mpProjection = "Stereographic"
opts_at_gsnPolar = "SH"
; opts_at_mpEllipticalBoundary = True
opts_at_mpFillOn = False
opts_at_sfXArray = lon
opts_at_sfYArray = lat
opts_at_mpLimitMode = "Corners" ; choose map limits
y1 = 0
x1 = 0
y2 = dim(3)-1
x2 = dim(2)-1
opts_at_mpLeftCornerLatF = lat(y1,x1)
opts_at_mpLeftCornerLonF = lon(y1,x1)
opts_at_mpRightCornerLatF = lat(y2,x2)
opts_at_mpRightCornerLonF = lon(y2,x2)
if ( opts_at_mpRightCornerLonF .lt. 0.0 ) then
opts_at_mpRightCornerLonF = opts_at_mpRightCornerLonF + 360.0
end if
opts_at_mpCenterLonF = 180.0
opts_at_mpGeophysicalLineColor = "black"
opts_at_mpGridLineColor = "black"
opts_at_cnLineLabelsOn = True
opts_at_cnLineLabelFontQuality="High"
opts_at_cnLineLabelPlacementMode="Computed"
opts_at_cnLineLabelDensityF=0.6
opts_at_sfDataArray = test_function
plot = gsn_csm_contour_map_polar(wks,test_function,opts) ; create
plot
draw(plot)
frame(wks)
end do
end do
end
;----------------------------------------------------------------------------
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Jul 07 2009 - 11:00:40 MDT
This archive was generated by hypermail 2.2.0 : Wed Jul 08 2009 - 14:48:16 MDT