iamsaswata / imdlib

Download and process binary IMD meteorological data in Python
https://imdlib.readthedocs.io
MIT License
30 stars 16 forks source link

change of input arguments #4

Closed pratiman-91 closed 4 years ago

pratiman-91 commented 4 years ago

import imdlib as imd

start_yr =2018 end_yr = 2018 variable = 'rain' # other options are ('tmin'/ 'tmax') file_format = 'yearwise' # other option (None), which will assume deafult imd naming convention file_dir = '/home/data/imd' # other option keep it blank

use of data = imd.open_data(start_yr, end_yr, 'rain','yearwise', file_dir) instead of data = imd.open_data((start_yr, end_yr), 'rain','yearwise', file_dir) and if only one year is given then it can be treated as a single year data = imd.open_data(year, 'rain','yearwise', file_dir)

iamsaswata commented 4 years ago

Thanks for the suggestion.

This has been incorporated with eea0fb87f9d0e74b5ac50dedef8404b727351b37

Now to open data we have:

 imd.open_data(var_type, start_yr, end_yr=None, fn_format=None, file_dir=None)`

Now to downaload data we have:

imd.get_data(var_type, start_yr, end_yr=None, fn_format=None, file_dir=None, sub_dir=False, proxies=None)`

So, now we can use:

# for multiple years
data = imd.open_data(var_type, start_yr, end_yr, 'yearwise', file_dir)
#for single  year
data = imd.open_data(var_type, start_yr, fn_format='yearwise', file_dir='/home/downloads')
pratiman-91 commented 4 years ago

Thanks