iamsaswata / imdlib

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

Selecting data only for specifc dates #30

Open pratiman-91 opened 5 months ago

pratiman-91 commented 5 months ago

The current implementation uses year to download and open datasets. It is better to provide start_date and end_date to download and read the dataset.

Current Implementation:

import imdlib as imd

start_yr = 2010
end_yr = 2018
variable = 'rain' # other options are ('tmin'/ 'tmax')
file_dir = (r'C:\Users\imdlib\Desktop\\') #Path to save the files
data = imd.open_data(variable, start_yr, end_yr,'yearwise', file_dir)

Possible new implementation:

import imdlib as imd

start_date = '2010-01-01'
end_date = '2018-12-31'
variable = 'rain' # other options are ('tmin'/ 'tmax')
file_dir = (r'C:\Users\imdlib\Desktop\\') #Path to save the files
data = imd.open_data(variable, start_date, end_date,'yearwise', file_dir)