monocongo/climate_indices

ERROR Failed to complete PET. Invalid latitude value: 90.0 (must be in degrees north, between -90.0 and 90.0 inclusive)

Closed this issue · 3 comments

Describe the bug
I want to use the following command to calculate PET:

process_climate_indices --index pet --periodicity monthly --netcdf_temp data/CMIP6/hist_GHG/tas_Amon_NorESM2-LM_hist-GHG_r3i1p1f1_gn_201501-202012_for_climate_indices.nc --var_name_temp tas --output_file_base data/CMIP6/hist_GHG/pet_Amon_NorESM2-LM_hist-GHG_r3i1p1f1_gn_201501-202012_ --multiprocessing all

But I got the error:

ValueError: Invalid latitude value: 90.0 (must be in degrees north, between -90.0 and 90.0 inclusive)

image

I checked the data I used and their latitude is from -90 to 90.
image

I want to know what went wrong.

  • OS: Linux
  • Version: climate-indices 1.0.13

Yes, this looks odd, your lats look good at first glance although I don't see everything in the screenshot you've shared.

I have a new version that will be released soon. Can you please try this again but instead use the climate_indices package from that PR's branch? I.e use a new virtual environment and install the latest development branch then rerun the processing. Try this: #530 (comment)

I'm sorry for the delay in my response. I sliced the latitude of the input temperature data to [-88,88], and the code worked. It appears to be a problem with the input data, although the latitude of the original data also seems to be [-90,90]. All in all, the problem is solved, thank you very much!

Thanks for your follow-up @DancingChild !

The issue here may be that the values need to be less than 90 degrees. If I remember correctly the PET/SPEI isn't very reliable at latitudes above 60 degrees, not useful in areas with lots of days below freezing.