pro read_southern_ocean_ship_sub, file_path, file_name, doy, latitude, longitude, SOG, COG, heading, port_wspd, port_wdir ; Get the data from the txt file ;**************************************************************** ; Information to set up the fssp data structure ;**************************************************************** ;x=ascii_template(filedir+'/'+filename) ;IDL> print,x ;{ 1.00000 0 32 NaN 12 4 4 4 4 4 4 4 4 4 4 4 4 ;FIELD01 FIELD02 FIELD03 FIELD04 FIELD05 FIELD06 FIELD07 FIELD08 FIELD09 FIELD10 FIELD11 FIELD12 ; 3 14 24 34 44 55 65 75 85 95 105 115 ; 0 1 2 3 4 5 6 7 8 9 10 11 ;} ;IDL> help,/struct,x ;** Structure <14018c08>, 10 tags, length=376, data length=369, refs=1: ; VERSION FLOAT 1.00000 ; DATASTART LONG 0 ; DELIMITER BYTE 32 ; MISSINGVALUE FLOAT NaN ; COMMENTSYMBOL STRING '' ; FIELDCOUNT LONG 12 ; FIELDTYPES LONG Array[12] ; FIELDNAMES STRING Array[12] ; FIELDLOCATIONS LONG Array[12] ; FIELDGROUPS LONG Array[12] ; ;************************************************* ; Define the structure ;************************************************* ;SELECTED SHIP MET/SEAWATER/NAV PARAMETERS ;CAPRICORN_2016_proc_scs_1min_2016_mm_dd_xxx.txt ; ;1 jd decimal day of year ;2 lat seapath latitude ;3 lon seapath longitude, deg E ;4 sog seapath sog, m/s ;5 cog seapath cog, deg ;6 hed gyro heading, deg ;7 wspd_port true wspd, port, m/s @ 25m ;8 wdir_port true wdir, port, deg ;9 rwspd_port rel wspd, port, m/s @ 25m ;10 rwdir_port rel wdir, port, 0-360 deg ;11 wspd_stbd true wspd, stbd, m/s @ 25m ;12 wdir_stbd true wdir, stbd, deg ;13 rwspd_stbd rel wspd, stbd, m/s @ 25m ;14 rwdir_stbd rel wdir, stbd, 0-360 deg ;15 wspd_sonic true wspd, sonic, m/s @ 22.5m ;16 wdir_sonic true wdir, sonic, deg ;17 rwspd_sonic rel wspd, sonic, m/s @ 22.5m ;18 rwdir_sonic rel wdir, sonic, 0-360 deg ;19 ta_port air temp, port, C @ 31.4m ;20 ta_stbd air temp, stbd, C 31.4m ;21 rh_port rel humidity, port, % 31.4m ;22 rh_stbd rel humidity, stbd, % 31.4m ;23 Pmb atm preessure, mb 20m ;24 rain accumulated rain, RM Young, mm ;25 rain_rate rain rate, RM Young, mm/hr ;26 rain_optical accumulated rain, optical disdrometer, mm ;27 rain_rate_optical rain rate, optical disdrometer, mm/hr ;28 PSP_port solar rad flux, port, W/m2 ;29 PSP_stbd solar rad flux, stbd, W/m2 ;30 PIR_port IR rad flux, port, W/m2 ;31 PIR_stbd IR rad flux, stbd, W/m2 ;32 SST_IR ISAR infrared sea surface temp, C ;33 SST TSG water temp, C @ depth of port drop keel ;34 Sal TSG salinity, psu ;35 uship_long longitudinal speed through water, m/s ;36 uship_trans transverse speed through water, m/s ;37 SST_depth depth of SST on port drop keel, m ;38 sog_n N-S component of ship speed ;39 sog_w E-W component of ship speed ;40 hed_n N-S component of ship heading ;41 hed_w E-W component of ship heading ; Structure field names field_names=['FIELD01','FIELD02','FIELD03','FIELD04','FIELD05','FIELD06',$ 'FIELD07','FIELD08','FIELD09','FIELD10','FIELD11','FIELD12'] ;87.004861 287.5236 546.8000 12.1200 12.7600 16.2305 11.4800 71.6800 0.0000 5.0160 159.5000 1012.4400 ;83.000000 -44.7079 145.8908 3.7938 38.3218 41.6025 12.9318 246.3780 9.7705 -145.2175 10.6889 249.6347 7.7201 -137.8328 12.9306 246.8504 ; Structure field locations field_locations=[3,14,25,37,47,58,70,80,93,101,114,124] ; Structure field types field_types=make_array(12,value=4) ; Structure field groups field_groups=indgen(12) ; Structure field count field_count=[12] ; Ascii template structure n={ntemplate,$ VERSION:1.0,$ DATASTART:0,$ DELIMITER:32b,$ MISSINGVALUE:-9999.0,$ COMMENTSYMBOL:'',$ FIELDCOUNT:field_count,$ FIELDTYPES:field_types,$ FIELDNAMES:field_names,$ FIELDLOCATIONS:field_locations,$ FIELDGROUPS:field_groups} ;****************************************************** ; Read the file ;****************************************************** dbase=read_ascii(file_path+file_name, template=n) doy=dbase.field01 ;decimal day-of-year (2015 in this case) latitude=dbase.field02 ;Eppley PIR #1 downwelling IR flux W/m2 longitude=dbase.field03 ;Eppley PIR #2 downwelling IR flux W/m2 SOG=dbase.field04 ;Eppley PSP #1 downwelling solar flux W/m2 COG=dbase.field05 ;Eppley PSP #2 downwelling solar flux W/m2 heading=dbase.field06 ;PIR #1 case temperature, C port_wspd=dbase.field07 ;PIR #1 dome temperature, C port_wdir=dbase.field08 ;PIR #2 case temperature, C port_rel_wspd=dbase.field09 ;PIR #2 dome temperature, C port_rwdir=dbase.field10 ;Air temperature, C stbd_wspd=dbase.field11 ;Relative Humidity, % stbd_wdir=dbase.field12 ;SST, C ;latitude, longitude, SOG, COG, heading, port_wspd, port_wdir ;1 jd decimal day of year ;2 lat seapath latitude ;3 lon seapath longitude, deg E ;4 sog seapath sog, m/s ;5 cog seapath cog, deg ;6 hed gyro heading, deg ;7 wspd_port true wspd, port, m/s @ 25m ;8 wdir_port true wdir, port, deg ;9 rwspd_port rel wspd, port, m/s @ 25m ;10 rwdir_port rel wdir, port, 0-360 deg ;11 wspd_stbd true wspd, stbd, m/s @ 25m ;12 wdir_stbd true wdir, stbd, deg ;13 rwspd_stbd rel wspd, stbd, m/s @ 25m ;14 rwdir_stbd rel wdir, stbd, 0-360 deg plot_flag=0 if plot_flag eq 1 then begin sec_per_day=double(24L*60L*60L) day1=julday(1,1,1970,0,0,0) ;julian_day=double(day1+((base_time+time_offset)/sec_per_day)) dummy = label_date(DATE_FORMAT=['%D %M!C%H:%I']) loadct,39 ; Position the plots xl=0.17 & xr=0.97 yb=0.08 & yt=0.9 sx=0.14 sy=0.05 numplots_x=1 numplots_y=5 position_plots,xl,xr,yb,yt,sx,sy,numplots_x,numplots_y,pos alldata=[ir_flux_down_pir1,ir_flux_down_pir2] result=where(finite(alldata),count) dmax=max(alldata[result]) dmin=min(alldata[result]) p0=plot(doy,ir_flux_down_pir1,position=reform(pos[0,*]),/buffer,$ ;xtickunits='time',xtickformat='label_date', xstyle=1,xminor=5,$ yrange=[dmin,dmax],ytitle='ir flux down!CW/m2',dimensions=[800,800]) p1=plot(doy,ir_flux_down_pir2,/overplot,color='red') t0=text(0.005,pos[0,1]+0.08,'Pir1',color='black',/normal) t1=text(0.005,pos[0,1]+0.06,'Pir2',color='red',/normal) alldata=[solar_flux_down_psp1,solar_flux_down_psp2] result=where(finite(alldata),count) dmax=max(alldata[result]) dmin=min(alldata[result]) p0=plot(doy,solar_flux_down_psp1,position=reform(pos[1,*]),/buffer,$ ;xtickunits='time',xtickformat='label_date', xstyle=1,xminor=5,$ yrange=[dmin,dmax],/current,ytitle='solar flux down!CW/m2') p1=plot(doy,solar_flux_down_psp2,/overplot,color='red') t0=text(0.005,pos[1,1]+0.08,'Psp1',color='black',/normal) t1=text(0.005,pos[1,1]+0.06,'Psp2',color='red',/normal) alldata=[case_temp_pir1,case_temp_pir2,dome_temp_pir1,dome_temp_pir2] dmax=max(alldata) dmin=min(alldata) p0=plot(doy,case_temp_pir1,position=reform(pos[2,*]),/buffer,$ ;xtickunits='time',xtickformat='label_date', xstyle=1,xminor=5,$ yrange=[dmin,dmax],/current,ytitle='pir temp (C)') p1=plot(doy,case_temp_pir2,/overplot,color='red') p2=plot(doy,dome_temp_pir1,/overplot,color='blue') p3=plot(doy,dome_temp_pir2,/overplot,color='green') t0=text(0.005,pos[2,1]+0.08,'casePir1',color='black',/normal) t1=text(0.005,pos[2,1]+0.06,'casePir2',color='red',/normal) t2=text(0.005,pos[2,1]+0.04,'domePir1',color='blue',/normal) t3=text(0.005,pos[2,1]+0.02,'domePir2',color='green',/normal) alldata=[air_temp,sst] result=where(finite(alldata)) dmax=max(alldata[result]) dmin=min(alldata[result]) p0=plot(doy,air_temp,position=reform(pos[3,*]),/buffer,$ ;xtickunits='time',xtickformat='label_date', xstyle=1,xminor=5,$ yrange=[dmin,dmax],/current,ytitle='temp (C)') p1=plot(doy,sst,/overplot,color='red') t0=text(0.005,pos[3,1]+0.08,'air',color='black',/normal) t1=text(0.005,pos[3,1]+0.06,'sst',color='red',/normal) alldata=[rh] result=where(finite(alldata)) dmax=max(alldata[result]) dmin=min(alldata[result]) p0=plot(doy,rh,position=reform(pos[4,*]),/buffer,$ ;xtickunits='time',xtickformat='label_date', xstyle=1,xminor=5,$ yrange=[dmin,dmax],/current,ytitle='rh (%)') t1=text(0.5,0.95,'southern ocean rad',/normal) p0.save,'southern_ocean_rad.png',height=900,resolution=900 endif ; plot_flag return end