Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uploading ITRC ET inst #5

Open
andybell opened this issue Jun 29, 2017 · 1 comment
Open

Uploading ITRC ET inst #5

andybell opened this issue Jun 29, 2017 · 1 comment

Comments

@andybell
Copy link
Collaborator

First, rasters need to be converted to geotifs using gdal. Note: units are in mm

for i in *.img; do
	echo $i
	d=$(basename $i .img)
	gdal_translate -ot Float32 -of Gtiff -co "COMPRESS=DEFLATE" $i $d.tif
done

Then, upload to google bucket

gsutil -m cp *.tif  gs://earth-engine-staging

Daily ET rasters are named like ITRC_Delta_2015_Jul_11_ET_inst.tif . In order to move all assets to EarthEngine from the bucket with the correct date use the following bash script.

earthengine create collection users/ucd-cws-ee-data/ssj-delta-cu/ssj-itrc-metric/et_daily

for i in *.tif; do 
 array=(`echo $i | sed 's/_/\n/g'`)
 y=${array[2]}
 mon=${array[3]}
 d=${array[4]}
 date=`date --date="$d $mon $y" --iso`

 echo $date
 
 earthengine upload image --asset_id=users/ucd-cws-ee-data/ssj-delta-cu/ssj-itrc-metric/et_daily/$date \
 --time_start="$date" --pyramiding_policy=mean gs://earth-engine-staging/$i; 
done
@andybell
Copy link
Collaborator Author

When files are name like f03_et24_2016_05_10.tif -

for i in *.tif; do 
 array=(`echo $i | sed 's/_/\n/g'`)
 y=${array[2]}
 mon=${array[3]}
 dt=${array[4]}
 d="${dt%.*}"
 date=`date --date="$y-$mon-$d" --iso`

 echo $date

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant