-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
514ea2b
commit a5a8d64
Showing
17 changed files
with
8,539 additions
and
5,553 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
{ | ||
"_____":"GENERAL PARAMETERS", | ||
|
||
"date_ini":"2015-03-20", | ||
"date_end":"2015-03-29", | ||
"outdir":"/home/fontana/MODEL/OUTPUTS", | ||
"diagdir":"/home/fontana/MODEL/DIAGS", | ||
|
||
|
||
"_____":"RIVER PARAMETERS", | ||
|
||
"french_list":["Argens","Var"], | ||
"italian_list":["Magra","Arno","Ombrone","Serchio"], | ||
"river_ini":"2019-05-01", | ||
"river_end":"2019-05-31", | ||
|
||
|
||
"_____":"METEO PARAMETERS", | ||
|
||
"meteo_ini":"2019-05-01", | ||
"meteo_end":"2019-05-30", | ||
"day_cycle":2, | ||
"n_cycle":5, | ||
"imin":"500", | ||
"imax":"600", | ||
"jmin":"350", | ||
"jmax":"450", | ||
|
||
|
||
"_____":"DYFAMED PARAMETERS", | ||
|
||
"some_par":"some_par", | ||
|
||
"_____":"BOUSSOLE PARAMETERS", | ||
|
||
"some_par":"some_par", | ||
|
||
|
||
"_____":"PLOT PARAMETERS", | ||
|
||
"resol":"10m", | ||
"fig_proj":"ccrs.PlateCarree()", | ||
"fig_sx":"8", | ||
"fig_sy":"8", | ||
"fig_fmt":"jpg", | ||
"fig_res":"300", | ||
"tight":"False", | ||
"fig_tck_size":"10", | ||
"fig_tcklbl_size":"10", | ||
"fig_lbl_size":"10", | ||
"cb_fraction_2D":"0.02", | ||
"cb_pad_2D":"0.12", | ||
|
||
"_____":"SECTION PLOT PARAMETERS", | ||
|
||
|
||
"fig_secx":"8", | ||
"fig_secy":"4", | ||
"sec_lon1":"8.5", | ||
"sec_lat1":"43.", | ||
"sec_lon2":"10.", | ||
"sec_lat2":"43.5", | ||
"sec_dep":"200", | ||
"sec_resH":"0.05", | ||
"sec_resV":"1", | ||
"cb_fraction_sec":"0.025", | ||
"cb_pad_sec":"0.06", | ||
|
||
"_____":"PROFILE PLOT PARAMETERS", | ||
|
||
"fig_prox":"6", | ||
"fig_proy":"8", | ||
"col1":"r", | ||
"col2":"b", | ||
|
||
|
||
"_____":"INTERPOLATION PARAMETERS", | ||
|
||
"dump":"0.01", | ||
"itp_meth":"linear", | ||
"cmap":"viridis" | ||
|
||
} |
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
Binary file not shown.
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 @@ | ||
cache_bgc |
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,96 @@ | ||
# ------------------------- # | ||
# Routine to get Argo data # | ||
# ------------------------- # | ||
import warnings | ||
warnings.simplefilter("ignore") | ||
import numpy as np | ||
|
||
from fun_gen import * | ||
from fun_io import * | ||
import sys,os | ||
import datetime as dt | ||
import xarray as xr | ||
import datetime as dt | ||
|
||
|
||
# Get args | ||
# -------- | ||
config = sys.argv[1] # Configuration name | ||
|
||
|
||
# Load config file | ||
# ---------------- | ||
load_config(config) | ||
from fun_gen import * | ||
|
||
# Load coordinates | ||
# ---------------- | ||
lon_mod,lat_mod,lev_mod=load_coords() | ||
|
||
|
||
# Load data | ||
# --------- | ||
savedir = diagdir+'/'+config+'/ARGO' | ||
ds = xr.load_dataset(savedir+'/argo.nc') | ||
|
||
lat = ds['LATITUDE'] | ||
lon = ds['LONGITUDE'] | ||
time = ds['TIME'] | ||
num = ds['PLATFORM_NUMBER'] | ||
cyc = ds['CYCLE_NUMBER'] | ||
pres = ds['PRES_ADJUSTED'] | ||
|
||
time = np.array(time,dtype=str) | ||
|
||
# Define profiles position | ||
# ------------------------ | ||
|
||
lon_uni = np.unique(lon) | ||
print(lon_uni.shape[0],'profiles found\n') | ||
|
||
# Loop on profiles | ||
# ---------------- | ||
for plon in lon_uni: | ||
|
||
# Get all indexes | ||
idx = np.where( lon == plon ) | ||
|
||
for var in ['CHLA_ADJUSTED','PSAL_ADJUSTED','TEMP_ADJUSTED']: | ||
|
||
if var == 'CHLA_ADJUSTED': | ||
mod_var = 'chl' | ||
elif var == 'PSAL_ADJUSTED': | ||
mod_var = 'so' | ||
elif var == 'TEMP_ADJUSTED': | ||
mod_var = 'thetao' | ||
|
||
|
||
# Get current variable parameters | ||
vname, ftag, cmap, islog, vmod, vmin, vmax, label, units\ | ||
= load_variable(config,mod_var) | ||
|
||
# Convert date | ||
ptime = [] | ||
dstr = str(time[idx][0]).split('T')[0] | ||
jd = dt.datetime.strptime(dstr,'%Y-%m-%d').toordinal() | ||
|
||
# Get filename | ||
fname,dtag = get_filename(int(np.floor(jd)),ftag) | ||
|
||
print(fname,dtag) | ||
|
||
|
||
exit() | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
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,72 @@ | ||
# ------------------------- # | ||
# Routine to get Argo data # | ||
# ------------------------- # | ||
|
||
import numpy as np | ||
|
||
from fun_gen import * | ||
from fun_io import * | ||
import sys,os | ||
import datetime as dt | ||
|
||
import argopy | ||
from argopy import DataFetcher | ||
from argopy import ArgoIndex | ||
from argopy import ArgoNVSReferenceTables | ||
from argopy import ArgoColors | ||
from argopy.plot import scatter_map, scatter_plot | ||
argopy.reset_options() | ||
argopy.clear_cache() | ||
argopy.set_options(cachedir='cache_bgc') | ||
|
||
|
||
|
||
|
||
|
||
# Get args | ||
# -------- | ||
config = sys.argv[1] # Configuration name | ||
|
||
|
||
# Load config file | ||
# ---------------- | ||
load_config(config) | ||
from fun_gen import * | ||
|
||
# Create diagnostic arborescence | ||
os.system('mkdir -p '+diagdir) | ||
os.system('mkdir -p '+diagdir+'/'+config) | ||
savedir = diagdir+'/'+config+'/ARGO' | ||
os.system('mkdir -p '+savedir) | ||
|
||
|
||
# Load coordinates | ||
# ---------------- | ||
lon_mod,lat_mod,lev_mod=load_coords() | ||
|
||
lon_min,lon_max = np.amin(lon_mod),np.amax(lon_mod) | ||
lat_min,lat_max = np.amin(lat_mod),np.amax(lat_mod) | ||
|
||
|
||
# Get Argo data | ||
# ------------- | ||
box = [lon_min, lon_max, lat_min, lat_max, 0, 300, date_ini, date_end] | ||
|
||
f = DataFetcher(ds='bgc', mode='expert', params='all', | ||
parallel=True, progress=True, cache=False, | ||
chunks_maxsize={'time': 30}, | ||
) | ||
|
||
f = f.region(box).load() | ||
|
||
ds = f.data | ||
df = f.index | ||
|
||
|
||
ds_profiles = ds.argo.point2profile() | ||
|
||
# Save data | ||
# --------- | ||
ds.to_netcdf(path=savedir+'/argo.nc', mode='w', format=None, group=None, engine=None, encoding=None, unlimited_dims=None, compute=True, invalid_netcdf=False) | ||
|
||
|
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 @@ | ||
,fontana,fontana,09.05.2024 12:03,file:///home/fontana/.config/libreoffice/4; |
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 @@ | ||
,fontana,fontana,08.05.2024 11:37,file:///home/fontana/.config/libreoffice/4; |
Oops, something went wrong.