Skip to content

Commit 4cd0934

Browse files
Demonstrate show_data in reference notebook
1 parent 5861c42 commit 4cd0934

File tree

1 file changed

+64
-4
lines changed

1 file changed

+64
-4
lines changed

examples/reference-guide.ipynb

Lines changed: 64 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -757,22 +757,52 @@
757757
"cell_type": "markdown",
758758
"metadata": {},
759759
"source": [
760-
"## Show any data file"
760+
"## Show any data file\n",
761+
"To explore any data file you have at hand without delving into image or table specific options, you can use the `show_data` method of the FireflyClient object."
761762
]
762763
},
763764
{
764765
"cell_type": "markdown",
765766
"metadata": {},
766767
"source": [
767-
"### Preview metadata"
768+
"### Preview metadata\n",
769+
"It's often useful to preview the metadata of a data file you have no information about. `preview_metadata` parameter allows you to do that:"
768770
]
769771
},
770772
{
771773
"cell_type": "code",
772774
"execution_count": null,
773775
"metadata": {},
774776
"outputs": [],
775-
"source": []
777+
"source": [
778+
"some_fpath = '/Users/jsinghal/dev/cm/__test_data/MF.20210502.18830.fits'"
779+
]
780+
},
781+
{
782+
"cell_type": "code",
783+
"execution_count": null,
784+
"metadata": {},
785+
"outputs": [
786+
{
787+
"data": {
788+
"text/plain": [
789+
"{'success': True}"
790+
]
791+
},
792+
"metadata": {},
793+
"output_type": "display_data"
794+
}
795+
],
796+
"source": [
797+
"fc.show_data(some_fpath, preview_metadata=True)"
798+
]
799+
},
800+
{
801+
"cell_type": "markdown",
802+
"metadata": {},
803+
"source": [
804+
"This allows you to select which extensions/HDUs to load from a multi-extension FITS file. Same can be done for a VOTable with multiple tables."
805+
]
776806
},
777807
{
778808
"cell_type": "markdown",
@@ -781,10 +811,40 @@
781811
"### Directly view data"
782812
]
783813
},
814+
{
815+
"cell_type": "code",
816+
"execution_count": null,
817+
"metadata": {},
818+
"outputs": [],
819+
"source": [
820+
"spectrum_file_url = 'http://irsa.ipac.caltech.edu/api/spectrumdm/convert/euclid/q1/SIR/102160339/EUC_SIR_W-COMBSPEC_102160339_2024-11-05T16:26:34.614296Z.fits?dataset_id=euclid_combspec&hdu=1644'"
821+
]
822+
},
823+
{
824+
"cell_type": "code",
825+
"execution_count": null,
826+
"metadata": {},
827+
"outputs": [
828+
{
829+
"data": {
830+
"text/plain": [
831+
"{'success': True}"
832+
]
833+
},
834+
"metadata": {},
835+
"output_type": "display_data"
836+
}
837+
],
838+
"source": [
839+
"fc.show_data(spectrum_file_url, preview_metadata=False)"
840+
]
841+
},
784842
{
785843
"cell_type": "markdown",
786844
"metadata": {},
787-
"source": []
845+
"source": [
846+
"Note that show_data is a recent addition to firefly_client and is still evolving. It doesn't allow as much customization as image/table specific methods yet, but it is a quick way to get a look at your data."
847+
]
788848
}
789849
],
790850
"metadata": {

0 commit comments

Comments
 (0)