;filename='socrates_ship_track.20180110.232300.20180221.052900.cdf' pro in2020_v08_ship_track path_prefix='/Volumes/' ;path_prefix='/uufs/chpc.utah.edu/common/home/' imagedir='./' ;imagedir='/uufs/chpc.utah.edu/common/home/u0079358/socrates/' ; Read in the investigator data files filedir='/Users/u0079358/Downloads/' ;filedir='/Users/u0079358/Downloads/in2020_v08_Hydro_Deployments_NetCDF/' ;filedir=path_prefix+'mace-group5/field_programs/investigator/in2020_v08/hydro/' files=file_search(filedir+'IMOS_SOOP-ASF_FMT*.nc',count=numfiles) for f=0,numfiles-1 do begin print,files[f] fid=ncdf_open(files[f]) vid=ncdf_varid(fid,'TIME') & ncdf_varget,fid,vid,time1 vid=ncdf_varid(fid,'LATITUDE') & ncdf_varget,fid,vid,lat1 vid=ncdf_varid(fid,'LONGITUDE') & ncdf_varget,fid,vid,lon1 ncdf_close,fid if time eq !NULL then begin time=time1 lat=lat1 lon=lon1 endif else begin time=[time,time1] lat=[lat,lat1] lon=[lon,lon1] endelse endfor ;TIME:units = "days since 1950-01-01 00:00:00Z" ; day1=julday(1,1,1950) julian_day=double(day1+time) caldat,julian_day,mm,dd,yy,hh,mi,ss ; Write out ship track file ; Make the new filename date_str=string(yy[0],format='(I4)')+string(mm[0],format='(I02)')+$ string(dd[0],format='(I02)')+'.'+string(hh[0],format='(I02)')+$ string(mi[0],format='(I02)')+string(ss[0],format='(I02)')+'.'+$ string(yy[-1],format='(I4)')+string(mm[-1],format='(I02)')+$ string(dd[-1],format='(I02)')+'.'+string(hh[-1],format='(I02)')+$ string(mi[-1],format='(I02)')+string(ss[-1],format='(I02)') print,date_str ; Open the netcdf file cdf_id=ncdf_create('in2020_v08_ship_track.'+date_str+'.cdf',/clobber) ; Define the dimensions numtimes=n_elements(julian_day) time_did=ncdf_dimdef(cdf_id,'time',numtimes) ; Define the variables julian_day_id=ncdf_vardef(cdf_id,'julian_day',time_did,/double) ncdf_attput,cdf_id,julian_day_id,'long_name','IDL julian day' ncdf_attput,cdf_id,julian_day_id,'units','day' lat_id=ncdf_vardef(cdf_id,'lat',time_did,/double) ncdf_attput,cdf_id,lat_id,'long_name','latitude' ncdf_attput,cdf_id,lat_id,'units','degree_north' lon_id=ncdf_vardef(cdf_id,'lon',time_did,/double) ncdf_attput,cdf_id,lon_id,'long_name','longitude' ncdf_attput,cdf_id,lon_id,'units','degree_east' time_id=ncdf_vardef(cdf_id,'time',time_did,/double) ncdf_attput,cdf_id,time_id,'long_name','acquisition time' ncdf_attput,cdf_id,time_id,'units','days since 1950-01-01 00:00:00Z' ; Change from define mode to data mode ncdf_control,cdf_id,/endef ; Put in the variables ncdf_varput,cdf_id,julian_day_id,julian_day ncdf_varput,cdf_id,time_id,time ncdf_varput,cdf_id,lat_id,lat ncdf_varput,cdf_id,lon_id,lon ;ncdf_varput,cdf_id,alt_id,alt ; Close the file ncdf_close,cdf_id stop shipdir='/Users/u0079358/Documents/gpm/' ;shipdir=path_prefix+'mace-group2/socrates/ship_track/' fid=ncdf_open(shipdir+'socrates_ship_track.20180110.232300.20180221.052900.cdf') xid=ncdf_varid(fid,'julian_day') & ncdf_varget,fid,xid,julian_day_ship xid=ncdf_varid(fid,'lat') & ncdf_varget,fid,xid,lat_ship xid=ncdf_varid(fid,'lon') & ncdf_varget,fid,xid,lon_ship ncdf_close,fid ;*************************** ; Colors ;*************************** ; jan feb mar apr may june july ct=['red','orange','green','blue','saddle brown','dodger blue','spring green',$ ; aug sep oct nov dec 'gray','crimson','olive','purple','magenta'] ; jan feb mar apr may june july ct=['red','orange','green','blue','saddle brown','dodger blue','spring green',$ ; aug sep oct nov dec 'gray','crimson','olive','purple','magenta'] ;*************** ; Plot ship track ;*************** ; Set up the plot pxdim=800 pydim=800 ; Position plots xl=0.10 & xr=0.95 yb=0.10 & yt=0.95 sx=0.1 sy=0.12 numplots_x=1 numplots_y=1 position_plots,xl,xr,yb,yt,sx,sy,numplots_x,numplots_y,pos dummy=label_date(date_format=['%N/%D %H:%I']) dx=0.01 & dy=0.01 fs1=14 ;****************** ; BIG MAP ;****************** llat=-70 & ulat=-37.5 llon=60 & rlon=165;195 ; little map llat_little=-54 & ulat_little=-41 llon_little=140 & rlon_little=153 ; Plot flight track on a map pos_big=[0.1,0.1,0.9,0.48] m0=map('mercator',limit=[llat,llon,ulat,rlon],$ box_axes=1,label_position=0,position=pos_big,/buffer,dimensions=[pxdim,pydim],$ fill_color='white',linestyle='dot',font_size=14) m1=mapcontinents(/countries,/USA,color='black',fill_color='pale goldenrod') ;p2=plot([llon,rlon],[62.5,62.5],/overplot,/data,linestyle=0,color='blue') p1=plot([llon_little,rlon_little,rlon_little,llon_little,llon_little],$ [llat_little,llat_little,ulat_little,ulat_little,llat_little],/overplot) p2=plot([llon,rlon],[-50,-50],/overplot,color='black',linestyle=2) p2=plot([llon,rlon],[-62.5,-62.5],/overplot,color='black',linestyle=2) for i=0,11 do begin print,i+1 r=where(mm eq i+1,c) ;0=solid,1=dotted,2=dashed,3=dash dot if c gt 0 then begin p1=plot(lon[r],lat[r],/overplot,color=ct[i],thick=2,linestyle=0) ;stop endif ; r=where(mm_cap2b eq i+1,c) ; if c gt 0 then begin ; p1=plot(lon_cap2b[r],lat_cap2b[r],/overplot,color=ct[i],thick=1,linestyle=0) ; ;stop ; endif ; r=where(mm_cap1a eq i+1,c) ; if c gt 0 then begin ; p1=plot(lon_cap1a[r],lat_cap1a[r],/overplot,color=ct[i],thick=1,linestyle=3) ; ;stop ; endif ; r=where(mm_cap1b eq i+1,c) ;don't need after april 15 ; if c gt 0 then begin ; p1=plot(lon_cap1b[r],lat_cap1b[r],/overplot,color=ct[i],thick=2,linestyle=3) ; ;stop ; endif ;r=where(mm_marcus eq i+1,c) ;if c gt 0 then begin ; p1=plot(lon_marcus[r],lat_marcus[r],/overplot,color=ct[i],thick=2,linestyle=2) ; ;stop ;endif endfor ;*********************** ; Little map ;*********************** ;llat_little=-54 & ulat_little=-41 ;llon_little=140 & rlon_little=153 if 1 eq 0 then begin ; Plot flight track on a map pos_little=[0.565,0.57,0.885,0.9] m0=map('mercator',limit=[llat_little,llon_little,ulat_little,rlon_little],$ box_axes=1,label_position=0,position=pos_little,/current,dimensions=[pxdim,pydim],$ fill_color='white',linestyle='dot',font_size=14);,$;,grid_latitude=2,grid_longitude=2,$ ;font_name='Helvetica') m1=mapcontinents(/countries,/USA,color='black',fill_color='pale goldenrod') p2=plot([llon_little,rlon_little],[-50,-50],/overplot,color='black',linestyle=2) for i=0,11 do begin print,i+1 ; r=where(mm_cap2a eq i+1,c) ;0=solid,1=dotted,2=dashed,3=dash dot ; if c gt 0 then begin ; p1=plot(lon_cap2a[r],lat_cap2a[r],/overplot,color=ct[i],thick=2,linestyle=0) ; ;stop ; endif ; r=where(mm_cap2b eq i+1,c) ;don't need that ; if c gt 0 then begin ; p1=plot(lon_cap2b[r],lat_cap2b[r],/overplot,color=ct[i],thick=2,linestyle=0) ; ;stop ; endif r=where(mm_cap1a eq i+1,c) if c gt 0 then begin p1=plot(lon_cap1a[r],lat_cap1a[r],/overplot,color=ct[i],thick=2,linestyle=3) ;stop endif ; r=where(mm_cap1b eq i+1,c) ; if c gt 0 then begin ; p1=plot(lon_cap1b[r],lat_cap1b[r],/overplot,color=ct[i],thick=1,linestyle=3) ; ;stop ; endif ; r=where(mm_marcus eq i+1,c) ; if c gt 0 then begin ; p1=plot(lon_marcus[r],lat_marcus[r],/overplot,color=ct[i],thick=2,linestyle=2) ; ;stop ; endif endfor endif mx=xl+6*dx my=0.50 t1=text(mx+0*dx,my,'Nov',color=ct[10],font_size=14) t1=text(mx+6*dx,my,'Dec',color=ct[11],font_size=14) t1=text(mx+12*dx,my,'Jan',color=ct[0],font_size=14) t1=text(mx+18*dx,my,'Feb',color=ct[1],font_size=14) t1=text(mx+24*dx,my,'Mar',color=ct[2],font_size=14) t1=text(mx+30*dx,my,'Apr',color=ct[3],font_size=14) ;t1=text(xl+36*dx,my,'May',color=ct[4],font_size=14) ;t1=text(xl+35*dx,my,'Jun',color=ct[5]) ;t1=text(xl+30*dx,my,'Jul',color=ct[6]) ;t1=text(xl+35*dx,my,'Aug',color=ct[7]) ;t1=text(xl+40*dx,my,'Sep',color=ct[8]) ;t1=text(xl+45*dx,my,'Oct',color=ct[9]) ;t1=text(xl+50*dx,my,'Nov',color=ct[10]) ;t1=text(xl+55*dx,my,'Dec',color=ct[11]) tx=mx;xl ty=0.7 tyy=15 caldat,julian_day,mm,dd,yy,hh,mi,ss date_str=string(yy[0],format='(I4)')+string(mm[0],format='(I02)')+string(dd[0],format='(I02)')+$ '-'+string(yy[-1],format='(I4)')+string(mm[-1],format='(I02)')+string(dd[-1],format='(I02)') ;caldat,julian_day_cap1b,mm,dd,yy,hh,mi,ss ;date_str_cap1b=string(yy[0],format='(I4)')+string(mm[0],format='(I02)')+string(dd[0],format='(I02)')+$ ; '-'+string(yy[-1],format='(I4)')+string(mm[-1],format='(I02)')+string(dd[-1],format='(I02)') ;t1=text(tx+0*dx,ty+tyy*dy,'CAPRICORN I',font_size=fs1,/normal) ;p3=polyline([tx+17*dx,tx+22*dx],[ty+(tyy+1)*dy,ty+(tyy+1)*dy],thick=2,linestyle=3,/normal) ;t1=text(tx+0*dx,ty+(tyy-2.5)*dy,date_str_cap1a+', '+date_str_cap1b,color='black',font_size=fs1,/normal) ;t1=text(tx+0*dx,ty+(tyy-2.5)*dy,date_str_cap1a,color='black',font_size=fs1,/normal) ;tyy=8 ;caldat,julian_day_marcus,mm,dd,yy,hh,mi,ss ;date_str_marcus=string(yy[0],format='(I4)')+string(mm[0],format='(I02)')+string(dd[0],format='(I02)')+$ ; '-'+string(yy[-1],format='(I4)')+string(mm[-1],format='(I02)')+string(dd[-1],format='(I02)') ;t1=text(tx+0*dx,ty+tyy*dy,'MARCUS',font_size=fs1,/normal) ;p3=polyline([tx+17*dx,tx+22*dx],[ty+(tyy+1)*dy,ty+(tyy+1)*dy],thick=2,linestyle=2,/normal) ;t1=text(tx+0*dx,ty+(tyy-2.5)*dy,date_str_marcus,font_size=fs1,/normal) ;tyy=1 ;caldat,julian_day_cap2a,mm,dd,yy,hh,mi,ss ;date_str_cap2a=string(yy[0],format='(I4)')+string(mm[0],format='(I02)')+string(dd[0],format='(I02)')+$ ; '-'+string(yy[-1],format='(I4)')+string(mm[-1],format='(I02)')+string(dd[-1],format='(I02)') ;caldat,julian_day_cap2b,mm,dd,yy,hh,mi,ss ;date_str_cap2b=string(yy[0],format='(I4)')+string(mm[0],format='(I02)')+string(dd[0],format='(I02)')+$ ; '-'+string(yy[-1],format='(I4)')+string(mm[-1],format='(I02)')+string(dd[-1],format='(I02)') ;t1=text(tx+0*dx,ty+tyy*dy,'CAPRICORN II',font_size=fs1,/normal) ;p3=polyline([tx+17*dx,tx+22*dx],[ty+(tyy+1)*dy,ty+(tyy+1)*dy],thick=2,linestyle=0,/normal) ;t1=text(tx+0*dx,ty+(tyy-2.5)*dy,date_str_cap2a+', '+date_str_cap2b,color='black',font_size=fs1,/normal) ;t1=text(tx+0*dx,ty+(tyy-2.5)*dy,date_str_cap2a,color='black',font_size=fs1,/normal) ;t1=text(tx+0*dx,ty+(tyy-5)*dy,date_str_cap2b,color='black',font_size=fs1,/normal) ;print,date_str m0.save,imagedir+'in2020_v08_track.png',height=pydim ;m0.save,imagedir+'Fig1_southern_ocean_ship_tracks_v2.eps',height=pydim stop ;****************************** ; Color coded track 4 llat=min(lat_track4) ulat=max(lat_track4) llon=130 rlon=230 ;subsample these arrays n=500;10000 lat_track4=lat_track4[0:-1:n] lon_track4=lon_track4[0:-1:n] julian_day_track4=julian_day_track4[0:-1:n] ; Plot flight track on a map pnum=0 m0=map('mercator',limit=[llat,llon,ulat,rlon],$ box_axes=1,label_position=0,position=pos[pnum,*],/buffer,dimensions=[pxdim,pydim],$ fill_color='white',linestyle='dot',font_size=10,$;,grid_latitude=2,grid_longitude=2,$ font_name='Helvetica',center_longitude=(rlon-llon)/2.0) m1=mapcontinents(/countries,/USA,color='black',fill_color='pale goldenrod') ;cnum=bytscl(julian_day,top=top_color) cnum=bytscl(julian_day_track4,top=top_color) for i=0,n_elements(lon_track4)-3 do begin if i mod 100 eq 0 then print,i,'i',n_elements(lon_track4) cvec=transpose(cbtable[cnum[i],*]) p1=plot(lon_track4[i:i+2],lat_track4[i:i+2],/overplot,color=cvec,thick=2) ; rgb_triplet=cbtable[colored_track[i],*] ; p1=plot([lon[i]],[lat[i]],/overplot,color=[0,0,0],thick=1) endfor ;t1=text(xl,0.95,'RV Investigator ship track Jan-Feb 2018',font_size=10,font_name='Helvetica') ; Colorbar c0=colorbar(orientation=1,$ rgb_table=cbtable,$ range=[min(julian_day_track4),max(julian_day_track4)],$ ;xtickformat='label_date',$ major=10,$ tickformat='label_date',$ position=[0.97,0.16,0.98,0.79],ticklayout=1,$ ; tickvalues=[julian_day[0],$ ;julday(3,16,2016,0,0,0),$ ;julday(3,19,2016,0,0,0),$ ;julday(3,22,2016,0,0,0),$ ;julday(3,25,2016,0,0,0),$ ;julday(4,2,2016,0,0,0),$ ; julian_day[-1]],$ font_size=10,font_name='Helvetica',$;ticklen=0.8,$ tickdir=1,border=1) ;; Plot cloudsat analysis box ;cs_ulat=-45.0 ;cs_llat=-53.0 ;cs_rlon=152.0 ;cs_llon=141.0 ;p3=plot([cs_llon,cs_rlon,cs_rlon,cs_llon,cs_llon],$ ; [cs_llat,cs_llat,cs_ulat,cs_ulat,cs_llat],/overplot,thick=2,color='gray') ;p1=plot(lon[0:10],lat[0:10],/overplot,color=[cbtable[20,*]],thick=1) ;cvec=transpose(cbtable[100,*]) ;p1=plot(lon[0:10],lat[0:10],/overplot,color=cvec,thick=1) ;p1=plot(lon[0:10],lat[0:10],/overplot,color=[255,255,255],thick=1) ; ;for i=0,n_elements(lon)-3 do begin ; if i mod 10 eq 0 then print,i,'i',n_elements(lon) ; cvec=transpose(cbtable[cnum[i],*]) ; p1=plot(lon[i:i+2],lat[i:i+2],/overplot,color=cvec,thick=2) ;; rgb_triplet=cbtable[colored_track[i],*] ;; p1=plot([lon[i]],[lat[i]],/overplot,color=[0,0,0],thick=1) ;endfor ;t1=text(xl,0.95,'RV Investigator ship track Jan-Feb 2018',font_size=10,font_name='Helvetica') ;; Colorbar ;c0=colorbar(orientation=1,$ ; rgb_table=cbtable,$ ; range=[min(julian_day),max(julian_day)],$ ; ;xtickformat='label_date',$ ; major=10,$ ; tickformat='label_date',$ ; position=[0.97,0.16,0.98,0.79],ticklayout=1,$ ;; tickvalues=[julian_day[0],$ ; ;julday(3,16,2016,0,0,0),$ ; ;julday(3,19,2016,0,0,0),$ ; ;julday(3,22,2016,0,0,0),$ ; ;julday(3,25,2016,0,0,0),$ ; ;julday(4,2,2016,0,0,0),$ ;; julian_day[-1]],$ ; font_size=10,font_name='Helvetica',$;ticklen=0.8,$ ; tickdir=1,border=1) m0.save,imagedir+'plot_ship_track4.png',height=pydim ;m0.save,'plot_4_ship_tracks.'+date_str+'.png',height=pydim ;m0.save,'ship_track.'+date_str+'.eps',height=pydim stop end