Example¶
Walkthrough for an example case on Linux system: The example directory includes randomly drawn polygons (example_parcels.shp) and Sentinel2 tiles over Finland (Fin_s2.shp, derived from http://ftpearth.bu.edu/public/emelaas/sentinel2_tiles_world/). The data in cropyield/example/cropyield_data is only intended for testing purposes.
According to chapter Preparation:
- Download conda :
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh - Install above downloaded
- Create conda environment with required packages:
conda env create --file environment.yml - Activate above created environment:
conda activate cropyield
According to chapter Usage:
- Clone the repository:
git clone https://github.com/myliheik/cropyield.git - Switch into repository directory :
cd cropyield - Switch to example directory:
cd example/cropyield_data - Get the data with:
wget https://a3s.fi/Sentinel2testCase.tar.zst, and unpack withtar -I zstd -xvf Sentinel2testCase.tar.zst, then switch back to example directory by typingcd ..twice. - Split test-shapefile based on S2 tiles (here only Finland):
python ../python/splitshp_mp.py ./Sentinel2testCase/example_parcels.shp ./Sentinel2testCase/Fin_s2.shp ../cropyield_shp - Start the process (for the example use the start file within example directory)
bash start.sh - Check the result files in ./cropyield_results
Resulting files:¶
- Step 9 should create files within cropyield_shp: All tiles here have overlap with the example_parcels file: 34VEN,34VFN,34VFP,35VLH,35VLJ.
- Step 10 should create 2 files in cropyield_results (plus some resampled shapefiles in cropyield_data):
- array_34VFN_20200626_B04.csv with PlotID as first row following all pixelvalues within each polygon, and
- meta_34VFN_20200626_B04.csv with PlotID,year,DOY,tilefilename,missionID,count for each polygon.
-> if those files exist and are non empty, everything is fine. If not check the error messages and that all inputs are available.