Minimum temperature of a year is given in GRD file. I have to read that file and then calculate the frost day (less than zero degrees celcius) from it in python.

  • 2
    Can you please provide I little bit more information (e.g. a sample file, a screenshot, or some numbers of your data).
    – ustroetz
    Apr 23, 2014 at 13:59
  • sir,how can i send u sample file,there is no upload option.
    – Rano
    Apr 23, 2014 at 14:10
  • (1) Is the data 365 days of temperature and you need to find how many are < 0? (2) You used the QGIS tag -- is your data imported already and you have questions about the statistics? Or are you asking about importing the GRD file?
    – Erica
    Apr 23, 2014 at 14:17
  • yes sir,i am having the data of 365 days and want to calculate number of day in which temp is less than 0 degree celcius in python.
    – Rano
    Apr 23, 2014 at 14:23

1 Answer 1


What are you using to do this?

In brief, you can load the data using RasterIO and then when you have a numpy array, you can do something like numpy.where( data < 3 ) and sum the resulting fields. That should give you an array that is X by Y and has a single value, which is a count of the number of days that are sub-zero. RasterIO again has a write function.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.