# Install external dependencies
#!pip install -qq harmony-py python-cmr # these are installed in OPENSCAPES, in other environments may need to be installed first
#!pip install -qq gnss_lib_py # this might be needed to work with GPS time
Plotting polar cloud variables from PREFIRE data
Summary
This notebook shows how to retrieve and plot cloud values for the polar region, from Polar Radiant Energy in the Far-InfraRed Experiment (PREFIRE) data.
Prerequisites
- cartopy
- earthaccess
- matplotlib
- netCDF4
- numpy
- harmony-py
Installing libraries
Importing libraries
from datetime import datetime # needed to work with time in plotting time series
import getpass
import requests
import cartopy.crs as ccrs
import earthaccess # needed to discover and download TEMPO data
import matplotlib.pyplot as plt # needed to plot the resulting time series
import netCDF4 as nc # needed to read TEMPO data
import numpy as np
from harmony import Client, Collection, Request
from harmony.config import Environment
function to read data
def read_PREFIRE_2B_CLD(fn):
try:
with nc.Dataset(fn) as ds:
= ds.groups["Geometry"]
geo = geo.variables["ctime"]
var = np.ma.getdata(var[:])
ctime
= geo.variables["ctime_minus_UTC"]
var = np.ma.getdata(var[:])
ctime_minus_UTC
= geo.variables["latitude"]
var = np.ma.getdata(var[:])
lat
= geo.variables["longitude"]
var = np.ma.getdata(var[:])
lon
= geo.variables["time_UTC_values"]
var = np.ma.getdata(var[:])
time_UTC
= ds.groups["Cld"]
Cld = Cld.variables["cld_qc_bitflags"]
var = np.ma.getdata(var[:])
bitQF
= Cld.variables["cloud_d_eff"]
var = np.ma.getdata(var[:])
cloud_d_eff = var.get_fill_value()
fv_cloud_d_eff
= Cld.variables["cloud_tau"]
var = np.ma.getdata(var[:])
cloud_tau = var.get_fill_value()
fv_cloud_tau
= Cld.variables["cloudtop_pressure"]
var = np.ma.getdata(var[:])
cloudtop_pressure = var.get_fill_value()
fv_cloudtop_pressure
except Exception:
= 0.0
ctime = 0.0
ctime_minus_UTC = 0.0
lat = 0.0
lon = 0.0
time_UTC = 0.0
bitQF = 0.0
cloud_d_eff = 0.0
fv_cloud_d_eff = 0.0
cloud_tau = 0.0
fv_cloud_tau = 0.0
cloudtop_pressure = 0.0
fv_cloudtop_pressure
return (
ctime,
ctime_minus_UTC,
lat,
lon,
time_UTC,
bitQF,
cloud_d_eff,
fv_cloud_d_eff,
cloud_tau,
fv_cloud_tau,
cloudtop_pressure,
fv_cloudtop_pressure, )
Getting collection’s conceptID also known as collectionID
from Earthdata search
from Harmony web page
https://harmony.earthdata.nasa.gov/docs#getting-harmony-capabilities-for-a-given-collection-by-collection-short-name:
https://harmony.earthdata.nasa.gov/capabilities?shortName=collection_short_name
we will get a JSON file
read collection JSON programmatically
= "PREFIRE_SAT2_2B-CLD"
short_name = "https://harmony.earthdata.nasa.gov/capabilities?shortName=" + short_name
url
= requests.get(url)
response # Raise HTTPError for bad responses (4xx or 5xx)
response.raise_for_status()
= response.json()
data = data["conceptId"]
collectionID print(f"collectionID for collection short_name {short_name} is {collectionID}")
collectionID for collection short_name PREFIRE_SAT2_2B-CLD is C3499264827-LARC_CLOUD
Using earthaccess library
see
https://earthaccess.readthedocs.io/en/latest/
for more details on this library
login to Earthdata via earthaccess
# User needs to create an account at https://www.earthdata.nasa.gov/
# Function earthaccess.login prompts for EarthData login and password.
= earthaccess.login(strategy="interactive", persist=True) auth
define a function to get collection ID from its short_name and version
def get_collectionID_earthaccess(short_name, version):
= "-1"
collectionID
= earthaccess.search_datasets(short_name=short_name, version=version)
results
if len(results) == 1:
= results[0]["meta"]["concept-id"]
collectionID else:
raise Exception("Specify valid collection")
return collectionID
= "PREFIRE_SAT2_2B-CLD"
short_name = "R01"
version = get_collectionID_earthaccess(short_name, version)
collectionID print(
f"collectionID for collection short_name {short_name} and version {version} is {collectionID}"
)
collectionID for collection short_name PREFIRE_SAT2_2B-CLD and version R01 is C3499264827-LARC_CLOUD
getting collection ID
Search for granules using earthaccess library
specify timeframe and/or boundingbox of interest
= "PREFIRE_SAT2_2B-CLD" # collection name
short_name = "R01" # version of the collection
version
= 2024
yyyy = 9
mm = 1
dd
= str("%4.4i-%2.2i-%2.2i 00:00:00" % (yyyy, mm, dd))
date_start = str("%4.4i-%2.2i-%2.2i 06:00:00" % (yyyy, mm, dd))
date_end
= earthaccess.search_data(
results_earthaccess =short_name,
short_name=version,
version# bounding_box: a tuple representing spatial bounds in the form
# (lower_left_lon, lower_left_lat, upper_right_lon, upper_right_lat)
# where -180 <= lower_left_lon, upper_right_lon < 180,
# -90 <= lower_left_lat, upper_right_lat <= 90
=(-180.0, 60.0, 180.0, 90.0),
bounding_box=(date_start, date_end),
temporal
)= sorted([r["meta"]["native-id"] for r in results_earthaccess])
PREFIRE_names for name in PREFIRE_names:
print(name)
PREFIRE_SAT2_2B-CLD_R01_P00_20240831222721_01490.nc
PREFIRE_SAT2_2B-CLD_R01_P00_20240901013749_01492.nc
PREFIRE_SAT2_2B-CLD_R01_P00_20240901031303_01493.nc
PREFIRE_SAT2_2B-CLD_R01_P00_20240901044818_01494.nc
compare outcome with Earthdata Search results
Download granules with earthaccess
One-by-one
= sorted([r.data_links() for r in results_earthaccess])
PREFIRE_links for link in PREFIRE_links:
print(link)
= earthaccess.download(link, local_path=".") granule
['https://data.asdc.earthdata.nasa.gov/asdc-prod-protected/PREFIRE/PREFIRE_SAT2_2B-CLD_R01/2024.08.31/PREFIRE_SAT2_2B-CLD_R01_P00_20240831222721_01490.nc']
['https://data.asdc.earthdata.nasa.gov/asdc-prod-protected/PREFIRE/PREFIRE_SAT2_2B-CLD_R01/2024.09.01/PREFIRE_SAT2_2B-CLD_R01_P00_20240901013749_01492.nc']
['https://data.asdc.earthdata.nasa.gov/asdc-prod-protected/PREFIRE/PREFIRE_SAT2_2B-CLD_R01/2024.09.01/PREFIRE_SAT2_2B-CLD_R01_P00_20240901031303_01493.nc']
['https://data.asdc.earthdata.nasa.gov/asdc-prod-protected/PREFIRE/PREFIRE_SAT2_2B-CLD_R01/2024.09.01/PREFIRE_SAT2_2B-CLD_R01_P00_20240901044818_01494.nc']
All at once
# remove downloaded granules for demonstration
!rm *.nc
= earthaccess.download(results_earthaccess, local_path=".") granules
print("Please provide your Earthdata Login credentials to allow data access")
print("Your credentials will only be passed to Earthdata and will not be exposed in the notebook")
= input("Username:")
username
= Client(env=Environment.PROD, auth=(username, getpass.getpass())) harmony_client
Please provide your Earthdata Login credentials to allow data access
Your credentials will only be passed to Earthdata and will not be exposed in the notebook
Username: alexrad71
········
Logging in with harmony-py
= datetime.strptime(date_start, "%Y-%m-%d %H:%M:%S")
start_date_object = datetime.strptime(date_end, "%Y-%m-%d %H:%M:%S")
end_date_object
= Request(
request =Collection(id=collectionID),
collection=PREFIRE_names,
granule_name=[
variables"Cld/cld_qc_bitflags",
"Cld/cloud_d_eff",
"Cld/cloud_tau",
"Cld/cloudtop_pressure",
"Geometry/ctime",
"Geometry/ctime_minus_UTC",
"Geometry/latitude",
"Geometry/longitude",
"Geometry/time_UTC_values",
],# , spatial = BBox(-180., 60., 180., 90.)
={"start": start_date_object, "stop": end_date_object},
temporal
)
= harmony_client.submit(request)
job_id
=True)
harmony_client.wait_for_processing(job_id, show_progress= harmony_client.download_all(job_id, directory="./", overwrite=True)
results = [f.result() for f in results] all_results_stored
[ Processing: 100% ] |###################################################| [|]
./101258408_PREFIRE_SAT2_2B-CLD_R01_P00_20240831222721_01490_subsetted_20240901T044818Z_C3499264827-LARC_CLOUD_merged.nc4
searching for the granules’ subset with Harmony
all_results_stored
['./101258408_PREFIRE_SAT2_2B-CLD_R01_P00_20240831222721_01490_subsetted_20240901T044818Z_C3499264827-LARC_CLOUD_merged.nc4']
if correct subset exist, start from this point
= [
all_results_stored "./101258408_PREFIRE_SAT2_2B-CLD_R01_P00_20240831222721_01490_subsetted_20240901T044818Z_C3499264827-LARC_CLOUD_merged.nc4"
]
read subset, get number of granules in it
= all_results_stored[0].split("/")[-1]
subset_fname
(
ctime,
ctime_minus_UTC,
lat,
lon,
time_UTC,
bitQF,
cloud_d_eff,
fv_cloud_d_eff,
cloud_tau,
fv_cloud_tau,
cloudtop_pressure,
fv_cloudtop_pressure,= read_PREFIRE_2B_CLD(subset_fname) )
= ctime.shape[0]
granules_number print("number of granules in the subset:", granules_number)
number of granules in the subset: 4
Plotting variables cloud_d_eff, cloud_tau, cloudtop_pressure
North Pole
for the South Pole the two lines need to be changed in the cell below
1) projection definition:
proj = ccrs.Orthographic(central_longitude=0.0, central_latitude=90.0, globe=None) # North Pole
proj = ccrs.Orthographic(central_longitude=0.0, central_latitude=-90.0, globe=None) # South Pole
2) extent of the plot:
ax1.set_extent([0., 360., 60., 90.], crs=transform) # North Pole
ax1.set_extent([0., 360., -90., -60.], crs=transform) # South Pole
# create arrays of valid values along with arrays of geopositions
for granule_i in range(granules_number):
# find valid beginning and ending times in the slice
for time in time_UTC[granule_i, :, :]:
if time[0] == -9999:
continue
= time
beginning_time_array break
for time in time_UTC[granule_i, -1::-1, :]:
if time[0] == -9999:
continue
= time
ending_time_array break
= f"{beginning_time_array[0]:4d}-{beginning_time_array[1]:02d}-{beginning_time_array[2]:02d} {beginning_time_array[3]:02d}:{beginning_time_array[4]:02d}:{beginning_time_array[5]:02d}"
beginning_time = f"{ending_time_array[0]:4d}-{ending_time_array[1]:02d}-{ending_time_array[2]:02d} {ending_time_array[3]:02d}:{ending_time_array[4]:02d}:{ending_time_array[5]:02d}"
ending_time = f"{beginning_time_array[0]:4d}{beginning_time_array[1]:02d}{beginning_time_array[2]:02d}T{beginning_time_array[3]:02d}{beginning_time_array[4]:02d}{beginning_time_array[5]:02d}"
beginning_time_fn = f"{ending_time_array[0]:4d}{ending_time_array[1]:02d}{ending_time_array[2]:02d}T{ending_time_array[3]:02d}{ending_time_array[4]:02d}{ending_time_array[5]:02d}"
ending_time_fn
= (cloud_d_eff[granule_i, :, :] != fv_cloud_d_eff) & (
mask_cloud_d_eff == 0
bitQF[granule_i, :, :]
)= (cloud_tau[granule_i, :, :] != fv_cloud_tau) & (bitQF[granule_i, :, :] == 0)
mask_cloud_tau = (cloudtop_pressure[granule_i, :, :] != fv_cloudtop_pressure) & (
mask_cloudtop_pressure == 0
bitQF[granule_i, :, :]
)
= cloud_d_eff[granule_i, mask_cloud_d_eff]
valid_cloud_d_eff = lat[granule_i, mask_cloud_d_eff]
valid_cloud_d_eff_lat = lon[granule_i, mask_cloud_d_eff]
valid_cloud_d_eff_lon
= cloud_tau[granule_i, mask_cloud_tau]
valid_cloud_tau = lat[granule_i, mask_cloud_tau]
valid_cloud_tau_lat = lon[granule_i, mask_cloud_tau]
valid_cloud_tau_lon
= cloudtop_pressure[granule_i, mask_cloudtop_pressure]
valid_cloudtop_pressure = lat[granule_i, mask_cloudtop_pressure]
valid_cloudtop_pressure_lat = lon[granule_i, mask_cloudtop_pressure]
valid_cloudtop_pressure_lon
# Plot arrays in orthografic projection
if len(valid_cloud_d_eff) > 0:
= plt.figure(figsize=(4, 4), dpi=300, facecolor=None)
fig
= ccrs.Orthographic(central_longitude=0.0, central_latitude=90.0, globe=None)
proj = ccrs.PlateCarree()
transform
= fig.add_subplot(111, projection=proj)
ax1 0.0, 360.0, 60.0, 90.0], crs=transform)
ax1.set_extent([= ax1.scatter(
im1
valid_cloud_d_eff_lon,
valid_cloud_d_eff_lat,=valid_cloud_d_eff,
c=1.0,
s=plt.cm.jet,
cmap=0.0,
vmin=50.0,
vmax=transform,
transform
)="50m", color="black", linewidth=1)
ax1.coastlines(resolution= ax1.gridlines(draw_labels=True, dms=True)
gl = False
gl.xlabels_top = False
gl.ylabels_left = plt.colorbar(
cb1
im1,=[0, 10.0, 20.0, 30.0, 40.0, 50.0],
ticks=0.025,
fraction=0.1,
pad="vertical",
orientation
)"effective diameter, micron", fontsize=8)
cb1.set_label("PREFIRE CLD D$_{eff}$ \n" + beginning_time + " " + ending_time, fontsize=8)
ax1.set_title(
plt.savefig("PREFIRE_CLD_D_eff_" + beginning_time_fn + "_" + ending_time_fn + ".png", dpi=600
)
plt.show()
plt.close()else:
print(
f"there is nothing to plot for cloud effective diameter between {beginning_time} and {ending_time}"
)
if len(valid_cloud_tau) > 0:
= plt.figure(figsize=(4, 4), dpi=300, facecolor=None)
fig
= ccrs.Orthographic(central_longitude=0.0, central_latitude=90.0, globe=None)
proj = ccrs.PlateCarree()
transform
= fig.add_subplot(111, projection=proj)
ax1 0.0, 360.0, 60.0, 90.0], crs=transform)
ax1.set_extent([= ax1.scatter(
im1
valid_cloud_tau_lon,
valid_cloud_tau_lat,=valid_cloud_tau,
c=1.0,
s=plt.cm.jet,
cmap=0.0,
vmin=20.0,
vmax=transform,
transform
)="50m", color="black", linewidth=1)
ax1.coastlines(resolution= ax1.gridlines(draw_labels=True, dms=True)
gl = False
gl.xlabels_top = False
gl.ylabels_left = plt.colorbar(
cb1 =[0, 5.0, 10.0, 15.0, 20.0], fraction=0.025, pad=0.1, orientation="vertical"
im1, ticks
)"cloud optical thickness", fontsize=8)
cb1.set_label(
ax1.set_title("PREFIRE cloud optical thickness \n" + beginning_time + " " + ending_time, fontsize=8
)
"PREFIRE_CLD_tau_" + beginning_time_fn + "_" + ending_time_fn + ".png", dpi=600)
plt.savefig(
plt.show()
plt.close()else:
print(
f"there is nothing to plot for cloud optical thickness between {beginning_time} and {ending_time}"
)
if len(valid_cloudtop_pressure) > 0:
= plt.figure(figsize=(4, 4), dpi=300, facecolor=None)
fig
= ccrs.Orthographic(central_longitude=0.0, central_latitude=90.0, globe=None)
proj = ccrs.PlateCarree()
transform
= fig.add_subplot(111, projection=proj)
ax1 0.0, 360.0, 60.0, 90.0], crs=transform)
ax1.set_extent([= ax1.scatter(
im1
valid_cloudtop_pressure_lon,
valid_cloudtop_pressure_lat,=valid_cloudtop_pressure,
c=1.0,
s=plt.cm.jet,
cmap=0.0,
vmin=1000.0,
vmax=transform,
transform
)="50m", color="black", linewidth=1)
ax1.coastlines(resolution= ax1.gridlines(draw_labels=True, dms=True)
gl = False
gl.xlabels_top = False
gl.ylabels_left = plt.colorbar(
cb1
im1,=[0, 200.0, 400.0, 600.0, 800.0, 1000.0],
ticks=0.025,
fraction=0.1,
pad="vertical",
orientation
)"cloudtop pressure, hPa", fontsize=8)
cb1.set_label(
ax1.set_title("PREFIRE cloudtop pressure \n" + beginning_time + " " + ending_time, fontsize=8
)
plt.savefig("PREFIRE_CLDTOP_pressure_" + beginning_time_fn + "_" + ending_time_fn + ".png", dpi=600
)
plt.show()
plt.close()else:
print(
f"there is nothing to plot for cloudtop pressure between {beginning_time} and {ending_time}"
)
there is nothing to plot for cloud effective diameter between 2024-08-31 23:59:55 and 2024-09-01 00:02:34
there is nothing to plot for cloud optical thickness between 2024-08-31 23:59:55 and 2024-09-01 00:02:34
there is nothing to plot for cloudtop pressure between 2024-08-31 23:59:55 and 2024-09-01 00:02:34
Plot the variables from the original granules
for name in PREFIRE_names:
(
ctime_orig,
ctime_minus_UTC_orig,
lat_orig,
lon_orig,
time_UTC_orig,
bitQF_orig,
cloud_d_eff_orig,
fv_cloud_d_eff_orig,
cloud_tau_orig,
fv_cloud_tau_orig,
cloudtop_pressure_orig,
fv_cloudtop_pressure_orig,= read_PREFIRE_2B_CLD(name)
)
# find valid beginning and ending times in the slice
for time in time_UTC_orig[:, :]:
if time[0] == -9999:
continue
= time
beginning_time_array break
for time in time_UTC_orig[-1::-1, :]:
if time[0] == -9999:
continue
= time
ending_time_array break
= f"{beginning_time_array[0]:4d}-{beginning_time_array[1]:02d}-{beginning_time_array[2]:02d} {beginning_time_array[3]:02d}:{beginning_time_array[4]:02d}:{beginning_time_array[5]:02d}"
beginning_time = f"{ending_time_array[0]:4d}-{ending_time_array[1]:02d}-{ending_time_array[2]:02d} {ending_time_array[3]:02d}:{ending_time_array[4]:02d}:{ending_time_array[5]:02d}"
ending_time = f"{beginning_time_array[0]:4d}{beginning_time_array[1]:02d}{beginning_time_array[2]:02d}T{beginning_time_array[3]:02d}{beginning_time_array[4]:02d}{beginning_time_array[5]:02d}"
beginning_time_fn = f"{ending_time_array[0]:4d}{ending_time_array[1]:02d}{ending_time_array[2]:02d}T{ending_time_array[3]:02d}{ending_time_array[4]:02d}{ending_time_array[5]:02d}"
ending_time_fn
= (cloud_d_eff_orig[:, :] != fv_cloud_d_eff) & (bitQF_orig[:, :] == 0)
mask_cloud_d_eff = (cloud_tau_orig[:, :] != fv_cloud_tau) & (bitQF_orig[:, :] == 0)
mask_cloud_tau = (cloudtop_pressure_orig[:, :] != fv_cloudtop_pressure) & (
mask_cloudtop_pressure == 0
bitQF_orig[:, :]
)
= cloud_d_eff_orig[mask_cloud_d_eff]
valid_cloud_d_eff = lat_orig[mask_cloud_d_eff]
valid_cloud_d_eff_lat = lon_orig[mask_cloud_d_eff]
valid_cloud_d_eff_lon
= cloud_tau_orig[mask_cloud_tau]
valid_cloud_tau = lat_orig[mask_cloud_tau]
valid_cloud_tau_lat = lon_orig[mask_cloud_tau]
valid_cloud_tau_lon
= cloudtop_pressure_orig[mask_cloudtop_pressure]
valid_cloudtop_pressure = lat_orig[mask_cloudtop_pressure]
valid_cloudtop_pressure_lat = lon_orig[mask_cloudtop_pressure]
valid_cloudtop_pressure_lon
# Plot arrays in orthografic projection
if len(valid_cloud_d_eff) > 0:
= plt.figure(figsize=(4, 4), dpi=300, facecolor=None)
fig
= ccrs.Orthographic(central_longitude=0.0, central_latitude=-90.0, globe=None)
proj = ccrs.PlateCarree()
transform
= fig.add_subplot(111, projection=proj)
ax1 0.0, 360.0, -90.0, -60.0], crs=transform)
ax1.set_extent([= ax1.scatter(
im1
valid_cloud_d_eff_lon,
valid_cloud_d_eff_lat,=valid_cloud_d_eff,
c=1.0,
s=plt.cm.jet,
cmap=0.0,
vmin=50.0,
vmax=transform,
transform
)="50m", color="black", linewidth=1)
ax1.coastlines(resolution= ax1.gridlines(draw_labels=True, dms=True)
gl = False
gl.xlabels_top = False
gl.ylabels_left = plt.colorbar(
cb1
im1,=[0, 10.0, 20.0, 30.0, 40.0, 50.0],
ticks=0.025,
fraction=0.1,
pad="vertical",
orientation
)"effective diameter, micron", fontsize=8)
cb1.set_label("PREFIRE CLD D$_{eff}$ \n" + beginning_time + " " + ending_time, fontsize=8)
ax1.set_title(
plt.savefig("PREFIRE_CLD_D_eff_SP_" + beginning_time_fn + "_" + ending_time_fn + ".png", dpi=600
)
plt.show()
plt.close()else:
print(
f"there is nothing to plot for cloud effective diameter between {beginning_time} and {ending_time}"
)
if len(valid_cloud_tau) > 0:
= plt.figure(figsize=(4, 4), dpi=300, facecolor=None)
fig
= ccrs.Orthographic(central_longitude=0.0, central_latitude=-90.0, globe=None)
proj = ccrs.PlateCarree()
transform
= fig.add_subplot(111, projection=proj)
ax1 0.0, 360.0, -90.0, -60.0], crs=transform)
ax1.set_extent([= ax1.scatter(
im1
valid_cloud_tau_lon,
valid_cloud_tau_lat,=valid_cloud_tau,
c=1.0,
s=plt.cm.jet,
cmap=0.0,
vmin=20.0,
vmax=transform,
transform
)="50m", color="black", linewidth=1)
ax1.coastlines(resolution= ax1.gridlines(draw_labels=True, dms=True)
gl = False
gl.xlabels_top = False
gl.ylabels_left = plt.colorbar(
cb1 =[0, 5.0, 10.0, 15.0, 20.0], fraction=0.025, pad=0.1, orientation="vertical"
im1, ticks
)"cloud optical thickness", fontsize=8)
cb1.set_label(
ax1.set_title("PREFIRE cloud optical thickness \n" + beginning_time + " " + ending_time, fontsize=8
)
plt.savefig("PREFIRE_CLD_tau_SP_" + beginning_time_fn + "_" + ending_time_fn + ".png", dpi=600
)
plt.show()
plt.close()else:
print(
f"there is nothing to plot for cloud optical thickness between {beginning_time} and {ending_time}"
)
if len(valid_cloudtop_pressure) > 0:
= plt.figure(figsize=(4, 4), dpi=300, facecolor=None)
fig
= ccrs.Orthographic(central_longitude=0.0, central_latitude=-90.0, globe=None)
proj = ccrs.PlateCarree()
transform
= fig.add_subplot(111, projection=proj)
ax1 0.0, 360.0, -90.0, -60.0], crs=transform)
ax1.set_extent([= ax1.scatter(
im1
valid_cloudtop_pressure_lon,
valid_cloudtop_pressure_lat,=valid_cloudtop_pressure,
c=1.0,
s=plt.cm.jet,
cmap=0.0,
vmin=1000.0,
vmax=transform,
transform
)="50m", color="black", linewidth=1)
ax1.coastlines(resolution= ax1.gridlines(draw_labels=True, dms=True)
gl = False
gl.xlabels_top = False
gl.ylabels_left = plt.colorbar(
cb1
im1,=[0, 200.0, 400.0, 600.0, 800.0, 1000.0],
ticks=0.025,
fraction=0.1,
pad="vertical",
orientation
)"cloudtop pressure, hPa", fontsize=8)
cb1.set_label(
ax1.set_title("PREFIRE cloudtop pressure \n" + beginning_time + " " + ending_time, fontsize=8
)
plt.savefig("PREFIRE_CLDTOP_pressure_SP_" + beginning_time_fn + "_" + ending_time_fn + ".png",
=600,
dpi
)
plt.show()
plt.close()else:
print(
f"there is nothing to plot for cloudtop pressure between {beginning_time} and {ending_time}"
)