Metadata-Version: 2.4
Name: HARD-lib
Version: 1.0.1
Summary: Harmony Analysis Ready Dataset
Author: Yan Yuan
Author-email: Yan.Yuan@tudelft.nl
Project-URL: Homepage, https://gitlab.tudelft.nl/yyuan6/hard
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: matplotlib
Requires-Dist: xarray<=2025.10.1
Requires-Dist: asf_search>=10.1.0
Requires-Dist: cdsapi
Requires-Dist: dask
Requires-Dist: ipykernel
Requires-Dist: cartopy==0.24.1
Requires-Dist: opencv-python-headless
Requires-Dist: xsar[S1]
Requires-Dist: dask==2025.7.0
Requires-Dist: zarr
Requires-Dist: tqdm
Requires-Dist: global-land-mask
Requires-Dist: h5netcdf
Requires-Dist: jupyterlab
Requires-Dist: watermark
Requires-Dist: joblib
Requires-Dist: tomli
Requires-Dist: build
Requires-Dist: twine
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Dynamic: author-email

## Pre-requisites
1. Create an ECMWF account to access the ERA5 CDS API (for setup go to [cds.climate.copernicus.eu](https://cds.climate.copernicus.eu/how-to-api)). This is needed for wind-field information.

2. Create an Alaskan Satellite Fascility (ASF) account so that you may querry their API using `asf_search`. Store your ASK credentials in a `.netrc` file. This will be needed to download data from ASF.

An example `.netrc`:
```bash
machine asf
login YOURUSERNAME
password YOURPASSWORD
```

## Installation 
Create a new environment and activate
```bash
conda create -n ENV_NAME python==3.12

conda activate ENV_NAME
```
Conda install GDAL (not enabled from pip)
```bash
conda install GDAL
```
Clone HARD repository

```bash
git clone https://gitlab.tudelft.nl/yyuan6/hard.git
```

Navigate to cloned folder and install an editibale version
```bash
cd HARD

pip install -e .
```

## Usage
### Python
For Python tutorials refer to the notebook tutorials in `hard/Tutorial/`

### Command Line Interface (CLI)
To run an automated download, processing and saving exercise using a bash script go to either:

- `hard/HARD/CLI/download_process_save_local_example.sh`
- `hard/HARD/CLI/download_process_save_DelftBlue_example.sh`

Please copy the files before editing and do not track them in this git repository.

#### NOTE 
When submitting the bash script on Delft Blue, please make sure a `logs` subdirectory exists in the same location as the `.sh` file, e.g.:

```bash
mkdir -p logs
sbatch /home/.../hard/HARD/CLI/download_process_save_DelftBlue_example.sh
```


## To Do
### ERA5
- check if ERA5 file exists before downloading
- give downlaoded era5 files descriptive names relating to aoi (so that they may be reused)
- enable using pre-downlaoded era5 files

### Processing
- return the xsar object instead of arbitrary roughness field
- land masking on radar data 
- add attributes to file for all processing steps and 
- get land mask from xsar variable
- streamline output types so that `.values` and `.item()` can be kept to a minimum
- remove unnecessary variables after preprocessing 

