|
698 | 698 | "\trefresh();\r", |
699 | 699 | "}\r", |
700 | 700 | "\r", |
| 701 | + "// NSRDB Download Functions Start Here //////\r", |
| 702 | + "\r", |
701 | 703 | "// check JSON returned by a call to NSRDB Data Query for a valid response\r", |
702 | 704 | "function nsrdb_query_json_check( json_str ) {\r", |
703 | 705 | "\tvar = json_read( json_str );\r", |
|
725 | 727 | "\t\t\t\tif ( strpos( lower(var.code), 'api' ) > -1 ) { msg += 'See private.h to set API keys.'; }\r", |
726 | 728 | "\t\t\t}\t\r", |
727 | 729 | "\t\t}\r", |
728 | | - "\t\t// some locations are not covered by the NSRDB, e.g., Anchorage AK\r", |
| 730 | + "\t\t// some locations are not covered by the NSRDB\r", |
729 | 731 | "\t\tif ( var.outputs == null ) {\r", |
730 | 732 | "\t\t\tjson_ok = false;\r", |
731 | | - "\t\t\tmsg += 'NSRDB Data Query returns no data (outputs = null).\\n\\nSee https://sam.nrel.gov/weather for links to other data sources.\\n';\r", |
| 733 | + "\t\t\tmsg += 'NSRDB Data Query returns no data (outputs = null) for this location.\\n\\nSee https://sam.nrel.gov/weather for links to other data sources.\\n';\r", |
732 | 734 | "\t\t}\r", |
733 | 735 | "\t\telseif ( var.outputs == [] ) {\r", |
734 | 736 | "\t\t\tjson_ok = false;\r", |
735 | | - "\t\t\tmsg += 'NSRDB Data Query returns no data (outputs = []).\\n\\nSee https://sam.nrel.gov/weather for links to other data sources.\\n';\r", |
| 737 | + "\t\t\tmsg += 'NSRDB Data Query returns no data (outputs = []) for this location.\\n\\nSee https://sam.nrel.gov/weather for links to other data sources.\\n';\r", |
736 | 738 | "\t\t}\r", |
737 | 739 | "\t}\r", |
738 | 740 | "\t// NSRDB API service could be down\r", |
|
892 | 894 | "\t}\r", |
893 | 895 | "\tok_test = ( lat != null && lon != null && dataset_ok == true );\r", |
894 | 896 | "\t//msgbox('Debug\\nok_test = ' + ok_test + '\\nlat = ' + lat\t+ '\\nlon = ' + lon + '\\ndataset_ok = ' + dataset_ok );\r", |
| 897 | + "\t//msgbox('Debug\\nmsg = ' + msg);\r", |
895 | 898 | "\treturn { 'name' = name , 'msg' = msg , 'url' = url, 'years' = years , 'ok' = ok_test };\r", |
896 | 899 | "}\r", |
897 | 900 | "\r", |
|
993 | 996 | "\t\twrite_line( flog, 'Location ' + to_string(n+1) + ' of ' + #coordinate_list + ': ' + coordinate_list[n] + '');\r", |
994 | 997 | "\t\twrite_line( flog, '----------------------------------------------------------\\n');\t\r", |
995 | 998 | "\t\tdataset[n] = nsrdb_query( lat, lon, download_option == TMY );\r", |
| 999 | + "\t\t//msgbox('Debug\\ndataset[n] = ' + dataset[n]);\r", |
996 | 1000 | "\t\tif ( !dataset[n].ok ) {\r", |
997 | 1001 | "\t\t\twrite_line( flog, dataset[n].msg + '\\n');\r", |
998 | | - "\t\t\tprogressbar(pb, {'message' = dataset[n].msg, 'value'= pb_count});\r", |
| 1002 | + "\t\t\tprogressbar(pb, {'message' = 'NSRDB Data Query failed.', 'value'= pb_count});\r", |
| 1003 | + "\t\t\tmsgbox('NSRDB Data Query Failed.\\n' + dataset[n].msg);\r", |
999 | 1004 | "\t\t\tcontinue;\r", |
1000 | 1005 | "\t\t}\t\r", |
1001 | 1006 | "\t\tif ( download_option == TMY ) { // this needs to work for both nsrdb-GOES-tmy-v4-0-0 and suny-india-tmy\r", |
|
0 commit comments