Example of how to get all the (MODIS Airborne Simulator) eMAS granule names from the ORACLES campaign using python:
Get ORACLES campaign days
First step, let's download, using python, the json file at the root of the eMAS ORACLES campaign available here:
import urllib.request, json
ladsweb_url = 'https://ladsweb.modaps.eosdis.nasa.gov/archive/MAS_eMAS/ORACLES.json'
with urllib.request.urlopen(ladsweb_url) as url:
data = json.loads(url.read().decode())
print(data)
which returns
[{'name': '16_953', 'size': 0, 'last-modified': '2018-10-03 23:10'}, {'name': '16_954', 'size': 0, 'last-modified': '2018-10-03 23:10'}, {'name': '16_955', 'size': 0, 'last-modified': '2018-10-03 23:10'}, {'name': '16_956', 'size': 0, 'last-modified': '2018-10-03 23:10'}, {'name': '16_957', 'size': 0, 'last-modified': '2018-10-03 23:10'}, {'name': '16_958', 'size': 0, 'last-modified': '2018-10-03 23:10'}, {'name': '16_960', 'size': 0, 'last-modified': '2018-10-03 23:10'}, {'name': '16_961', 'size': 0, 'last-modified': '2018-10-03 23:10'}, {'name': '16_962', 'size': 0, 'last-modified': '2018-10-03 23:10'}]
Get file names for a given day
Get eMASL1B file names
ladsweb_url = 'https://ladsweb.modaps.eosdis.nasa.gov/archive/MAS_eMAS/ORACLES/16_953/eMASL1B.json'
with urllib.request.urlopen(ladsweb_url) as url:
data = json.loads(url.read().decode())
print(data)
returns
[{'name': 'eMASL1B_16953_01_20160910_0751_0819_V01.hdf', 'size': 412600376, 'last-modified': '2018-10-03 02:33'}, {'name': 'eMASL1B_16953_02_20160910_0820_0854_V01.hdf', 'size': 505309711, 'last-modified': '2018-10-03 02:34'}, {'name': 'eMASL1B_16953_03_20160910_0854_0927_V01.hdf', 'size': 526627134, 'last-modified': '2018-10-03 02:35'}, {'name': 'eMASL1B_16953_04_20160910_0927_0955_V01.hdf', 'size': 432581907, 'last-modified': '2018-10-03 02:36'}, {'name': 'eMASL1B_16953_05_20160910_0958_1031_V01.hdf', 'size': 531358891, 'last-modified': '2018-10-03 02:38'}, {'name': 'eMASL1B_16953_06_20160910_1031_1101_V01.hdf', 'size': 466174295, 'last-modified': '2018-10-03 02:39'}, {'name': 'eMASL1B_16953_07_20160910_1103_1108_V01.hdf', 'size': 75452726, 'last-modified': '2018-10-03 02:39'}, {'name': 'eMASL1B_16953_08_20160910_1108_1116_V01.hdf', 'size': 123577499, 'last-modified': '2018-10-03 02:39'}, {'name': 'eMASL1B_16953_09_20160910_1116_1149_V01.hdf', 'size': 503859794, 'last-modified': '2018-10-03 02:40'}, {'name': 'eMASL1B_16953_10_20160910_1149_1223_V01.hdf', 'size': 490133247, 'last-modified': '2018-10-03 02:42'}, {'name': 'eMASL1B_16953_11_20160910_1223_1255_V01.hdf', 'size': 509831826, 'last-modified': '2018-10-03 02:43'}]
Get eMASL2CLD file names
ladsweb_url = 'https://ladsweb.modaps.eosdis.nasa.gov/archive/MAS_eMAS/ORACLES/16_953/eMASL2CLD.json'
with urllib.request.urlopen(ladsweb_url) as url:
data = json.loads(url.read().decode())
print(data)
returns
[{'name': 'eMASL2CLD_16953_01_20160910_0751_0819_20180920_0026.nc4', 'size': 321687356, 'last-modified': '2018-09-20 22:14'}, {'name': 'eMASL2CLD_16953_02_20160910_0820_0854_20180920_0059.nc4', 'size': 645892214, 'last-modified': '2018-09-20 22:15'}, {'name': 'eMASL2CLD_16953_03_20160910_0854_0927_20180920_0228.nc4', 'size': 608081985, 'last-modified': '2018-09-20 22:13'}, {'name': 'eMASL2CLD_16953_04_20160910_0927_0955_20180920_0403.nc4', 'size': 607777014, 'last-modified': '2018-09-20 22:13'}, {'name': 'eMASL2CLD_16953_05_20160910_0958_1031_20180920_0512.nc4', 'size': 683310356, 'last-modified': '2018-09-20 22:12'}, {'name': 'eMASL2CLD_16953_06_20160910_1031_1101_20180920_0623.nc4', 'size': 670607977, 'last-modified': '2018-09-20 22:11'}, {'name': 'eMASL2CLD_16953_07_20160910_1103_1108_20180920_0737.nc4', 'size': 107879861, 'last-modified': '2018-09-20 22:10'}, {'name': 'eMASL2CLD_16953_08_20160910_1108_1116_20180920_0748.nc4', 'size': 159543282, 'last-modified': '2018-09-20 22:09'}, {'name': 'eMASL2CLD_16953_09_20160910_1116_1149_20180920_0805.nc4', 'size': 309310544, 'last-modified': '2018-09-20 22:09'}, {'name': 'eMASL2CLD_16953_10_20160910_1149_1223_20180920_0834.nc4', 'size': 279058626, 'last-modified': '2018-09-20 22:08'}, {'name': 'eMASL2CLD_16953_11_20160910_1223_1255_20180920_0858.nc4', 'size': 492045912, 'last-modified': '2018-09-20 22:09'}]
Create a loop over all ORACLES campaign days
Next step create a loop over all ORACLES campaign days:
for day in data:
print(day)
print(day['name'])
ladsweb_url = 'https://ladsweb.modaps.eosdis.nasa.gov/archive/MAS_eMAS/ORACLES/{}/eMASL1B.json.json'.format(day['name'])
with urllib.request.urlopen(ladsweb_url) as url:
eMASL1B_data = json.loads(url.read().decode())
ladsweb_url = 'https://ladsweb.modaps.eosdis.nasa.gov/archive/MAS_eMAS/ORACLES/{}/eMASL2CLD.json'.format(day['name'])
with urllib.request.urlopen(ladsweb_url) as url:
eMASL2CLD_data = json.loads(url.read().decode())
Example of python code
import urllib.request, json
ladsweb_url = 'https://ladsweb.modaps.eosdis.nasa.gov/archive/MAS_eMAS/ORACLES.json'
with urllib.request.urlopen(ladsweb_url) as url:
data = json.loads(url.read().decode())
granule_name_list = []
for day in data:
print(day)
print(day['name'])
ladsweb_url = 'https://ladsweb.modaps.eosdis.nasa.gov/archive/MAS_eMAS/ORACLES/{}/eMASL1B.json.json'.format(day['name'])
with urllib.request.urlopen(ladsweb_url) as url:
eMASL1B_data = json.loads(url.read().decode())
ladsweb_url = 'https://ladsweb.modaps.eosdis.nasa.gov/archive/MAS_eMAS/ORACLES/{}/eMASL2CLD.json'.format(day['name'])
with urllib.request.urlopen(ladsweb_url) as url:
eMASL2CLD_data = json.loads(url.read().decode())
for eMASL1B,eMASL2CLD in zip(eMASL1B_data,eMASL2CLD_data):
granule_name_list.append((eMASL1B['name'],eMASL2CLD['name']))
print(granule_name_list)
returns
[('eMASL1B_16953_01_20160910_0751_0819_V01.hdf', 'eMASL2CLD_16953_01_20160910_0751_0819_20180920_0026.nc4'), ('eMASL1B_16953_02_20160910_0820_0854_V01.hdf', 'eMASL2CLD_16953_02_20160910_0820_0854_20180920_0059.nc4'), ('eMASL1B_16953_03_20160910_0854_0927_V01.hdf', 'eMASL2CLD_16953_03_20160910_0854_0927_20180920_0228.nc4'), ('eMASL1B_16953_04_20160910_0927_0955_V01.hdf', 'eMASL2CLD_16953_04_20160910_0927_0955_20180920_0403.nc4'), ('eMASL1B_16953_05_20160910_0958_1031_V01.hdf', 'eMASL2CLD_16953_05_20160910_0958_1031_20180920_0512.nc4'), ('eMASL1B_16953_06_20160910_1031_1101_V01.hdf', 'eMASL2CLD_16953_06_20160910_1031_1101_20180920_0623.nc4'), ('eMASL1B_16953_07_20160910_1103_1108_V01.hdf', 'eMASL2CLD_16953_07_20160910_1103_1108_20180920_0737.nc4'), ('eMASL1B_16953_08_20160910_1108_1116_V01.hdf', 'eMASL2CLD_16953_08_20160910_1108_1116_20180920_0748.nc4'), ('eMASL1B_16953_09_20160910_1116_1149_V01.hdf', 'eMASL2CLD_16953_09_20160910_1116_1149_20180920_0805.nc4'), ('eMASL1B_16953_10_20160910_1149_1223_V01.hdf', 'eMASL2CLD_16953_10_20160910_1149_1223_20180920_0834.nc4'), ('eMASL1B_16953_11_20160910_1223_1255_V01.hdf', 'eMASL2CLD_16953_11_20160910_1223_1255_20180920_0858.nc4'), ('eMASL1B_16954_01_20160912_0750_0820_V01.hdf', 'eMASL2CLD_16954_01_20160912_0750_0820_20180920_0948.nc4'), ('eMASL1B_16954_02_20160912_0824_0857_V01.hdf', 'eMASL2CLD_16954_02_20160912_0824_0857_20180920_1039.nc4'), ('eMASL1B_16954_03_20160912_0857_0931_V01.hdf', 'eMASL2CLD_16954_03_20160912_0857_0931_20180920_1129.nc4'), ('eMASL1B_16954_04_20160912_0931_1004_V01.hdf', 'eMASL2CLD_16954_04_20160912_0931_1004_20180920_1300.nc4'), ('eMASL1B_16954_05_20160912_1004_1025_V01.hdf', 'eMASL2CLD_16954_05_20160912_1004_1025_20180920_1435.nc4'), ('eMASL1B_16954_06_20160912_1027_1101_V01.hdf', 'eMASL2CLD_16954_06_20160912_1027_1101_20180920_1459.nc4'), ('eMASL1B_16954_07_20160912_1101_1134_V01.hdf', 'eMASL2CLD_16954_07_20160912_1101_1134_20180920_1546.nc4'), ('eMASL1B_16954_08_20160912_1134_1203_V01.hdf', 'eMASL2CLD_16954_08_20160912_1134_1203_20180920_1715.nc4'), ('eMASL1B_16954_09_20160912_1206_1239_V01.hdf', 'eMASL2CLD_16954_09_20160912_1206_1239_20180920_1901.nc4'), ('eMASL1B_16954_10_20160912_1239_1313_V01.hdf', 'eMASL2CLD_16954_10_20160912_1239_1313_20180920_2032.nc4'), ('eMASL1B_16954_11_20160912_1313_1346_V01.hdf', 'eMASL2CLD_16954_11_20160912_1313_1346_20180920_2201.nc4'), ('eMASL1B_16954_12_20160912_1346_1419_V01.hdf', 'eMASL2CLD_16954_12_20160912_1346_1419_20180920_2311.nc4'), ('eMASL1B_16954_13_20160912_1419_1453_V01.hdf', 'eMASL2CLD_16954_13_20160912_1419_1453_20180920_2339.nc4'), ('eMASL1B_16954_14_20160912_1453_1509_V01.hdf', 'eMASL2CLD_16954_14_20160912_1453_1509_20180920_2345.nc4'), ('eMASL1B_16955_01_20160914_0754_0828_V01.hdf', 'eMASL2CLD_16955_01_20160914_0754_0828_20180920_0030.nc4'), ('eMASL1B_16955_02_20160914_0828_0841_V01.hdf', 'eMASL2CLD_16955_02_20160914_0828_0841_20180920_0153.nc4'), ('eMASL1B_16955_03_20160914_0845_0910_V01.hdf', 'eMASL2CLD_16955_03_20160914_0845_0910_20180920_0225.nc4'), ('eMASL1B_16955_04_20160914_0916_0922_V01.hdf', 'eMASL2CLD_16955_04_20160914_0916_0922_20180920_0325.nc4'), ('eMASL1B_16955_05_20160914_0922_0926_V01.hdf', 'eMASL2CLD_16955_05_20160914_0922_0926_20180920_0340.nc4'), ('eMASL1B_16955_06_20160914_0929_0933_V01.hdf', 'eMASL2CLD_16955_06_20160914_0929_0933_20180920_0355.nc4'), ('eMASL1B_16955_07_20160914_0933_0956_V01.hdf', 'eMASL2CLD_16955_07_20160914_0933_0956_20180920_0407.nc4'), ('eMASL1B_16955_08_20160914_0958_1033_V01.hdf', 'eMASL2CLD_16955_08_20160914_0958_1033_20180920_0505.nc4'), ('eMASL1B_16955_09_20160914_1040_1113_V01.hdf', 'eMASL2CLD_16955_09_20160914_1040_1113_20180920_0659.nc4'), ('eMASL1B_16955_10_20160914_1117_1145_V01.hdf', 'eMASL2CLD_16955_10_20160914_1117_1145_20180920_0822.nc4'), ('eMASL1B_16955_11_20160914_1147_1159_V01.hdf', 'eMASL2CLD_16955_11_20160914_1147_1159_20180920_0936.nc4'), ('eMASL1B_16955_12_20160914_1202_1231_V01.hdf', 'eMASL2CLD_16955_12_20160914_1202_1231_20180920_1003.nc4'), ('eMASL1B_16955_13_20160914_1236_1254_V01.hdf', 'eMASL2CLD_16955_13_20160914_1236_1254_20180920_1109.nc4'), ('eMASL1B_16955_14_20160914_1259_1311_V01.hdf', 'eMASL2CLD_16955_14_20160914_1259_1311_20180920_1149.nc4'), ('eMASL1B_16955_15_20160914_1315_1324_V01.hdf', 'eMASL2CLD_16955_15_20160914_1315_1324_20180920_1215.nc4'), ('eMASL1B_16955_16_20160914_1326_1330_V01.hdf', 'eMASL2CLD_16955_16_20160914_1326_1330_20180920_1235.nc4'), ('eMASL1B_16955_17_20160914_1333_1337_V01.hdf', 'eMASL2CLD_16955_17_20160914_1333_1337_20180920_1245.nc4'), ('eMASL1B_16955_18_20160914_1337_1411_V01.hdf', 'eMASL2CLD_16955_18_20160914_1337_1411_20180920_1255.nc4'), ('eMASL1B_16955_19_20160914_1411_1435_V01.hdf', 'eMASL2CLD_16955_19_20160914_1411_1435_20180920_1407.nc4'), ('eMASL1B_16956_01_20160916_0755_0818_V01.hdf', 'eMASL2CLD_16956_01_20160916_0755_0818_20180918_1016.nc4'), ('eMASL1B_16956_02_20160916_0819_0838_V01.hdf', 'eMASL2CLD_16956_02_20160916_0819_0838_20180918_1032.nc4'), ('eMASL1B_16956_03_20160916_0838_0857_V01.hdf', 'eMASL2CLD_16956_03_20160916_0838_0857_20180918_1104.nc4'), ('eMASL1B_16956_04_20160916_0858_0931_V01.hdf', 'eMASL2CLD_16956_04_20160916_0858_0931_20180918_1155.nc4'), ('eMASL1B_16956_05_20160916_0931_0949_V01.hdf', 'eMASL2CLD_16956_05_20160916_0931_0949_20180918_1258.nc4'), ('eMASL1B_16956_06_20160916_0949_1006_V01.hdf', 'eMASL2CLD_16956_06_20160916_0949_1006_20180918_1331.nc4'), ('eMASL1B_16956_07_20160916_1008_1041_V01.hdf', 'eMASL2CLD_16956_07_20160916_1008_1041_20180918_1414.nc4'), ('eMASL1B_16956_08_20160916_1041_1115_V01.hdf', 'eMASL2CLD_16956_08_20160916_1041_1115_20180918_1516.nc4'), ('eMASL1B_16956_09_20160916_1115_1129_V01.hdf', 'eMASL2CLD_16956_09_20160916_1115_1129_20180918_1638.nc4'), ('eMASL1B_16956_10_20160916_1133_1207_V01.hdf', 'eMASL2CLD_16956_10_20160916_1133_1207_20180918_1701.nc4'), ('eMASL1B_16956_11_20160916_1207_1240_V01.hdf', 'eMASL2CLD_16956_11_20160916_1207_1240_20180924_1146.nc4'), ('eMASL1B_16956_12_20160916_1240_1313_V01.hdf', 'eMASL2CLD_16956_12_20160916_1240_1313_20180924_1307.nc4'), ('eMASL1B_16956_13_20160916_1313_1347_V01.hdf', 'eMASL2CLD_16956_13_20160916_1313_1347_20180924_1350.nc4'), ('eMASL1B_16956_14_20160916_1347_1409_V01.hdf', 'eMASL2CLD_16956_14_20160916_1347_1409_20180924_1436.nc4'), ('eMASL1B_16957_01_20160918_0830_0853_V01.hdf', 'eMASL2CLD_16957_01_20160918_0830_0853_20180920_0137.nc4'), ('eMASL1B_16957_02_20160918_0854_0917_V01.hdf', 'eMASL2CLD_16957_02_20160918_0854_0917_20180920_0214.nc4'), ('eMASL1B_16957_03_20160918_0917_0940_V01.hdf', 'eMASL2CLD_16957_03_20160918_0917_0940_20180920_0350.nc4'), ('eMASL1B_16957_04_20160918_0940_1009_V01.hdf', 'eMASL2CLD_16957_04_20160918_0940_1009_20180920_0522.nc4'), ('eMASL1B_16957_05_20160918_1009_1028_V01.hdf', 'eMASL2CLD_16957_05_20160918_1009_1028_20180920_0746.nc4'), ('eMASL1B_16957_06_20160918_1035_1055_V01.hdf', 'eMASL2CLD_16957_06_20160918_1035_1055_20180920_0848.nc4'), ('eMASL1B_16957_07_20160918_1101_1123_V01.hdf', 'eMASL2CLD_16957_07_20160918_1101_1123_20180920_0944.nc4'), ('eMASL1B_16957_08_20160918_1126_1159_V01.hdf', 'eMASL2CLD_16957_08_20160918_1126_1159_20180920_1039.nc4'), ('eMASL1B_16957_09_20160918_1159_1222_V01.hdf', 'eMASL2CLD_16957_09_20160918_1159_1222_20180920_1218.nc4'), ('eMASL1B_16957_10_20160918_1222_1246_V01.hdf', 'eMASL2CLD_16957_10_20160918_1222_1246_20180920_1332.nc4'), ('eMASL1B_16957_11_20160918_1256_1330_V01.hdf', 'eMASL2CLD_16957_11_20160918_1256_1330_20180920_1455.nc4'), ('eMASL1B_16957_12_20160918_1330_1403_V01.hdf', 'eMASL2CLD_16957_12_20160918_1330_1403_20180920_1654.nc4'), ('eMASL1B_16957_13_20160918_1403_1430_V01.hdf', 'eMASL2CLD_16957_13_20160918_1403_1430_20180921_0044.nc4'), ('eMASL1B_16957_14_20160918_1430_1504_V01.hdf', 'eMASL2CLD_16957_14_20160918_1430_1504_20180921_0142.nc4'), ('eMASL1B_16957_15_20160918_1504_1527_V01.hdf', 'eMASL2CLD_16957_15_20160918_1504_1527_20180921_0234.nc4'), ('eMASL1B_16957_16_20160918_1527_1550_V01.hdf', 'eMASL2CLD_16957_16_20160918_1527_1550_20180921_0319.nc4'), ('eMASL1B_16958_01_20160920_0821_0834_V01.hdf', 'eMASL2CLD_16958_01_20160920_0821_0834_20180925_0224.nc4'), ('eMASL1B_16958_02_20160920_0836_0909_V01.hdf', 'eMASL2CLD_16958_02_20160920_0836_0909_20180925_0228.nc4'), ('eMASL1B_16958_03_20160920_0909_0929_V01.hdf', 'eMASL2CLD_16958_03_20160920_0909_0929_20180925_0222.nc4'), ('eMASL1B_16958_04_20160920_0929_0949_V01.hdf', 'eMASL2CLD_16958_03_20160920_0909_0929_20180925_0416.nc4'), ('eMASL1B_16958_05_20160920_0954_1029_V01.hdf', 'eMASL2CLD_16958_04_20160920_0929_0949_20180925_0505.nc4'), ('eMASL1B_16958_06_20160920_1031_1042_V01.hdf', 'eMASL2CLD_16958_05_20160920_0954_1029_20180925_0604.nc4'), ('eMASL1B_16958_07_20160920_1043_1101_V01.hdf', 'eMASL2CLD_16958_06_20160920_1031_1042_20180925_0724.nc4'), ('eMASL1B_16958_08_20160920_1101_1119_V01.hdf', 'eMASL2CLD_16958_07_20160920_1043_1101_20180925_0749.nc4'), ('eMASL1B_16958_09_20160920_1125_1130_V01.hdf', 'eMASL2CLD_16958_08_20160920_1101_1119_20180925_0826.nc4'), ('eMASL1B_16958_10_20160920_1130_1202_V01.hdf', 'eMASL2CLD_16958_09_20160920_1125_1130_20180925_0909.nc4'), ('eMASL1B_16958_11_20160920_1207_1227_V01.hdf', 'eMASL2CLD_16958_10_20160920_1130_1202_20180925_0921.nc4'), ('eMASL1B_16958_12_20160920_1227_1246_V01.hdf', 'eMASL2CLD_16958_11_20160920_1207_1227_20180925_1039.nc4'), ('eMASL1B_16958_13_20160920_1247_1301_V01.hdf', 'eMASL2CLD_16958_12_20160920_1227_1246_20180925_1126.nc4'), ('eMASL1B_16958_14_20160920_1303_1336_V01.hdf', 'eMASL2CLD_16958_13_20160920_1247_1301_20180925_1217.nc4'), ('eMASL1B_16958_15_20160920_1336_1404_V01.hdf', 'eMASL2CLD_16958_14_20160920_1303_1336_20180925_1248.nc4'), ('eMASL1B_16958_16_20160920_1404_1433_V01.hdf', 'eMASL2CLD_16958_15_20160920_1336_1404_20180925_1417.nc4'), ('eMASL1B_16958_17_20160920_1434_1447_V01.hdf', 'eMASL2CLD_16958_16_20160920_1404_1433_20180925_1558.nc4'), ('eMASL1B_16960_01_20160924_0820_0854_V01.hdf', 'eMASL2CLD_16960_01_20160924_0820_0854_20180926_1632.nc4'), ('eMASL1B_16960_02_20160924_0854_0927_V01.hdf', 'eMASL2CLD_16960_02_20160924_0854_0927_20180926_1737.nc4'), ('eMASL1B_16960_03_20160924_0927_1000_V01.hdf', 'eMASL2CLD_16960_03_20160924_0927_1000_20180926_1833.nc4'), ('eMASL1B_16960_04_20160924_1000_1009_V01.hdf', 'eMASL2CLD_16960_04_20160924_1000_1009_20180926_1915.nc4'), ('eMASL1B_16960_05_20160924_1013_1037_V01.hdf', 'eMASL2CLD_16960_05_20160924_1013_1037_20180926_1922.nc4'), ('eMASL1B_16960_06_20160924_1037_1101_V01.hdf', 'eMASL2CLD_16960_06_20160924_1037_1101_20180926_1934.nc4'), ('eMASL1B_16960_07_20160924_1102_1127_V01.hdf', 'eMASL2CLD_16960_07_20160924_1102_1127_20180926_2016.nc4'), ('eMASL1B_16960_08_20160924_1127_1152_V01.hdf', 'eMASL2CLD_16960_08_20160924_1127_1152_20180926_2117.nc4'), ('eMASL1B_16960_09_20160924_1155_1213_V01.hdf', 'eMASL2CLD_16960_09_20160924_1155_1213_20180926_2154.nc4'), ('eMASL1B_16960_10_20160924_1213_1232_V01.hdf', 'eMASL2CLD_16960_10_20160924_1213_1232_20180926_2137.nc4'), ('eMASL1B_16960_11_20160924_1233_1306_V01.hdf', 'eMASL2CLD_16960_11_20160924_1233_1306_20180926_2034.nc4'), ('eMASL1B_16960_12_20160924_1306_1340_V01.hdf', 'eMASL2CLD_16960_12_20160924_1306_1340_20180926_1850.nc4'), ('eMASL1B_16960_13_20160924_1340_1413_V01.hdf', 'eMASL2CLD_16960_13_20160924_1340_1413_20180926_1727.nc4'), ('eMASL1B_16960_14_20160924_1413_1442_V01.hdf', 'eMASL2CLD_16960_14_20160924_1413_1442_20180926_1618.nc4'), ('eMASL1B_16961_01_20160925_0807_0840_V01.hdf', 'eMASL2CLD_16961_01_20160925_0807_0840_20180917_1738.nc4'), ('eMASL1B_16961_02_20160925_0841_0915_V01.hdf', 'eMASL2CLD_16961_02_20160925_0841_0915_20180917_1843.nc4'), ('eMASL1B_16961_03_20160925_0915_0948_V01.hdf', 'eMASL2CLD_16961_03_20160925_0915_0948_20180917_2005.nc4'), ('eMASL1B_16961_04_20160925_0948_1015_V01.hdf', 'eMASL2CLD_16961_04_20160925_0948_1015_20180917_2129.nc4'), ('eMASL1B_16961_05_20160925_1015_1043_V01.hdf', 'eMASL2CLD_16961_05_20160925_1015_1043_20180917_2219.nc4'), ('eMASL1B_16961_06_20160925_1043_1049_V01.hdf', 'eMASL2CLD_16961_06_20160925_1043_1049_20180917_2256.nc4'), ('eMASL1B_16961_07_20160925_1053_1126_V01.hdf', 'eMASL2CLD_16961_07_20160925_1053_1126_20180917_2301.nc4'), ('eMASL1B_16961_08_20160925_1126_1156_V01.hdf', 'eMASL2CLD_16961_08_20160925_1126_1156_20180917_2336.nc4'), ('eMASL1B_16961_09_20160925_1156_1225_V01.hdf', 'eMASL2CLD_16961_09_20160925_1156_1225_20180918_0001.nc4'), ('eMASL1B_16961_10_20160925_1226_1232_V01.hdf', 'eMASL2CLD_16961_10_20160925_1226_1232_20180918_0045.nc4'), ('eMASL1B_16961_11_20160925_1233_1237_V01.hdf', 'eMASL2CLD_16961_11_20160925_1233_1237_20180918_0056.nc4'), ('eMASL1B_16961_12_20160925_1238_1254_V01.hdf', 'eMASL2CLD_16961_12_20160925_1238_1254_20180918_0105.nc4'), ('eMASL1B_16961_13_20160925_1254_1327_V01.hdf', 'eMASL2CLD_16961_13_20160925_1254_1327_20180918_0136.nc4'), ('eMASL1B_16961_14_20160925_1327_1400_V01.hdf', 'eMASL2CLD_16961_14_20160925_1327_1400_20180918_0241.nc4'), ('eMASL1B_16961_15_20160925_1400_1433_V01.hdf', 'eMASL2CLD_16961_15_20160925_1400_1433_20180918_0356.nc4'), ('eMASL1B_16961_16_20160925_1433_1507_V01.hdf', 'eMASL2CLD_16961_16_20160925_1433_1507_20180918_0515.nc4'), ('eMASL1B_16961_17_20160925_1507_1534_V01.hdf', 'eMASL2CLD_16961_17_20160925_1507_1534_20180918_0634.nc4'), ('eMASL1B_16962_01_20160927_0743_0810_V01.hdf', 'eMASL2CLD_16962_01_20160927_0743_0810_20180924_1823.nc4'), ('eMASL1B_16962_02_20160927_0811_0844_V01.hdf', 'eMASL2CLD_16962_02_20160927_0811_0844_20180924_1917.nc4'), ('eMASL1B_16962_03_20160927_0844_0918_V01.hdf', 'eMASL2CLD_16962_03_20160927_0844_0918_20180924_2058.nc4'), ('eMASL1B_16962_04_20160927_0918_0951_V01.hdf', 'eMASL2CLD_16962_04_20160927_0918_0951_20180924_2225.nc4'), ('eMASL1B_16962_05_20160927_0951_1019_V01.hdf', 'eMASL2CLD_16962_05_20160927_0951_1019_20180924_2353.nc4'), ('eMASL1B_16962_06_20160927_1021_1055_V01.hdf', 'eMASL2CLD_16962_06_20160927_1021_1055_20180925_0031.nc4'), ('eMASL1B_16962_07_20160927_1055_1128_V01.hdf', 'eMASL2CLD_16962_07_20160927_1055_1128_20180925_0126.nc4'), ('eMASL1B_16962_08_20160927_1128_1204_V01.hdf', 'eMASL2CLD_16962_08_20160927_1128_1204_20180925_0237.nc4'), ('eMASL1B_16962_09_20160927_1208_1242_V01.hdf', 'eMASL2CLD_16962_09_20160927_1208_1242_20180925_0413.nc4'), ('eMASL1B_16962_10_20160927_1242_1315_V01.hdf', 'eMASL2CLD_16962_10_20160927_1242_1315_20180925_0534.nc4'), ('eMASL1B_16962_11_20160927_1315_1318_V01.hdf', 'eMASL2CLD_16962_11_20160927_1315_1318_20180925_0620.nc4'), ('eMASL1B_16962_12_20160927_1319_1330_V01.hdf', 'eMASL2CLD_16962_12_20160927_1319_1330_20180925_0629.nc4'), ('eMASL1B_16962_13_20160927_1332_1337_V01.hdf', 'eMASL2CLD_16962_13_20160927_1332_1337_20180925_0658.nc4'), ('eMASL1B_16962_14_20160927_1339_1412_V01.hdf', 'eMASL2CLD_16962_14_20160927_1339_1412_20180919_0006.nc4'), ('eMASL1B_16962_15_20160927_1412_1446_V01.hdf', 'eMASL2CLD_16962_14_20160927_1339_1412_20180925_0715.nc4'), ('eMASL1B_16962_16_20160927_1446_1505_V01.hdf', 'eMASL2CLD_16962_15_20160927_1412_1446_20180925_0918.nc4')]
Number of files:
print(len(granule_name_list))
138
Create a json file
Note: the file can be downloaded here
import urllib.request, json
ladsweb_url = 'https://ladsweb.modaps.eosdis.nasa.gov/archive/MAS_eMAS/ORACLES.json'
with urllib.request.urlopen(ladsweb_url) as url:
data = json.loads(url.read().decode())
granule_name_list = []
data_json = {}
for day in data:
print(day)
print(day['name'])
ladsweb_url = 'https://ladsweb.modaps.eosdis.nasa.gov/archive/MAS_eMAS/ORACLES/{}/eMASL1B.json.json'.format(day['name'])
with urllib.request.urlopen(ladsweb_url) as url:
eMASL1B_data = json.loads(url.read().decode())
ladsweb_url = 'https://ladsweb.modaps.eosdis.nasa.gov/archive/MAS_eMAS/ORACLES/{}/eMASL2CLD.json'.format(day['name'])
with urllib.request.urlopen(ladsweb_url) as url:
eMASL2CLD_data = json.loads(url.read().decode())
for eMASL1B,eMASL2CLD in zip(eMASL1B_data,eMASL2CLD_data):
dic_values = {}
dic_values['eMASL2CLD'] = eMASL2CLD['name']
dic_values['name'] = day['name']
dic_values['last-modified'] = eMASL2CLD['last-modified']
dic_values['size'] = eMASL2CLD['size']
#print(dic_values)
data_json[eMASL1B['name']] = dic_values
granule_name_list.append((eMASL1B['name'],eMASL2CLD['name']))
print(granule_name_list)
print(len(granule_name_list))
with open('mas_emas_oracles.json', 'w') as fp:
json.dump(data_json, fp, sort_keys=False, indent=4)
References
Link | WebSite |
---|---|
MODIS Airborne Simulator | mas.arc.nasa.gov |
LAADS DAAC | ladsweb.modaps.eosdis.nasa.gov |