Skip to content

Commit 10b61ba

Browse files
authored
Merge pull request #550 from ledpup/development
Fix Port Macquarie
2 parents 9bffc71 + b285302 commit 10b61ba

File tree

717 files changed

+70205
-11230
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

717 files changed

+70205
-11230
lines changed

ClimateExplorer.Data.Bom/Bom/AcornSatDownloader.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010

1111
public static class AcornSatDownloader
1212
{
13-
public static void DownloadAndExtractData(string acornSatfileName, string outputFolder, Dictionary<string, string> fileRenames)
13+
public static void DownloadAndExtractData(string acornSatfileName, string outputFolder)
1414
{
1515
if (!Directory.Exists("source-data")) Directory.CreateDirectory("source-data");
1616

1717
byte[] v2DailyTmaxTarGzBytes = CachingFtpHelper.Download("ftp.bom.gov.au", $"/anon/home/ncc/www/change/ACORN_SAT_daily/{acornSatfileName}.tar.gz");
1818

19-
ExtractTarGzToFolder(v2DailyTmaxTarGzBytes, outputFolder, fileRenames);
19+
ExtractTarGzToFolder(v2DailyTmaxTarGzBytes, outputFolder);
2020
}
2121

22-
public static void ExtractTarGzToFolder(byte[] gzTarBytes, string outputFolder, Dictionary<string, string> fileRenames)
22+
public static void ExtractTarGzToFolder(byte[] gzTarBytes, string outputFolder)
2323
{
2424
if (!Directory.Exists(outputFolder)) Directory.CreateDirectory(outputFolder);
2525

@@ -36,9 +36,7 @@ public static void ExtractTarGzToFolder(byte[] gzTarBytes, string outputFolder,
3636
continue;
3737
}
3838

39-
var fileName = fileRenames.ContainsKey(reader.Entry.Key!)
40-
? fileRenames[reader.Entry.Key!]
41-
: reader.Entry.Key!;
39+
var fileName = reader.Entry.Key!;
4240

4341
Console.WriteLine(fileName);
4442

ClimateExplorer.Data.Bom/Bom/BomLocationsAndStationsMapper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static async Task<List<Station>> BuildAcornSatLocationsFromReferenceMetaD
1818
var stationToLocationMapping = new Dictionary<string, Guid>();
1919

2020
// Get the friendly location name and the "primary station", as best we can do.
21-
var locationRowData = File.ReadAllLines(@"ReferenceMetaData\ACORN-SAT\acorn_sat_v2.3.0_stations.csv");
21+
var locationRowData = File.ReadAllLines(@"ReferenceMetaData\ACORN-SAT\acorn_sat_stations.csv");
2222
foreach (var row in locationRowData.Skip(1))
2323
{
2424
var splitRow = row.Split(',');
@@ -150,7 +150,7 @@ internal static async Task BuildAcornSatAdjustedDataFileMappingAsync(Guid dataSe
150150
var file = await File.ReadAllTextAsync(unadjustedDataFileMappingPath);
151151
var unadjustedDataFileMapping = JsonSerializer.Deserialize<DataFileMapping>(file);
152152
var locationIdToDataFileMappings = unadjustedDataFileMapping!.LocationIdToDataFileMappings;
153-
var stations = await File.ReadAllLinesAsync(@"ReferenceMetaData\ACORN-SAT\acorn_sat_v2.3.0_stations.txt");
153+
var stations = await File.ReadAllLinesAsync(@"ReferenceMetaData\ACORN-SAT\acorn_sat_stations.txt");
154154

155155
var dataFileMapping = new DataFileMapping() { DataSetDefinitionId = dataSetDefinitionId };
156156
foreach (var station in stations)

ClimateExplorer.Data.Bom/ClimateExplorer.Data.Bom.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@
2727
</ItemGroup>
2828

2929
<ItemGroup>
30-
<None Update="ReferenceMetaData\ACORN-SAT\acorn_sat_v2.3.0_stations.csv">
31-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
30+
<None Update="ReferenceMetaData\ACORN-SAT\acorn_sat_stations.csv">
31+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
3232
</None>
33-
<None Update="ReferenceMetaData\ACORN-SAT\acorn_sat_v2.3.0_stations.txt">
34-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
33+
<None Update="ReferenceMetaData\ACORN-SAT\acorn_sat_stations.txt">
34+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
3535
</None>
3636
<None Update="ReferenceMetaData\ACORN-SAT\Locations.json">
37-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
37+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
3838
</None>
3939
<None Update="ReferenceMetaData\ACORN-SAT\primarysites.txt">
40-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
40+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
4141
</None>
4242
</ItemGroup>
4343

ClimateExplorer.Data.Bom/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
const string SourceDataFolder = @"..\..\..\..\ClimateExplorer.SourceData";
1111

12-
AcornSatDownloader.DownloadAndExtractData("acorn_sat_v2.6.0_daily_tmean", $@"{SourceDataFolder}\Temperature\ACORN-SAT\daily_tmean", new Dictionary<string, string>{ { "tmean.060168.daily.csv", "tmean.060139.daily.csv" } });
13-
AcornSatDownloader.DownloadAndExtractData("acorn_sat_v2.6.0_daily_tmax", $@"{SourceDataFolder}\Temperature\ACORN-SAT\daily_tmax", new Dictionary<string, string> { { "tmax.060168.daily.csv", "tmax.060139.daily.csv" } });
14-
AcornSatDownloader.DownloadAndExtractData("acorn_sat_v2.6.0_daily_tmin", $@"{SourceDataFolder}\Temperature\ACORN-SAT\daily_tmin", new Dictionary<string, string> { { "tmin.060168.daily.csv", "tmin.060139.daily.csv" } });
12+
AcornSatDownloader.DownloadAndExtractData("acorn_sat_v2.6.0_daily_tmean", $@"{SourceDataFolder}\Temperature\ACORN-SAT\daily_tmean");
13+
AcornSatDownloader.DownloadAndExtractData("acorn_sat_v2.6.0_daily_tmax", $@"{SourceDataFolder}\Temperature\ACORN-SAT\daily_tmax");
14+
AcornSatDownloader.DownloadAndExtractData("acorn_sat_v2.6.0_daily_tmin", $@"{SourceDataFolder}\Temperature\ACORN-SAT\daily_tmin");
1515

1616
var outDirectories = new Dictionary<ObsCode, string>
1717
{

ClimateExplorer.Data.Bom/ReferenceMetaData/ACORN-SAT/Locations.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,11 +1321,11 @@
13211321
"DataSetId": "b13afcaf-cdbc-4267-9def-9629c8066321",
13221322
"Name": "Port Macquarie",
13231323
"CountryCode": "AS",
1324-
"PrimaryStation": "060139",
1324+
"PrimaryStation": "060168",
13251325
"Sites": [
1326+
"060168",
13261327
"060139",
1327-
"060026",
1328-
"060168"
1328+
"060026"
13291329
],
13301330
"Coordinates": {
13311331
"Latitude": -31.43,

ClimateExplorer.Data.Bom/ReferenceMetaData/ACORN-SAT/acorn_sat_v2.3.0_stations.csv renamed to ClimateExplorer.Data.Bom/ReferenceMetaData/ACORN-SAT/acorn_sat_stations.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ stn_num,stn_name,lat,lon,elevation
7979
56242,Inverell,-29.78,151.11,582
8080
58012,Yamba,-29.43,153.36,27
8181
59151,Coffs Harbour,-30.32,153.12,3
82-
60139,Port Macquarie,-31.43,152.87,4
82+
60168,Port Macquarie,-31.43,152.87,4
8383
61078,Williamtown,-32.79,151.84,7
8484
61363,Scone,-32.03,150.83,221
8585
63005,Bathurst,-33.43,149.56,713

ClimateExplorer.Data.Bom/ReferenceMetaData/ACORN-SAT/acorn_sat_v2.3.0_stations.txt renamed to ClimateExplorer.Data.Bom/ReferenceMetaData/ACORN-SAT/acorn_sat_stations.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
056242
8080
058012
8181
059151
82-
060139
82+
060168
8383
061078
8484
061363
8585
063005

0 commit comments

Comments
 (0)