Skip to content

Commit

Permalink
Update output from docs. Update path to hats catalogs. (#445)
Browse files Browse the repository at this point in the history
* Update output from docs. Update path to hats catalogs.

* More working notebooks.

* fix notebooks

* add link to remote data notebook

* add columns to margins

* fix margin plots

* lint

* Update survey links

* Set plot titles

---------

Co-authored-by: Sean McGuire <[email protected]>
Co-authored-by: Sandro Campos <[email protected]>
  • Loading branch information
3 people authored Oct 25, 2024
1 parent 84465fa commit f1a3713
Show file tree
Hide file tree
Showing 11 changed files with 317 additions and 427 deletions.
8 changes: 4 additions & 4 deletions docs/getting-started.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Getting Started with LSDB
============
==========================

Installation
--------------------------
Expand Down Expand Up @@ -70,7 +70,7 @@ Catalog, and specify which columns we want to use from it.
import lsdb
ztf = lsdb.read_hats(
'https://data.lsdb.io/unstable/ztf/ztf_dr14/',
'https://data.lsdb.io/hats/ztf_dr14/ztf_object/',
columns=["ra", "dec", "ps1_objid", "nobs_r", "mean_mag_r"],
)
>> ztf
Expand Down Expand Up @@ -133,9 +133,9 @@ get accurate results. This should be provided with the catalog by the catalog's
.. code-block:: python
gaia = lsdb.read_hats(
'https://data.lsdb.io/unstable/gaia_dr3/gaia/',
'https://data.lsdb.io/hats/gaia_dr3/gaia/',
columns=["ra", "dec", "phot_g_n_obs", "phot_g_mean_flux", "pm"],
margin_cache="https://data.lsdb.io/unstable/gaia_dr3/gaia_10arcs/",
margin_cache="https://data.lsdb.io/hats/gaia_dr3/gaia_10arcs/",
)
Once we've got our other catalog, we can crossmatch the two together!
Expand Down
1 change: 0 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ Using this Guide
:hidden:

Home page <self>
Installation <installation>
Getting Started <getting-started>
Tutorials <tutorials>
API Reference <autoapi/index>
Expand Down
1 change: 1 addition & 0 deletions docs/tutorials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ A more in-depth look into how LSDB works
:name: Advanced Topics

Topic: Import catalogs <tutorials/import_catalogs>
Topic: Accessing Remote Data <tutorials/remote_data>
Topic: Margins <tutorials/margins>
Topic: Performance Testing <tutorials/performance>

Expand Down
20 changes: 10 additions & 10 deletions docs/tutorials/filtering_large_catalogs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"metadata": {},
"outputs": [],
"source": [
"surveys_path = \"https://data.lsdb.io/unstable/\""
"surveys_path = \"https://data.lsdb.io/hats/\""
]
},
{
Expand All @@ -92,7 +92,7 @@
"metadata": {},
"outputs": [],
"source": [
"ztf_object_path = f\"{surveys_path}/ztf/ztf_dr14\"\n",
"ztf_object_path = f\"{surveys_path}/ztf_dr14/ztf_object\"\n",
"ztf_object = lsdb.read_hats(ztf_object_path, columns=[\"ps1_objid\", \"ra\", \"dec\"])\n",
"ztf_object"
]
Expand Down Expand Up @@ -144,7 +144,7 @@
"metadata": {},
"outputs": [],
"source": [
"ztf_object.plot_pixels(\"ZTF_DR14 - pixel map\")"
"ztf_object.plot_pixels(plot_title=\"ZTF_DR14 - pixel map\")"
]
},
{
Expand Down Expand Up @@ -175,7 +175,7 @@
"metadata": {},
"outputs": [],
"source": [
"ztf_object_cone.plot_pixels(\"ZTF_DR14 - cone pixel map\")"
"ztf_object_cone.plot_pixels(plot_title=\"ZTF_DR14 - cone pixel map\")"
]
},
{
Expand Down Expand Up @@ -207,7 +207,7 @@
"metadata": {},
"outputs": [],
"source": [
"ztf_object_polygon.plot_pixels(\"ZTF_DR14 - polygon pixel map\")"
"ztf_object_polygon.plot_pixels(plot_title=\"ZTF_DR14 - polygon pixel map\")"
]
},
{
Expand Down Expand Up @@ -250,7 +250,7 @@
"metadata": {},
"outputs": [],
"source": [
"ztf_object_box_ra.plot_pixels(\"ZTF_DR14 - RA band pixel map\")"
"ztf_object_box_ra.plot_pixels(plot_title=\"ZTF_DR14 - RA band pixel map\")"
]
},
{
Expand Down Expand Up @@ -279,7 +279,7 @@
"metadata": {},
"outputs": [],
"source": [
"ztf_object_box_dec.plot_pixels(\"ZTF_DR14 - DEC band pixel map\")"
"ztf_object_box_dec.plot_pixels(plot_title=\"ZTF_DR14 - DEC band pixel map\")"
]
},
{
Expand Down Expand Up @@ -310,7 +310,7 @@
"metadata": {},
"outputs": [],
"source": [
"ztf_object_box.plot_pixels(\"ZTF_DR14 - box pixel map\")"
"ztf_object_box.plot_pixels(plot_title=\"ZTF_DR14 - box pixel map\")"
]
},
{
Expand Down Expand Up @@ -384,7 +384,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "hipscatenv",
"display_name": "demo",
"language": "python",
"name": "python3"
},
Expand All @@ -398,7 +398,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.14"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
8 changes: 4 additions & 4 deletions docs/tutorials/getting_data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"metadata": {},
"outputs": [],
"source": [
"gaia_dr3 = lsdb.read_hats(\"https://data.lsdb.io/unstable/gaia_dr3/gaia/\")\n",
"gaia_dr3 = lsdb.read_hats(\"https://data.lsdb.io/hats/gaia_dr3/gaia/\")\n",
"gaia_dr3"
]
},
Expand Down Expand Up @@ -73,8 +73,8 @@
"outputs": [],
"source": [
"gaia_dr3 = lsdb.read_hats(\n",
" \"https://data.lsdb.io/unstable/gaia_dr3/gaia/\",\n",
" margin_cache=\"https://data.lsdb.io/unstable/gaia_dr3/gaia_10arcs/\",\n",
" \"https://data.lsdb.io/hats/gaia_dr3/gaia/\",\n",
" margin_cache=\"https://data.lsdb.io/hats/gaia_dr3/gaia_10arcs/\",\n",
" columns=[\n",
" \"source_id\",\n",
" \"ra\",\n",
Expand Down Expand Up @@ -130,7 +130,7 @@
"metadata": {},
"outputs": [],
"source": [
"gaia_dr3.plot_pixels(\"Gaia DR3 Pixel Map\")"
"gaia_dr3.plot_pixels(plot_title=\"Gaia DR3 Pixel Map\")"
]
},
{
Expand Down
55 changes: 21 additions & 34 deletions docs/tutorials/import_catalogs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
"id": "529d9e23",
"metadata": {},
"source": [
"We will be importing `small_sky_order1` from a single CSV file:"
"We will be importing `small_sky` from a single CSV file.\n",
"\n",
"Let's define the input and output paths:"
]
},
{
Expand All @@ -52,37 +54,14 @@
}
},
"outputs": [],
"source": [
"catalog_name = \"small_sky_order1\"\n",
"test_data_dir = Path.cwd() / \"..\" / \"..\" / \"tests\" / \"data\""
]
},
{
"cell_type": "markdown",
"id": "8b37826f",
"metadata": {},
"source": [
"Let's define the input and output paths:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "59e857888ae9ea70",
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-10T15:14:55.958272Z",
"start_time": "2023-11-10T15:14:55.924340Z"
}
},
"outputs": [],
"source": [
"# Input paths\n",
"catalog_dir = test_data_dir / catalog_name\n",
"catalog_csv_path = catalog_dir / f\"{catalog_name}.csv\"\n",
"test_data_dir = Path.cwd() / \"..\" / \"..\" / \"tests\" / \"data\"\n",
"catalog_csv_path = test_data_dir / \"raw\" / \"small_sky\" / \"small_sky.csv\"\n",
"\n",
"# Temporary directory for the intermediate/output files\n",
"tmp_dir = tempfile.TemporaryDirectory()"
"tmp_dir = tempfile.TemporaryDirectory()\n",
"tmp_path = Path(tmp_dir.name)"
]
},
{
Expand Down Expand Up @@ -120,7 +99,7 @@
")\n",
"\n",
"# Save it to disk in HATS format\n",
"catalog.to_hats(f\"{tmp_dir.name}/from_dataframe\")"
"catalog.to_hats(tmp_path / \"from_dataframe\")"
]
},
{
Expand Down Expand Up @@ -196,7 +175,7 @@
" file_reader=\"csv\",\n",
" input_file_list=[catalog_csv_path],\n",
" output_artifact_name=\"from_import_pipeline\",\n",
" output_path=tmp_dir.name,\n",
" output_path=tmp_path,\n",
" resume=False,\n",
")\n",
"\n",
Expand Down Expand Up @@ -226,7 +205,7 @@
},
"outputs": [],
"source": [
"from_dataframe_catalog = lsdb.read_hats(f\"{tmp_dir.name}/from_dataframe\")\n",
"from_dataframe_catalog = lsdb.read_hats(tmp_path / \"from_dataframe\")\n",
"from_dataframe_catalog"
]
},
Expand All @@ -242,7 +221,7 @@
},
"outputs": [],
"source": [
"from_import_pipeline_catalog = lsdb.read_hats(f\"{tmp_dir.name}/from_import_pipeline\")\n",
"from_import_pipeline_catalog = lsdb.read_hats(tmp_path / \"from_import_pipeline\")\n",
"from_import_pipeline_catalog"
]
},
Expand Down Expand Up @@ -284,11 +263,19 @@
"source": [
"tmp_dir.cleanup()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "240241dc",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "demo",
"language": "python",
"name": "python3"
},
Expand All @@ -302,7 +289,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.14"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit f1a3713

Please sign in to comment.