Spaces:
Sleeping
Sleeping
Download test_imd.py from SeriousSam07/Ritu-AI: direct link, hf CLI and curl.
- Browser
- Download file 537 Bytes
-
https://huggingface.co/spaces/SeriousSam07/Ritu-AI/resolve/main/test_imd.py
- Command line
-
hf download hf://spaces/SeriousSam07/Ritu-AI/test_imd.py
-
curl -L -o test_imd.py https://huggingface.co/spaces/SeriousSam07/Ritu-AI/resolve/main/test_imd.py
537 Bytes
| import imdlib as imd | |
| def main(): | |
| start_yr = 2020 | |
| end_yr = 2020 | |
| variable = 'tmax' | |
| file_dir = './imd_data' | |
| print("Downloading...") | |
| # This will download the 2020 tmax gridded file from IMD | |
| imd.get_data(variable, start_yr, end_yr, fn_format='yearwise', file_dir=file_dir) | |
| print("Download complete.") | |
| print("Opening...") | |
| data = imd.open_data(variable, start_yr, end_yr, 'yearwise', file_dir) | |
| ds = data.get_xarray() | |
| print("Xarray Dataset:", ds) | |
| if __name__ == "__main__": | |
| main() | |