Skip to content

Commit

Permalink
Merge pull request #340 from johnarban/fix-cloud-cover-csv
Browse files Browse the repository at this point in the history
Fix cloud cover csv
  • Loading branch information
patudom authored Jan 22, 2024
2 parents 3855c12 + 40993a9 commit 45f2754
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 57 deletions.
11 changes: 7 additions & 4 deletions solar-eclipse-2024/src/SolarEclipse2024.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1471,13 +1471,16 @@ import { csvParseRows } from "d3-dsv";
// the first row is the longitude values
// the first column is the latitude values
// the data lies in the interior of the matrix
const cloudData = csvParseRows(cloudCover, (d, _i) => {
let cloudData: number[][] = csvParseRows(cloudCover, (d, _i) => {
// loop over the row and convert each value to a number ("+v")
return d.map((v) => +v);
});
const minLat = Math.min(...cloudData.map((d) => d[0]));
const minLon = Math.min(...cloudData[0]);
// lon and lat are first col and row (dropping the first value)
const minLat = Math.min(...cloudData.map(d => d[0]).slice(1));
const minLon = Math.min(...cloudData[0].slice(1));
// get just the inner data grid
cloudData = cloudData.slice(1).map(row => row.slice(1));
console.log("cloud cover data loaded");
Expand Down Expand Up @@ -1970,7 +1973,7 @@ export default defineComponent({
return `Cloud Cover: ${(cc * 100).toFixed(0)}%`;
}
}
return "Cloud Cover: N/A";
return "Outside Range";
},
Expand Down
53 changes: 0 additions & 53 deletions solar-eclipse-2024/src/cloud_cover.ts

This file was deleted.

0 comments on commit 45f2754

Please sign in to comment.