make sure you save your username and password you will need them later!
Note the short name of the dataset. For this example it would be "MUR-JPL-L4-GLOB-v4.1"
pip install podaac-data-subscriber
nano ~/.netrc
machine urs.earthdata.nasa.gov login your_earthdata_username password your_earthdata_password
chmod 600 ~/.netrc
curl -n https://urs.earthdata.nasa.gov
9) Download the files! (you can only download one year of data at a time) This is where you need the short name of the dataset from earlier.
podaac-data-downloader -c shortnameofdataset -d ./data \ --start-date YYYY-MM-DDT00:00:00Z \ --end-date YYYY-MM-DDT00:00:00Z \ -b="-179,-90,180,90" --verbose1
with the example dataset and the year 2002 it would be:
podaac-data-downloader -c MW_IR_OI-REMSS-L4-GLOB-v5.0 -d ./data \ --start-date 2002-06-01T00:00:00Z \ --end-date 2002-06-08T00:00:00Z \ -b="-179,-90,180,90" --verbose
repeat step 9 for as many years as you need changing the start and end date
using conda: conda install -c conda-forge nco
using cd....
2) Create a bash file in the folder where your data is located using a text editor (IE nano on a mac)
using nano: nano yourbashfilename.sh
3) Using your desired bounding box (with start lat/lons and end lat/lons) and subset filenames update this text in the bash file:
#!/bin/bash
# Define the latitude and longitude bounds
lat_min=value
lat_max=value
lon_min=value
lon_max=value
# Loop through the NetCDF files and perform subsetting
for f in *.nc
do
echo "Processing $f file..."
# Use value-based subsetting
ncks -d latitude,$lat_min,$lat_max \
-d longitude,$lon_min,$lon_max \
"$f" "updatedfilename_$f"
done
make sure you check what format the lat/lons are in the datafiles! Many of the lat/lons on PODAAC are 0-360 not -180 to 180 format.
For a region in the Carribean using lat/lons with 0-360 this is what the bash file text would be:
#!/bin/bash
# Define the latitude and longitude bounds
lat_min=13.955392
lat_max=16.888660
lon_min=290.105
lon_max=295.356
# Loop through the NetCDF files and perform subsetting
for f in *.nc
do
echo "Processing $f file..."
# Use value-based subsetting
ncks -d latitude,$lat_min,$lat_max \
-d longitude,$lon_min,$lon_max \
"$f" "carib_$f"
done
a) make the file executable: chmod +x yourbashfilename.sh
b) run the script: ./yourbashfilename.sh

