diff --git a/Download_tide_model.ipynb b/Download_tide_model.ipynb
index de90eda..26c61dc 100644
--- a/Download_tide_model.ipynb
+++ b/Download_tide_model.ipynb
@@ -29,7 +29,7 @@
"![image](https://github.com/Doodleverse/CoastSeg/assets/61564689/5f188ced-0f7e-4732-b065-8eb8f2d54986)\n",
"\n",
"### Step 3: Account Verification\n",
- "- **Confirmation Email:** After completing the registration, AVISO will send you a confirmation email. Check your inbox (and spam folder if necessary) for this email.\r",
+ "- **Confirmation Email:** After completing the registration, AVISO will send you a confirmation email. Check your inbox (and spam folder if necessary) for this email.\n",
"- **Verify Your Account**: Click on the link provided in the email to verify your account. This step is crucial to activate your account and gain access to the data models.\n",
"\n",
"### Step 4: Accessing Your Dashboard\n",
@@ -74,67 +74,10 @@
},
{
"cell_type": "code",
- "execution_count": 1,
+ "execution_count": null,
"id": "2c9db87b-1512-4ac7-9e60-961f871f07b9",
"metadata": {},
- "outputs": [
- {
- "data": {
- "application/vnd.jupyter.widget-view+json": {
- "model_id": "184dca22773f4c12ab94b10a189ea55e",
- "version_major": 2,
- "version_minor": 0
- },
- "text/plain": [
- "Text(value='', description='Username:', placeholder='Enter username')"
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "application/vnd.jupyter.widget-view+json": {
- "model_id": "e78214c2301e446b94de0cbe0a898e91",
- "version_major": 2,
- "version_minor": 0
- },
- "text/plain": [
- "Password(description='Password:', placeholder='Enter password')"
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "application/vnd.jupyter.widget-view+json": {
- "model_id": "9998db3f74da4a389e11dc95ff671255",
- "version_major": 2,
- "version_minor": 0
- },
- "text/plain": [
- "Button(description='Submit', icon='check', style=ButtonStyle(), tooltip='Download Model')"
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "application/vnd.jupyter.widget-view+json": {
- "model_id": "04744c4787f844af82d0763adc9f171d",
- "version_major": 2,
- "version_minor": 0
- },
- "text/plain": [
- "Output()"
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- }
- ],
+ "outputs": [],
"source": [
"import ipywidgets as widgets\n",
"from IPython.display import display\n",
@@ -143,6 +86,9 @@
"# Create an output widget to capture error messages or other outputs\n",
"output_widget = widgets.Output()\n",
"\n",
+ "# Create a widget to display instructions\n",
+ "instructions_widget = widgets.HTML(value=\"Download Tide Model Instructions
1. Select the model you want to download
2. Enter your username and password
3. Click Download\")\n",
+ "\n",
"# Create text input widget for username\n",
"username_input = widgets.Text(\n",
" value='',\n",
@@ -159,23 +105,46 @@
" disabled=False\n",
")\n",
"\n",
+ "# Create a dropdown widget for model selection\n",
+ "model_dropdown = widgets.Dropdown(\n",
+ " options=['fes2014', 'fes2022'],\n",
+ " value='fes2014',\n",
+ " description='Model:',\n",
+ " disabled=False,\n",
+ ")\n",
+ "\n",
+ "\n",
"# Define a function to be called when the button is clicked\n",
"def on_button_click(button):\n",
" with output_widget:\n",
" # Clear any previous outputs\n",
" output_widget.clear_output()\n",
+ "\n",
+ " if not username_input.value:\n",
+ " print(\"Please enter your username\")\n",
+ " \n",
+ " if not password_input.value:\n",
+ " print(\"Please enter your password.\")\n",
+ " return\n",
+ "\n",
" try:\n",
" username = username_input.value\n",
" password = password_input.value\n",
" # Handle the username and password here\n",
- " download_tide_model.download_fes_tides(user=username,password=password)\n",
+ " print(f\"Downloading the tide model {model_dropdown.value}...\")\n",
+ "\n",
+ " GZIP=True\n",
+ " if model_dropdown.value == 'fes2022':\n",
+ " GZIP=False\n",
+ " \n",
+ " download_tide_model.download_fes_tides(user=username,password=password,tide=[model_dropdown.value],gzip=GZIP)\n",
" # For security reasons, avoid printing the password\n",
" except Exception as e:\n",
" print(f\"Error: {e}\")\n",
"\n",
"# Create a button and set its properties\n",
"submit_button = widgets.Button(\n",
- " description='Submit',\n",
+ " description='Download Model',\n",
" disabled=False,\n",
" button_style='', # 'success', 'info', 'warning', 'danger' or ''\n",
" tooltip='Download Model',\n",
@@ -186,7 +155,7 @@
"submit_button.on_click(on_button_click)\n",
"\n",
"# Display the widgets\n",
- "display(username_input, password_input, submit_button,output_widget)"
+ "display(instructions_widget,model_dropdown,username_input, password_input, submit_button,output_widget)"
]
},
{
@@ -196,45 +165,16 @@
"source": [
"## 2. Clipping the Tide Model to the United States\n",
"---\n",
- "### Overview\r\n",
+ "### Overview\n",
"The global tide mode can be computationally intensive when making predictions across vast areas.To optimize and streamline our tide predictions, we are adapting the global tide model to focus specifically on the United States. By segmenting the US into smaller, more manageable regions, we can enhance the speed and efficiency of our predictions.. By doing so, we can quickly identify and load the relevant regional model based on a given latitude and longitude, making tide predictions faster and more efficien.."
]
},
{
"cell_type": "code",
- "execution_count": 1,
+ "execution_count": null,
"id": "edae3939-0949-4fbc-885d-9c3d83242204",
"metadata": {},
- "outputs": [
- {
- "data": {
- "application/vnd.jupyter.widget-view+json": {
- "model_id": "9227c23d696449248376912b75494028",
- "version_major": 2,
- "version_minor": 0
- },
- "text/plain": [
- "Button(description='Clip Model', icon='scissors', style=ButtonStyle(), tooltip='Clip Model')"
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "application/vnd.jupyter.widget-view+json": {
- "model_id": "dc70ef3798d244b98d0452fb2e26470f",
- "version_major": 2,
- "version_minor": 0
- },
- "text/plain": [
- "Output()"
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- }
- ],
+ "outputs": [],
"source": [
"import ipywidgets as widgets\n",
"from IPython.display import display\n",
@@ -309,7 +249,7 @@
],
"metadata": {
"kernelspec": {
- "display_name": "Python 3 (ipykernel)",
+ "display_name": "tf12_coastseg",
"language": "python",
"name": "python3"
},
@@ -323,7 +263,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.10.12"
+ "version": "3.10.16"
}
},
"nbformat": 4,