generated from QCDIS/NaaVRE-cells
-
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.
b-load-the-remote-txt-file-as-dataframe-spiros-koulouzis-lifewatch-eu…
… creation
- Loading branch information
Showing
1 changed file
with
78 additions
and
0 deletions.
There are no files selected for viewing
78 changes: 78 additions & 0 deletions
78
b-load-the-remote-txt-file-as-dataframe-spiros-koulouzis-lifewatch-eu/task.py
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,78 @@ | ||
import ipywidgets as widgets | ||
import pandas as pd | ||
|
||
import argparse | ||
import json | ||
import os | ||
arg_parser = argparse.ArgumentParser() | ||
|
||
|
||
arg_parser.add_argument('--id', action='store', type=str, required=True, dest='id') | ||
|
||
|
||
arg_parser.add_argument('--selected_hab_abb', action='store', type=str, required=True, dest='selected_hab_abb') | ||
|
||
|
||
args = arg_parser.parse_args() | ||
print(args) | ||
|
||
id = args.id | ||
|
||
selected_hab_abb = args.selected_hab_abb.replace('"','') | ||
|
||
|
||
|
||
url_txt = f"http://opendap.biodt.eu/ias-pdt/0/outputs/hab{selected_hab_abb}/predictions/Prediction_Summary_Shiny.txt" | ||
df_mod = pd.read_csv(url_txt, sep="\t") | ||
|
||
habitat_dropdown = widgets.Dropdown( | ||
options=df_mod[ | ||
"hab_name" | ||
].unique(), # Replace 'column_name' with the actual column name you want to use | ||
description="Habitat Type:", | ||
disabled=False, | ||
layout=widgets.Layout(margin="0 0 0 0px"), | ||
) | ||
|
||
climate_model_dropdown = widgets.Dropdown( | ||
options=df_mod["climate_model"].unique(), | ||
description="Climate Model:", | ||
disabled=False, | ||
layout=widgets.Layout(margin='0 0 0 0px') | ||
) | ||
|
||
climate_model_dropdown.options = list(climate_model_dropdown.options) + ["Ensemble"] | ||
|
||
|
||
climate_scenario_dropdown = widgets.Dropdown( | ||
options=df_mod["climate_scenario"].unique(), | ||
description="Climate Scenario:", | ||
disabled=False, | ||
layout=widgets.Layout(margin='0 0 0 0px') | ||
) | ||
|
||
time_period_dropdown = widgets.Dropdown( | ||
options=df_mod["time_period"].unique(), | ||
description="Time Period:", | ||
disabled=False, | ||
layout=widgets.Layout(margin='0 0 0 0px') | ||
) | ||
|
||
species_name_dropdown = widgets.Dropdown( | ||
options=df_mod["species_name"].dropna().unique(), | ||
description="Species Name:", | ||
disabled=False, | ||
) | ||
|
||
|
||
param_habitat_name = 'Human maintained grasslands' | ||
param_climate_model = 'Current' | ||
param_climate_scenario = 'Current' | ||
param_time_period = '1981-2010' | ||
param_species_name = 'Agave americana' | ||
|
||
|
||
conf_x = 0.95 | ||
conf_y = 0.95 | ||
conf_arrow_length = 0.1 | ||
|