{ "cells": [ { "cell_type": "markdown", "id": "9977229d-1d53-4ee2-ba8d-889518598634", "metadata": {}, "source": [ "# LVIS Access and Explore" ] }, { "cell_type": "markdown", "id": "c8d49f4b", "metadata": {}, "source": [ "Authors: Rajat Shinde (UAH), Sheyenne Kirkland (UAH), Alex Mandel (Development Seed), Jamison French (Development Seed), Emile Tenezakis (Development Seed), Brian Freitag (NASA MSFC)\n", "\n", "Date: August 22, 2023\n", "\n", "Description: In this tutorial, we will explore the LVIS (Land Vegetation and Ice Sensor) based data products and work on accessing these data products using MAAP.\n", "\n", "### Run This Notebook\n", "To access and run this tutorial within MAAP's Algorithm Development Environment (ADE), please refer to the [\"Getting started with the MAAP\"](https://docs.maap-project.org/en/latest/getting_started/getting_started.html) section of our documentation.\n", "\n", "Disclaimer: It is highly recommended to run a tutorial within MAAP's ADE, which already includes packages specific to MAAP, such as maap-py. Running the tutorial outside of the MAAP ADE may lead to errors." ] }, { "cell_type": "markdown", "id": "793665fc-ff05-48ab-96f3-b1040cac8d26", "metadata": { "tags": [] }, "source": [ "### Importing Packages" ] }, { "cell_type": "markdown", "id": "4cf8cffb", "metadata": {}, "source": [ "We import the `os` module, import the `MAAP` package, and create a new MAAP class instance." ] }, { "cell_type": "code", "execution_count": null, "id": "4ef74ea1-9209-4e44-a06c-fe8847242cd4", "metadata": {}, "outputs": [], "source": [ "# import os module\n", "import os\n", "\n", "# import the MAAP package to handle queries\n", "from maap.maap import MAAP\n", "\n", "# import printing package to help display outputs\n", "from pprint import pprint\n", "\n", "# invoke the MAAP search client\n", "maap = MAAP()" ] }, { "cell_type": "markdown", "id": "1cb61686", "metadata": {}, "source": [ "### Creating a Data Directory for this Tutorial" ] }, { "cell_type": "code", "execution_count": 14, "id": "032d637f", "metadata": {}, "outputs": [], "source": [ "# set data directory path\n", "dataDir = './data'\n", "\n", "# check if directory exists -> if directory doesn't exist, directory is created\n", "if not os.path.exists(dataDir):\n", " os.mkdir(dataDir)" ] }, { "cell_type": "markdown", "id": "f1b64ad1", "metadata": {}, "source": [ "After executing the previous cell, we can observe that the data directory has been created and all the files in this tutorial will be downloaded to this directory." ] }, { "cell_type": "markdown", "id": "791edd0b-5c13-468c-8807-560c461e7a75", "metadata": { "tags": [] }, "source": [ "## Accessing the LVIS Facility L1B Geolocated Return Energy Waveforms V001" ] }, { "cell_type": "markdown", "id": "602ba2d6", "metadata": {}, "source": [ "### About the Dataset" ] }, { "cell_type": "markdown", "id": "08f89e0f", "metadata": {}, "source": [ "The [LVIS Facility L1B Geolocated Return Energy Waveforms V001 dataset](https://doi.org/10.5067/XQJ8PN8FTIDG) contains Level-1B geolocated return energy waveforms collected by the NASA Land, Vegetation and Ice Sensor (LVIS) Facility, an imaging lidar and camera sensor suite. The short name for this collection is `LVISF1B`. This short name is used for searching this collection in the NASA CMR using the `searchCollection()` method." ] }, { "cell_type": "markdown", "id": "8665848d", "metadata": {}, "source": [ "### Searching the Collection" ] }, { "cell_type": "code", "execution_count": 15, "id": "1e78727f-2411-4c7b-85ec-19cff8e48f90", "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/plain": [ "[{'concept-id': 'C1723866745-NSIDC_ECS',\n", " 'revision-id': '38',\n", " 'format': 'application/echo10+xml',\n", " 'Collection': {'ShortName': 'LVISF1B',\n", " 'VersionId': '1',\n", " 'InsertTime': '2023-08-22T18:01:08.485Z',\n", " 'LastUpdate': '2023-08-22T18:01:08.485Z',\n", " 'LongName': 'Not provided',\n", " 'DataSetId': 'LVIS Facility L1B Geolocated Return Energy Waveforms V001',\n", " 'Description': 'This data set contains Level-1B geolocated return energy waveforms collected by the NASA Land, Vegetation, and Ice Sensor (LVIS) Facility, an imaging lidar and camera sensor suite.',\n", " 'DOI': {'DOI': '10.5067/XQJ8PN8FTIDG'},\n", " 'StandardProduct': 'false',\n", " 'RevisionDate': '2023-05-31T00:00:00.000Z',\n", " 'SuggestedUsage': 'Scientific Research',\n", " 'ProcessingCenter': 'NASA/GSFC/SED/ESD/LRSL',\n", " 'ProcessingLevelId': 'Level 1B',\n", " 'ProcessingLevelDescription': 'Sensor units',\n", " 'ArchiveCenter': 'NASA NSIDC DAAC',\n", " 'CollectionState': 'PLANNED',\n", " 'RestrictionComment': ' These data are freely, openly, and fully accessible, provided that you are logged into your NASA Earthdata profile (https://urs.earthdata.nasa.gov/).',\n", " 'UseConstraints': {'LicenseText': ' These data are freely, openly, and fully available to use without restrictions, provided that you cite the data according to the recommended citation at https://nsidc.org/about/use_copyright.html. For more information on the NASA EOSDIS Data Use Policy, see https://earthdata.nasa.gov/earth-observation-data/data-use-policy.'},\n", " 'DataFormat': 'HDF5',\n", " 'SpatialKeywords': {'Keyword': ['CANADA',\n", " 'GREENLAND',\n", " 'UNITED STATES OF AMERICA',\n", " 'COSTA RICA',\n", " 'FRENCH GUIANA']},\n", " 'Temporal': {'EndsAtPresentFlag': 'false',\n", " 'RangeDateTime': {'BeginningDateTime': '2018-11-07T00:00:00.000Z'}},\n", " 'Contacts': {'Contact': [{'Role': 'ARCHIVER',\n", " 'OrganizationName': 'NASA NSIDC DAAC',\n", " 'OrganizationAddresses': {'Address': {'StreetAddress': 'National Snow and Ice Data Center CIRES, 449 UCB University of Colorado',\n", " 'City': 'Boulder',\n", " 'StateProvince': 'CO',\n", " 'PostalCode': '80309-0449',\n", " 'Country': 'USA'}},\n", " 'OrganizationPhones': {'Phone': {'Number': '1 303 492 6199',\n", " 'Type': 'Telephone'}},\n", " 'OrganizationEmails': {'Email': 'nsidc@nsidc.org'}},\n", " {'Role': 'DISTRIBUTOR',\n", " 'OrganizationName': 'NASA NSIDC DAAC',\n", " 'OrganizationAddresses': {'Address': {'StreetAddress': 'National Snow and Ice Data Center CIRES, 449 UCB University of Colorado',\n", " 'City': 'Boulder',\n", " 'StateProvince': 'CO',\n", " 'PostalCode': '80309-0449',\n", " 'Country': 'USA'}},\n", " 'OrganizationPhones': {'Phone': {'Number': '1 303 492 6199',\n", " 'Type': 'Telephone'}},\n", " 'OrganizationEmails': {'Email': 'nsidc@nsidc.org'}},\n", " {'Role': 'PROCESSOR', 'OrganizationName': 'NASA/GSFC/SED/ESD/LRSL'},\n", " {'Role': 'ORIGINATOR', 'OrganizationName': 'NASA/GSFC/SED/ESD/LRSL'},\n", " {'Role': 'TECHNICAL CONTACT',\n", " 'ContactPersons': {'ContactPerson': [{'FirstName': 'NSIDC',\n", " 'MiddleName': 'User',\n", " 'LastName': 'Services',\n", " 'JobPosition': 'TECHNICAL CONTACT'},\n", " {'FirstName': 'J.',\n", " 'MiddleName': 'Bryan',\n", " 'LastName': 'Blair',\n", " 'JobPosition': 'TECHNICAL CONTACT'},\n", " {'FirstName': 'Michelle',\n", " 'LastName': 'Hofton',\n", " 'JobPosition': 'TECHNICAL CONTACT'}]}}]},\n", " 'ScienceKeywords': {'ScienceKeyword': {'CategoryKeyword': 'EARTH SCIENCE',\n", " 'TopicKeyword': 'SPECTRAL/ENGINEERING',\n", " 'TermKeyword': 'INFRARED WAVELENGTHS',\n", " 'VariableLevel1Keyword': {'Value': 'SENSOR COUNTS'}}},\n", " 'Platforms': {'Platform': [{'ShortName': 'B-200',\n", " 'LongName': 'Beechcraft King Air B-200',\n", " 'Type': 'Propeller',\n", " 'Instruments': {'Instrument': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor'}}}}},\n", " {'ShortName': 'G-III',\n", " 'LongName': 'Gulfstream III',\n", " 'Type': 'Jet',\n", " 'Instruments': {'Instrument': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor'}}}}},\n", " {'ShortName': 'G-V',\n", " 'LongName': 'Gulfstream V',\n", " 'Type': 'Jet',\n", " 'Instruments': {'Instrument': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor'}}}}},\n", " {'ShortName': 'P-3B',\n", " 'LongName': 'Lockheed P-3B Orion',\n", " 'Type': 'Propeller',\n", " 'Instruments': {'Instrument': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor'}}}}}]},\n", " 'AdditionalAttributes': {'AdditionalAttribute': [{'Name': 'AircraftID',\n", " 'DataType': 'STRING',\n", " 'Description': 'The identifier of the airplane used by the FAA to uniquely identify each aircraft'},\n", " {'Name': 'SIPSMetGenVersion',\n", " 'DataType': 'STRING',\n", " 'Description': 'The version of the SIPSMetGen software used to produce the metadata file for this granule'},\n", " {'Name': 'ThemeID',\n", " 'DataType': 'STRING',\n", " 'Description': 'The identifier of the theme under which data are logically grouped'},\n", " {'Name': 'identifier_product_doi',\n", " 'DataType': 'STRING',\n", " 'Description': 'Digital object identifier that uniquely identifies this data product'},\n", " {'Name': 'identifier_product_doi_authority',\n", " 'DataType': 'STRING',\n", " 'Description': 'URL of the digital object identifier resolving authority'}]},\n", " 'Campaigns': {'Campaign': [{'ShortName': 'ABoVE',\n", " 'LongName': 'Arctic-Boreal Vulnerability Experiment (ABoVE) NASA field campaign',\n", " 'StartDate': '2017-06-29T00:00:00.000Z',\n", " 'EndDate': '2017-07-17T00:00:00.000Z'},\n", " {'ShortName': 'GEDI',\n", " 'LongName': \"NASA's Global Ecosystem Dynamics Investigation\",\n", " 'StartDate': '2019-01-01T00:00:00.000Z',\n", " 'EndDate': '2019-12-31T00:00:00.000Z'},\n", " {'ShortName': 'MULTI_NASA',\n", " 'LongName': 'Operation IceBridge Multiple Campaigns',\n", " 'StartDate': '1993-01-01T00:00:00.000Z',\n", " 'EndDate': '2025-12-31T00:00:00.000Z'}]},\n", " 'SpatialInfo': {'SpatialCoverageType': 'HORIZONTAL'},\n", " 'OnlineAccessURLs': {'OnlineAccessURL': [{'URL': 'https://n5eil01u.ecs.nsidc.org/ICEBRIDGE/LVISF1B.001/',\n", " 'URLDescription': 'Direct download via HTTPS protocol.'},\n", " {'URL': 'https://search.earthdata.nasa.gov/search?q=LVISF1B+V001',\n", " 'URLDescription': \"NASA's newest search and order tool for subsetting, reprojecting, and reformatting data.\"},\n", " {'URL': 'https://nsidc.org/data/data-access-tool/LVISF1B/versions/1/',\n", " 'URLDescription': 'Search and filter data files using a map-based interface'}]},\n", " 'OnlineResources': {'OnlineResource': [{'URL': 'https://doi.org/10.5067/XQJ8PN8FTIDG',\n", " 'Description': 'Provides access to data, documentation, tools, citation information, support, and other resources.',\n", " 'Type': 'CollectionURL : DATA SET LANDING PAGE'},\n", " {'URL': 'https://doi.org/10.5067/XQJ8PN8FTIDG',\n", " 'Description': \"Includes a user's guide, supplemental documents like ATBDs and academic papers, How Tos, FAQs, etc.\",\n", " 'Type': 'VIEW RELATED INFORMATION : GENERAL DOCUMENTATION'}]},\n", " 'Spatial': {'SpatialCoverageType': 'HORIZONTAL',\n", " 'HorizontalSpatialDomain': {'Geometry': {'CoordinateSystem': 'CARTESIAN',\n", " 'BoundingRectangle': {'WestBoundingCoordinate': '-167.0',\n", " 'NorthBoundingCoordinate': '88.0',\n", " 'EastBoundingCoordinate': '18.0',\n", " 'SouthBoundingCoordinate': '2.0'}}},\n", " 'GranuleSpatialRepresentation': 'GEODETIC'}}}]" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lvisf1b_collections = maap.searchCollection(\n", " short_name='LVISF1B',\n", " version='1',\n", " cmr_host='cmr.earthdata.nasa.gov'\n", ")\n", "lvisf1b_collections" ] }, { "cell_type": "markdown", "id": "762fffa2", "metadata": {}, "source": [ "The above cell searches and generates the metadata associated with the LVISF1B collection. The `concept-id` in the above output is important and defines the collection id. Using this collection id (See `COLLECTION_ID` below), we will be searching for the granules in this collection." ] }, { "cell_type": "markdown", "id": "f480b05b", "metadata": {}, "source": [ "### Searching and Downloading a Granule" ] }, { "cell_type": "markdown", "id": "1009f8e4", "metadata": {}, "source": [ "We use `searchGranule()` method for searching granules in a particular collection. Once the list of granules is retrieved, we can download a granule to above-defined path by using the `getData()` method." ] }, { "cell_type": "code", "execution_count": 16, "id": "e1557cec-f118-4d76-9155-569395f0e1b7", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "'Got 20 results'\n", "./data/LVISF1B_US2018_1107_R2011_067463.h5\n" ] } ], "source": [ "COLLECTION_ID = lvisf1b_collections[0][\"concept-id\"]\n", "\n", "results = maap.searchGranule(\n", " concept_id=COLLECTION_ID,\n", " cmr_host=\"cmr.earthdata.nasa.gov\"\n", ")\n", "pprint(f'Got {len(results)} results')\n", "\n", "\n", "#Validating download\n", "filename = results[0].getData(dataDir)\n", "print(filename)" ] }, { "cell_type": "markdown", "id": "65b3096b", "metadata": {}, "source": [ "### Validating the Downloaded Product" ] }, { "cell_type": "markdown", "id": "6a297706", "metadata": {}, "source": [ "The downloaded product is stored in a Hierarchical Data Format, Version 5 or HDF5 file format (`.h5`). Such files can be accessed in Python by using the [h5py](https://pypi.org/project/h5py/) library. " ] }, { "cell_type": "code", "execution_count": 17, "id": "6acfe753-fc8d-429c-b785-989b92b8be3a", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Keys: \n", "\n", "[159.14177 159.4966 158.7841 ... 127.461716 124.07847 124.752396]\n" ] } ], "source": [ "#Testing the HDF5 files\n", "import h5py\n", "with h5py.File(filename, \"r\") as f: \n", " print(\"Keys: %s\" % f.keys())\n", " # get first object name/key; may or may NOT be a group\n", " a_group_key = list(f.keys())[0]\n", "\n", " # get the object type for a_group_key: usually group or dataset\n", " print(type(f[a_group_key])) \n", "\n", " # If a_group_key is a group name, \n", " # this gets the object names in the group and returns as a list\n", " data = list(f[a_group_key])\n", "\n", " # If a_group_key is a dataset name, \n", " # this gets the dataset values and returns as a list\n", " data = list(f[a_group_key])\n", " # preferred methods to get dataset values:\n", " ds_obj = f[a_group_key] # returns as a h5py dataset object\n", " ds_arr = f[a_group_key][()] # returns as a numpy array\n", " \n", " print(ds_arr)" ] }, { "cell_type": "markdown", "id": "26e91766", "metadata": {}, "source": [ "Since we are able to access data values from the downloaded granule, it is justified that the downloaded file is a valid data product." ] }, { "cell_type": "markdown", "id": "c614d0f9-3613-4979-b056-bde5ff2350cc", "metadata": { "tags": [] }, "source": [ "## Acessing the ABoVE LVIS L1B Geolocated Return Energy Waveforms V001" ] }, { "cell_type": "markdown", "id": "e6054828", "metadata": {}, "source": [ "### About the Dataset\n", "The [ABoVE LVIS L1B Geolocated Return Energy Waveforms V001 dataset](https://doi.org/10.5067/UMRAWS57QAFU) contains return energy waveform data over Alaska and Western Canada measured by the NASA Land, Vegetation, and Ice Sensor (LVIS), an airborne lidar scanning laser altimeter. The data were collected as part of NASA's Terrestrial Ecology Program campaign, the Arctic-Boreal Vulnerability Experiment (ABoVE). The short name for this collection is `ABLVIS1B`." ] }, { "cell_type": "markdown", "id": "b3598bbe", "metadata": {}, "source": [ "### Searching the Collection" ] }, { "cell_type": "code", "execution_count": 18, "id": "06b33851-795c-4ead-bfb0-16ad8f6d8d1a", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[{'concept-id': 'C1513105920-NSIDC_ECS',\n", " 'revision-id': '49',\n", " 'format': 'application/echo10+xml',\n", " 'Collection': {'ShortName': 'ABLVIS1B',\n", " 'VersionId': '1',\n", " 'InsertTime': '2023-08-22T16:58:08.001Z',\n", " 'LastUpdate': '2023-08-22T16:58:08.001Z',\n", " 'LongName': 'Not provided',\n", " 'DataSetId': 'ABoVE LVIS L1B Geolocated Return Energy Waveforms V001',\n", " 'Description': \"This data set contains return energy waveform data over Alaska and Western Canada measured by the NASA Land, Vegetation, and Ice Sensor (LVIS), an airborne lidar scanning laser altimeter. The data were collected as part of NASA's Terrestrial Ecology Program campaign, the Arctic-Boreal Vulnerability Experiment (ABoVE).\",\n", " 'DOI': {'DOI': '10.5067/UMRAWS57QAFU'},\n", " 'StandardProduct': 'false',\n", " 'RevisionDate': '2023-07-05T00:00:00.000Z',\n", " 'SuggestedUsage': 'Scientific Research',\n", " 'ProcessingCenter': 'NASA/GSFC/SED/ESD/LRSL',\n", " 'ProcessingLevelId': 'Level 1B',\n", " 'ProcessingLevelDescription': 'Sensor units',\n", " 'ArchiveCenter': 'NASA NSIDC DAAC',\n", " 'CollectionState': 'PLANNED',\n", " 'RestrictionComment': ' These data are freely, openly, and fully accessible, provided that you are logged into your NASA Earthdata profile (https://urs.earthdata.nasa.gov/).',\n", " 'UseConstraints': {'LicenseText': ' These data are freely, openly, and fully available to use without restrictions, provided that you cite the data according to the recommended citation at https://nsidc.org/about/use_copyright.html. For more information on the NASA EOSDIS Data Use Policy, see https://earthdata.nasa.gov/earth-observation-data/data-use-policy.'},\n", " 'DataFormat': 'HDF5',\n", " 'SpatialKeywords': {'Keyword': ['ALASKA', 'CANADA']},\n", " 'Temporal': {'EndsAtPresentFlag': 'false',\n", " 'RangeDateTime': {'BeginningDateTime': '2017-06-29T00:00:00.000Z',\n", " 'EndingDateTime': '2017-07-17T23:59:59.999Z'}},\n", " 'Contacts': {'Contact': [{'Role': 'ARCHIVER',\n", " 'OrganizationName': 'NASA NSIDC DAAC',\n", " 'OrganizationAddresses': {'Address': {'StreetAddress': 'National Snow and Ice Data Center CIRES, 449 UCB University of Colorado',\n", " 'City': 'Boulder',\n", " 'StateProvince': 'CO',\n", " 'PostalCode': '80309-0449',\n", " 'Country': 'USA'}},\n", " 'OrganizationPhones': {'Phone': {'Number': '1 303 492 6199',\n", " 'Type': 'Telephone'}},\n", " 'OrganizationEmails': {'Email': 'nsidc@nsidc.org'}},\n", " {'Role': 'DISTRIBUTOR',\n", " 'OrganizationName': 'NASA NSIDC DAAC',\n", " 'OrganizationAddresses': {'Address': {'StreetAddress': 'National Snow and Ice Data Center CIRES, 449 UCB University of Colorado',\n", " 'City': 'Boulder',\n", " 'StateProvince': 'CO',\n", " 'PostalCode': '80309-0449',\n", " 'Country': 'USA'}},\n", " 'OrganizationPhones': {'Phone': {'Number': '1 303 492 6199',\n", " 'Type': 'Telephone'}},\n", " 'OrganizationEmails': {'Email': 'nsidc@nsidc.org'}},\n", " {'Role': 'PROCESSOR', 'OrganizationName': 'NASA/GSFC/SED/ESD/LRSL'},\n", " {'Role': 'ORIGINATOR', 'OrganizationName': 'NASA/GSFC/SED/ESD/LRSL'},\n", " {'Role': 'TECHNICAL CONTACT',\n", " 'ContactPersons': {'ContactPerson': [{'FirstName': 'NSIDC',\n", " 'MiddleName': 'User',\n", " 'LastName': 'Services',\n", " 'JobPosition': 'TECHNICAL CONTACT'},\n", " {'FirstName': 'J.',\n", " 'MiddleName': 'Bryan',\n", " 'LastName': 'Blair',\n", " 'JobPosition': 'TECHNICAL CONTACT'},\n", " {'FirstName': 'Michelle',\n", " 'LastName': 'Hofton',\n", " 'JobPosition': 'TECHNICAL CONTACT'}]}}]},\n", " 'ScienceKeywords': {'ScienceKeyword': {'CategoryKeyword': 'EARTH SCIENCE',\n", " 'TopicKeyword': 'SPECTRAL/ENGINEERING',\n", " 'TermKeyword': 'INFRARED WAVELENGTHS',\n", " 'VariableLevel1Keyword': {'Value': 'SENSOR COUNTS'}}},\n", " 'Platforms': {'Platform': [{'ShortName': 'AIRCRAFT',\n", " 'LongName': 'Not provided',\n", " 'Type': 'Aircraft',\n", " 'Instruments': {'Instrument': [{'ShortName': 'ALTIMETERS',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'ALTIMETERS'}}},\n", " {'ShortName': 'LASERS',\n", " 'LongName': 'Light Amplification by Stimulated Emission of Radiation',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LASERS',\n", " 'LongName': 'Light Amplification by Stimulated Emission of Radiation'}}}]}},\n", " {'ShortName': 'B-200',\n", " 'LongName': 'Beechcraft King Air B-200',\n", " 'Type': 'Propeller',\n", " 'Instruments': {'Instrument': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor'}}}}},\n", " {'ShortName': 'C-130',\n", " 'LongName': 'Lockheed C-130 Hercules',\n", " 'Type': 'Propeller',\n", " 'Instruments': {'Instrument': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor'}}}}},\n", " {'ShortName': 'DC-8',\n", " 'LongName': 'Douglas DC-8',\n", " 'Type': 'Aircraft',\n", " 'Characteristics': {'Characteristic': {'Name': 'AircraftID',\n", " 'Description': 'The identifier of the airplane used by the FAA to uniquely identify each aircraft',\n", " 'DataType': 'STRING',\n", " 'Unit': 'Not Applicable',\n", " 'Value': 'N817NA'}},\n", " 'Instruments': {'Instrument': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor'}}}}},\n", " {'ShortName': 'G-V',\n", " 'LongName': 'Gulfstream V',\n", " 'Type': 'Jet',\n", " 'Instruments': {'Instrument': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor'}}}}},\n", " {'ShortName': 'HU-25C',\n", " 'LongName': 'Dassault HU-25C Guardian',\n", " 'Type': 'Jet',\n", " 'Instruments': {'Instrument': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor'}}}}},\n", " {'ShortName': 'P-3B',\n", " 'LongName': 'Lockheed P-3B Orion',\n", " 'Type': 'Propeller',\n", " 'Instruments': {'Instrument': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor'}}}}},\n", " {'ShortName': 'RQ-4',\n", " 'LongName': 'Northrop Grumman RQ-4 Global Hawk',\n", " 'Type': 'Uncrewed Aerial Vehicles',\n", " 'Instruments': {'Instrument': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor'}}}}}]},\n", " 'AdditionalAttributes': {'AdditionalAttribute': [{'Name': 'AircraftID',\n", " 'DataType': 'STRING',\n", " 'Description': 'The identifier of the airplane used by the FAA to uniquely identify each aircraft'},\n", " {'Name': 'SIPSMetGenVersion',\n", " 'DataType': 'STRING',\n", " 'Description': 'The version of the SIPSMetGen software used to produce the metadata file for this granule'},\n", " {'Name': 'ThemeID',\n", " 'DataType': 'STRING',\n", " 'Description': 'The identifier of the theme under which data are logically grouped'},\n", " {'Name': 'identifier_product_doi',\n", " 'DataType': 'STRING',\n", " 'Description': 'Digital object identifier that uniquely identifies this data product'},\n", " {'Name': 'identifier_product_doi_authority',\n", " 'DataType': 'STRING',\n", " 'Description': 'URL of the digital object identifier resolving authority'}]},\n", " 'Campaigns': {'Campaign': {'ShortName': 'ABoVE',\n", " 'LongName': 'Arctic-Boreal Vulnerability Experiment (ABoVE) NASA field campaign',\n", " 'StartDate': '2017-06-29T00:00:00.000Z',\n", " 'EndDate': '2017-07-17T00:00:00.000Z'}},\n", " 'SpatialInfo': {'SpatialCoverageType': 'HORIZONTAL'},\n", " 'OnlineAccessURLs': {'OnlineAccessURL': [{'URL': 'https://n5eil01u.ecs.nsidc.org/ICEBRIDGE/ABLVIS1B.001',\n", " 'URLDescription': 'Direct download via HTTPS protocol.'},\n", " {'URL': 'https://search.earthdata.nasa.gov/search?q=ABLVIS1B+V001',\n", " 'URLDescription': \"NASA's newest search and order tool for subsetting, reprojecting, and reformatting data.\"},\n", " {'URL': 'https://nsidc.org/icebridge/portal/map',\n", " 'URLDescription': 'Tool to visualize, search, and download IceBridge data.'},\n", " {'URL': 'https://nsidc.org/data/data-access-tool/ABLVIS1B/versions/1/',\n", " 'URLDescription': 'Search and filter data files using a map-based interface'}]},\n", " 'OnlineResources': {'OnlineResource': [{'URL': 'https://doi.org/10.5067/UMRAWS57QAFU',\n", " 'Description': 'Provides access to data, documentation, tools, citation information, support, and other resources.',\n", " 'Type': 'CollectionURL : DATA SET LANDING PAGE'},\n", " {'URL': 'https://doi.org/10.5067/UMRAWS57QAFU',\n", " 'Description': \"Includes a user's guide, supplemental documents like ATBDs and academic papers, How Tos, FAQs, etc.\",\n", " 'Type': 'VIEW RELATED INFORMATION : GENERAL DOCUMENTATION'}]},\n", " 'Spatial': {'SpatialCoverageType': 'HORIZONTAL',\n", " 'HorizontalSpatialDomain': {'Geometry': {'CoordinateSystem': 'CARTESIAN',\n", " 'BoundingRectangle': {'WestBoundingCoordinate': '-158.0',\n", " 'NorthBoundingCoordinate': '72.0',\n", " 'EastBoundingCoordinate': '-104.0',\n", " 'SouthBoundingCoordinate': '48.0'}}},\n", " 'GranuleSpatialRepresentation': 'GEODETIC'}}}]" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ablvis1b_collections = maap.searchCollection(\n", " short_name='ABLVIS1B',\n", " version='1',\n", " cmr_host='cmr.earthdata.nasa.gov'\n", ")\n", "ablvis1b_collections" ] }, { "cell_type": "markdown", "id": "f4da5c55", "metadata": {}, "source": [ "Based on the output of the above cell, we can retrieve the `concept-id` as collection id and use in the subsequent cells for downloading the granules from this collection.\n", "\n", "### Searching and Downloading a Granule" ] }, { "cell_type": "code", "execution_count": 20, "id": "7e75775b-a55a-44aa-90d5-f0c350eeff94", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "'Got 20 results'\n", "./data/LVIS1B_ABoVE2017_0629_R1803_056233.h5\n" ] } ], "source": [ "COLLECTION_ID = ablvis1b_collections[0]['concept-id']\n", "\n", "results = maap.searchGranule(\n", " concept_id=COLLECTION_ID,\n", " cmr_host=\"cmr.earthdata.nasa.gov\"\n", ")\n", "pprint(f'Got {len(results)} results')\n", "\n", "\n", "#Validating download\n", "filename = results[0].getData(dataDir)\n", "print(filename)" ] }, { "cell_type": "markdown", "id": "337b6ab9", "metadata": {}, "source": [ "### Validating the Downloaded Product\n", "\n", "Similar to the `LVISF1B` dataset (as discussed above), `ABLVIS1B` dataset has products stored as `.h5` files. We will be following the same steps as described above to validate the downloaded product." ] }, { "cell_type": "code", "execution_count": 21, "id": "6a9a265e-a73e-4e27-9510-3220da38e93c", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Keys: \n", "\n", "[209.55528 209.98833 209.2643 ... 181.83081 183.49066 182.28035]\n" ] } ], "source": [ "#Testing the HDF5 files\n", "import h5py\n", "with h5py.File(filename, \"r\") as f: \n", " print(\"Keys: %s\" % f.keys())\n", " # get first object name/key; may or may NOT be a group\n", " a_group_key = list(f.keys())[0]\n", "\n", " # get the object type for a_group_key: usually group or dataset\n", " print(type(f[a_group_key])) \n", "\n", " # If a_group_key is a group name, \n", " # this gets the object names in the group and returns as a list\n", " data = list(f[a_group_key])\n", "\n", " # If a_group_key is a dataset name, \n", " # this gets the dataset values and returns as a list\n", " data = list(f[a_group_key])\n", " # preferred methods to get dataset values:\n", " ds_obj = f[a_group_key] # returns as a h5py dataset object\n", " ds_arr = f[a_group_key][()] # returns as a numpy array\n", " \n", " print(ds_arr)" ] }, { "cell_type": "markdown", "id": "c360a494-2731-478f-b3fc-07ae946f8f2d", "metadata": { "tags": [] }, "source": [ "## Accessing LVIS Facility L2 Geolocated Surface Elevation and Canopy Height Product V001\n", "\n", "### About the Dataset\n", "The [LVIS Facility L2 Geolocated Surface Elevation and Canopy Height Product V001 dataset](https://doi.org/10.5067/VP7J20HJQISD) contains Level-2 geolocated surface elevation and canopy height measurements collected by the NASA Land, Vegetation, and Ice Sensor (LVIS) Facility, an imaging lidar and camera sensor suite. The short name for this collection is `LVISF2`.\n", "\n", "### Searching the Collection" ] }, { "cell_type": "code", "execution_count": 23, "id": "2bc6c1f7-b3ce-4906-91d7-23c7684cda5f", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[{'concept-id': 'C1723866830-NSIDC_ECS',\n", " 'revision-id': '29',\n", " 'format': 'application/echo10+xml',\n", " 'Collection': {'ShortName': 'LVISF2',\n", " 'VersionId': '1',\n", " 'InsertTime': '2023-08-22T16:21:40.702Z',\n", " 'LastUpdate': '2023-08-22T16:21:40.702Z',\n", " 'LongName': 'Not provided',\n", " 'DataSetId': 'LVIS Facility L2 Geolocated Surface Elevation and Canopy Height Product V001',\n", " 'Description': 'This data set contains Level-2 geolocated surface elevation and canopy height measurements collected by the NASA Land, Vegetation, and Ice Sensor (LVIS) Facility, an imaging lidar and camera sensor suite.',\n", " 'DOI': {'DOI': '10.5067/VP7J20HJQISD'},\n", " 'StandardProduct': 'false',\n", " 'RevisionDate': '2023-05-31T00:00:00.000Z',\n", " 'SuggestedUsage': 'Scientific Research',\n", " 'ProcessingCenter': 'NASA/GSFC/SED/ESD/LRSL',\n", " 'ProcessingLevelId': 'Level 2',\n", " 'ProcessingLevelDescription': 'Derived geophysical variables',\n", " 'ArchiveCenter': 'NASA NSIDC DAAC',\n", " 'CollectionState': 'PLANNED',\n", " 'RestrictionComment': ' These data are freely, openly, and fully accessible, provided that you are logged into your NASA Earthdata profile (https://urs.earthdata.nasa.gov/).',\n", " 'UseConstraints': {'LicenseText': ' These data are freely, openly, and fully available to use without restrictions, provided that you cite the data according to the recommended citation at https://nsidc.org/about/use_copyright.html. For more information on the NASA EOSDIS Data Use Policy, see https://earthdata.nasa.gov/earth-observation-data/data-use-policy.'},\n", " 'DataFormat': 'ASCII',\n", " 'SpatialKeywords': {'Keyword': ['ALASKA',\n", " 'CANADA',\n", " 'GREENLAND',\n", " 'UNITED STATES OF AMERICA',\n", " 'COSTA RICA',\n", " 'FRENCH GUIANA']},\n", " 'Temporal': {'EndsAtPresentFlag': 'false',\n", " 'RangeDateTime': {'BeginningDateTime': '2018-11-07T00:00:00.000Z'}},\n", " 'Contacts': {'Contact': [{'Role': 'ARCHIVER',\n", " 'OrganizationName': 'NASA NSIDC DAAC',\n", " 'OrganizationAddresses': {'Address': {'StreetAddress': 'National Snow and Ice Data Center CIRES, 449 UCB University of Colorado',\n", " 'City': 'Boulder',\n", " 'StateProvince': 'CO',\n", " 'PostalCode': '80309-0449',\n", " 'Country': 'USA'}},\n", " 'OrganizationPhones': {'Phone': {'Number': '1 303 492 6199',\n", " 'Type': 'Telephone'}},\n", " 'OrganizationEmails': {'Email': 'nsidc@nsidc.org'}},\n", " {'Role': 'DISTRIBUTOR',\n", " 'OrganizationName': 'NASA NSIDC DAAC',\n", " 'OrganizationAddresses': {'Address': {'StreetAddress': 'National Snow and Ice Data Center CIRES, 449 UCB University of Colorado',\n", " 'City': 'Boulder',\n", " 'StateProvince': 'CO',\n", " 'PostalCode': '80309-0449',\n", " 'Country': 'USA'}},\n", " 'OrganizationPhones': {'Phone': {'Number': '1 303 492 6199',\n", " 'Type': 'Telephone'}},\n", " 'OrganizationEmails': {'Email': 'nsidc@nsidc.org'}},\n", " {'Role': 'PROCESSOR', 'OrganizationName': 'NASA/GSFC/SED/ESD/LRSL'},\n", " {'Role': 'ORIGINATOR', 'OrganizationName': 'NASA/GSFC/SED/ESD/LRSL'},\n", " {'Role': 'TECHNICAL CONTACT',\n", " 'ContactPersons': {'ContactPerson': [{'FirstName': 'NSIDC',\n", " 'MiddleName': 'User',\n", " 'LastName': 'Services',\n", " 'JobPosition': 'TECHNICAL CONTACT'},\n", " {'FirstName': 'J.',\n", " 'MiddleName': 'Bryan',\n", " 'LastName': 'Blair',\n", " 'JobPosition': 'TECHNICAL CONTACT'},\n", " {'FirstName': 'Michelle',\n", " 'LastName': 'Hofton',\n", " 'JobPosition': 'TECHNICAL CONTACT'}]}}]},\n", " 'ScienceKeywords': {'ScienceKeyword': [{'CategoryKeyword': 'EARTH SCIENCE',\n", " 'TopicKeyword': 'CRYOSPHERE',\n", " 'TermKeyword': 'GLACIERS/ICE SHEETS',\n", " 'VariableLevel1Keyword': {'Value': 'GLACIER ELEVATION/ICE SHEET ELEVATION'}},\n", " {'CategoryKeyword': 'EARTH SCIENCE',\n", " 'TopicKeyword': 'CRYOSPHERE',\n", " 'TermKeyword': 'SEA ICE',\n", " 'VariableLevel1Keyword': {'Value': 'SEA ICE ELEVATION'}},\n", " {'CategoryKeyword': 'EARTH SCIENCE',\n", " 'TopicKeyword': 'LAND SURFACE',\n", " 'TermKeyword': 'TOPOGRAPHY',\n", " 'VariableLevel1Keyword': {'Value': 'TERRAIN ELEVATION'}},\n", " {'CategoryKeyword': 'EARTH SCIENCE',\n", " 'TopicKeyword': 'BIOSPHERE',\n", " 'TermKeyword': 'VEGETATION',\n", " 'VariableLevel1Keyword': {'Value': 'CANOPY CHARACTERISTICS',\n", " 'VariableLevel2Keyword': {'Value': 'VEGETATION HEIGHT'}}}]},\n", " 'Platforms': {'Platform': [{'ShortName': 'B-200',\n", " 'LongName': 'Beechcraft King Air B-200',\n", " 'Type': 'Propeller',\n", " 'Instruments': {'Instrument': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor'}}}}},\n", " {'ShortName': 'G-III',\n", " 'LongName': 'Gulfstream III',\n", " 'Type': 'Jet',\n", " 'Instruments': {'Instrument': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor'}}}}},\n", " {'ShortName': 'G-V',\n", " 'LongName': 'Gulfstream V',\n", " 'Type': 'Jet',\n", " 'Instruments': {'Instrument': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor'}}}}},\n", " {'ShortName': 'P-3B',\n", " 'LongName': 'Lockheed P-3B Orion',\n", " 'Type': 'Propeller',\n", " 'Instruments': {'Instrument': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor'}}}}}]},\n", " 'AdditionalAttributes': {'AdditionalAttribute': [{'Name': 'AircraftID',\n", " 'DataType': 'STRING',\n", " 'Description': 'The identifier of the airplane used by the FAA to uniquely identify each aircraft'},\n", " {'Name': 'SIPSMetGenVersion',\n", " 'DataType': 'STRING',\n", " 'Description': 'The version of the SIPSMetGen software used to produce the metadata file for this granule'},\n", " {'Name': 'ThemeID',\n", " 'DataType': 'STRING',\n", " 'Description': 'The identifier of the theme under which data are logically grouped'},\n", " {'Name': 'identifier_product_doi',\n", " 'DataType': 'STRING',\n", " 'Description': 'Digital object identifier that uniquely identifies this data product'},\n", " {'Name': 'identifier_product_doi_authority',\n", " 'DataType': 'STRING',\n", " 'Description': 'URL of the digital object identifier resolving authority'}]},\n", " 'Campaigns': {'Campaign': [{'ShortName': 'ABoVE',\n", " 'LongName': 'Arctic-Boreal Vulnerability Experiment (ABoVE) NASA field campaign',\n", " 'StartDate': '2017-06-29T00:00:00.000Z',\n", " 'EndDate': '2017-07-17T00:00:00.000Z'},\n", " {'ShortName': 'GEDI',\n", " 'LongName': \"NASA's Global Ecosystem Dynamics Investigation\",\n", " 'StartDate': '2019-01-01T00:00:00.000Z',\n", " 'EndDate': '2019-12-31T00:00:00.000Z'},\n", " {'ShortName': 'MULTI_NASA',\n", " 'LongName': 'Operation IceBridge Multiple Campaigns',\n", " 'StartDate': '1993-01-01T00:00:00.000Z',\n", " 'EndDate': '2025-12-31T00:00:00.000Z'}]},\n", " 'SpatialInfo': {'SpatialCoverageType': 'HORIZONTAL'},\n", " 'OnlineAccessURLs': {'OnlineAccessURL': [{'URL': 'https://n5eil01u.ecs.nsidc.org/ICEBRIDGE/LVISF2.001/',\n", " 'URLDescription': 'Direct download via HTTPS protocol.'},\n", " {'URL': 'https://search.earthdata.nasa.gov/search?q=LVISF2+V001',\n", " 'URLDescription': \"NASA's newest search and order tool for subsetting, reprojecting, and reformatting data.\"},\n", " {'URL': 'https://nsidc.org/data/data-access-tool/LVISF2/versions/1/',\n", " 'URLDescription': 'Search and filter data files using a map-based interface'}]},\n", " 'OnlineResources': {'OnlineResource': [{'URL': 'https://doi.org/10.5067/VP7J20HJQISD',\n", " 'Description': 'Provides access to data, documentation, tools, citation information, support, and other resources.',\n", " 'Type': 'CollectionURL : DATA SET LANDING PAGE'},\n", " {'URL': 'https://doi.org/10.5067/VP7J20HJQISD',\n", " 'Description': \"Includes a user's guide, supplemental documents like ATBDs and academic papers, How Tos, FAQs, etc.\",\n", " 'Type': 'VIEW RELATED INFORMATION : GENERAL DOCUMENTATION'}]},\n", " 'Spatial': {'SpatialCoverageType': 'HORIZONTAL',\n", " 'HorizontalSpatialDomain': {'Geometry': {'CoordinateSystem': 'CARTESIAN',\n", " 'BoundingRectangle': {'WestBoundingCoordinate': '-167.0',\n", " 'NorthBoundingCoordinate': '88.0',\n", " 'EastBoundingCoordinate': '18.0',\n", " 'SouthBoundingCoordinate': '2.0'}}},\n", " 'GranuleSpatialRepresentation': 'GEODETIC'}}}]" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lvisf2_collections = maap.searchCollection(\n", " short_name='LVISF2',\n", " version='1',\n", " cmr_host='cmr.earthdata.nasa.gov'\n", ")\n", "lvisf2_collections" ] }, { "cell_type": "markdown", "id": "64520c37", "metadata": {}, "source": [ "### Searching and Downloading a Granule" ] }, { "cell_type": "code", "execution_count": 24, "id": "7a006fb0-b028-4e01-bd0b-b8749177502e", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "'Got 20 results'\n", "./data/LVISF2_US2018_1107_R2011_067463.TXT\n" ] } ], "source": [ "COLLECTION_ID = lvisf2_collections[0]['concept-id']\n", "\n", "results = maap.searchGranule(\n", " concept_id=COLLECTION_ID,\n", " cmr_host=\"cmr.earthdata.nasa.gov\"\n", ")\n", "pprint(f'Got {len(results)} results')\n", "\n", "\n", "#Validating download\n", "filename = results[0].getData(dataDir)\n", "print(filename)" ] }, { "cell_type": "markdown", "id": "a1c967bf", "metadata": {}, "source": [ "We follow the same steps as above for searching and downloading a granule from the LVISF2 collection. However, as we observe, the downloaded product in this case is a `.txt` file. So, we will be using the [numpy](https://numpy.org/) Python package for accessing the downloaded text file.\n", "\n", "### Validating the Downloaded Product" ] }, { "cell_type": "code", "execution_count": 25, "id": "550eb7d4-b7b2-4578-94e4-91b26e07e058", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[[1.95842916e+09 5.93768900e+06 6.74631929e+04 ... 1.00000000e+00\n", " 1.00000000e+00 1.00000000e+00]\n", " [1.95842916e+09 5.93769000e+06 6.74631931e+04 ... 1.00000000e+00\n", " 1.00000000e+00 1.00000000e+00]\n", " [1.95842916e+09 5.93769100e+06 6.74631934e+04 ... 1.00000000e+00\n", " 1.00000000e+00 1.00000000e+00]\n", " ...\n", " [1.95842916e+09 6.49713000e+06 6.76030543e+04 ... 1.00000000e+00\n", " 1.00000000e+00 1.00000000e+00]\n", " [1.95842916e+09 6.49713100e+06 6.76030545e+04 ... 1.00000000e+00\n", " 1.00000000e+00 1.00000000e+00]\n", " [1.95842916e+09 6.49713200e+06 6.76030548e+04 ... 1.00000000e+00\n", " 1.00000000e+00 1.00000000e+00]]\n" ] } ], "source": [ "#Testing the TXT files from the LVIS collections\n", "import numpy as np\n", "data = np.genfromtxt(filename)\n", "print(data)" ] }, { "cell_type": "markdown", "id": "b2229b53", "metadata": {}, "source": [ "As we can observe from the output of the above cell, the data values are accessible from the downloaded product. Hence, validating the downloaded file." ] }, { "cell_type": "markdown", "id": "bad18a05-8b44-4dce-9ae2-bf3641532bd7", "metadata": { "tags": [] }, "source": [ "## Accessing the ABoVE LVIS L2 Geolocated Surface Elevation Product V001\n", "\n", "### About the Dataset\n", "This [dataset](https://doi.org/10.5067/IA5WAX7K3YGY) contains surface elevation data over Alaska and Western Canada measured by the NASA Land, Vegetation, and Ice Sensor (LVIS), an airborne lidar scanning laser altimeter. The data were collected as part of NASA's Terrestrial Ecology Program campaign, the Arctic-Boreal Vulnerability Experiment (ABoVE). The short name for this collection is `ABLVIS2`.\n", "\n", "### Searching the Collection" ] }, { "cell_type": "code", "execution_count": 26, "id": "12347e25-083d-4e26-88af-f091989eb189", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[{'concept-id': 'C1513105984-NSIDC_ECS',\n", " 'revision-id': '43',\n", " 'format': 'application/echo10+xml',\n", " 'Collection': {'ShortName': 'ABLVIS2',\n", " 'VersionId': '1',\n", " 'InsertTime': '2023-08-22T16:58:08.004Z',\n", " 'LastUpdate': '2023-08-22T16:58:08.004Z',\n", " 'LongName': 'Not provided',\n", " 'DataSetId': 'ABoVE LVIS L2 Geolocated Surface Elevation Product V001',\n", " 'Description': \"This data set contains surface elevation data over Alaska and Western Canada measured by the NASA Land, Vegetation, and Ice Sensor (LVIS), an airborne lidar scanning laser altimeter. The data were collected as part of NASA's Terrestrial Ecology Program campaign, the Arctic-Boreal Vulnerability Experiment (ABoVE).\",\n", " 'DOI': {'DOI': '10.5067/IA5WAX7K3YGY'},\n", " 'StandardProduct': 'false',\n", " 'RevisionDate': '2023-05-31T00:00:00.000Z',\n", " 'SuggestedUsage': 'Scientific Research',\n", " 'ProcessingCenter': 'NASA/GSFC/SED/ESD/LRSL',\n", " 'ProcessingLevelId': 'Level 2',\n", " 'ProcessingLevelDescription': 'Derived geophysical variables',\n", " 'ArchiveCenter': 'NASA NSIDC DAAC',\n", " 'CollectionState': 'PLANNED',\n", " 'RestrictionComment': ' These data are freely, openly, and fully accessible, provided that you are logged into your NASA Earthdata profile (https://urs.earthdata.nasa.gov/).',\n", " 'UseConstraints': {'LicenseText': ' These data are freely, openly, and fully available to use without restrictions, provided that you cite the data according to the recommended citation at https://nsidc.org/about/use_copyright.html. For more information on the NASA EOSDIS Data Use Policy, see https://earthdata.nasa.gov/earth-observation-data/data-use-policy.'},\n", " 'DataFormat': 'ASCII',\n", " 'SpatialKeywords': {'Keyword': ['CANADA', 'ALASKA']},\n", " 'Temporal': {'EndsAtPresentFlag': 'false',\n", " 'RangeDateTime': {'BeginningDateTime': '2017-06-29T00:00:00.000Z',\n", " 'EndingDateTime': '2017-07-17T23:59:59.999Z'}},\n", " 'Contacts': {'Contact': [{'Role': 'ARCHIVER',\n", " 'OrganizationName': 'NASA NSIDC DAAC',\n", " 'OrganizationAddresses': {'Address': {'StreetAddress': 'National Snow and Ice Data Center CIRES, 449 UCB University of Colorado',\n", " 'City': 'Boulder',\n", " 'StateProvince': 'CO',\n", " 'PostalCode': '80309-0449',\n", " 'Country': 'USA'}},\n", " 'OrganizationPhones': {'Phone': {'Number': '1 303 492 6199',\n", " 'Type': 'Telephone'}},\n", " 'OrganizationEmails': {'Email': 'nsidc@nsidc.org'}},\n", " {'Role': 'DISTRIBUTOR',\n", " 'OrganizationName': 'NASA NSIDC DAAC',\n", " 'OrganizationAddresses': {'Address': {'StreetAddress': 'National Snow and Ice Data Center CIRES, 449 UCB University of Colorado',\n", " 'City': 'Boulder',\n", " 'StateProvince': 'CO',\n", " 'PostalCode': '80309-0449',\n", " 'Country': 'USA'}},\n", " 'OrganizationPhones': {'Phone': {'Number': '1 303 492 6199',\n", " 'Type': 'Telephone'}},\n", " 'OrganizationEmails': {'Email': 'nsidc@nsidc.org'}},\n", " {'Role': 'PROCESSOR', 'OrganizationName': 'NASA/GSFC/SED/ESD/LRSL'},\n", " {'Role': 'ORIGINATOR', 'OrganizationName': 'NASA/GSFC/SED/ESD/LRSL'},\n", " {'Role': 'TECHNICAL CONTACT',\n", " 'ContactPersons': {'ContactPerson': [{'FirstName': 'J.',\n", " 'MiddleName': 'Bryan',\n", " 'LastName': 'Blair',\n", " 'JobPosition': 'TECHNICAL CONTACT'},\n", " {'FirstName': 'Michelle',\n", " 'LastName': 'Hofton',\n", " 'JobPosition': 'TECHNICAL CONTACT'},\n", " {'FirstName': 'NSIDC',\n", " 'MiddleName': 'User',\n", " 'LastName': 'Services',\n", " 'JobPosition': 'TECHNICAL CONTACT'},\n", " {'FirstName': 'J.',\n", " 'MiddleName': 'Bryan',\n", " 'LastName': 'Blair',\n", " 'JobPosition': 'TECHNICAL CONTACT'},\n", " {'FirstName': 'Michelle',\n", " 'LastName': 'Hofton',\n", " 'JobPosition': 'TECHNICAL CONTACT'}]}}]},\n", " 'ScienceKeywords': {'ScienceKeyword': {'CategoryKeyword': 'EARTH SCIENCE',\n", " 'TopicKeyword': 'LAND SURFACE',\n", " 'TermKeyword': 'TOPOGRAPHY',\n", " 'VariableLevel1Keyword': {'Value': 'TERRAIN ELEVATION'}}},\n", " 'Platforms': {'Platform': [{'ShortName': 'AIRCRAFT',\n", " 'LongName': 'Not provided',\n", " 'Type': 'Aircraft',\n", " 'Instruments': {'Instrument': [{'ShortName': 'ALTIMETERS',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'ALTIMETERS'}}},\n", " {'ShortName': 'LASERS',\n", " 'LongName': 'Light Amplification by Stimulated Emission of Radiation',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LASERS',\n", " 'LongName': 'Light Amplification by Stimulated Emission of Radiation'}}}]}},\n", " {'ShortName': 'B-200',\n", " 'LongName': 'Beechcraft King Air B-200',\n", " 'Type': 'Propeller',\n", " 'Instruments': {'Instrument': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor'}}}}},\n", " {'ShortName': 'C-130',\n", " 'LongName': 'Lockheed C-130 Hercules',\n", " 'Type': 'Propeller',\n", " 'Instruments': {'Instrument': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor'}}}}},\n", " {'ShortName': 'DC-8',\n", " 'LongName': 'Douglas DC-8',\n", " 'Type': 'Aircraft',\n", " 'Characteristics': {'Characteristic': {'Name': 'AircraftID',\n", " 'Description': 'The identifier of the airplane used by the FAA to uniquely identify each aircraft',\n", " 'DataType': 'STRING',\n", " 'Unit': 'Not Applicable',\n", " 'Value': 'N817NA'}},\n", " 'Instruments': {'Instrument': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor'}}}}},\n", " {'ShortName': 'G-V',\n", " 'LongName': 'Gulfstream V',\n", " 'Type': 'Jet',\n", " 'Instruments': {'Instrument': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor'}}}}},\n", " {'ShortName': 'HU-25C',\n", " 'LongName': 'Dassault HU-25C Guardian',\n", " 'Type': 'Jet',\n", " 'Instruments': {'Instrument': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor'}}}}},\n", " {'ShortName': 'P-3B',\n", " 'LongName': 'Lockheed P-3B Orion',\n", " 'Type': 'Propeller',\n", " 'Instruments': {'Instrument': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor'}}}}},\n", " {'ShortName': 'RQ-4',\n", " 'LongName': 'Northrop Grumman RQ-4 Global Hawk',\n", " 'Type': 'Uncrewed Aerial Vehicles',\n", " 'Instruments': {'Instrument': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor'}}}}}]},\n", " 'AdditionalAttributes': {'AdditionalAttribute': [{'Name': 'AircraftID',\n", " 'DataType': 'STRING',\n", " 'Description': 'The identifier of the airplane used by the FAA to uniquely identify each aircraft'},\n", " {'Name': 'SIPSMetGenVersion',\n", " 'DataType': 'STRING',\n", " 'Description': 'The version of the SIPSMetGen software used to produce the metadata file for this granule'},\n", " {'Name': 'ThemeID',\n", " 'DataType': 'STRING',\n", " 'Description': 'The identifier of the theme under which data are logically grouped'},\n", " {'Name': 'identifier_product_doi',\n", " 'DataType': 'STRING',\n", " 'Description': 'Digital object identifier that uniquely identifies this data product'},\n", " {'Name': 'identifier_product_doi_authority',\n", " 'DataType': 'STRING',\n", " 'Description': 'URL of the digital object identifier resolving authority'}]},\n", " 'Campaigns': {'Campaign': {'ShortName': 'ABoVE',\n", " 'LongName': 'Arctic-Boreal Vulnerability Experiment (ABoVE) NASA field campaign',\n", " 'StartDate': '2017-06-29T00:00:00.000Z',\n", " 'EndDate': '2017-07-17T00:00:00.000Z'}},\n", " 'SpatialInfo': {'SpatialCoverageType': 'HORIZONTAL'},\n", " 'OnlineAccessURLs': {'OnlineAccessURL': [{'URL': 'https://n5eil01u.ecs.nsidc.org/ICEBRIDGE/ABLVIS2.001/',\n", " 'URLDescription': 'Direct download via HTTPS protocol.'},\n", " {'URL': 'https://search.earthdata.nasa.gov/search?q=ABLVIS2+V001',\n", " 'URLDescription': \"NASA's newest search and order tool for subsetting, reprojecting, and reformatting data.\"},\n", " {'URL': 'https://nsidc.org/icebridge/portal/map',\n", " 'URLDescription': 'Tool to visualize, search, and download IceBridge data.'},\n", " {'URL': 'https://nsidc.org/data/data-access-tool/ABLVIS2/versions/1/',\n", " 'URLDescription': 'Search and filter data files using a map-based interface'}]},\n", " 'OnlineResources': {'OnlineResource': [{'URL': 'https://doi.org/10.5067/IA5WAX7K3YGY',\n", " 'Description': 'Provides access to data, documentation, tools, citation information, support, and other resources.',\n", " 'Type': 'CollectionURL : DATA SET LANDING PAGE'},\n", " {'URL': 'https://doi.org/10.5067/IA5WAX7K3YGY',\n", " 'Description': \"Includes a user's guide, supplemental documents like ATBDs and academic papers, How Tos, FAQs, etc.\",\n", " 'Type': 'VIEW RELATED INFORMATION : GENERAL DOCUMENTATION'}]},\n", " 'Spatial': {'SpatialCoverageType': 'HORIZONTAL',\n", " 'HorizontalSpatialDomain': {'Geometry': {'CoordinateSystem': 'CARTESIAN',\n", " 'BoundingRectangle': {'WestBoundingCoordinate': '-158.0',\n", " 'NorthBoundingCoordinate': '72.0',\n", " 'EastBoundingCoordinate': '-104.0',\n", " 'SouthBoundingCoordinate': '48.0'}}},\n", " 'GranuleSpatialRepresentation': 'GEODETIC'}}}]" ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ablvis2_collections = maap.searchCollection(\n", " short_name='ABLVIS2',\n", " version='1',\n", " cmr_host='cmr.earthdata.nasa.gov'\n", ")\n", "ablvis2_collections" ] }, { "cell_type": "markdown", "id": "04926cdc", "metadata": {}, "source": [ "### Searching and Downloading a Granule\n", "\n", "We follow the same steps as above." ] }, { "cell_type": "code", "execution_count": 27, "id": "85aedddb-871a-40ae-89ae-c113e539cbb3", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "'Got 20 results'\n", "./data/LVIS2_ABoVE2017_0629_R1803_056233.TXT\n" ] } ], "source": [ "COLLECTION_ID = ablvis2_collections[0]['concept-id']\n", "\n", "results = maap.searchGranule(\n", " concept_id=COLLECTION_ID,\n", " cmr_host=\"cmr.earthdata.nasa.gov\"\n", ")\n", "pprint(f'Got {len(results)} results')\n", "\n", "\n", "#Validating download\n", "filename = results[0].getData(dataDir)\n", "print(filename)" ] }, { "cell_type": "markdown", "id": "6b3c6dda", "metadata": {}, "source": [ "### Validating the Dataset\n", "\n", "Since the output for this data product is also downloaded as a text file, we will follow the same steps as decribed above for the `LVISF2` data product." ] }, { "cell_type": "code", "execution_count": 28, "id": "58cbafdc-63d0-4e9e-b760-bb909211cdc4", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[[1.95793304e+09 3.99310900e+06 5.62334890e+04 ... 1.00000000e+00\n", " 1.00000000e+00 1.00000000e+00]\n", " [1.95793304e+09 3.99311000e+06 5.62334890e+04 ... 1.00000000e+00\n", " 1.00000000e+00 1.00000000e+00]\n", " [1.95793304e+09 3.99311100e+06 5.62334890e+04 ... 1.00000000e+00\n", " 1.00000000e+00 1.00000000e+00]\n", " ...\n", " [1.95793306e+09 5.43227700e+06 5.65932850e+04 ... 1.00000000e+00\n", " 1.00000000e+00 1.00000000e+00]\n", " [1.95793306e+09 5.43227900e+06 5.65932850e+04 ... 1.00000000e+00\n", " 1.00000000e+00 1.00000000e+00]\n", " [1.95793306e+09 5.43228200e+06 5.65932860e+04 ... 1.00000000e+00\n", " 1.00000000e+00 1.00000000e+00]]\n" ] } ], "source": [ "#Testing the downloaded TXT file\n", "import numpy as np\n", "data = np.genfromtxt(filename)\n", "print(data)" ] }, { "cell_type": "markdown", "id": "f38abc8f", "metadata": {}, "source": [ "As observed from the output of the above cell, the data values are accessible from the downloaded product. Hence, validating the downloaded file." ] }, { "cell_type": "markdown", "id": "9f6f5b03-93a6-4f01-bc9f-8bc833d14de3", "metadata": { "tags": [] }, "source": [ "## Accessing the AfriSAR LVIS L1B Geolocated Return Energy Waveforms V001\n", "\n", "### About the Dataset\n", "The [AfriSAR LVIS L1B Geolocated Return Energy Waveforms V001 dataset](https://doi.org/10.5067/ED5IYGVTB50Z) contains return energy waveform data over Gabon, Africa. The measurements were taken by the NASA Land, Vegetation, and Ice Sensor (LVIS), an airborne lidar scanning laser altimeter. The data were collected as part of a NASA campaign, in collaboration with the European Space Agency (ESA) mission AfriSAR. This collection has `AFLVIS1B` as it's short name.\n", "\n", "### Searching the Collection" ] }, { "cell_type": "code", "execution_count": 29, "id": "5e088a0f-1038-4c06-a409-9322a1a05a00", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[{'concept-id': 'C1549378019-NSIDC_ECS',\n", " 'revision-id': '43',\n", " 'format': 'application/echo10+xml',\n", " 'Collection': {'ShortName': 'AFLVIS1B',\n", " 'VersionId': '1',\n", " 'InsertTime': '2023-08-22T16:12:12.094Z',\n", " 'LastUpdate': '2023-08-22T16:12:12.094Z',\n", " 'LongName': 'Not provided',\n", " 'DataSetId': 'AfriSAR LVIS L1B Geolocated Return Energy Waveforms V001',\n", " 'Description': 'This data set contains return energy waveform data over Gabon, Africa. The measurements were taken by the NASA Land, Vegetation, and Ice Sensor (LVIS), an airborne lidar scanning laser altimeter. The data were collected as part of a NASA campaign, in collaboration with the European Space Agency (ESA) mission AfriSAR.',\n", " 'DOI': {'DOI': '10.5067/ED5IYGVTB50Z'},\n", " 'StandardProduct': 'false',\n", " 'RevisionDate': '2023-05-31T00:00:00.000Z',\n", " 'SuggestedUsage': 'Scientific Research',\n", " 'ProcessingCenter': 'NASA/GSFC/SED/ESD/LRSL',\n", " 'ProcessingLevelId': 'Level 1B',\n", " 'ProcessingLevelDescription': 'Sensor units',\n", " 'ArchiveCenter': 'NASA NSIDC DAAC',\n", " 'CollectionState': 'PLANNED',\n", " 'RestrictionComment': ' These data are freely, openly, and fully accessible, provided that you are logged into your NASA Earthdata profile (https://urs.earthdata.nasa.gov/).',\n", " 'UseConstraints': {'LicenseText': ' These data are freely, openly, and fully available to use without restrictions, provided that you cite the data according to the recommended citation at https://nsidc.org/about/use_copyright.html. For more information on the NASA EOSDIS Data Use Policy, see https://earthdata.nasa.gov/earth-observation-data/data-use-policy.'},\n", " 'DataFormat': 'HDF5',\n", " 'SpatialKeywords': {'Keyword': 'GABON'},\n", " 'Temporal': {'EndsAtPresentFlag': 'false',\n", " 'RangeDateTime': {'BeginningDateTime': '2016-02-20T00:00:00.000Z',\n", " 'EndingDateTime': '2016-03-08T23:59:59.999Z'}},\n", " 'Contacts': {'Contact': [{'Role': 'ARCHIVER',\n", " 'OrganizationName': 'NASA NSIDC DAAC',\n", " 'OrganizationAddresses': {'Address': {'StreetAddress': 'National Snow and Ice Data Center CIRES, 449 UCB University of Colorado',\n", " 'City': 'Boulder',\n", " 'StateProvince': 'CO',\n", " 'PostalCode': '80309-0449',\n", " 'Country': 'USA'}},\n", " 'OrganizationPhones': {'Phone': {'Number': '1 303 492 6199',\n", " 'Type': 'Telephone'}},\n", " 'OrganizationEmails': {'Email': 'nsidc@nsidc.org'}},\n", " {'Role': 'DISTRIBUTOR',\n", " 'OrganizationName': 'NASA NSIDC DAAC',\n", " 'OrganizationAddresses': {'Address': {'StreetAddress': 'National Snow and Ice Data Center CIRES, 449 UCB University of Colorado',\n", " 'City': 'Boulder',\n", " 'StateProvince': 'CO',\n", " 'PostalCode': '80309-0449',\n", " 'Country': 'USA'}},\n", " 'OrganizationPhones': {'Phone': {'Number': '1 303 492 6199',\n", " 'Type': 'Telephone'}},\n", " 'OrganizationEmails': {'Email': 'nsidc@nsidc.org'}},\n", " {'Role': 'PROCESSOR', 'OrganizationName': 'NASA/GSFC/SED/ESD/LRSL'},\n", " {'Role': 'ORIGINATOR', 'OrganizationName': 'NASA/GSFC/SED/ESD/LRSL'},\n", " {'Role': 'TECHNICAL CONTACT',\n", " 'ContactPersons': {'ContactPerson': [{'FirstName': 'J.',\n", " 'MiddleName': 'Bryan',\n", " 'LastName': 'Blair',\n", " 'JobPosition': 'TECHNICAL CONTACT'},\n", " {'FirstName': 'Michelle',\n", " 'LastName': 'Hofton',\n", " 'JobPosition': 'TECHNICAL CONTACT'},\n", " {'FirstName': 'NSIDC',\n", " 'MiddleName': 'User',\n", " 'LastName': 'Services',\n", " 'JobPosition': 'TECHNICAL CONTACT'},\n", " {'FirstName': 'J.',\n", " 'MiddleName': 'Bryan',\n", " 'LastName': 'Blair',\n", " 'JobPosition': 'TECHNICAL CONTACT'},\n", " {'FirstName': 'Michelle',\n", " 'LastName': 'Hofton',\n", " 'JobPosition': 'TECHNICAL CONTACT'}]}}]},\n", " 'ScienceKeywords': {'ScienceKeyword': {'CategoryKeyword': 'EARTH SCIENCE',\n", " 'TopicKeyword': 'SPECTRAL/ENGINEERING',\n", " 'TermKeyword': 'INFRARED WAVELENGTHS',\n", " 'VariableLevel1Keyword': {'Value': 'SENSOR COUNTS'}}},\n", " 'Platforms': {'Platform': [{'ShortName': 'AIRCRAFT',\n", " 'LongName': 'Not provided',\n", " 'Type': 'Aircraft',\n", " 'Instruments': {'Instrument': [{'ShortName': 'ALTIMETERS',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'ALTIMETERS'}}},\n", " {'ShortName': 'LASERS',\n", " 'LongName': 'Light Amplification by Stimulated Emission of Radiation',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LASERS',\n", " 'LongName': 'Light Amplification by Stimulated Emission of Radiation'}}}]}},\n", " {'ShortName': 'B-200',\n", " 'LongName': 'Beechcraft King Air B-200',\n", " 'Type': 'Propeller',\n", " 'Instruments': {'Instrument': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor'}}}}},\n", " {'ShortName': 'C-130',\n", " 'LongName': 'Lockheed C-130 Hercules',\n", " 'Type': 'Propeller',\n", " 'Instruments': {'Instrument': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor'}}}}},\n", " {'ShortName': 'DC-8',\n", " 'LongName': 'Douglas DC-8',\n", " 'Type': 'Aircraft',\n", " 'Characteristics': {'Characteristic': {'Name': 'AircraftID',\n", " 'Description': 'The identifier of the airplane used by the FAA to uniquely identify each aircraft',\n", " 'DataType': 'STRING',\n", " 'Unit': 'Not Applicable',\n", " 'Value': 'N817NA'}},\n", " 'Instruments': {'Instrument': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor'}}}}},\n", " {'ShortName': 'G-V',\n", " 'LongName': 'Gulfstream V',\n", " 'Type': 'Jet',\n", " 'Instruments': {'Instrument': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor'}}}}},\n", " {'ShortName': 'HU-25C',\n", " 'LongName': 'Dassault HU-25C Guardian',\n", " 'Type': 'Jet',\n", " 'Instruments': {'Instrument': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor'}}}}},\n", " {'ShortName': 'P-3B',\n", " 'LongName': 'Lockheed P-3B Orion',\n", " 'Type': 'Propeller',\n", " 'Instruments': {'Instrument': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor'}}}}},\n", " {'ShortName': 'RQ-4',\n", " 'LongName': 'Northrop Grumman RQ-4 Global Hawk',\n", " 'Type': 'Uncrewed Aerial Vehicles',\n", " 'Instruments': {'Instrument': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor',\n", " 'Technique': 'instrument',\n", " 'NumberOfSensors': '1',\n", " 'Sensors': {'Sensor': {'ShortName': 'LVIS',\n", " 'LongName': 'Land, Vegetation, and Ice Sensor'}}}}}]},\n", " 'AdditionalAttributes': {'AdditionalAttribute': [{'Name': 'AircraftID',\n", " 'DataType': 'STRING',\n", " 'Description': 'The identifier of the airplane used by the FAA to uniquely identify each aircraft'},\n", " {'Name': 'SIPSMetGenVersion',\n", " 'DataType': 'STRING',\n", " 'Description': 'The version of the SIPSMetGen software used to produce the metadata file for this granule'},\n", " {'Name': 'ThemeID',\n", " 'DataType': 'STRING',\n", " 'Description': 'The identifier of the theme under which data are logically grouped'},\n", " {'Name': 'identifier_product_doi',\n", " 'DataType': 'STRING',\n", " 'Description': 'Digital object identifier that uniquely identifies this data product'},\n", " {'Name': 'identifier_product_doi_authority',\n", " 'DataType': 'STRING',\n", " 'Description': 'URL of the digital object identifier resolving authority'}]},\n", " 'Campaigns': {'Campaign': {'ShortName': 'AfriSAR',\n", " 'LongName': 'NASA campaign in collaboration with European Space Agency (ESA) in Gabon, Africa ',\n", " 'StartDate': '2016-02-02T00:00:00.000Z',\n", " 'EndDate': '2016-03-08T00:00:00.000Z'}},\n", " 'SpatialInfo': {'SpatialCoverageType': 'HORIZONTAL'},\n", " 'OnlineAccessURLs': {'OnlineAccessURL': [{'URL': 'https://n5eil01u.ecs.nsidc.org/ICEBRIDGE/AFLVIS1B.001',\n", " 'URLDescription': 'Direct download via HTTPS protocol.'},\n", " {'URL': 'https://search.earthdata.nasa.gov/search?q=AFLVIS1B+V001',\n", " 'URLDescription': \"NASA's newest search and order tool for subsetting, reprojecting, and reformatting data.\"},\n", " {'URL': 'https://nsidc.org/data/data-access-tool/AFLVIS1B/versions/1/',\n", " 'URLDescription': 'Search and filter data files using a map-based interface'}]},\n", " 'OnlineResources': {'OnlineResource': [{'URL': 'https://doi.org/10.5067/ED5IYGVTB50Z',\n", " 'Description': 'Provides access to data, documentation, tools, citation information, support, and other resources.',\n", " 'Type': 'CollectionURL : DATA SET LANDING PAGE'},\n", " {'URL': 'https://doi.org/10.5067/ED5IYGVTB50Z',\n", " 'Description': \"Includes a user's guide, supplemental documents like ATBDs and academic papers, How Tos, FAQs, etc.\",\n", " 'Type': 'VIEW RELATED INFORMATION : GENERAL DOCUMENTATION'}]},\n", " 'Spatial': {'SpatialCoverageType': 'HORIZONTAL',\n", " 'HorizontalSpatialDomain': {'Geometry': {'CoordinateSystem': 'CARTESIAN',\n", " 'BoundingRectangle': {'WestBoundingCoordinate': '8.0',\n", " 'NorthBoundingCoordinate': '1.0',\n", " 'EastBoundingCoordinate': '12.0',\n", " 'SouthBoundingCoordinate': '-2.0'}}},\n", " 'GranuleSpatialRepresentation': 'GEODETIC'}}}]" ] }, "execution_count": 29, "metadata": {}, "output_type": "execute_result" } ], "source": [ "aflvis1b_collections = maap.searchCollection(\n", " short_name='AFLVIS1B',\n", " version='1',\n", " cmr_host='cmr.earthdata.nasa.gov'\n", ")\n", "aflvis1b_collections" ] }, { "cell_type": "markdown", "id": "75832410", "metadata": {}, "source": [ "### Searching and Downloading a Granule\n", "\n", "We will be following the same steps as described above for the other data products." ] }, { "cell_type": "code", "execution_count": 31, "id": "9a951eb2-8af4-4d77-b5c0-f0b651ba1788", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "'Got 20 results'\n", "./data/LVIS1B_Gabon2016_0220_R1808_038024.h5\n" ] } ], "source": [ "COLLECTION_ID = aflvis1b_collections[0]['concept-id']\n", "\n", "results = maap.searchGranule(\n", " concept_id=COLLECTION_ID,\n", " cmr_host=\"cmr.earthdata.nasa.gov\"\n", ")\n", "pprint(f'Got {len(results)} results')\n", "\n", "\n", "#Validating download\n", "filename = results[0].getData(dataDir)\n", "print(filename)" ] }, { "cell_type": "markdown", "id": "113a8713", "metadata": {}, "source": [ "### Validating the Product\n", "\n", "We observe that the downloaded product is stored as a `.h5` file similar to the `ABLVIS1B` and `LVISF1B` data products discussed above. So, we will be using the `h5py` package to validate the dowloaded product." ] }, { "cell_type": "code", "execution_count": 32, "id": "44fc95a9-812b-4746-a3b7-c90d219bf4cc", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Keys: \n", "\n", "[170.88405 171.3952 179.33963 ... 178.35054 178.84067 179.31787]\n" ] } ], "source": [ "#Testing the HDF5 files\n", "import h5py\n", "with h5py.File(filename, \"r\") as f: \n", " print(\"Keys: %s\" % f.keys())\n", " # get first object name/key; may or may NOT be a group\n", " a_group_key = list(f.keys())[0]\n", "\n", " # get the object type for a_group_key: usually group or dataset\n", " print(type(f[a_group_key])) \n", "\n", " # If a_group_key is a group name, \n", " # this gets the object names in the group and returns as a list\n", " data = list(f[a_group_key])\n", "\n", " # If a_group_key is a dataset name, \n", " # this gets the dataset values and returns as a list\n", " data = list(f[a_group_key])\n", " # preferred methods to get dataset values:\n", " ds_obj = f[a_group_key] # returns as a h5py dataset object\n", " ds_arr = f[a_group_key][()] # returns as a numpy array\n", " \n", " print(ds_arr)" ] }, { "cell_type": "markdown", "id": "df914821", "metadata": {}, "source": [ "As observed from the output of the above cell, the data values are retrieved from the downloaded product. Hence, validating the downloaded file." ] }, { "cell_type": "markdown", "id": "cd8e5abc-9bbf-4972-ae07-79fe5e353b04", "metadata": {}, "source": [ "### References\n", "1. Blair, J. B. and M. Hofton. (2020). LVIS Facility L1B Geolocated Return Energy Waveforms, Version 1 [Data Set]. Boulder, Colorado USA. NASA National Snow and Ice Data Center Distributed Active Archive Center. https://doi.org/10.5067/XQJ8PN8FTIDG. Date Accessed 08-17-2023.\n", "2. Blair, J. B. and M. Hofton. (2018). ABoVE LVIS L1B Geolocated Return Energy Waveforms, Version 1 [Data Set]. Boulder, Colorado USA. NASA National Snow and Ice Data Center Distributed Active Archive Center. https://doi.org/10.5067/UMRAWS57QAFU. Date Accessed 08-17-2023.\n", "3. Blair, J. B. and M. Hofton. (2020). LVIS Facility L2 Geolocated Surface Elevation and Canopy Height Product, Version 1 [Data Set]. Boulder, Colorado USA. NASA National Snow and Ice Data Center Distributed Active Archive Center. https://doi.org/10.5067/VP7J20HJQISD. Date Accessed 08-17-2023.\n", "4. Blair, J. B. and M. Hofton. (2018). ABoVE LVIS L2 Geolocated Surface Elevation Product, Version 1 [Data Set]. Boulder, Colorado USA. NASA National Snow and Ice Data Center Distributed Active Archive Center. https://doi.org/10.5067/IA5WAX7K3YGY. Date Accessed 08-17-2023.\n", "5. Blair, J. B. and M. Hofton. (2018). AfriSAR LVIS L1B Geolocated Return Energy Waveforms, Version 1 [Data Set]. Boulder, Colorado USA. NASA National Snow and Ice Data Center Distributed Active Archive Center. https://doi.org/10.5067/ED5IYGVTB50Z. Date Accessed 08-17-2023." ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.8" } }, "nbformat": 4, "nbformat_minor": 5 }