Overview
ASCII files are plain text files that use ASCII character encoding, and which can store geospatial data. NASA offers some data products in ASCII format, including new data products from HAQAST. This document will explain how to open this file format in popular GIS software, ArcGIS Pro and QGIS. The process for both is very similar and any differences will be included as notes. Videos of this tutorial are available at the end.
Example
This example will use the NASA data product “HAQES_NA_PM25_TOT_CENSUS_1” to show the fine particulate matter (PM2.5) levels in each census tract across the United States on 11/1/2022.
Prerequisites
This example used ArcGIS Pro version 3.1.0 And QGIS version 3.28.10, as well as the Python package “pandas” for file conversion.
ArcGIS Pro is a desktop client. Individual ArcGIS Pro licenses can be acquired from Esri or can be accessed through an organization with Named user or concurrent use licenses. Other web based platforms, like ArcGIS Enterprise or ArcGIS Online (AGOL), provide limited free public access to GIS tools or services.
Procedure
1. Download one of the .txt files from NASA Earthdata Search.
2. Convert the .txt file to CSV using the following Python code snippet. This has been adapted from the "Options for Reading the Data" section in the Health and Air Quality Applied Science Team's (HAQAST) README file.
import pandas as pd
#Read data file
Data_file= r'\path\HAQAST_ASCII.txt'
df_census = pd.read_csv(Data_file,low_memory=False, dtype={"TRACT": "str"}, skiprows=20)
#save as csv
df_census.to_csv(r'path\HAQAST.csv')3. Download the Census Tracts 1:500,000 (national), and the newly defined 2020 ZIP Code shapefile (as of February 8, 2022) as specified in the README: Cartographic Boundary Files (census.gov).
4. Add the census tract shapefile (cb_2020_us_tract_500k.shp) to the GIS map. This can be done simply in both ArcGIS Pro and QGIS by dragging and dropping the shp file onto the map or into the ArcGIS Contents pane or QGIS Layers pane. The contents of the shapefile can be viewed as an attribute table in both QGIS and ArcGIS by right-clicking the census tract layer in the QGIS Layers or ArcGIS Contents pane, and selecting "Attribute Table" or "Open Attribute Table". See Figures 1 and 2 below for how this should appear in your GIS map.