Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Construct the second line of the title by extracting the date and time from the MSLP field and converting into an appropriate string - do this in the Macro code.

Hints:

  • this procedure will be covered in Customising Your Plot Title
  • if you have a fieldset variable called msl_grib, the following line will extract the date at which the field is valid:
    • msl_date = grib_get_long(msl_grib, 'validityDate')
  • we can do something similar for the validity time
  • these are extracted as integer numbers, but can be combined into a proper date variable in Macro:
    • full_date = date(msl_date) + hour(msl_time)

  • use the string() function to construct a date string similar to the one used in the current title
  • insert this into the mtext() function instead of the current title
  • it is now more robust - if you use data from a different date or time, the title will still be correct
  • note that this method will not work directly if you want to generate an animation from different time steps of data

...