[ncl-talk] reodering data

Dennis Shea shea at ucar.edu
Wed Mar 18 09:44:15 MDT 2015


variable: nr2pgbq_T
Type: float
Total Size: 107976960 bytes
             26994240 values
Number of Dimensions: 3
Dimensions and sizes:    [lv_ISBL3 | 26] x [lat | 721] x [lon | 1440]
Coordinates:
             lat: [-90..90]
             lon: [-179.75..180]   <=====
+++++
Variable: anal_pgbq_T
Type: float
Total Size: 107976960 bytes
             26994240 values
Number of Dimensions: 3
Dimensions and sizes:    [lv_ISBL3 | 26] x [g0_lat_0 | 721] x [g0_lon_1
| 1440]
Coordinates:
             lv_ISBL3: [10..1000]
             g0_lat_0: [-90..90]
             g0_lon_1: [ 0..359.75] <=========
+++++
Assuming the levels are the same ... (no level coord variable for
anal_pgbq_T)

anal_pgbq_T = lonFlip(anal_pgbq_T)
printVarSummary(anal_pgbq_T)    ; look at lon coord variable

diff = nr2pgbq_T - anal_pgbq_T
diff at long_name = "Difference T"
dif at units = anal_pgbq_T at units
copy_VarCoords(anal_pgbq_T, diff)
printVarSummary(diff)




On Wed, Mar 18, 2015 at 9:29 AM, Agnes Lim Huei Ni <alim at ssec.wisc.edu>
wrote:

> Hi,
>
>
> I have two arrays which I would like to take the difference. But looks
> like i need to do some reordering before i can subtract them.
>
> Variable: nr2pgbq_T
> Type: float
> Total Size: 107976960 bytes
>              26994240 values
> Number of Dimensions: 3
> Dimensions and sizes:    [lv_ISBL3 | 26] x [lat | 721] x [lon | 1440]
> Coordinates:
>              lat: [-90..90]
>              lon: [-179.75..180]
> Number Of Attributes: 1
>    _FillValue :    1e+15
>
> Variable: anal_pgbq_T
> Type: float
> Total Size: 107976960 bytes
>              26994240 values
> Number of Dimensions: 3
> Dimensions and sizes:    [lv_ISBL3 | 26] x [g0_lat_0 | 721] x [g0_lon_1
> | 1440]
> Coordinates:
>              lv_ISBL3: [10..1000]
>              g0_lat_0: [-90..90]
>              g0_lon_1: [ 0..359.75]
> Number Of Attributes: 12
>    center :    US National Weather Service - NCEP (WMC)
>    long_name :    Temperature
>    units :    K
>    _FillValue :    1e+20
>    level_indicator :    100
>    gds_grid_type :    0
>    parameter_table_version :    2
>    parameter_number :    11
>    model :    Spectral Statistical Interpolation (SSI) analysis from
> "Final" run.
>    forecast_time :    0
>    forecast_time_units :    hours
>    initial_time :    04/12/2006 (18:00)
>
> The following is a code segment that I have used.
>
>   anal_pgbq_T=anal_pgbq->TMP_GDS0_ISBL_10
>          lat=guess_pgbq->g0_lat_0
>          lon=guess_pgbq->g0_lon_1
>
>          nr2pgbq_T=nr2pgbq->regrid_int_nr_T
>          anal_pgbq_T=anal_pgbq_T(:,::-1,::-1)
>          anal_pgbq_T!1="lat"
>          anal_pgbq_T!2="lon"
>
>          dim=dimsizes(lon)
>          do i=1, dim(0)-1
>             if(lon(i) .gt. 180.0) then
>               lon(i)=lon(i)-360
>             end if
>          end do
>          lon_1=new((/dim(0)/), "float")
>          lon_1(0:718)=lon(721:1439)
>          lon_1(719:1439)=lon(0:720)
>          delete(dim)
>
>          anal_pgbq_T&lon=lon_1
>
>          printVarSummary(nr2pgbq_T)
>          printVarSummary(anal_pgbq_T)
>
> I am seeing regions of much larger difference than I expected, does
> checking if I reorder my data incorrectly before subtracting.
>
> Thanks
> Agnes
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150318/a1ecea15/attachment.html 


More information about the ncl-talk mailing list