;First define the file name to be opened. you will need to change this to the file location in your directory args = command_line_args() print, args[0] file1='command_line_args(a)' ;;;;;;idl opens the file id=NCDF_OPEN(file1) NCDF_VARGET,id,'trackid',trackno_xbylr NCDF_VARGET,id,'variables',vars_xbylr NCDF_VARGET,id,'data', data_xbylr NCDF_VARGET,id,'points', points_xbylr NCDF_CLOSE,id num_tracks=n_elements(trackno_xbylr) print, num_tracks num_points=n_elements(points_xbylr) print, num_points ;Define variables and create arrays vort=fltarr(num_tracks,100) ; vorticity at each point on each track vortcolour=strarr(num_tracks,100) ; colour for vorticity value at each point on each track ;;;;If you would like to check it's working so far you can remove the comments here and see the vorticity values it prints ;sanity check? Should show vort vals for first 20 points on first 20 tracks ;print, data_xbylr(0:20,0:20,2) ;;;;For missing values data_xbylr(where(data_xbylr eq 0.0))=!VALUES.F_NAN ; open postscript file - Andy Heaps syntax used from here---from the IDL guide ; ; Adjust file name to save image in your directory PSOPEN, file='command_line_args(b)' ;;;;Map.pro gives you options on projections ;default is MAP,/NH, can reduce the size if give lat/long, hires = high resolution coastlines MAP,/cylindrical, OCEAN=10,LAND=11,/draw,latmin=30,latmax=80,lonmin=-90,lonmax=10 ;;can adjust the lat/long to reduce plot size ;MAP,/sector,OCEAN=10,LAND=11,/draw ;;;I modified sector in map.pro which i would not recommend doing. See if you can adjust the lat/long like in other projections ;Colorscale default is 1 but here we are specifying the number of colours on scale 4 we would like to use to show intensity in vorticity CS,SCALE=4,NCOLS=254 ;;;;;;;;;;Loop thru tracks to assign vorticity into intensity bins for i=0, num_tracks-1 do begin ; loop through track number ; Max jvalue is 2 less than total points - as loops onto next point when plotting for j=0, 98 do begin ; loop through points on track ; create array for the vorticity values, which will define the track colouring vort(i,j) = data_xbylr(i,j,2) ;;;;;;;;;;;;; AMEND THE BIN VALUES DEPENDING ON THE INTENSITY DISTRIBUTIONS if (vort(i,j) gt 0) and (vort(i,j) le 2) then begin vortcolour(i,j) = 2 endif if (vort(i,j) gt 2) and (vort(i,j) le 4) then begin vortcolour(i,j) = 50 endif endif if (vort(i,j) gt 4) and (vort(i,j) le 6) then begin vortcolour(i,j) = 100 endif if (vort(i,j) gt 6) and (vort(i,j) le 8) then begin vortcolour(i,j) = 150 endif if (vort(i,j) gt 8) and (vort(i,j) le 10) then begin vortcolour(i,j) = 200 endif if (vort(i,j) gt 10) then begin vortcolour(i,j) = 250 endif ;VOR='!9'+SCROP(BYTE(120))+'!X' intensity=['VOR<2','2