Re: Question of format

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue Mar 22 2011 - 14:37:33 MDT

http://www.ncl.ucar.edu/Document/Functions/io.shtml

Go to "write_matrix"

http://www.ncl.ucar.edu/Document/Functions/Built-in/write_matrix.shtml

On 3/22/11 2:24 PM, wei chih chen wrote:
> Dear NCL user,
> I have a problem outputing the data format. When I use asciiwrite to
> output the data, my output has lat, lon, value, and it looks like
>
> 41.73556
> -87.53095
> 23.23955
> 41.6049
> -86.90971
> 23.14267
> 41.35524
> -86.46437
> 23.13775
> 42.42077
> -88.20273
> 22.91891
> 42.27899
> -87.82433
> 22.96287
>
> But, for my purpose, I want it looks like
> 41.56 -88.47 -7.56
> 41.84 -88.38 -7.89
> 41.77 -88.00 -7.45
> 41.70 -87.63 -6.94
> 41.62 -87.25 -6.94
> 41.55 -86.88 -6.67
> 42.12 -88.28 -7.81
> 42.05 -87.90 -6.92
>
> I post my part of code below. Could anyone be kind of helping me with
> the format. Thank you.
>
> interp_val = dspnt2(x_SUNTANS_Grid,y_SUNTANS_Grid,val,x_WRF,y_WRF)
> interp_lat= dspnt2(x_SUNTANS_Grid,y_SUNTANS_Grid,lat,x_WRF,y_WRF)
> interp_lon=dspnt2(x_SUNTANS_Grid,y_SUNTANS_Grid,lon,x_WRF,y_WRF)
> ;print(dimsizes(interp_lat))
> narray=new((/161,3/),float)
> narray(:,0)=interp_lat
> narray(:,1)=interp_lon
> narray(:,2)=interp_val
>
> asciiwrite(filename,narray)
>
> --
> Best regards
> Wei-Chih
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Mar 22 14:37:39 2011

This archive was generated by hypermail 2.1.8 : Wed Mar 23 2011 - 16:15:59 MDT