From e27f57f248d7a2d081dcfd56f0523ab3b5ee4c50 Mon Sep 17 00:00:00 2001 From: Paul Gilman Date: Thu, 21 Nov 2024 12:55:47 -0800 Subject: [PATCH 1/2] Update NSRDB API calls from PSM V3 to GOES V4 --- deploy/runtime/ui/Solar Resource Data.json | 26 +++++++++++----------- src/nsrdb.cpp | 3 ++- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/deploy/runtime/ui/Solar Resource Data.json b/deploy/runtime/ui/Solar Resource Data.json index 87fb741095..540d90bc49 100644 --- a/deploy/runtime/ui/Solar Resource Data.json +++ b/deploy/runtime/ui/Solar Resource Data.json @@ -3888,8 +3888,8 @@ "\t\t\t\tname = available_datasets[i].name;\r", "\t\t\t\tif ( is_tmy )\r", "\t\t\t\t{\r", - "\t\t\t\t\t// only use himawari-tmy if psm3-2-2-tmy is not available\r", - "\t\t\t\t\tif ( name == 'himawari-tmy' && (available_names ?@ 'psm3-2-2-tmy') < 0 )\r", + "\t\t\t\t\t// only use himawari-tmy if nsrdb-GOES-tmy-v4-0-0 is not available\r", + "\t\t\t\t\tif ( name == 'himawari-tmy' && (available_names ?@ 'nsrdb-GOES-tmy-v4-0-0') < 0 )\r", "\t\t\t\t\t{\r", "\t\t\t\t\t\ti_dataset = i;\r", "\t\t\t\t\t}\r", @@ -3898,7 +3898,7 @@ "\t\t\t\t\t{\r", "\t\t\t\t\t\ti_dataset = i;\r", "\t\t\t\t\t}\r", - "\t\t\t\t\telseif ( name == 'psm3-2-2-tmy' )\r", + "\t\t\t\t\telseif ( name == 'nsrdb-GOES-tmy-v4-0-0' )\r", "\t\t\t\t\t{\r", "\t\t\t\t\t\ti_dataset = i;\r", "\t\t\t\t\t}\r", @@ -3913,15 +3913,15 @@ "\t\t\t\t\t{\r", "\t\t\t\t\t\t\ti_dataset = i;\r", "\t\t\t\t\t}\r", - "\t\t\t\t\telseif ( name == 'full-disc' && (available_names ?@ 'psm3-2-2') < 0 )\r", + "\t\t\t\t\telseif ( name == 'full-disc' && (available_names ?@ 'nsrdb-GOES-aggregated-v4-0-0') < 0 )\r", "\t\t\t\t\t{\r", "\t\t\t\t\t\t\ti_dataset = i;\r", "\t\t\t\t\t}\r", - "\t\t\t\t\telseif ( name == 'himawari' && (available_names ?@ 'psm3-2-2') < 0 )\r", + "\t\t\t\t\telseif ( name == 'himawari' && (available_names ?@ 'nsrdb-GOES-aggregated-v4-0-0') < 0 )\r", "\t\t\t\t\t{\r", "\t\t\t\t\t\t\ti_dataset = i;\r", "\t\t\t\t\t}\r", - "\t\t\t\t\telseif ( name == 'psm3-2-2' ) \r", + "\t\t\t\t\telseif ( name == 'nsrdb-GOES-aggregated-v4-0-0' ) \r", "\t\t\t\t\t{\r", "\t\t\t\t\t\ti_dataset = i;\r", "\t\t\t\t\t}\r", @@ -4025,9 +4025,9 @@ "\t\t\tmsg += dataset[n].msg + '\\n';", "\t\t\tcontinue;", "\t\t}\t", - "\t\tif ( download_option == TMY ) // this needs to work for both psm3-tmy and suny-india-tmy", + "\t\tif ( download_option == TMY ) // this needs to work for both nsrdb-GOES-tmy-v4-0-0 and suny-india-tmy", "\t\t{\t", - "\t\t\ttype = ['tmy']; // should get newest TMY file for psm3-tmy, or tmy for suny-india-tmy", + "\t\t\ttype = ['tmy']; // should get newest TMY file for nsrdb-GOES-tmy-v4-0-0, or tmy for suny-india-tmy", "\t\t}", "\t\telseif ( download_option == SINGLE_YEAR ) ", "\t\t{", @@ -4093,13 +4093,13 @@ "\t\t\t\t// only get attributes SAM needs for simulations", "\t\t\t\t// otherwise default is to get all attributes", "\t\t\t\t// https://developer.nrel.gov/docs/solar/nsrdb/", - "\t\t\t\tif ( dataset[n].name == 'psm3-2-2')", + "\t\t\t\tif ( dataset[n].name == 'nsrdb-GOES-aggregated-v4-0-0')", "\t\t\t\t{", - "\t\t\t\t\tbase_url += '&attributes=dni,dhi,ghi,dew_point,air_temperature,surface_pressure,relative_humidity,wind_direction,wind_speed,surface_albedo';", + "\t\t\t\t\tbase_url += '&attributes=dni,dhi,ghi,dew_point,air_temperature,surface_pressure,relative_humidity,wind_direction,wind_speed,surface_albedo,clearsky_dhi,clearsky_dni,clearsky_ghi';", "\t\t\t\t}", - "\t\t\t\telseif ( dataset[n].name == 'psm3-2-2-tmy')", + "\t\t\t\telseif ( dataset[n].name == 'nsrdb-GOES-tmy-v4-0-0')", "\t\t\t\t{", - "\t\t\t\t\tbase_url += '&attributes=dni,dhi,ghi,dew_point,air_temperature,surface_pressure,wind_direction,wind_speed,surface_albedo';", + "\t\t\t\t\tbase_url += '&attributes=dni,dhi,ghi,dew_point,air_temperature,surface_pressure,wind_direction,wind_speed,surface_albedo,clearsky_dhi,clearsky_dni,clearsky_ghi';", "\t\t\t\t}", "\t\t\t\telseif ( dataset[n].name == 'suny-india' )", "\t\t\t\t{", @@ -4111,7 +4111,7 @@ "\t\t\t\t}", "\t\t\t\telseif ( dataset[n].name == 'msg-iodc' )", "\t\t\t\t{", - "\t\t\t\t\tbase_url += '&attributes=dni,dhi,ghi,dew_point,air_temperature,surface_pressure,relative_humidity,wind_direction,wind_speed,surface_albedo';", + "\t\t\t\t\tbase_url += '&attributes=dni,dhi,ghi,dew_point,air_temperature,surface_pressure,relative_humidity,wind_direction,wind_speed,surface_albedo,clearsky_dhi,clearsky_dni,clearsky_ghi';", "\t\t\t\t}", "\t\t\t\twrite_line( flog, '\\nFile ' + to_string(i+1) + ' of ' + #type + ': ' + type[i]);", "\t\t\t\twrite_line( flog, '----------------------------------------------------------\\n');\t", diff --git a/src/nsrdb.cpp b/src/nsrdb.cpp index 24d566f5a7..8df5d0f6e4 100644 --- a/src/nsrdb.cpp +++ b/src/nsrdb.cpp @@ -686,6 +686,7 @@ void NSRDBDialog::GetResources() datasets have different available intervals in addition to 60 (all datasets have 60 minute data): psm3 https://developer.nrel.gov/docs/solar/nsrdb/psm3-download/ 30 psm3-2-2 https://developer.nrel.gov/docs/solar/nsrdb/psm3-2-2-download/ 30 + nsrdb-GOES-aggregated-v4-0-0 https://developer.nrel.gov/api/nsrdb/v2/solar/nsrdb-GOES-aggregated-v4-0-0-download 30 psm3-5min https://developer.nrel.gov/docs/solar/nsrdb/psm3-5min-download/ 5,15,30 suny-india https://developer.nrel.gov/docs/solar/nsrdb/suny-india-data-download/ 15,30 msg-iodc https://developer.nrel.gov/docs/solar/nsrdb/meteosat-download/ 15,30 @@ -699,7 +700,7 @@ void NSRDBDialog::GetResources() #endif // skip some datasets if ((name.Lower() != "spectral-india-tmy") // not compatible with SAM - && (name.Lower() != "full-disc") // only covers a few years and is similar to PSM V3 from solar modeling perspective + && (name.Lower() != "full-disc") // only covers a few years and is similar to GOES V4 from solar modeling perspective && (name.Lower() != "philippines") // basic solar resource data only tamb, dhi, dni, ghi, wind (not enough data for CSP or PV thermal models) && (name.Lower() != "vietnam")) // // basic solar resource data only tamb, dhi, dni, ghi, wind (not enough data for CSP or PV thermal models) { From 76eda4fa4a554be993c2445842c2084bfb9ff1a0 Mon Sep 17 00:00:00 2001 From: Paul Gilman Date: Thu, 5 Dec 2024 09:57:14 -0800 Subject: [PATCH 2/2] Omit GOES V4 Full Disc dataset from downloads --- src/nsrdb.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nsrdb.cpp b/src/nsrdb.cpp index 8df5d0f6e4..88eb543581 100644 --- a/src/nsrdb.cpp +++ b/src/nsrdb.cpp @@ -700,7 +700,8 @@ void NSRDBDialog::GetResources() #endif // skip some datasets if ((name.Lower() != "spectral-india-tmy") // not compatible with SAM - && (name.Lower() != "full-disc") // only covers a few years and is similar to GOES V4 from solar modeling perspective + && (name.Lower() != "full-disc") // only covers a few years and is similar to PSM V3 from solar modeling perspective + && (name.Lower() != "nsrdb-goes-full-disc-v4-0-0") // similar to GOES V4 from solar modeling perspective && (name.Lower() != "philippines") // basic solar resource data only tamb, dhi, dni, ghi, wind (not enough data for CSP or PV thermal models) && (name.Lower() != "vietnam")) // // basic solar resource data only tamb, dhi, dni, ghi, wind (not enough data for CSP or PV thermal models) {