SDO | Data

Best Practice for getting SDO Browse Data.

SDO provides near-real-time (NRT) images that are updated every 15 minutes. They are designed for Space Weather operators and citizen scientists. You can examine the images on the SDO website or download them for use elsewhere. The best way to regularly download our latest NRT images is a script using either a wget or curl command. Once a script tailored to your needs has been developed it can be invoked automatically as a cron job.

The best method to download our NRT images is to use the wget utility.


Cadence

Best practice would be to retrieve a new images once every fifteen minutes.

Example crontab:

*/15 * * * * bash /path/to/script > /path/to/output 2>&1 &

Downloading latest NRT images

Our latest images are located in the /assets/inmg/latest directory and have a common naming convention as see below. There are four resolutions available and 15 images.

URL: https://sdo.gsfc.nasa.gov/assets/img/latest/latest_[ resolution ]_[ wavelength ].jpg

Resolutions: [ 4096, 2048, 1024, 512 ]

Wavelengths: [ 0094, 0193, 0171, 0304, 0211, 0131, 0335, 1600, 1700, hmib, hmii, hmibc, hmiic, hmiif, hmid ]


Example bash code — using wget:

#!/bin/bash
# COMMANDLINE ARGUMENTS
DOWNLOAD_PATH=$1

# SDO WEBSITE URL
LATEST_URL=https://sdo.gsfc.nasa.gov/assets/img/latest

# DOWNLOAD PATH
LOCALDIR=$DOWNLOAD_PATH

CHANNELS=( 0094 0131 0171 0193 0211 0304 0335 1600 1700 HMIB HMII HMID HMIBC HMIIF HMIIC )
RESOLUTIONS=( 4096 2048 1024 512 )

for CHANNEL in ${CHANNELS[@]}
do  
    for RESOLUTION in ${RESOLUTIONS[@]}
    do
	FILENAME="latest_"$RESOLUTION"_"$CHANNEL".jpg"
	URL=$LATEST_URL/$FILENAME

	#wget command
	wget -N -nd --no-check-certificate $URL --directory-prefix=$LOCALDIR
    done
done

Getting images from the browse directories

The browse directories are the drilldown directories deliniated by date. These images also have a common naming convention consisting of date/time stamp, resolution, and instrument or wavelength.

Example directory drilldown

 

Below is an example script on how to download browse images from a date range.

#!/bin/bash
# COMMANDLINE ARGUMENTS
STARTDATE=$1
ENDDATE=$2
CHANNEL=$3
RESOLUTION=$4
DOWNLOAD_PATH=$5

# SDO WEBSITE URL
SDOURL=https://sdo.gsfc.nasa.gov
BROWSEDIR=$SDOURL"/assets/img/browse"

# DOWNLOAD PATH
LOCALDIR=$DOWNLOAD_PATH

# UNIX TIMESTAMPS
STARTSECONDS=$(date -j -u -f "%Y-%m-%d" ${STARTDATE} +"%s")
ENDSECONDS=$(date -j -u -f "%Y-%m-%d" ${ENDDATE} +"%s")

echo -e "\n\n"
echo "Download Images to local directory"
echo "START DATE: "$STARTDATE
echo "END DATE: "$ENDDATE
echo "CHANNEL: "$CHANNEL
echo "RESOLUTION: "$RESOLUTION
echo "DOWNLOAD PATH: "$LOCALDIR
echo -e "\n"

val=0
for (( i=$STARTSECONDS; i<=$ENDSECONDS; i+=86400 ))
do
	NEXTDATEPATH=$(date -j -u -f %s "${i}" +%Y/%m/%d)
	NEXTDATESTRING=$(date -j -u -f %s "${i}" +%Y%m%d)
	URL=${BROWSEDIR}/${NEXTDATEPATH}
	ACCEPT=${NEXTDATESTRING}_*_${RESOLUTION}_${CHANNEL}.jpg
	printf "Downloading Images from: %s\r" "$URL"
	wget -q -nd --no-check-certificate --level=1 --recursive -e robots=off --no-parent -R "index.html*" -A $ACCEPT $URL --directory-prefix=$LOCALDIR
done

echo -e "\n"Script complete: $(date)
 

Downloads

» Download scripts