{"id":153,"date":"2021-01-12T19:30:00","date_gmt":"2021-01-12T11:30:00","guid":{"rendered":"http:\/\/47.107.115.238\/?p=153"},"modified":"2024-08-30T19:31:09","modified_gmt":"2024-08-30T11:31:09","slug":"s5p","status":"publish","type":"post","link":"https:\/\/lxylp.com\/?p=153","title":{"rendered":"s5p"},"content":{"rendered":"\n<ul class=\"wp-block-list\">\n<li><a href=\"http:\/\/www.tropomi.eu\/tools\">tropomi tools<\/a><\/li>\n\n\n\n<li>HARP software can be downloaded from GitHub: <a href=\"https:\/\/github.com\/stcorp\/harp\/releases\/latest\">download<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/forum.atmospherictoolbox.org\/t\/about-the-harp-category\/13\/2\">HARP\u8bba\u575b<\/a><\/li>\n\n\n\n<li>NO2 Mapping description, <a href=\"http:\/\/stcorp.github.io\/harp\/doc\/html\/ingestions\/S5P_L2_NO2.html\">here<\/a><\/li>\n\n\n\n<li>MATLAB\u8bfb\u53d6nc\u6587\u4ef6\u5e76\u8f6c\u6362\u4e3a.tif\u683c\u5f0f(<a href=\"https:\/\/blog.csdn.net\/yangjh1991\/article\/details\/69788778\">here<\/a>), Matlab\uff1aSave as GeoTiff Format (<a href=\"http:\/\/blog.sciencenet.cn\/blog-1148346-842075.html\">here<\/a>)<\/li>\n\n\n\n<li>Sentinel-5P\u6570\u636e\u7684\u6805\u683c\u5316\u5904\u7406 (<a href=\"https:\/\/www.zhengzihao.org\/2018\/11\/sentinel-5prasterisation-of-sentinel-5p.html\">here<\/a>)<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">sp5 harp<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u7f16\u5199trans.sh\uff0c\u5b9e\u73b0harp\u548cgdal\u7ed3\u5408\u7684\u6279\u91cfnc-nc-tif<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>conda install -c stcorp harp -y\nsudo apt install harp\nconda install gdal -y\n# harpconvert -a 'keep(latitude_bounds,longitude_bounds,tropospheric_NO2_column_number_density);bin_spatial(2400,-37,0.01,3300,-83,0.01);squash(time, (latitude_bounds,longitude_bounds));derive(latitude {latitude});derive(longitude {longitude});exclude(latitude_bounds,longitude_bounds,count,weight)' no2.nc xx.nc\n\nharpconvert -a 'keep(latitude_bounds,longitude_bounds,nitrogendioxide_tropospheric_column);bin_spatial(2400,-37,0.01,3300,-83,0.01);squash(time, (latitude_bounds,longitude_bounds));derive(latitude {latitude});derive(longitude {longitude});exclude(latitude_bounds,longitude_bounds,count,weight)' no2.nc xx1.nc\n\n\u5168\u7403\u7ecf\u7eac\u5ea6\u7684\u53d6\u503c\u8303\u56f4\u4e3a\uff1a\u7eac\u5ea6-90\u81f390\uff0c\u7ecf\u5ea6-180\u81f3180\n\u4e2d\u56fd\u7684\u7ecf\u7eac\u5ea6\u8303\u56f4\u5927\u7ea6\u4e3a\uff1a\u7eac\u5ea63.86\u81f353.55\uff0c\u7ecf\u5ea673.66\u81f3135.05\n\u7eac\u5ea61\u5ea6 = \u5927\u7ea6111km \n\u7eac\u5ea61\u5206 = \u5927\u7ea61.85km \n# harpconvert -a 'keep(latitude_bounds,longitude_bounds,tropospheric_NO2_column_number_density);bin_spatial(52,3,1,64,73,1);squash(time, (latitude_bounds,longitude_bounds));derive(latitude {latitude});derive(longitude {longitude});exclude(latitude_bounds,longitude_bounds,count,weight)' no2.nc china.nc\n\n\u5750\u6807\u6362\u7b97\n# lat_edge_length, lat_edge_offset, lat_edge_step, lon_edge_length, lon_edge_offset, and lon_edge_step.\nbin_spatial(181,-90,1,361,-180,1):  latitude starts at -90 with 1 degree steps (ending up after (181 - 1) steps at 90) and longitude starts at -180 with 1 degree steps (ending up after (361 - 1) steps at 180)\n\n1 degree\n\n# harpconvert -a 'keep(latitude_bounds,longitude_bounds,tropospheric_NO2_column_number_density);bin_spatial(181,-90,1,361,-180,1);squash(time, (latitude_bounds,longitude_bounds));derive(latitude {latitude});derive(longitude {longitude});exclude(latitude_bounds,longitude_bounds,count,weight)' no2.nc xx1.nc\n\n0.1 degree, 6'=10km\n\n# harpconvert -a 'keep(latitude_bounds,longitude_bounds,tropospheric_NO2_column_number_density);bin_spatial(1801,-90,0.1,3601,-180,0.1);squash(time, (latitude_bounds,longitude_bounds));derive(latitude {latitude});derive(longitude {longitude});exclude(latitude_bounds,longitude_bounds,count,weight)' no2.nc f6.nc\n\n0.05 degree, 3'=5km\n# harpconvert -a 'keep(latitude_bounds,longitude_bounds,tropospheric_NO2_column_number_density);bin_spatial(3601,-90,0.05,7201,-180,0.05);squash(time, (latitude_bounds,longitude_bounds));derive(latitude {latitude});derive(longitude {longitude});exclude(latitude_bounds,longitude_bounds,count,weight)' no2.nc f3.nc\n\n# harpconvert -a 'keep(latitude_bounds,longitude_bounds,tropospheric_NO2_column_number_density);bin_spatial(3601,-90,0.05,7201,-180,0.05);squash(time, (latitude_bounds,longitude_bounds));derive(latitude {latitude});derive(longitude {longitude});exclude(latitude_bounds,longitude_bounds,count,weight)' S5P_OFFL_L2__NO2____20200301T053638_20200301T071808_12341_01_010302_20200304T104828.nc tile5f3.nc\n\n# harpconvert -a 'keep(latitude_bounds,longitude_bounds,tropospheric_NO2_column_number_density);bin_spatial(3601,-90,0.05,7201,-180,0.05);squash(time, (latitude_bounds,longitude_bounds));derive(latitude {latitude});derive(longitude {longitude});exclude(latitude_bounds,longitude_bounds,count,weight)' S5P_OFFL_L2__NO2____20200301T071808_20200301T085939_12342_01_010302_20200304T121216.nc tile7f3.nc\n\n# translate to GeoTiff\ngdal_translate -a_srs EPSG:4326 -of GTiff NETCDF:\"C:\\Users\\liupei\\Desktop\\no2\\2019\\S5P_OFFL_L2__NO2____20190301T031704_20190301T045834_07147_01_010202_20190307T050828.nc.nc\":tropospheric_NO2_column_number_density C:\/Users\/liupei\/Desktop\/no2\/2019\/hello.tif\n\n# tfw from ipython \u5b66\u4e60 gdal https:\/\/wenku.baidu.com\/view\/f419727d27284b73f2425035.html\nimport gdal\ndataset = gdal.Open(\"f3_S5P_OFFL_L2__NO2____20190301T031704_20190301T045834_07147_01_010202_20190307T050828.nc.tif\")\n\ngt = dataset.GetGeoTransform()\ngt\ngt&#91;1]\ngt&#91;2]\ngt&#91;4]\ngt&#91;5]\ngt&#91;0]\ngt&#91;3]\n\ndataset.RasterCount\nband = dataset.GetRasterBand(1)\ndataset.RasterXSize\ndataset.RasterYSize\n\ndataset.ReadAsArray(500,500,10,10)\ndir(band)\nband.XSize\nband.YSize\nband.DataType\n\nimport gdalconst\ndir(gdalconst)\n\nband.GetNoDataValue()\nband.GetMaximum()\nband.GetMinimum()\nband.ComputeRasterMinMax()\n\nband.GetRasterColorInterpretation()\ngdalconst.GCI_PaletteIndex\ncolormap = band.GetRasterColorTable()\ndir(colormap)<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>sp5 harp \u7f16\u5199trans&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[9],"class_list":["post-153","post","type-post","status-publish","format-standard","hentry","category-6","tag-9"],"_links":{"self":[{"href":"https:\/\/lxylp.com\/index.php?rest_route=\/wp\/v2\/posts\/153","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lxylp.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lxylp.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lxylp.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lxylp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=153"}],"version-history":[{"count":1,"href":"https:\/\/lxylp.com\/index.php?rest_route=\/wp\/v2\/posts\/153\/revisions"}],"predecessor-version":[{"id":154,"href":"https:\/\/lxylp.com\/index.php?rest_route=\/wp\/v2\/posts\/153\/revisions\/154"}],"wp:attachment":[{"href":"https:\/\/lxylp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lxylp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lxylp.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}