[Thread Prev][Thread Next][Index]

Re: [ferret_users] Fw: problem in REshape



Hi,

RESHAPE will take all the data you give it, in this case the entire grid of qlwave, turn it in into a long 1-dimensional list, and then assign the values to the grid of the second argument. So, what you have specified will string together into a list the over 11 million values in the variable qlwave[x=1:193,y=1:87,y=1:697]. Then it will take the first 697 values from that list, and put them onto that time axis. The result of the _expression_ you have defined using reshape function has its grid only in the T direction.

I think what you want to do instead is this: Use a regridding transformation. The @ASN transformation will simply associate the first L index of the grid with the first L index of the axis and so forth.


yes? let/unit='W/m^2'/title='long wave heat flux' qlwave_on_time=qlwave,[gt=day_axis@asn]

This will still have the dependence on the original X and Y axes, but with the new day_axis in the T direction, so you can plot it at any chosen X,Y location.

Or, you could do this, to use RESHAPE to put only the timeseries at a single X,Y location onto the new day axis.

yes? let/unit='W/m^2'/title='long wave heat flux' qlwave_on_time=RESHAPE(qlwave[x=74,y=33],t[gt=day_axis])
yes? plot qlwave_on_time

Ansley

On 9/7/2017 1:42 PM, 'sarasari206@xxxxxxxxx' via _OAR PMEL Ferret Users wrote:

Hi,
I try this script:

define axis/t=1:30/npoints=697/units=day day_axis
yes? let/unit='W/m^2'/title='long wave heat flux' qlwave_on_time=RESHAPE(qlwave,t[gt=day_axis])
yes? plot qlwave_on_time[x=74,y=33]
but it produces the attached plot 1.
While when I just ask plot qlwave[x=74,y=33] it plots correctly as in the second attachment.
anybody knows why the RESHAPE command works improperly?

here is the details:

use rhoneG_1.tsout2N
yes? sh d
currently SET data sets:
1> ./rhoneG_1.tsout2N (default)
name title I J K L M N
XOUT longitude 1:193 1:87 ... ... ... ...
YOUT latitude 1:193 1:87 ... ... ... ...
DEPOUT Mean_water_depth 1:193 1:87 ... ... ... ...
TIME Time ... ... 1:697 ... ... ...
QLWAVE Long-wave_heat_flux 1:193 1:87 1:697 ... ... ...

Thank you,
Sara









[Thread Prev][Thread Next][Index]