Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read multiple files of 2DVD #28

Open
yogeshkkolte opened this issue Jun 20, 2016 · 3 comments
Open

read multiple files of 2DVD #28

yogeshkkolte opened this issue Jun 20, 2016 · 3 comments

Comments

@yogeshkkolte
Copy link

How can we read more than one files simultaneously and combine data to plot combined total drop size distribution.

@josephhardinee
Copy link
Owner

Hey yogesh, I'm not sure I follow your question exactly. Are you wanting to combine data from different times?

@yogeshkkolte
Copy link
Author

import os
import glob
import numpy as np
import matplotlib.pylab as plt
import pydisdrometer as pyd
import pandas as pd
folder_path = '/home/user/anaconda/DSD/Dsd_dbl/DSD_CSV/*.csv'
new_folder_path = folder_path[:-5] + 'DSD_Out/'
files = glob.glob(folder_path)

if not os.path.exists(new_folder_path):
os.makedirs(new_folder_path)
os.chdir(new_folder_path)
lenf = len(files)

ZHs,ZHc,ZHx,ZHk = [],[],[],[]
AIs,AIc,AIx,AIk = [],[],[],[]
Dvd_R,filNw,Tmin,Nw,mu,D0,Dm =[],[],[],[],[],[],[]
ZDrs,ZDrc,ZDrx,ZDrk = [],[],[],[]
KDps,KDpc,KDpx,KDpk = [],[],[],[]

for filename in files:

print 'Filename is: ', filename
reader = pyd.aux_readers.HACPL_2DVD_reader.HACPL_2DVD_dsd_reader(filename,'hacpl')
dsd = pyd.aux_readers.HACPL_2DVD_reader.read_2dvd_dsd_hacpl(filename,'hacpl')

dsd.calculate_dsd_parameterization()
dvd_r = np.squeeze(reader.rain_rate) # in reader I am reading 2dvd rain rate
dsd.calculate_RR()

Reading multiple files and plotting combined plot of all files

@yogeshkkolte
Copy link
Author

Yes i want to combine data and plot mean profile for monsoon days June to Sept

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants