From 9149afc786700319700eb4ab99286fc1842211ea Mon Sep 17 00:00:00 2001 From: Wille Marcel Date: Wed, 6 Nov 2024 11:19:48 +0700 Subject: [PATCH] Add AMISA, CARAFE AND ASCENDS campaigns --- campaigns/AMISA/deployments.yaml | 16 +++++ campaigns/ASCENDS Airborne/deployments.yaml | 74 +++++++++++++++++++++ campaigns/CARAFE/deployments.yaml | 12 ++++ task/src/process.js | 25 +++---- 4 files changed, 113 insertions(+), 14 deletions(-) create mode 100644 campaigns/AMISA/deployments.yaml create mode 100644 campaigns/ASCENDS Airborne/deployments.yaml create mode 100644 campaigns/CARAFE/deployments.yaml diff --git a/campaigns/AMISA/deployments.yaml b/campaigns/AMISA/deployments.yaml new file mode 100644 index 0000000..1eab0ae --- /dev/null +++ b/campaigns/AMISA/deployments.yaml @@ -0,0 +1,16 @@ +--- +deployments: +- name: AMISA-D1_2008 + platforms: + - name: DC-8 + files: + - https://asp-archive.arc.nasa.gov/AMISA/N817NA/2008-07-31/IWG1.31Jul2008-1920 + - https://asp-archive.arc.nasa.gov/AMISA/N817NA/2008-08-05/IWG1.05Aug2008-2032 + - https://asp-archive.arc.nasa.gov/AMISA/N817NA/2008-08-07/IWG1.08Aug2008-1038 + - https://asp-archive.arc.nasa.gov/AMISA/N817NA/2008-08-12/IWG1.13Aug2008-0352 + - https://asp-archive.arc.nasa.gov/AMISA/N817NA/2008-08-15/IWG1.15Aug2008-1515 + - https://asp-archive.arc.nasa.gov/AMISA/N817NA/2008-08-22/IWG1.22Aug2008-1244 + - https://asp-archive.arc.nasa.gov/AMISA/N817NA/2008-08-23/IWG1.23Aug2008-2048 + - https://asp-archive.arc.nasa.gov/AMISA/N817NA/2008-08-25/IWG1.25Aug2008-1930 + - https://asp-archive.arc.nasa.gov/AMISA/N817NA/2008-08-28/IWG1.28Aug2008-1453 + - https://asp-archive.arc.nasa.gov/AMISA/N817NA/2008-07-31/IWG1.xml \ No newline at end of file diff --git a/campaigns/ASCENDS Airborne/deployments.yaml b/campaigns/ASCENDS Airborne/deployments.yaml new file mode 100644 index 0000000..a6d37d1 --- /dev/null +++ b/campaigns/ASCENDS Airborne/deployments.yaml @@ -0,0 +1,74 @@ +--- +deployments: +- name: ASCENDS-D1_2010 + platforms: + - name: DC-8 + files: + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2014-08-13/IWG1.xml + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2010-07-06/IWG1.07Jul2010-0014 + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2010-07-06/IWG1.07Jul2010-0320 + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2010-07-08/IWG1.09Jul2010-0011 + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2010-07-09/IWG1.10Jul2010-0206 + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2010-07-12/IWG1.12Jul2010-1857 + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2010-07-12/IWG1.12Jul2010-2255 + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2010-07-14/IWG1.15Jul2010-0140 + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2010-07-18/IWG1.18Jul2010-2251 +- name: ASCENDS-D2_2011 + platforms: + - name: DC-8 + files: + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2014-08-13/IWG1.xml + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2011-07-26/IWG1.26Jul2011-2159-v2 + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2011-07-28/IWG1.28Jul2011-2256-v2 + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2011-08-02/IWG1.02Aug2011-1902 + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2011-08-03/IWG1.03Aug2011-2256 + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2011-08-07/IWG1.07Aug2011-2253 + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2011-08-09/IWG1.09Aug2011-2144 + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2011-08-10/IWG1.11Aug2011-0051 + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2011-08-11/IWG1.11Aug2011-2311 +- name: ASCENDS-D3_2013 + platforms: + - name: DC-8 + files: + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2014-08-13/IWG1.xml + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2013-02-21/IWG1.21Feb2013-2350 + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2013-02-22/IWG1.23Feb2013-0227 + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2013-02-26/IWG1.26Feb2013-2343 + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2013-02-27/IWG1.28Feb2013-0506 + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2013-03-01/IWG1.02Mar2013-0314 + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2013-03-05/IWG1.05Mar2013-0113 + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2013-03-07/IWG1.08Mar2013-0425 +- name: ASCENDS-D4_2014 + platforms: + - name: DC-8 + files: + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2014-08-13/IWG1.xml + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2014-08-13/IWG1.13Aug2014-2111 + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2014-08-13/IWG1.13Aug2014-2111 + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2014-08-14/IWG1.14Aug2014-2255 + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2014-08-20/IWG1.20Aug2014-2230 + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2014-08-22/IWG1.23Aug2014-0325 + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2014-08-25/IWG1.26Aug2014-0558 + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2014-08-27/IWG1.27Aug2014-0023 + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2014-09-03/IWG1.03Sep2014-1733 +- name: ASCENDS-D5_2016 + platforms: + - name: DC-8 + files: + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2016-02-10/IWG1.xml + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2016-02-10/IWG1.10Feb2016-2151 + - https://asp-archive.arc.nasa.gov/ASCENDS/N817NA/2016-02-11/IWG1.12Feb2016-0246 +- name: ASCENDS-D6_2017 + platforms: + - name: DC-8 + files: + - https://asp-archive.arc.nasa.gov/ASCENDS_2017/N817NA/2017-07-27/IWG1.xml + - https://asp-archive.arc.nasa.gov/ASCENDS_2017/N817NA/2017-07-20/IWG1.21Jul2017-0127 + - https://asp-archive.arc.nasa.gov/ASCENDS_2017/N817NA/2017-07-21/IWG1.22Jul2017-0148 + - https://asp-archive.arc.nasa.gov/ASCENDS_2017/N817NA/2017-07-27/IWG1.28Jul2017-0128 + - https://asp-archive.arc.nasa.gov/ASCENDS_2017/N817NA/2017-07-31/IWG1.01Aug2017-0748 + - https://asp-archive.arc.nasa.gov/ASCENDS_2017/N817NA/2017-08-02/IWG1.03Aug2017-0735 + - https://asp-archive.arc.nasa.gov/ASCENDS_2017/N817NA/2017-08-05/IWG1.05Aug2017-1458 + - https://asp-archive.arc.nasa.gov/ASCENDS_2017/N817NA/2017-08-05/IWG1.05Aug2017-2311 + - https://asp-archive.arc.nasa.gov/ASCENDS_2017/N817NA/2017-08-06/IWG1.06Aug2017-2244 + - https://asp-archive.arc.nasa.gov/ASCENDS_2017/N817NA/2017-08-08/IWG1.09Aug2017-0053 \ No newline at end of file diff --git a/campaigns/CARAFE/deployments.yaml b/campaigns/CARAFE/deployments.yaml new file mode 100644 index 0000000..0be219a --- /dev/null +++ b/campaigns/CARAFE/deployments.yaml @@ -0,0 +1,12 @@ +--- +deployments: +- name: CARAFE-D1_2016 + platforms: + - name: C-23 Sherpa + files: + - https://www-air.larc.nasa.gov/img/tmp/WWW-AIR_1730865968791.zip +- name: CARAFE-D2_2017 + platforms: + - name: C-23 Sherpa + files: + - https://www-air.larc.nasa.gov/img/tmp/WWW-AIR_1730865929216.zip diff --git a/task/src/process.js b/task/src/process.js index 3bf6c58..90edd67 100644 --- a/task/src/process.js +++ b/task/src/process.js @@ -169,22 +169,15 @@ const makeGeoJSON = ( ) => { const file = fs.readFileSync(filePath); const content = file.toString(); - // configure latitude and longitude fields - let latField = 'latitude'; - let lonField = 'longitude'; - if (content.includes('Latitude,') && content.includes('Longitude,')) { - latField = 'Latitude'; - lonField = 'Longitude'; - } let geojson; csv2geojson.csv2geojson( content, { - latfield: latField, - lonfield: lonField, + latfield: 'latitude', + lonfield: 'longitude', delimiter: ',', - numericFields: `${latField},${lonField}`, + numericFields: 'latitude,longitude', }, (err, data) => geojson = data ); @@ -192,10 +185,14 @@ const makeGeoJSON = ( geojson.features = divideCoordinates(geojson.features, coordsDivisor); } // remove invalid coordinates - geojson.features = geojson.features.filter((i) => ( - i.geometry.coordinates[0] >= -180 && i.geometry.coordinates[1] >= -90 - && i.geometry.coordinates[0] <= 180 && i.geometry.coordinates[1] <= 90 - )); + geojson.features = geojson.features + .filter((i) => ( + i.geometry.coordinates[0] >= -180 && i.geometry.coordinates[1] >= -90 + && i.geometry.coordinates[0] <= 180 && i.geometry.coordinates[1] <= 90 + )) + .filter((i) => ( + i.geometry.coordinates[0] !== 0 && i.geometry.coordinates[1] !== 0 + )); geojson = csv2geojson.toLine(geojson); if (fixCoords) { const newCoords = cleanCoords(geojson.features[0].geometry.coordinates, 300);