You should select the period of interest and it downloads all data at once. There will be one raster file for each 3-hourly soil moisture data that I then summarized by averaging through Python codes.
thank you for your excellent explanation, but still I could not get the exact measurements of the soil moisture, which means how can I read it in Arc map gis? thank you so much
Did you download the GeoTiff format? You can add the GeoTiff file directly into ArcMAP (same as a raster file). Clicking on each pixel (grid cell) using ArcMAP "Identify" tool, you can know the exact values of soil moisture. If you have downloaded large data (for a long period) let me know and I can show you how to extract data for your study area.
Python Script: import arcpy import os from shutil import copy2 arcpy.CheckOutExtension("Spatial") from collections import defaultdict def main(): raster_dir = r"D:\NASA\Data\USA\SMAP_L4\Processed-Daily" arcpy.env.workspace = raster_dir raster_days = defaultdict(list) for r in arcpy.ListRasters(): #To calculate Daily Average #raster_days[r[15:23]].append(r) # To calculate Monthly Average raster_days[r[0:6]].append(r) if not os.path.exists(raster_dir+"\Processed-Monthly"): os.makedirs(raster_dir+"\Processed-Monthly") for date, rasters in raster_days.items(): print(date) outCellStatistics = arcpy.sa.CellStatistics(rasters, "MEAN") outCellStatistics.save(raster_dir+"\Processed-Monthly\{}.tif".format(date)) if _name_ == '__main__': main()
@@geospatialcamp5618 Thanks you so much...! what kind of jobs profile available for these skills..? can you suggest any well-paying remote jobs related to these skills.? Need video related to this. Thanks in advance
Check this: import arcpy import os from shutil import copy2 arcpy.CheckOutExtension("Spatial") from collections import defaultdict def main(): raster_dir = r"D:\NASA\Data\USA\SMAP_L4\Processed-Daily" arcpy.env.workspace = raster_dir raster_days = defaultdict(list) for r in arcpy.ListRasters(): #To calculate Daily Average #raster_days[r[15:23]].append(r) # To calculate Monthly Average raster_days[r[0:6]].append(r) if not os.path.exists(raster_dir+"\Processed-Monthly"): os.makedirs(raster_dir+"\Processed-Monthly") for date, rasters in raster_days.items(): print(date) outCellStatistics = arcpy.sa.CellStatistics(rasters, "MEAN") outCellStatistics.save(raster_dir+"\Processed-Monthly\{}.tif".format(date)) if __name__ == '__main__': main()
Thank you! You’re a lifesaver
Thank you so much. It was very helpful. Expecting more videos from you.
Thank you!
thank you, this was very helpful
looks like all smap soil Moisture h5 file are globe size. is there any way we can select a single area to download? globe is too big
Thank you for the very helpful tutorial! But may I know how to download and extract large data for a month-long period.
You should select the period of interest and it downloads all data at once. There will be one raster file for each 3-hourly soil moisture data that I then summarized by averaging through Python codes.
thank you for your excellent explanation, but still I could not get the exact measurements of the soil moisture, which means how can I read it in Arc map gis? thank you so much
Did you download the GeoTiff format? You can add the GeoTiff file directly into ArcMAP (same as a raster file). Clicking on each pixel (grid cell) using ArcMAP "Identify" tool, you can know the exact values of soil moisture. If you have downloaded large data (for a long period) let me know and I can show you how to extract data for your study area.
@@geospatialcamp5618 I downloaded numerous Geotiff files for three days. How do I get exact soil moisture data using python
Hello, ma'am. Do you have a video tutorial on extracting monthly averaged soil moisture data with a resolution of 30m or less?
It should be the same! At the beginning choose the monthly data and the rest is the same!
after downloading 3 hourly data for 1 day How to convert that data into 1 day data what method or logic you use.
Thank you for sharing.
I wrote a script in python (arcpy package) and averaged 3-hourly data into daily data (specified the date based on the file names)
Python Script:
import arcpy
import os from shutil
import copy2
arcpy.CheckOutExtension("Spatial")
from collections import defaultdict
def main():
raster_dir = r"D:\NASA\Data\USA\SMAP_L4\Processed-Daily"
arcpy.env.workspace = raster_dir
raster_days = defaultdict(list)
for r in arcpy.ListRasters():
#To calculate Daily Average
#raster_days[r[15:23]].append(r)
# To calculate Monthly Average
raster_days[r[0:6]].append(r)
if not os.path.exists(raster_dir+"\Processed-Monthly"):
os.makedirs(raster_dir+"\Processed-Monthly")
for date, rasters in raster_days.items():
print(date)
outCellStatistics = arcpy.sa.CellStatistics(rasters, "MEAN")
outCellStatistics.save(raster_dir+"\Processed-Monthly\{}.tif".format(date))
if _name_ == '__main__':
main()
@@geospatialcamp5618 Thanks you so much...!
what kind of jobs profile available for these skills..? can you suggest any well-paying remote jobs related to these skills.?
Need video related to this.
Thanks in advance
Great tutorial. After downloading, as these are 3 hourly data, could you please share some way to format them daily and then monthly? Thank you
I wrote a python script to summarize data into daily and monthly raster files. IF you leave an email, I can send the script to you.
Check this: import arcpy
import os from shutil
import copy2
arcpy.CheckOutExtension("Spatial")
from collections import defaultdict
def main():
raster_dir = r"D:\NASA\Data\USA\SMAP_L4\Processed-Daily"
arcpy.env.workspace = raster_dir
raster_days = defaultdict(list)
for r in arcpy.ListRasters():
#To calculate Daily Average
#raster_days[r[15:23]].append(r)
# To calculate Monthly Average
raster_days[r[0:6]].append(r)
if not os.path.exists(raster_dir+"\Processed-Monthly"):
os.makedirs(raster_dir+"\Processed-Monthly")
for date, rasters in raster_days.items():
print(date)
outCellStatistics = arcpy.sa.CellStatistics(rasters, "MEAN")
outCellStatistics.save(raster_dir+"\Processed-Monthly\{}.tif".format(date))
if __name__ == '__main__':
main()
@@geospatialcamp5618 thank you so much
hello the website was way more simpler, no it is not like this video and it is so difficult to extract the data.