Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ nonstd-parser/
.venv/
.gitattributes
.ipynb_checkpoints/

.env
38 changes: 22 additions & 16 deletions examples/tutorial.ipynb → examples/tutorial-noaa.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
"source": [
"import pyleotups as pt\n",
"\n",
"# Initialize the Dataset manager\n",
"# Initialize a NOAA Dataset manager\n",
"# This object will act as your session, storing search results and processing data.\n",
"dataset = pt.Dataset()"
"dataset = pt.NOAADataset()"
]
},
{
Expand Down Expand Up @@ -277,7 +277,7 @@
],
"source": [
"# Clear previous results\n",
"dataset = pt.Dataset()\n",
"dataset = pt.NOAADataset()\n",
"\n",
"# Example 1: \"OR\" Logic (Default)\n",
"# Find studies by EITHER Wahl OR Vose\n",
Expand All @@ -295,7 +295,7 @@
" investigators=[\"Wahl, E.R.\", \"Vose, R.S.\"],\n",
" investigators_and_or=\"AND\",\n",
")\n",
"print(f\"Found {len(search_by_investigator)} studies.\")"
"print(f\"Found {len(search_by_investigator_and)} studies.\")"
]
},
{
Expand All @@ -305,7 +305,7 @@
"metadata": {},
"outputs": [],
"source": [
"dataset = pt.Dataset()"
"dataset = pt.NOAADataset()"
]
},
{
Expand Down Expand Up @@ -778,7 +778,7 @@
"# Search for studies in a specific region (e.g., Tropical Pacific)\n",
"# Latitude: 10S to 10N (-10 to 10)\n",
"# Longitude: 120E to 150E (120 to 150)\n",
"dataset = pt.Dataset()\n",
"dataset = pt.NOAADataset()\n",
"\n",
"dataset.search_studies(\n",
" min_lat=-10, max_lat=10,\n",
Expand Down Expand Up @@ -935,7 +935,7 @@
"source": [
"# 1. View the high-level summary of the studies found\n",
"\n",
"dataset = pt.Dataset()\n",
"dataset = pt.NOAADataset()\n",
"dataset.search_studies(noaa_id=18316)\n",
"\n",
"summary_df = dataset.get_summary()\n",
Expand Down Expand Up @@ -1506,7 +1506,7 @@
"source": [
"# 1. View the high-level summary of the studies found\n",
"\n",
"dataset = pt.Dataset()\n",
"dataset = pt.NOAADataset()\n",
"dataset.search_studies(noaa_id=18316)\n",
"\n",
"dataset.get_sites()\n"
Expand Down Expand Up @@ -2011,7 +2011,7 @@
}
],
"source": [
"speleo8k_ds = pt.Dataset()\n",
"speleo8k_ds = pt.NOAADataset()\n",
"speleo8k_ds.search_studies(noaa_id=9957)\n",
"speleo8k_ds.get_summary()"
]
Expand Down Expand Up @@ -3885,7 +3885,7 @@
}
],
"source": [
"dataset = pt.Dataset()\n",
"dataset = pt.NOAADataset()\n",
"df_data_by_url = dataset.get_data(file_urls=\"https://www.ncei.noaa.gov/pub/data/paleo/climate_forcing/trace_gases/mcelwain1995co2.txt\")"
]
},
Expand Down Expand Up @@ -4098,7 +4098,7 @@
}
],
"source": [
"error_ds = pt.Dataset()\n",
"error_ds = pt.NOAADataset()\n",
"error_ds.get_data(file_urls = [\"https://www.ncei.noaa.gov/pub/data/paleo/reconstructions/climate12k/temperature/version1.0.0/Temp12k_directory_LiPD_files/AdelaideTarn.Jara.2015.lpd\"])\n",
"\n"
]
Expand Down Expand Up @@ -4507,7 +4507,7 @@
],
"source": [
"# Initialize a clean dataset\n",
"dataset = pt.Dataset()\n",
"dataset = pt.NOAADataset()\n",
"\n",
"# Query 1: Get the first 10 results\n",
"print(\"--- Fetching Batch 1 (1-10) ---\")\n",
Expand Down Expand Up @@ -5203,8 +5203,8 @@
],
"source": [
"# Create two separate datasets\n",
"ds_pollen = pt.Dataset()\n",
"ds_ice = pt.Dataset()\n",
"ds_pollen = pt.NOAADataset()\n",
"ds_ice = pt.NOAADataset()\n",
"\n",
"# Search 1: Pollen studies in a specific region\n",
"print(\"Searching for Pollen...\")\n",
Expand Down Expand Up @@ -5609,15 +5609,21 @@
"excel_parser = ExcelParser(excel_url)\n",
"excel_data_blocks = excel_parser.parse()\n",
"\n",
"for block in excel_data_dfs:\n",
"for block in excel_data_blocks:\n",
" if hasattr(block, 'df') and block.df is not None:\n",
" display(block.df.head())"
]
}
],
"metadata": {
"kernelspec": {
"display_name": ".venv (3.12.3)",
"language": "python",
"name": "python3"
},
"language_info": {
"name": "python"
"name": "python",
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
Loading
Loading