From 3e7c8bb5ef036ab71099de4a73ba8acacf501a52 Mon Sep 17 00:00:00 2001 From: Peter Baumgartner Date: Tue, 31 Oct 2023 00:24:04 +0000 Subject: [PATCH] Move JSON data into Python files The JSON data won't be installed with the Python package without jump through some extra hoops in `setup.py`. It's a pain to do there, so this makes them Python objects upfront. --- .../toar_locations.json => airpy/configs.py | 105 +++++++++++++++++- airpy/generate_config.py | 15 +-- configs/.DS_Store | Bin 6148 -> 0 bytes configs/gee_collections.json | 36 ------ configs/globe_coords.json | 65 ----------- 5 files changed, 109 insertions(+), 112 deletions(-) rename configs/toar_locations.json => airpy/configs.py (74%) delete mode 100644 configs/.DS_Store delete mode 100644 configs/gee_collections.json delete mode 100644 configs/globe_coords.json diff --git a/configs/toar_locations.json b/airpy/configs.py similarity index 74% rename from configs/toar_locations.json rename to airpy/configs.py index d79e82b..5e85756 100644 --- a/configs/toar_locations.json +++ b/airpy/configs.py @@ -1,4 +1,107 @@ -{"toar2": { +GEE_COLLECTIONS = { + "gee_dataset": { + "modis": { + "name": "modis", + "collection": "MODIS/006/MCD12Q1", + "band": "LC_Type1", + "t_cadence": "yearly", + "min_date": "2001-01-01", + "max_date": "2021-01-01" + }, + "population": { + "name": "pop", + "collection": "CIESIN/GPWv411/GPW_Population_Density", + "band": "population_density", + "t_cadence": "yearly", + "min_date": "2000-01-01", + "max_date": "2020-01-01" + }, + "fire": { + "name": "fire", + "collection": "ESA/CCI/FireCCI/5_1", + "band": "LandCover", + "t_cadence": "yearly", + "min_date": "2001-01-01", + "max_date": "2020-12-01" + }, + "nightlight": { + "name": "nightlight", + "collection": "NOAA/VIIRS/DNB/MONTHLY_V1/VCMCFG", + "band": "avg_rad", + "t_cadence": "monthly", + "min_date": "2012-04-01", + "max_date": "2023-01-01" + } + } +} + +GLOBE_COORDS = {"globe": { + "lats": [-89.142, -88.029, -86.911, -85.791, -84.67, -83.549, -82.428, + -81.307, -80.185, -79.064, -77.943, -76.821, -75.7, -74.578, + -73.457, -72.336, -71.214, -70.093, -68.971, -67.85, -66.728, + -65.607, -64.485, -63.364, -62.242, -61.121, -60.0, -58.878, + -57.757, -56.635, -55.514, -54.392, -53.271, -52.149, -51.028, + -49.906, -48.785, -47.663, -46.542, -45.42, -44.299, -43.177, + -42.056, -40.934, -39.813, -38.691, -37.57, -36.448, -35.327, + -34.205, -33.084, -31.962, -30.841, -29.719, -28.598, -27.476, + -26.355, -25.234, -24.112, -22.991, -21.869, -20.748, -19.626, + -18.505, -17.383, -16.262, -15.14, -14.019, -12.897, -11.776, + -11.654, -9.5327, -8.4112, -7.2897, -6.1682, -5.0467, + -3.9252, -2.8037, -1.6822, -0.56074, 0.56074, 1.6822, 2.8037, + 3.9252, 5.0467, 6.1682, 7.2897, 8.4112, 9.5327, 10.654, 11.776, + 12.897, 14.019, 15.14, 16.262, 17.383, 18.505, 19.626, 20.748, + 21.869, 22.991, 24.112, 25.234, 26.355, 27.476, 28.598, 29.719, + 30.841, 31.962, 33.084, 34.205, 35.327, 36.448, 37.57, 38.691, + 39.813, 40.934, 42.056, 43.177, 44.299, 45.42, 46.542, 47.663, + 48.785, 49.906, 51.028, 52.149, 53.271, 54.392, 55.514, 56.635, + 57.757, 58.878, 60.0, 61.121, 62.242, 63.364, 64.485, 65.607, + 66.728, 67.85, 68.971, 70.093, 71.214, 72.336, 73.457, 74.578, + 75.7, 76.821, 77.943, 79.064, 80.183, 81.307, 82.428, 83.549, + 84.67, 85.791, 86.911, 88.029, 89.142], + "lons": [-180.0, -178.875, -177.75, -176.625, -175.5, -174.375, -173.25, + -172.125, -171.0, -169.875, -168.75, -167.625, -166.5, -165.375, + -164.25, -163.125, -162.0, -160.875, -159.75, -158.625, -157.5, + -156.375, -155.25, -154.125, -153.0, -151.875, -150.75, -149.625, + -148.5, -147.375, -146.25, -145.125, -144.0, -142.875, -141.75, + -140.625, -139.5, -138.375, -137.25, -136.125, -135.0, -133.875, + -132.75, -131.625, -130.5, -129.375, -128.25, -127.125, -126.0, + -124.875, -123.75, -122.625, -121.5, -120.375, -119.25, -118.125, + -117.0, -115.875, -114.75, -113.625, -112.5, -111.375, -110.25, + -109.125, -108.0, -106.875, -105.75, -104.625, -103.5, -102.375, + -101.25, -100.125, -99.0, -97.875, -96.75, -95.625, -94.5, -93.375, + -92.25, -91.125, -90.0, -88.875, -87.75, -86.625, -85.5, -84.375, + -83.25, -82.125, -81.0, -79.875, -78.75, -77.625, -76.5, -75.375, + -74.25, -73.125, -72.0, -70.875, -69.75, -68.625, -67.5, -66.375, + -65.25, -64.125, -63.0, -61.875, -60.75, -59.625, -58.5, -57.375, + -56.25, -55.125, -54.0, -52.875, -51.75, -50.625, -49.5, -48.375, + -47.25, -46.125, -45.0, -43.875, -42.75, -41.625, -40.5, -39.375, + -38.25, -37.125, -36.0, -34.875, -33.75, -32.625, -31.5, -30.375, + -29.25, -28.125, -27.0, -25.875, -24.75, -23.625, -22.5, -21.375, + -20.25, -19.125, -18.0, -16.875, -15.75, -14.625, -13.5, -12.375, + -11.25, -10.125, -9.0, -7.875, -6.75, -5.625, -4.5, -3.375, -2.25, + -1.125, 0.0, 1.125, 2.25, 3.375, 4.5, 5.625, 6.75 , 7.875, 9.0, + 10.125, 11.25, 12.375, 13.5, 14.625, 15.75, 16.875, 18.0, 19.125, + 20.25, 21.375, 22.5, 23.625, 24.75, 25.875, 27.0, 28.125, 29.25, + 30.375, 31.5, 32.625, 33.75, 34.875, 36.0, 37.125, 38.25, 39.375, + 40.5, 41.625, 42.75, 43.875, 45.0, 46.125, 47.25, 48.375, 49.5, + 50.625, 51.75, 52.875, 54.0, 55.125, 56.25, 57.375, 58.5, 59.625, + 60.75, 61.875, 63.0, 64.125, 65.25, 66.375, 67.5, 68.625, 69.75, + 70.875, 72.0, 73.125, 74.25, 75.375, 76.5, 77.625, 78.75, 79.875, + 81.0, 82.125, 83.25, 84.375, 85.5, 86.625, 87.75, 88.875, 90.0, + 91.125, 92.25, 93.375, 94.5, 95.625, 96.75, 97.875, 99.0, 100.125, + 101.25, 102.375, 103.5, 104.625, 105.75, 106.875, 108.0, 109.125, + 110.25, 111.375, 112.5, 113.625, 114.75, 115.875, 117.0, 118.125, + 119.25, 120.375, 121.5,122.625, 123.75, 124.875, 126.0, 127.125, + 128.25, 129.375, 130.5, 131.625, 132.75, 133.875, 135.0, 136.125, + 137.25, 138.375, 139.5, 140.625, 141.75, 142.875, 144.0, 145.125, + 146.25, 147.375, 148.5, 149.625, 150.75, 151.875, 153.0, 154.125, + 155.25, 156.375, 157.5, 158.625, 159.75, 160.875, 162.0, 163.125, + 164.25, 165.375, 166.5, 167.625, 168.75, 169.875, 171.0, 172.125, + 173.25, 174.375, 175.5, 176.625, 177.75, 178.875] + } +} + +TOAR_LOCATIONS = {"toar2": { "lats":[-77.943, -77.943, -75.7, -75.7, -72.336, -71.214, -70.093, -64.485, -55.514, -45.42, -42.056, -40.934, -38.691, -38.691, -38.691, -38.691, -37.57, -36.448, -35.327, -35.327, -35.327, -35.327, -35.327, -34.205, -34.205, -34.205, -34.205, -33.084, -33.084, -31.962, -31.962, -31.962, -30.841, -28.598, -28.598, -27.476, -27.476, -27.476, -26.355, -26.355, -26.355, -26.355, -24.112, -24.112, -24.112, -24.112, -22.991, -21.869, -19.626, -15.14, -9.5327, -8.4112, -7.2897, -6.1682, -3.9252, -3.9252, -2.8037, -0.56074, -0.56074, 3.9252, 3.9252, 3.9252, 3.9252, 5.0467, 6.1682, 12.897, 12.897, 12.897, 14.019, 14.019, 15.14, 16.262, 18.505, 18.505, 18.505, 20.748, 20.748, 21.869, 21.869, 22.991, 22.991, 22.991, 24.112, 24.112, 24.112, 24.112, 24.112, 24.112, 25.234, 25.234, 25.234, 26.355, 26.355, 26.355, 26.355, 26.355, 26.355, 27.476, 27.476, 27.476, 27.476, 27.476, 27.476, 27.476, 27.476, 27.476, 28.598, 28.598, 28.598, 28.598, 28.598, 28.598, 28.598, 29.719, 29.719, 29.719, 29.719, 29.719, 29.719, 29.719, 29.719, 29.719, 29.719, 29.719, 29.719, 29.719, 29.719, 29.719, 29.719, 30.841, 30.841, 30.841, 30.841, 30.841, 30.841, 30.841, 30.841, 30.841, 30.841, 30.841, 31.962, 31.962, 31.962, 31.962, 31.962, 31.962, 31.962, 31.962, 31.962, 31.962, 31.962, 31.962, 31.962, 31.962, 31.962, 31.962, 31.962, 31.962, 31.962, 31.962, 31.962, 31.962, 31.962, 31.962, 31.962, 33.084, 33.084, 33.084, 33.084, 33.084, 33.084, 33.084, 33.084, 33.084, 33.084, 33.084, 33.084, 33.084, 33.084, 33.084, 33.084, 33.084, 33.084, 33.084, 33.084, 33.084, 33.084, 33.084, 33.084, 34.205, 34.205, 34.205, 34.205, 34.205, 34.205, 34.205, 34.205, 34.205, 34.205, 34.205, 34.205, 34.205, 34.205, 34.205, 34.205, 34.205, 34.205, 34.205, 34.205, 34.205, 34.205, 34.205, 34.205, 34.205, 34.205, 34.205, 34.205, 34.205, 34.205, 34.205, 34.205, 34.205, 35.327, 35.327, 35.327, 35.327, 35.327, 35.327, 35.327, 35.327, 35.327, 35.327, 35.327, 35.327, 35.327, 35.327, 35.327, 35.327, 35.327, 35.327, 35.327, 35.327, 35.327, 35.327, 35.327, 35.327, 35.327, 35.327, 35.327, 35.327, 35.327, 35.327, 35.327, 35.327, 35.327, 35.327, 35.327, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 36.448, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 37.57, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 38.691, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 39.813, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 40.934, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 42.056, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 43.177, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 44.299, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 45.42, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 46.542, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 47.663, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 48.785, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 49.906, 51.028, 51.028, 51.028, 51.028, 51.028, 51.028, 51.028, 51.028, 51.028, 51.028, 51.028, 51.028, 51.028, 51.028, 51.028, 51.028, 51.028, 51.028, 51.028, 51.028, 51.028, 51.028, 51.028, 51.028, 51.028, 51.028, 51.028, 51.028, 51.028, 51.028, 51.028, 51.028, 51.028, 51.028, 51.028, 52.149, 52.149, 52.149, 52.149, 52.149, 52.149, 52.149, 52.149, 52.149, 52.149, 52.149, 52.149, 52.149, 52.149, 52.149, 52.149, 52.149, 52.149, 52.149, 52.149, 52.149, 52.149, 52.149, 52.149, 52.149, 52.149, 52.149, 52.149, 52.149, 52.149, 52.149, 52.149, 52.149, 53.271, 53.271, 53.271, 53.271, 53.271, 53.271, 53.271, 53.271, 53.271, 53.271, 53.271, 53.271, 53.271, 53.271, 53.271, 53.271, 53.271, 53.271, 53.271, 53.271, 53.271, 53.271, 53.271, 53.271, 53.271, 53.271, 53.271, 53.271, 53.271, 53.271, 53.271, 53.271, 54.392, 54.392, 54.392, 54.392, 54.392, 54.392, 54.392, 54.392, 54.392, 54.392, 54.392, 54.392, 54.392, 54.392, 54.392, 54.392, 54.392, 54.392, 54.392, 54.392, 54.392, 54.392, 54.392, 54.392, 54.392, 55.514, 55.514, 55.514, 55.514, 55.514, 55.514, 55.514, 55.514, 55.514, 55.514, 55.514, 55.514, 55.514, 55.514, 55.514, 55.514, 56.635, 56.635, 56.635, 56.635, 56.635, 56.635, 56.635, 56.635, 56.635, 56.635, 56.635, 56.635, 57.757, 57.757, 57.757, 57.757, 57.757, 57.757, 57.757, 57.757, 57.757, 57.757, 57.757, 58.878, 58.878, 58.878, 58.878, 58.878, 58.878, 58.878, 58.878, 58.878, 58.878, 58.878, 58.878, 58.878, 58.878, 58.878, 58.878, 58.878, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 61.121, 61.121, 61.121, 61.121, 61.121, 61.121, 61.121, 61.121, 61.121, 62.242, 62.242, 62.242, 62.242, 62.242, 62.242, 62.242, 62.242, 62.242, 62.242, 62.242, 62.242, 63.364, 63.364, 63.364, 63.364, 63.364, 63.364, 63.364, 63.364, 63.364, 63.364, 63.364, 63.364, 64.485, 64.485, 64.485, 64.485, 64.485, 64.485, 64.485, 64.485, 64.485, 65.607, 65.607, 65.607, 65.607, 66.728, 67.85, 67.85, 67.85, 67.85, 67.85, 68.971, 68.971, 68.971, 68.971, 71.214, 72.336, 77.943, 82.428], "lons":[-34.875, 166.5, -27.0, 122.625, 2.25, -9.0, 39.375, -57.375, -68.625, 168.75, 174.375, 144.0, 76.5, 144.0, 145.125, 146.25, 174.375, 148.5, 18.0, 138.375, 148.5, 149.625, 150.75, -72.0, -70.875, 149.625, 150.75, 114.75, 150.75, -64.125, 114.75, 115.875, -70.875, 151.875, 153.0, 27.0, 29.25, 153.0, -58.5, 27.0, 28.125, 29.25, -48.375, -47.25, -46.125, 150.75, -66.375, 55.125, 146.25, -171.0, -64.125, 112.5, 106.875, 105.75, -60.75, -55.125, -60.75, 37.125, 100.125, -74.25, -52.875, 101.25, 117.0, -76.5, -76.5, -59.625, 78.75, 100.125, -61.875, 97.875, -61.875, -25.875, -156.375, -100.125, 97.875, -158.625, 103.5, 119.25, 120.375, 5.625, 119.25, 120.375, 120.375, 121.5, 122.625, 123.75, 124.875, 153.0, -82.125, -81.0, 127.125, -83.25, -82.125, -81.0, 127.125, 128.25, 141.75, -83.25, -82.125, -81.0, -18.0, -16.875, -15.75, -14.625, 86.625, 99.0, -103.5, -92.25, -83.25, -82.125, -81.0, -18.0, -14.625, -95.625, -94.5, -93.375, -92.25, -91.125, -90.0, -88.875, -87.75, -86.625, -85.5, -84.375, -83.25, -82.125, 30.375, 76.5, 119.25, -111.375, -97.875, -93.375, -86.625, -85.5, -84.375, -82.125, 33.75, 34.875, 129.375, 130.5, -118.125, -117.0, -115.875, -114.75, -112.5, -111.375, -110.25, -94.5, -92.25, -91.125, -88.875, -86.625, -85.5, -84.375, -82.125, -65.25, -18.0, -16.875, 33.75, 34.875, 124.875, 128.25, 129.375, 130.5, 131.625, -119.25, -118.125, -117.0, -115.875, -114.75, -113.625, -112.5, -111.375, -93.375, -90.0, -87.75, -86.625, -85.5, -84.375, -83.25, -82.125, 126.0, 129.375, 130.5, 131.625, 132.75, 133.875, 135.0, 136.125, -121.5, -120.375, -119.25, -118.125, -115.875, -113.625, -112.5, -110.25, -102.375, -94.5, -93.375, -91.125, -88.875, -87.75, -86.625, -85.5, -84.375, -79.875, -77.625, 24.75, 32.625, 126.0, 127.125, 128.25, 130.5, 131.625, 132.75, 133.875, 135.0, 136.125, 137.25, 138.375, 139.5, -121.5, -120.375, -119.25, -118.125, -115.875, -112.5, -97.875, -95.625, -94.5, -93.375, -91.125, -86.625, -84.375, -82.125, -6.75, -5.625, 12.375, 13.5, 14.625, 24.75, 36.0, 50.625, 100.125, 126.0, 127.125, 128.25, 129.375, 132.75, 133.875, 135.0, 136.125, 137.25, 138.375, 139.5, 140.625, -122.625, -121.5, -120.375, -119.25, -117.0, -109.125, -108.0, -97.875, -88.875, -87.75, -86.625, -85.5, -84.375, -83.25, -81.0, -78.75, -9.0, -7.875, -6.75, -5.625, -4.5, -3.375, -2.25, -1.125, 12.375, 13.5, 14.625, 28.125, 30.375, 32.625, 33.75, 34.875, 36.0, 37.125, 38.25, 40.5, 126.0, 127.125, 128.25, 130.5, 136.125, 137.25, 138.375, 139.5, 140.625, -123.75, -122.625, -121.5, -120.375, -110.25, -109.125, -105.75, -97.875, -95.625, -91.125, -90.0, -88.875, -87.75, -86.625, -85.5, -83.25, -78.75, -77.625, -76.5, -29.25, -10.125, -9.0, -7.875, -6.75, -5.625, -4.5, -3.375, -2.25, -1.125, 12.375, 13.5, 14.625, 15.75, 21.375, 22.5, 23.625, 27.0, 28.125, 29.25, 30.375, 31.5, 33.75, 36.0, 37.125, 38.25, 39.375, 40.5, 123.75, 126.0, 127.125, 128.25, 138.375, 139.5, 140.625, -123.75, -122.625, -121.5, -120.375, -114.75, -109.125, -108.0, -106.875, -105.75, -104.625, -100.125, -96.75, -95.625, -91.125, -90.0, -88.875, -87.75, -86.625, -85.5, -84.375, -81.0, -79.875, -77.625, -76.5, -75.375, -10.125, -9.0, -7.875, -6.75, -4.5, -2.25, -1.125, 1.125, 2.25, 7.875, 9.0, 15.75, 16.875, 20.25, 21.375, 22.5, 27.0, 29.25, 30.375, 33.75, 34.875, 36.0, 39.375, 40.5, 114.75, 139.5, 140.625, 141.75, -124.875, -123.75, -122.625, -121.5, -115.875, -112.5, -110.25, -109.125, -108.0, -106.875, -105.75, -104.625, -92.25, -90.0, -88.875, -86.625, -85.5, -83.25, -82.125, -81.0, -79.875, -78.75, -77.625, -76.5, -75.375, -9.0, -7.875, -6.75, -5.625, -4.5, -3.375, -2.25, -1.125, 0.0, 2.25, 3.375, 7.875, 9.0, 13.5, 14.625, 15.75, 16.875, 18.0, 19.125, 20.25, 22.5, 25.875, 28.125, 29.25, 30.375, 31.5, 32.625, 33.75, 34.875, 36.0, 38.25, 39.375, 40.5, 115.875, 117.0, 139.5, 140.625, -124.875, -123.75, -114.75, -112.5, -106.875, -103.5, -96.75, -95.625, -94.5, -92.25, -91.125, -88.875, -87.75, -86.625, -85.5, -81.0, -79.875, -75.375, -74.25, -73.125, -9.0, -7.875, -6.75, -5.625, -4.5, -3.375, -2.25, -1.125, 0.0, 1.125, 2.25, 7.875, 11.25, 12.375, 13.5, 14.625, 15.75, 16.875, 19.125, 20.25, 21.375, 22.5, 23.625, 24.75, 25.875, 27.0, 28.125, 31.5, 33.75, 34.875, 36.0, 37.125, 39.375, 40.5, 41.625, 139.5, 140.625, -110.25, -105.75, -97.875, -95.625, -93.375, -92.25, -90.0, -88.875, -87.75, -84.375, -83.25, -82.125, -81.0, -79.875, -77.625, -73.125, -72.0, -70.875, -10.125, -9.0, -7.875, -6.75, -5.625, -4.5, -3.375, -2.25, -1.125, 0.0, 1.125, 2.25, 5.625, 9.0, 10.125, 11.25, 12.375, 13.5, 15.75, 18.0, 19.125, 20.25, 21.375, 22.5, 24.75, 25.875, 27.0, 76.5, 140.625, 141.75, 144.0, 145.125, -122.625, -117.0, -115.875, -113.625, -109.125, -104.625, -103.5, -86.625, -84.375, -82.125, -81.0, -79.875, -77.625, -74.25, -72.0, -70.875, -66.375, -60.75, -9.0, -7.875, -6.75, -5.625, -4.5, -3.375, -2.25, -1.125, 0.0, 1.125, 2.25, 3.375, 4.5, 5.625, 6.75, 7.875, 9.0, 10.125, 11.25, 12.375, 13.5, 18.0, 19.125, 21.375, 22.5, 23.625, 24.75, 25.875, 27.0, 28.125, 41.625, 141.75, -111.375, -106.875, -91.125, -82.125, -81.0, -79.875, -78.75, -76.5, -75.375, -74.25, -73.125, -72.0, -69.75, -68.625, -67.5, -66.375, -65.25, -64.125, -2.25, -1.125, 0.0, 1.125, 2.25, 3.375, 4.5, 5.625, 6.75, 7.875, 9.0, 10.125, 11.25, 12.375, 13.5, 16.875, 18.0, 19.125, 20.25, 21.375, 22.5, 23.625, 24.75, 25.875, 27.0, 28.125, 127.125, 140.625, -119.25, -84.375, -82.125, -81.0, -79.875, -77.625, -76.5, -75.375, -74.25, -73.125, -72.0, -70.875, -67.5, -66.375, -65.25, -64.125, -63.0, -61.875, -60.75, -2.25, -1.125, 0.0, 1.125, 2.25, 3.375, 4.5, 5.625, 6.75, 7.875, 9.0, 10.125, 11.25, 12.375, 13.5, 14.625, 15.75, 18.0, 19.125, 20.25, 21.375, 22.5, 23.625, 24.75, 25.875, 27.0, -122.625, -103.5, -93.375, -85.5, -79.875, -76.5, -73.125, -72.0, -70.875, -68.625, -66.375, -52.875, -3.375, -2.25, -1.125, 0.0, 1.125, 2.25, 3.375, 4.5, 5.625, 6.75, 7.875, 9.0, 10.125, 11.25, 12.375, 13.5, 14.625, 15.75, 16.875, 18.0, 19.125, 20.25, 21.375, 22.5, 23.625, 24.75, 25.875, 27.0, 87.75, -123.75, -121.5, -117.0, -114.75, -93.375, -90.0, -79.875, -77.625, -72.0, -69.75, -4.5, -3.375, -2.25, -1.125, 0.0, 1.125, 2.25, 3.375, 4.5, 5.625, 6.75, 7.875, 9.0, 10.125, 11.25, 12.375, 13.5, 14.625, 15.75, 16.875, 18.0, 19.125, 20.25, 21.375, 22.5, 23.625, 25.875, -126.0, -124.875, -123.75, -122.625, -121.5, -120.375, -118.125, -117.0, -113.625, -100.125, -97.875, -94.5, -82.125, -75.375, -73.125, -58.5, -56.25, -2.25, -1.125, 0.0, 1.125, 2.25, 3.375, 4.5, 5.625, 6.75, 7.875, 9.0, 10.125, 11.25, 12.375, 13.5, 14.625, 15.75, 16.875, 18.0, 19.125, 20.25, 21.375, 22.5, -126.0, -123.75, -121.5, -120.375, -114.75, -111.375, -108.0, -105.75, -104.625, -97.875, -65.25, -57.375, -4.5, -3.375, -2.25, -1.125, 0.0, 1.125, 2.25, 3.375, 4.5, 5.625, 6.75, 7.875, 9.0, 10.125, 11.25, 12.375, 13.5, 14.625, 15.75, 16.875, 18.0, 19.125, 20.25, 21.375, 22.5, -122.625, -117.0, -115.875, -114.75, -113.625, -110.25, -106.875, -91.125, -9.0, -5.625, -4.5, -3.375, -2.25, -1.125, 0.0, 2.25, 3.375, 4.5, 5.625, 6.75, 7.875, 9.0, 10.125, 11.25, 12.375, 13.5, 14.625, 15.75, 16.875, 18.0, 19.125, 20.25, 21.375, 22.5, 23.625, -122.625, -115.875, -114.75, -113.625, -106.875, -10.125, -9.0, -7.875, -6.75, -4.5, -3.375, -2.25, -1.125, 0.0, 1.125, 4.5, 5.625, 6.75, 7.875, 9.0, 10.125, 11.25, 12.375, 13.5, 14.625, 15.75, 16.875, 18.0, 19.125, 20.25, 21.375, 22.5, 23.625, -123.75, -119.25, -118.125, -117.0, -115.875, -114.75, -113.625, -112.5, -60.75, -10.125, -7.875, -6.75, -3.375, -2.25, -1.125, 5.625, 6.75, 7.875, 9.0, 10.125, 11.25, 12.375, 13.5, 14.625, 15.75, 16.875, 18.0, 19.125, 20.25, 21.375, 22.5, 23.625, -128.25, -120.375, -119.25, -114.75, -110.25, -102.375, -9.0, -7.875, -6.75, -4.5, -3.375, -2.25, -1.125, 7.875, 9.0, 10.125, 11.25, 12.375, 16.875, 18.0, 20.25, 23.625, 24.75, 25.875, 37.125, -97.875, -5.625, -4.5, -3.375, 7.875, 9.0, 10.125, 11.25, 12.375, 14.625, 20.25, 21.375, 22.5, 23.625, 25.875, 27.0, -112.5, -5.625, -4.5, -2.25, 9.0, 11.25, 12.375, 14.625, 21.375, 23.625, 24.75, 25.875, -111.375, 6.75, 7.875, 11.25, 12.375, 13.5, 14.625, 15.75, 16.875, 21.375, 25.875, 4.5, 5.625, 9.0, 10.125, 11.25, 14.625, 15.75, 16.875, 18.0, 20.25, 21.375, 22.5, 23.625, 24.75, 25.875, 27.0, 28.125, -136.125, -123.75, -2.25, 4.5, 5.625, 10.125, 14.625, 21.375, 22.5, 23.625, 24.75, 25.875, 27.0, 28.125, -150.75, -149.625, 10.125, 11.25, 21.375, 23.625, 24.75, 27.0, 28.125, -114.75, 5.625, 7.875, 10.125, 15.75, 16.875, 21.375, 23.625, 24.75, 27.0, 29.25, 30.375, -149.625, -117.0, -22.5, -21.375, -20.25, -19.125, 10.125, 14.625, 19.125, 20.25, 22.5, 27.0, -148.5, -127.125, -22.5, -14.625, 20.25, 21.375, 23.625, 24.75, 42.75, -19.125, 13.5, 15.75, 29.25, 25.875, -149.625, -133.875, 20.25, 23.625, 28.125, 18.0, 24.75, 29.25, 30.375, -157.5, -39.375, 11.25, -63.0] } diff --git a/airpy/generate_config.py b/airpy/generate_config.py index c0039ff..27761d6 100644 --- a/airpy/generate_config.py +++ b/airpy/generate_config.py @@ -8,6 +8,8 @@ from datetime import datetime import os +from . import configs + class GenerateConfig(): def __init__(self, gee_data, region, date, analysis_type, add_time, @@ -26,12 +28,7 @@ def get_gee_collection_data(self): Query json for GEE collection of interest :return: GEE collection dictionary """ - collection_file = '../configs/gee_collections.json' - if not os.path.isfile(collection_file): - raise FileNotFoundError - else: - with open('{}'.format(collection_file), 'r') as file: - data_collection = json.load(file) + data_collection = configs.GEE_COLLECTIONS if self.gee_data not in data_collection['gee_dataset'].keys(): raise(ValueError('Dataset not supported. Please select one of modis, fire, population, or nightlight')) @@ -73,14 +70,12 @@ def get_boundary(self): """ # Check if region is TOAR2 locations only if self.region == 'toar2': - with open('../configs/toar_locations.json', 'r') as file: - toar_vals = json.load(file) + toar_vals = configs.TOAR_LOCATIONS return {'extent': '{}'.format(self.region), 'lats': toar_vals['toar2']['lats'], 'lons': toar_vals['toar2']['lons']} # get globe vals - with open('../configs/globe_coords.json', 'r') as file: - globe_vals = json.load(file) + globe_vals = configs.GLOBE_COORDS # Check aus, west, east, europe & na bounds bbox_dict = { diff --git a/configs/.DS_Store b/configs/.DS_Store deleted file mode 100644 index ed114d0b3c861622ae24582de993444f1fa6086c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKu}T9$5PhR50yZaDSZ-@0*lBl!Scs(`5V=c~$l-yB{r;9;r*CG*kmv-++!0F2obMV$fD;lZf`4?ZM{aV+tO8P-@}H9+(ihji@~TJ(6v z1Gd+{#yOt256;|lecN<>W3iAk;^n&={S)qb!QaeyI&}0~s<1TH)jl5FGWTkW=a@Vl zbD9lTj~C3jhCM66+ZP5thJ^y5KqwFjgaSV(z&l%Qd{i*{P#_ct1vU!k`HNBo(%mtN2$1R;09|9&wbfLg6DDVNF-9^>_ diff --git a/configs/gee_collections.json b/configs/gee_collections.json deleted file mode 100644 index ff61053..0000000 --- a/configs/gee_collections.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "gee_dataset": { - "modis": { - "name": "modis", - "collection": "MODIS/006/MCD12Q1", - "band": "LC_Type1", - "t_cadence": "yearly", - "min_date": "2001-01-01", - "max_date": "2021-01-01" - }, - "population": { - "name": "pop", - "collection": "CIESIN/GPWv411/GPW_Population_Density", - "band": "population_density", - "t_cadence": "yearly", - "min_date": "2000-01-01", - "max_date": "2020-01-01" - }, - "fire": { - "name": "fire", - "collection": "ESA/CCI/FireCCI/5_1", - "band": "LandCover", - "t_cadence": "yearly", - "min_date": "2001-01-01", - "max_date": "2020-12-01" - }, - "nightlight": { - "name": "nightlight", - "collection": "NOAA/VIIRS/DNB/MONTHLY_V1/VCMCFG", - "band": "avg_rad", - "t_cadence": "monthly", - "min_date": "2012-04-01", - "max_date": "2023-01-01" - } - } -} \ No newline at end of file diff --git a/configs/globe_coords.json b/configs/globe_coords.json deleted file mode 100644 index 34d0464..0000000 --- a/configs/globe_coords.json +++ /dev/null @@ -1,65 +0,0 @@ -{"globe": { - "lats": [-89.142, -88.029, -86.911, -85.791, -84.67, -83.549, -82.428, - -81.307, -80.185, -79.064, -77.943, -76.821, -75.7, -74.578, - -73.457, -72.336, -71.214, -70.093, -68.971, -67.85, -66.728, - -65.607, -64.485, -63.364, -62.242, -61.121, -60.0, -58.878, - -57.757, -56.635, -55.514, -54.392, -53.271, -52.149, -51.028, - -49.906, -48.785, -47.663, -46.542, -45.42, -44.299, -43.177, - -42.056, -40.934, -39.813, -38.691, -37.57, -36.448, -35.327, - -34.205, -33.084, -31.962, -30.841, -29.719, -28.598, -27.476, - -26.355, -25.234, -24.112, -22.991, -21.869, -20.748, -19.626, - -18.505, -17.383, -16.262, -15.14, -14.019, -12.897, -11.776, - -11.654, -9.5327, -8.4112, -7.2897, -6.1682, -5.0467, - -3.9252, -2.8037, -1.6822, -0.56074, 0.56074, 1.6822, 2.8037, - 3.9252, 5.0467, 6.1682, 7.2897, 8.4112, 9.5327, 10.654, 11.776, - 12.897, 14.019, 15.14, 16.262, 17.383, 18.505, 19.626, 20.748, - 21.869, 22.991, 24.112, 25.234, 26.355, 27.476, 28.598, 29.719, - 30.841, 31.962, 33.084, 34.205, 35.327, 36.448, 37.57, 38.691, - 39.813, 40.934, 42.056, 43.177, 44.299, 45.42, 46.542, 47.663, - 48.785, 49.906, 51.028, 52.149, 53.271, 54.392, 55.514, 56.635, - 57.757, 58.878, 60.0, 61.121, 62.242, 63.364, 64.485, 65.607, - 66.728, 67.85, 68.971, 70.093, 71.214, 72.336, 73.457, 74.578, - 75.7, 76.821, 77.943, 79.064, 80.183, 81.307, 82.428, 83.549, - 84.67, 85.791, 86.911, 88.029, 89.142], - "lons": [-180.0, -178.875, -177.75, -176.625, -175.5, -174.375, -173.25, - -172.125, -171.0, -169.875, -168.75, -167.625, -166.5, -165.375, - -164.25, -163.125, -162.0, -160.875, -159.75, -158.625, -157.5, - -156.375, -155.25, -154.125, -153.0, -151.875, -150.75, -149.625, - -148.5, -147.375, -146.25, -145.125, -144.0, -142.875, -141.75, - -140.625, -139.5, -138.375, -137.25, -136.125, -135.0, -133.875, - -132.75, -131.625, -130.5, -129.375, -128.25, -127.125, -126.0, - -124.875, -123.75, -122.625, -121.5, -120.375, -119.25, -118.125, - -117.0, -115.875, -114.75, -113.625, -112.5, -111.375, -110.25, - -109.125, -108.0, -106.875, -105.75, -104.625, -103.5, -102.375, - -101.25, -100.125, -99.0, -97.875, -96.75, -95.625, -94.5, -93.375, - -92.25, -91.125, -90.0, -88.875, -87.75, -86.625, -85.5, -84.375, - -83.25, -82.125, -81.0, -79.875, -78.75, -77.625, -76.5, -75.375, - -74.25, -73.125, -72.0, -70.875, -69.75, -68.625, -67.5, -66.375, - -65.25, -64.125, -63.0, -61.875, -60.75, -59.625, -58.5, -57.375, - -56.25, -55.125, -54.0, -52.875, -51.75, -50.625, -49.5, -48.375, - -47.25, -46.125, -45.0, -43.875, -42.75, -41.625, -40.5, -39.375, - -38.25, -37.125, -36.0, -34.875, -33.75, -32.625, -31.5, -30.375, - -29.25, -28.125, -27.0, -25.875, -24.75, -23.625, -22.5, -21.375, - -20.25, -19.125, -18.0, -16.875, -15.75, -14.625, -13.5, -12.375, - -11.25, -10.125, -9.0, -7.875, -6.75, -5.625, -4.5, -3.375, -2.25, - -1.125, 0.0, 1.125, 2.25, 3.375, 4.5, 5.625, 6.75 , 7.875, 9.0, - 10.125, 11.25, 12.375, 13.5, 14.625, 15.75, 16.875, 18.0, 19.125, - 20.25, 21.375, 22.5, 23.625, 24.75, 25.875, 27.0, 28.125, 29.25, - 30.375, 31.5, 32.625, 33.75, 34.875, 36.0, 37.125, 38.25, 39.375, - 40.5, 41.625, 42.75, 43.875, 45.0, 46.125, 47.25, 48.375, 49.5, - 50.625, 51.75, 52.875, 54.0, 55.125, 56.25, 57.375, 58.5, 59.625, - 60.75, 61.875, 63.0, 64.125, 65.25, 66.375, 67.5, 68.625, 69.75, - 70.875, 72.0, 73.125, 74.25, 75.375, 76.5, 77.625, 78.75, 79.875, - 81.0, 82.125, 83.25, 84.375, 85.5, 86.625, 87.75, 88.875, 90.0, - 91.125, 92.25, 93.375, 94.5, 95.625, 96.75, 97.875, 99.0, 100.125, - 101.25, 102.375, 103.5, 104.625, 105.75, 106.875, 108.0, 109.125, - 110.25, 111.375, 112.5, 113.625, 114.75, 115.875, 117.0, 118.125, - 119.25, 120.375, 121.5,122.625, 123.75, 124.875, 126.0, 127.125, - 128.25, 129.375, 130.5, 131.625, 132.75, 133.875, 135.0, 136.125, - 137.25, 138.375, 139.5, 140.625, 141.75, 142.875, 144.0, 145.125, - 146.25, 147.375, 148.5, 149.625, 150.75, 151.875, 153.0, 154.125, - 155.25, 156.375, 157.5, 158.625, 159.75, 160.875, 162.0, 163.125, - 164.25, 165.375, 166.5, 167.625, 168.75, 169.875, 171.0, 172.125, - 173.25, 174.375, 175.5, 176.625, 177.75, 178.875] - } -} \ No newline at end of file