[Thread Prev][Thread Next][Index]

Re: converting abstract samplexy axis





Hi Joerg

The short answer is to use the RESHAPE function, see documentation.

Here is a script I wrote to sample the pathfinder SST (from a grid) along the ground track of a satellite. I have to use the repeat command to go through all the ground tracks.

Hope this helps,
Rob



! Description: read sst from binary, sample on TP tracks, output to NetCDF
! -----------------------------------------------------------------------
! get Pathfinder SST:
! -----------------------------------------------------------------------
\CANCEL MODE VERIFY
DEFINE SYMBOL out_file = pfsst_alongtrack.cdf

define axis/X=141.7236:179.9561:`360/4096`/units=longitude xaxis_pf
define axis/y=29.66309:39.24316:`180/2048`/units=latitude yaxis_pf
define axis/t="03-JAN:12:00:00":"28-DEC":`365.2425/73`/UNITS=days/MODULO taxis_pf
define grid/x=xaxis_pf/y=yaxis_pf/t=taxis_pf grid_pf

file/var=sst/format=stream/type=r4/grid=grid_pf sst_9km_KE_73pentads.bin

set variable/BAD=-3/UNITS=celsius sst

show data/variables
!contour/fill/L=1 sst

SET DATA lat_lon_shifted.cdf

DEFINE GRID/LIKE=lon/T=taxis_pf g_tr_pt_pftax
SET grid g_tr_pt_pftax
LET sst_alongtr = 1/0 * x * y * t
SET VARIABLE/TITLE="Pathfinder climatological SST"/UNITS=Celsius sst_alongtr
LET dummie = x * y * t

SAVE/CLOBBER/FILE=($out_file)/ILIMITS=1:200/JLIMITS=1:32 \
   /LLIMITS=1:73 sst_alongtr

REPEAT/k=1:`lon,return=jend` (LET lon_tmp = lon_nicest[j=`k`]; \
   SAY "track `k`" ;\
   LET lat_tmp = lat_nicest[j=`k`]; \
   LET sst_track_pt = SAMPLEXY(SST[D=sst_9km_KE_73pentads.bin],lon_tmp,lat_tmp); \
   LET sst_alongtr = RESHAPE(sst_track_pt,dummie[j=`k`]) ; \
   REPEAT/L=1:73 SAVE/QUIET/append/FILE=($out_file)/ILIMITS=1:200/JLIMITS=1:32 \
      /LLIMITS=1:73 sst_alongtr[x=@fave:3] )

CANCEL VARIABLE *tmp, sst_track_pt, sst_alongtr
CANCEL DATA lat_lon_shifted.cdf, sst_9km_KE_73pentads.bin

! -----------------------------------------------------------------------
SAY "Pathfinder SST now on TP tracks in sst_alongtrack_c.cdf"
SAY "Use 'SET DATA sst_alongtrack_c.cdf' to access"
! -----------------------------------------------------------------------
SET MODE /LAST VERIFY







At 03:40 AM 2/3/2005, you wrote:
Hello,

I want to plot irregular spaced ship track measurements as a depth-profile from 90 to -90 degree latitude.
I load my data from a netcdf-file:
yes? use data.nc

I load the measurement location-coordinates from an ascii-file:
yes? file /var="xlon,ylat" coordinates.dat

Have a look on the shiptrack with:
yes? plot xlog,ylat

Use samplexy to create the profile:
LET slantc14 = samplexy(c14[d=1,l=40,y=90:-90],xlon[d=2],ylat[d=2])

Now the horizontal axis is abstract.

How do I convert it back to a real latitude axis???

Cheers
Joerg

Rob Scott
Research Associate
Institute for Geophysics
University of Texas at Austin
4412 Spicewood Springs Rd.
Building 600
Austin, TX
78759

Office: +1-512-471-0375


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement