pro read_southern_ocean_rad_sub, file_path, file_name, doy, ir_flux_down_pir1, ir_flux_down_pir2, solar_flux_down_psp1, solar_flux_down_psp2, air_temp, rh, sst, ship_PIR_port,$ ship_PIR_starboard, ship_PSP_port, ship_PSP_starboard ; 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 ;************************************************* ; Structure field names field_names=['FIELD01','FIELD02','FIELD03','FIELD04','FIELD05','FIELD06',$ 'FIELD07','FIELD08','FIELD09','FIELD10','FIELD11','FIELD12'] ; Structure field locations field_locations=[3,14,24,34,44,55,65,75,85,95,105,115] ; 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) ir_flux_down_pir1=dbase.field02 ;Eppley PIR #1 downwelling IR flux W/m2 ir_flux_down_pir2=dbase.field03 ;Eppley PIR #2 downwelling IR flux W/m2 solar_flux_down_psp1=dbase.field04 ;Eppley PSP #1 downwelling solar flux W/m2 solar_flux_down_psp2=dbase.field05 ;Eppley PSP #2 downwelling solar flux W/m2 ship_PIR_port=dbase.field06 ;PIR #1 case temperature, C ship_PIR_starboard=dbase.field07 ;PIR #1 dome temperature, C ship_PSP_port=dbase.field08 ;PIR #2 case temperature, C ship_PSP_starboard=dbase.field09 ;PIR #2 dome temperature, C air_temp=dbase.field10 ;Air temperature, C rh=dbase.field11 ;Relative Humidity, % sst=dbase.field12 ;SST, C 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