-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(data-layer): use single image for some layers (#496)
- Loading branch information
Showing
33 changed files
with
236 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from matplotlib import cm | ||
|
||
stepsNum = 10 | ||
minValue = 0 | ||
maxValue = 6 | ||
cmap = cm.get_cmap('Blues') | ||
reverse = True | ||
|
||
r = range(0, stepsNum + 1) | ||
|
||
diff = (maxValue - minValue) / stepsNum | ||
steps = [n / stepsNum for n in r] | ||
values = [round(minValue + diff * n, 1) for n in r] | ||
|
||
if reverse: | ||
values.reverse() | ||
|
||
for s, v in zip(steps, values): | ||
r,g,b,a = cmap(s) | ||
print(v, int(r * 255), int(g * 255), int(b * 255), int(a * 255)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import os | ||
from datetime import datetime | ||
from ftplib import FTP | ||
|
||
ftp = FTP('anon-ftp.ceda.ac.uk') | ||
ftp.login() | ||
|
||
BASE_PATH = 'neodc/esacci/ozone/data/total_columns/l3/merged/v0100' | ||
OUTPUT_PATH = f"{os.getcwd()}/download/ozone" | ||
|
||
years = range(1996, 2011) | ||
|
||
for year in years: | ||
files = ftp.nlst(f'{BASE_PATH}/{year}/') | ||
|
||
for file in files: | ||
file_name = file.split('-')[-2] | ||
date = datetime.strptime(file_name, '%Y%m%d').strftime('%Y-%m-%d') | ||
out = f"{OUTPUT_PATH}/{file_name}.nc" | ||
|
||
with open(out, 'wb') as fp: | ||
ftp.retrbinary(f"RETR {file}", fp.write) | ||
print(file_name) | ||
|
||
os.system(f"python ./data/drop-unused-vars.py --file {out} --variable atmosphere_mole_content_of_ozone") | ||
os.system(f"python {os.getcwd()}/data/add-time-coordinate.py --file {out} --timestamp {date}") | ||
os.system(f"python ./data/wrap-longitude.py --file {out}") | ||
|
||
ftp.quit() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import os | ||
from ftplib import FTP | ||
|
||
ftp = FTP('anon-ftp.ceda.ac.uk') | ||
ftp.login() | ||
|
||
BASE_PATH = '/neodc/esacci/snow/data/swe/MERGED/v1.0' | ||
OUTPUT_PATH = f"{os.getcwd()}/download/snow" | ||
|
||
years = range(1979, 2018) | ||
|
||
for year in years: | ||
months = ftp.nlst(f'{BASE_PATH}/{year}/') | ||
|
||
for month in months: | ||
days = ftp.nlst(month) | ||
first_day = days[0] | ||
file_name = first_day.split('/').pop().split('-')[0] | ||
|
||
with open(f"{OUTPUT_PATH}/{file_name}.nc", 'wb') as fp: | ||
ftp.retrbinary(f"RETR {first_day}", fp.write) | ||
print(file_name) | ||
|
||
ftp.quit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
5 192 75 20 255 | ||
2.5 241 162 33 255 | ||
0.5 250 220 40 44 | ||
0 250 220 40 0 | ||
1 184 101 9 255 | ||
0 184 101 9 0 | ||
nv 0 0 0 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
250 255 255 255 255 | ||
0 9 9 12 255 | ||
nv 0 0 0 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
6.0 247 251 255 255 | ||
5.4 227 238 248 255 | ||
4.8 207 225 242 255 | ||
4.2 182 212 233 255 | ||
3.6 147 196 222 255 | ||
3.0 106 173 213 255 | ||
2.4 74 151 201 255 | ||
1.8 45 125 187 255 | ||
1.2 23 100 171 255 | ||
0.6 8 73 145 255 | ||
0.0 8 48 107 255 | ||
nv 0 0 0 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.