So I need to be working switch my code from jupyter notebook to spyder. I did some research on this error but all I have seen is doing it in jupyter solves the problem. This code came from jupyter and I need to run it on my local pc but now its not working. Does anyone know the workaround for this?
########## HAIL
url = 'https://nomads.ncep.noaa.gov/cgi-bin/filter_hrrr_2d.pl?file=hrrr.t{run}z.wrfsfcf{fhr}.grib2&lev_0.1_sigma_level=on&var_HAIL=on&leftlon=0&rightlon=360&toplat=90&bottomlat=-90&dir=%2Fhrrr.{ymd}%2Fconus'
URL = url.format(run=run, fhr=fhr, ymd=ymd)
r = requests.get(URL)
with open(r"C:\Users\kevin\Documents\extradata\hrr.hail.03", 'wb') as fh:
fh.write(r.content)
ds3 = xr.open_dataset(r"C:\Users\kevin\Documents\extradata\hrr.hail.03", engine='cfgrib')
lon, lat = ds3.longitude.values-360., ds3.latitude.values
hail = ds3.variables['hail']
hrrr3 = ds3.to_dataframe(dim_order=None)
JFK3 = hrrr3.iloc[[1251865, 1098863, 192179, 1093479, 364831, 580191, 1204696, 1395843, 1167136, 674130, 497931, 983360, 396676, 1585171, 826965, 687506, 319820, 1116874, 1179873, 1162649, 1262386, 1395238, 1072383, 405745, 1703931, 680474, 881884, 812749, 1056709, 782826, 1219370, 1064428, 745683, 1008418, 877572, 1222854]]
print("done")
The error I get is
ValueError: unrecognized engine cfgrib must be one of: ['scipy', 'store']
I downloaded spyder via anaconda/anaconda navigator and when i try to install cgfrib package it says it does not exists..
A solution would also be I just run everythin in a jupyter notebook but the code would HAVE to be able to save the image generated to my pc documents.