Commit 33767d07 authored by CEVAER's avatar CEVAER

Adding spatial_dims and crs to netcdf attributes

parent e3b8ae8c
......@@ -90,10 +90,10 @@ files_to_process=$(echo "$files_to_process" | sed -r '/^\s*$/d')
if [ "$smap" == "True" ] ; then
echo "Generating SMAP files..."
#printf "%s\n $files_to_process" | xargs -r -P 5 extractSmapCyclone.py --dbd "$DATABASE_URL" -o "$output_path" -i
printf "%s\n $files_to_process" | xargs -r -P 5 -L 1 extractWrapper.sh extractSmapCyclone.py --dbd "$DATABASE_URL" -o "$output_path" -i
printf "%s\n $files_to_process" | xargs -r -P 10 -L 1 extractWrapper.sh extractSmapCyclone.py --dbd "$DATABASE_URL" -o "$output_path" -i
elif [ "$smos" == "True" ] ; then
echo "Generating SMOS files..."
printf "%s\n $files_to_process" | xargs -r -P 5 -L 1 extractWrapper.sh extractSmosCyclone.py --dbd "$DATABASE_URL" -o "$output_path" -i
printf "%s\n $files_to_process" | xargs -r -P 10 -L 1 extractWrapper.sh extractSmosCyclone.py --dbd "$DATABASE_URL" -o "$output_path" -i
fi
......@@ -6,6 +6,7 @@ from sqlalchemy import and_, func, cast
from geoalchemy2 import Geometry
from cyclobs_orm import SimpleTrack
import xarray
import rioxarray as rxr
import pandas as pd
import geopandas as gpd
import numpy as np
......@@ -285,6 +286,9 @@ def extract_write_cyclone_data(dataset, kept_track_points, filename, output_path
sel = sel.squeeze()
sel.rio.set_spatial_dims('lon', 'lat', inplace=True)
sel.rio.write_crs("epsg:4326", inplace=True)
sel.to_netcdf(os.path.join(output_path, output_filename))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment