<div dir="ltr">I think you want <a href="https://www.ncl.ucar.edu/Document/Functions/Contributed/lonFlip.shtml">lonFlip</a> or <a href="https://www.ncl.ucar.edu/Document/Functions/Contributed/lonPivot.shtml">lonPivot</a>. <div><br><div>Redefining the coordinates of a variable wont reoder the associated data. </div><div>anal_pgbq_T&lon=lon_1 ;; this is just defining incorrect coordinates. The variable itself is still <span style="font-size:13.200000762939453px"> </span><span style="font-size:13.200000762939453px">[ 0..359.75] or </span><span style="font-size:13.200000762939453px"> </span><span style="font-size:13.200000762939453px">[ 359.75..0] after that -1 read in.</span><br style="font-size:13.200000762939453px"></div></div><div><span style="font-size:13.200000762939453px"><br></span></div><div><span style="font-size:13.200000762939453px">Alan. </span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 18, 2015 at 11:29 AM, Agnes Lim Huei Ni <span dir="ltr"><<a href="mailto:alim@ssec.wisc.edu" target="_blank">alim@ssec.wisc.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
<br>
I have two arrays which I would like to take the difference. But looks<br>
like i need to do some reordering before i can subtract them.<br>
<br>
Variable: nr2pgbq_T<br>
Type: float<br>
Total Size: 107976960 bytes<br>
26994240 values<br>
Number of Dimensions: 3<br>
Dimensions and sizes: [lv_ISBL3 | 26] x [lat | 721] x [lon | 1440]<br>
Coordinates:<br>
lat: [-90..90]<br>
lon: [-179.75..180]<br>
Number Of Attributes: 1<br>
_FillValue : 1e+15<br>
<br>
Variable: anal_pgbq_T<br>
Type: float<br>
Total Size: 107976960 bytes<br>
26994240 values<br>
Number of Dimensions: 3<br>
Dimensions and sizes: [lv_ISBL3 | 26] x [g0_lat_0 | 721] x [g0_lon_1<br>
| 1440]<br>
Coordinates:<br>
lv_ISBL3: [10..1000]<br>
g0_lat_0: [-90..90]<br>
g0_lon_1: [ 0..359.75]<br>
Number Of Attributes: 12<br>
center : US National Weather Service - NCEP (WMC)<br>
long_name : Temperature<br>
units : K<br>
_FillValue : 1e+20<br>
level_indicator : 100<br>
gds_grid_type : 0<br>
parameter_table_version : 2<br>
parameter_number : 11<br>
model : Spectral Statistical Interpolation (SSI) analysis from<br>
"Final" run.<br>
forecast_time : 0<br>
forecast_time_units : hours<br>
initial_time : 04/12/2006 (18:00)<br>
<br>
The following is a code segment that I have used.<br>
<br>
anal_pgbq_T=anal_pgbq->TMP_GDS0_ISBL_10<br>
lat=guess_pgbq->g0_lat_0<br>
lon=guess_pgbq->g0_lon_1<br>
<br>
nr2pgbq_T=nr2pgbq->regrid_int_nr_T<br>
anal_pgbq_T=anal_pgbq_T(:,::-1,::-1)<br>
anal_pgbq_T!1="lat"<br>
anal_pgbq_T!2="lon"<br>
<br>
dim=dimsizes(lon)<br>
do i=1, dim(0)-1<br>
if(lon(i) .gt. 180.0) then<br>
lon(i)=lon(i)-360<br>
end if<br>
end do<br>
lon_1=new((/dim(0)/), "float")<br>
lon_1(0:718)=lon(721:1439)<br>
lon_1(719:1439)=lon(0:720)<br>
delete(dim)<br>
<br>
anal_pgbq_T&lon=lon_1<br>
<br>
printVarSummary(nr2pgbq_T)<br>
printVarSummary(anal_pgbq_T)<br>
<br>
I am seeing regions of much larger difference than I expected, does<br>
checking if I reorder my data incorrectly before subtracting.<br>
<br>
Thanks<br>
Agnes<br>
<br>
<br>
_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div><br></div>