pro read_southern_ocean_met_sub, file_path, file_name, doy, ir_flux, solar_flux, sea_surface_temperature, air_temperature, relative_humidity, rain_rate, atmos_pressure ; Get the data from the txt file ;file_path, file_name, doy, ir_flux, solar_flux, sea_surface_temperature, air_temperature, relative_humidity, rain_rate, atmos_pressure ; ;doy=dbase.field01 ;decimal day-of-year (2015 in this case) ;pir1=dbase.field02 ;Eppley PIR #1 downwelling IR flux W/m2 ;psp1=dbase.field03 ;Eppley PIR #2 downwelling IR flux W/m2 ;PIR_case=dbase.field04 ;Eppley PSP #1 downwelling solar flux W/m2 ;PIR_dome=dbase.field05 ;Eppley PSP #2 downwelling solar flux W/m2 ;SST=dbase.field06 ;PIR #1 case temperature, C ;air_temperature=dbase.field07 ;PIR #1 dome temperature, C ;RH=dbase.field08 ;PIR #2 case temperature, C ;rain_rate=dbase.field09 ;PIR #2 dome temperature, C ;voltage=dbase.field10 ;Air temperature, C ;fan=dbase.field11 ;Relative Humidity, % ;pressure=dbase.field12 ;SST, C ;**************************************************************** ; 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'] ;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 ; 77.000000 385.5865 108.2000 14.7900 14.8900 11.2057 14.6300 93.0000 0.0000 5.0200 157.3000 996.0200 ; Structure field locations field_locations=[3,14,25,37,48,59,70,81,93,104,113,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) pir1=dbase.field02 ;Eppley PIR #1 downwelling IR flux W/m2 psp1=dbase.field03 ;Eppley PIR #2 downwelling IR flux W/m2 PIR_case=dbase.field04 ;Eppley PSP #1 downwelling solar flux W/m2 PIR_dome=dbase.field05 ;Eppley PSP #2 downwelling solar flux W/m2 SST=dbase.field06 ;PIR #1 case temperature, C air_temperature=dbase.field07 ;PIR #1 dome temperature, C relative_humidity=dbase.field08 ;PIR #2 case temperature, C rain_rate=dbase.field09 ;PIR #2 dome temperature, C voltage=dbase.field10 ;Air temperature, C fan=dbase.field11 ;Relative Humidity, % atmos_pressure=dbase.field12 ;SST, C ;SELECTED NOAA MET PARAMETERS ;CAPRICORN_2016_proc_met_1min_2016_mm_dd_xxx.txt ; ;1 decimal day of year ;2 pir1 W/m2 ;3 psp1 W/m2 ;4 PIR1 case temperature C ;5 PIR1 dome temperature C ;6 SST snake C ;7 air temperature C ;8 RH ;9 rain rate, org, mm/hr ;10 org carrier voltage ;11 T/RH aspirator fan ;12 atmospheric pressure mb 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