;***************************** ; Reads in the cband data for this gpm overpass ;***************************** pro read_cband_pyart,julian_day_ship,ulat,llat,llon,rlon,$ reflect,lat,lon,alt,julian_day,colon,path_prefix ; Date to test ;path_prefix='/Volumes/' ;julian_day_ship=julday(1,25,2018,19,22,29) ;test ;julian_day_ship=julday(1,28,2018,16,44,36) ;julian_day_ship=julday(1,28,2019,04,55,15) ;julian_day_ship=julday(2,09,2018,14,13,58) caldat,julian_day_ship,smm,sdd,syy,shh,smi,sss syy=string(syy,format='(I4)') smm=string(smm,format='(I02)') sdd=string(sdd,format='(I02)') shh=string(shh,format='(I02)') smi=string(smi,format='(I02)') sss=string(sss,format='(I02)') date_str=syy+smm+sdd+shh+smi+sss ymd_str=syy+smm+sdd ; directory if syy eq '2018' then begin ;filedir='/uufs/chpc.utah.edu/common/home/mace-group4/Capricorn2/CBand/' filedir=path_prefix+'mace-group4/Capricorn2/CBand/' endif else if syy eq '2019' then begin ;filedir='/uufs/chpc.utah.edu/common/home/mace-group5/field_programs/investigator/in2019_v01_gpm_passes/out_vol/' filedir=path_prefix+'mace-group5/field_programs/investigator/in2019_v01_gpm_passes/out_vol/' endif else if syy eq '2020' then begin filedir=path_prefix+'mace-group5/field_programs/investigator/in2020_v08/' endif ; File search string ;filestr='9776HUB-PPIVol-'+syy+smm+sdd+'-'+shh+'*nc' filestr='9776HUB-PPIVol-'+syy+smm+sdd+'*.pyart*.nc' ;filestr='9776HUB-PPIVol-*nc' ; file name filenames=file_search(filedir+filestr,count=numfiles) if numfiles gt 0 then begin ; Get the times of the file start and find the closest to ship time time_str=strmid(file_basename(filenames),24,6) fhh=strmid(time_str,0,2) fmi=strmid(time_str,2,2) fss=strmid(time_str,4,2) julian_day_files=julday(smm,sdd,syy,fhh,fmi,fss) closest=min(abs(julian_day_files-julian_day_ship),idx) ; Closest must be in 2 hours if closest le 2D/24D then begin caldat,julian_day_files[idx],xmm,xdd,xyy,xhh,xmi,xss print,xyy,xmm,xdd,xhh,xmi,xss filename=filenames[idx] print,filename fid=ncdf_open(filename) vid=ncdf_varid(fid,'base_time') & ncdf_varget,fid,vid,base_time vid=ncdf_varid(fid,'time_offset') & ncdf_varget,fid,vid,time_offset vid=ncdf_varid(fid,'point_latitude') & ncdf_varget,fid,vid,lat vid=ncdf_varid(fid,'point_longitude') & ncdf_varget,fid,vid,lon vid=ncdf_varid(fid,'point_altitude') & ncdf_varget,fid,vid,alt vid=ncdf_varid(fid,'point_x') & ncdf_varget,fid,vid,point_x vid=ncdf_varid(fid,'point_y') & ncdf_varget,fid,vid,point_y vid=ncdf_varid(fid,'point_z') & ncdf_varget,fid,vid,point_z vid=ncdf_varid(fid,'reflectivity') if vid ne -1 then begin ncdf_varget,fid,vid,reflect endif else begin vid=ncdf_varid(fid,'DBZH_gmm') & ncdf_varget,fid,vid,reflect endelse ncdf_close,fid ; convert point_x,y,z from m to km point_x=point_x/1000.0 point_y=point_y/1000.0 point_z=point_z/1000.0 ; convert time to julian_day day1=julday(1,1,1970,0,0,0) sec_per_day=long(24L*60L*60L) julian_day=double(day1+((base_time+time_offset)/sec_per_day)) ; Calculate colongitude colon=lon result=where(lon lt 0,count) if count gt 0 then colon[result]=colon[result]+360.0 endif else begin reflect=!null endelse endif else begin ;scan within 2 hours reflect=!null endelse end