Python iris NetCDF time gone awry -
something seems have gone wrong between yesterday , today. i’m wondering if might able help? running python using iris.
basically when ran code yesterday got first graph here, today second:
if run 1 of cordex models (blue line) , 1 of observed data (black) on own, can see both run cordex model seems have funny going on time.
so printed time coordinates each following cordex model
dimcoord([netcdftime._netcdftime.datetimenoleap(1989, 1, 16, 12, 0, 0, 0, 4, 16), netcdftime._netcdftime.datetimenoleap(1989, 2, 15, 0, 0, 0, 0, 6, 46), netcdftime._netcdftime.datetimenoleap(1989, 3, 16, 12, 0, 0, 0, 0, 75), netcdftime._netcdftime.datetimenoleap(1989, 4, 16, 0, 0, 0, 0, 3, 106), netcdftime._netcdftime.datetimenoleap(1989, 5, 16, 12, 0, 0, 0, 5, 136), netcdftime._netcdftime.datetimenoleap(1989, 6, 16, 0, 0, 0, 0, 1, 167), netcdftime._netcdftime.datetimenoleap(1989, 7, 16, 12, 0, 0, 0, 3, 197), netcdftime._netcdftime.datetimenoleap(1989, 8, 16, 12, 0, 0, 0, 6, 228), netcdftime._netcdftime.datetimenoleap(1989, 9, 16, 0, 0, 0, 0, 2, 259), netcdftime._netcdftime.datetimenoleap(1989, 10, 16, 12, 0, 0, 0, 4, 289), netcdftime._netcdftime.datetimenoleap(1989, 11, 16, 0, 0, 0, 0, 0, 320), netcdftime._netcdftime.datetimenoleap(1989, 12, 16, 12, 0, 0, 0, 2, 350), netcdftime._netcdftime.datetimenoleap(1990, 1, 16, 12, 0, 0, 0, 5, 16), netcdftime._netcdftime.datetimenoleap(1990, 2, 15, 0, 0, 0, 0, 0, 46), netcdftime._netcdftime.datetimenoleap(1990, 3, 16, 12, 0, 0, 0, 1, 75), netcdftime._netcdftime.datetimenoleap(1990, 4, 16, 0, 0, 0, 0, 4, 106), netcdftime._netcdftime.datetimenoleap(1990, 5, 16, 12, 0, 0, 0, 6, 136), netcdftime._netcdftime.datetimenoleap(1990, 6, 16, 0, 0, 0, 0, 2, 167), netcdftime._netcdftime.datetimenoleap(1990, 7, 16, 12, 0, 0, 0, 4, 197), netcdftime._netcdftime.datetimenoleap(1990, 8, 16, 12, 0, 0, 0, 0, 228), netcdftime._netcdftime.datetimenoleap(1990, 9, 16, 0, 0, 0, 0, 3, 259), netcdftime._netcdftime.datetimenoleap(1990, 10, 16, 12, 0, 0, 0, 5, 289), netcdftime._netcdftime.datetimenoleap(1990, 11, 16, 0, 0, 0, 0, 1, 320), netcdftime._netcdftime.datetimenoleap(1990, 12, 16, 12, 0, 0, 0, 3, 350), netcdftime._netcdftime.datetimenoleap(1991, 1, 16, 12, 0, 0, 0, 6, 16), netcdftime._netcdftime.datetimenoleap(1991, 2, 15, 0, 0, 0, 0, 1, 46), netcdftime._netcdftime.datetimenoleap(1991, 3, 16, 12, 0, 0, 0, 2, 75), netcdftime._netcdftime.datetimenoleap(1991, 4, 16, 0, 0, 0, 0, 5, 106), netcdftime._netcdftime.datetimenoleap(1991, 5, 16, 12, 0, 0, 0, 0, 136), netcdftime._netcdftime.datetimenoleap(1991, 6, 16, 0, 0, 0, 0, 3, 167), netcdftime._netcdftime.datetimenoleap(1991, 7, 16, 12, 0, 0, 0, 5, 197), netcdftime._netcdftime.datetimenoleap(1991, 8, 16, 12, 0, 0, 0, 1, 228), netcdftime._netcdftime.datetimenoleap(1991, 9, 16, 0, 0, 0, 0, 4, 259), netcdftime._netcdftime.datetimenoleap(1991, 10, 16, 12, 0, 0, 0, 6, 289), netcdftime._netcdftime.datetimenoleap(1991, 11, 16, 0, 0, 0, 0, 2, 320), netcdftime._netcdftime.datetimenoleap(1991, 12, 16, 12, 0, 0, 0, 4, 350), netcdftime._netcdftime.datetimenoleap(1992, 1, 16, 12, 0, 0, 0, 0, 16), netcdftime._netcdftime.datetimenoleap(1992, 2, 15, 0, 0, 0, 0, 2, 46), netcdftime._netcdftime.datetimenoleap(1992, 3, 16, 12, 0, 0, 0, 3, 75), netcdftime._netcdftime.datetimenoleap(1992, 4, 16, 0, 0, 0, 0, 6, 106), netcdftime._netcdftime.datetimenoleap(1992, 5, 16, 12, 0, 0, 0, 1, 136), netcdftime._netcdftime.datetimenoleap(1992, 6, 16, 0, 0, 0, 0, 4, 167), netcdftime._netcdftime.datetimenoleap(1992, 7, 16, 12, 0, 0, 0, 6, 197), netcdftime._netcdftime.datetimenoleap(1992, 8, 16, 12, 0, 0, 0, 2, 228), netcdftime._netcdftime.datetimenoleap(1992, 9, 16, 0, 0, 0, 0, 5, 259), netcdftime._netcdftime.datetimenoleap(1992, 10, 16, 12, 0, 0, 0, 0, 289), netcdftime._netcdftime.datetimenoleap(1992, 11, 16, 0, 0, 0, 0, 3, 320), netcdftime._netcdftime.datetimenoleap(1992, 12, 16, 12, 0, 0, 0, 5, 350), netcdftime._netcdftime.datetimenoleap(1993, 1, 16, 12, 0, 0, 0, 1, 16), netcdftime._netcdftime.datetimenoleap(1993, 2, 15, 0, 0, 0, 0, 3, 46), netcdftime._netcdftime.datetimenoleap(1993, 3, 16, 12, 0, 0, 0, 4, 75), netcdftime._netcdftime.datetimenoleap(1993, 4, 16, 0, 0, 0, 0, 0, 106), netcdftime._netcdftime.datetimenoleap(1993, 5, 16, 12, 0, 0, 0, 2, 136), netcdftime._netcdftime.datetimenoleap(1993, 6, 16, 0, 0, 0, 0, 5, 167), netcdftime._netcdftime.datetimenoleap(1993, 7, 16, 12, 0, 0, 0, 0, 197), netcdftime._netcdftime.datetimenoleap(1993, 8, 16, 12, 0, 0, 0, 3, 228), netcdftime._netcdftime.datetimenoleap(1993, 9, 16, 0, 0, 0, 0, 6, 259), netcdftime._netcdftime.datetimenoleap(1993, 10, 16, 12, 0, 0, 0, 1, 289), netcdftime._netcdftime.datetimenoleap(1993, 11, 16, 0, 0, 0, 0, 4, 320), netcdftime._netcdftime.datetimenoleap(1993, 12, 16, 12, 0, 0, 0, 6, 350), netcdftime._netcdftime.datetimenoleap(1994, 1, 16, 12, 0, 0, 0, 2, 16), netcdftime._netcdftime.datetimenoleap(1994, 2, 15, 0, 0, 0, 0, 4, 46), netcdftime._netcdftime.datetimenoleap(1994, 3, 16, 12, 0, 0, 0, 5, 75), netcdftime._netcdftime.datetimenoleap(1994, 4, 16, 0, 0, 0, 0, 1, 106), netcdftime._netcdftime.datetimenoleap(1994, 5, 16, 12, 0, 0, 0, 3, 136), netcdftime._netcdftime.datetimenoleap(1994, 6, 16, 0, 0, 0, 0, 6, 167), netcdftime._netcdftime.datetimenoleap(1994, 7, 16, 12, 0, 0, 0, 1, 197), netcdftime._netcdftime.datetimenoleap(1994, 8, 16, 12, 0, 0, 0, 4, 228), netcdftime._netcdftime.datetimenoleap(1994, 9, 16, 0, 0, 0, 0, 0, 259), netcdftime._netcdftime.datetimenoleap(1994, 10, 16, 12, 0, 0, 0, 2, 289), netcdftime._netcdftime.datetimenoleap(1994, 11, 16, 0, 0, 0, 0, 5, 320), netcdftime._netcdftime.datetimenoleap(1994, 12, 16, 12, 0, 0, 0, 0, 350), netcdftime._netcdftime.datetimenoleap(1995, 1, 16, 12, 0, 0, 0, 3, 16), netcdftime._netcdftime.datetimenoleap(1995, 2, 15, 0, 0, 0, 0, 5, 46), netcdftime._netcdftime.datetimenoleap(1995, 3, 16, 12, 0, 0, 0, 6, 75), netcdftime._netcdftime.datetimenoleap(1995, 4, 16, 0, 0, 0, 0, 2, 106), netcdftime._netcdftime.datetimenoleap(1995, 5, 16, 12, 0, 0, 0, 4, 136), netcdftime._netcdftime.datetimenoleap(1995, 6, 16, 0, 0, 0, 0, 0, 167), netcdftime._netcdftime.datetimenoleap(1995, 7, 16, 12, 0, 0, 0, 2, 197), netcdftime._netcdftime.datetimenoleap(1995, 8, 16, 12, 0, 0, 0, 5, 228), netcdftime._netcdftime.datetimenoleap(1995, 9, 16, 0, 0, 0, 0, 1, 259), netcdftime._netcdftime.datetimenoleap(1995, 10, 16, 12, 0, 0, 0, 3, 289), netcdftime._netcdftime.datetimenoleap(1995, 11, 16, 0, 0, 0, 0, 6, 320), netcdftime._netcdftime.datetimenoleap(1995, 12, 16, 12, 0, 0, 0, 1, 350), netcdftime._netcdftime.datetimenoleap(1996, 1, 16, 12, 0, 0, 0, 4, 16), netcdftime._netcdftime.datetimenoleap(1996, 2, 15, 0, 0, 0, 0, 6, 46), netcdftime._netcdftime.datetimenoleap(1996, 3, 16, 12, 0, 0, 0, 0, 75), netcdftime._netcdftime.datetimenoleap(1996, 4, 16, 0, 0, 0, 0, 3, 106), netcdftime._netcdftime.datetimenoleap(1996, 5, 16, 12, 0, 0, 0, 5, 136), netcdftime._netcdftime.datetimenoleap(1996, 6, 16, 0, 0, 0, 0, 1, 167), netcdftime._netcdftime.datetimenoleap(1996, 7, 16, 12, 0, 0, 0, 3, 197), netcdftime._netcdftime.datetimenoleap(1996, 8, 16, 12, 0, 0, 0, 6, 228), netcdftime._netcdftime.datetimenoleap(1996, 9, 16, 0, 0, 0, 0, 2, 259), netcdftime._netcdftime.datetimenoleap(1996, 10, 16, 12, 0, 0, 0, 4, 289), netcdftime._netcdftime.datetimenoleap(1996, 11, 16, 0, 0, 0, 0, 0, 320), netcdftime._netcdftime.datetimenoleap(1996, 12, 16, 12, 0, 0, 0, 2, 350), netcdftime._netcdftime.datetimenoleap(1997, 1, 16, 12, 0, 0, 0, 5, 16), netcdftime._netcdftime.datetimenoleap(1997, 2, 15, 0, 0, 0, 0, 0, 46), netcdftime._netcdftime.datetimenoleap(1997, 3, 16, 12, 0, 0, 0, 1, 75), netcdftime._netcdftime.datetimenoleap(1997, 4, 16, 0, 0, 0, 0, 4, 106), netcdftime._netcdftime.datetimenoleap(1997, 5, 16, 12, 0, 0, 0, 6, 136), netcdftime._netcdftime.datetimenoleap(1997, 6, 16, 0, 0, 0, 0, 2, 167), netcdftime._netcdftime.datetimenoleap(1997, 7, 16, 12, 0, 0, 0, 4, 197), netcdftime._netcdftime.datetimenoleap(1997, 8, 16, 12, 0, 0, 0, 0, 228), netcdftime._netcdftime.datetimenoleap(1997, 9, 16, 0, 0, 0, 0, 3, 259), netcdftime._netcdftime.datetimenoleap(1997, 10, 16, 12, 0, 0, 0, 5, 289), netcdftime._netcdftime.datetimenoleap(1997, 11, 16, 0, 0, 0, 0, 1, 320), netcdftime._netcdftime.datetimenoleap(1997, 12, 16, 12, 0, 0, 0, 3, 350), netcdftime._netcdftime.datetimenoleap(1998, 1, 16, 12, 0, 0, 0, 6, 16), netcdftime._netcdftime.datetimenoleap(1998, 2, 15, 0, 0, 0, 0, 1, 46), netcdftime._netcdftime.datetimenoleap(1998, 3, 16, 12, 0, 0, 0, 2, 75), netcdftime._netcdftime.datetimenoleap(1998, 4, 16, 0, 0, 0, 0, 5, 106), netcdftime._netcdftime.datetimenoleap(1998, 5, 16, 12, 0, 0, 0, 0, 136), netcdftime._netcdftime.datetimenoleap(1998, 6, 16, 0, 0, 0, 0, 3, 167), netcdftime._netcdftime.datetimenoleap(1998, 7, 16, 12, 0, 0, 0, 5, 197), netcdftime._netcdftime.datetimenoleap(1998, 8, 16, 12, 0, 0, 0, 1, 228), netcdftime._netcdftime.datetimenoleap(1998, 9, 16, 0, 0, 0, 0, 4, 259), netcdftime._netcdftime.datetimenoleap(1998, 10, 16, 12, 0, 0, 0, 6, 289), netcdftime._netcdftime.datetimenoleap(1998, 11, 16, 0, 0, 0, 0, 2, 320), netcdftime._netcdftime.datetimenoleap(1998, 12, 16, 12, 0, 0, 0, 4, 350), netcdftime._netcdftime.datetimenoleap(1999, 1, 16, 12, 0, 0, 0, 0, 16), netcdftime._netcdftime.datetimenoleap(1999, 2, 15, 0, 0, 0, 0, 2, 46), netcdftime._netcdftime.datetimenoleap(1999, 3, 16, 12, 0, 0, 0, 3, 75), netcdftime._netcdftime.datetimenoleap(1999, 4, 16, 0, 0, 0, 0, 6, 106), netcdftime._netcdftime.datetimenoleap(1999, 5, 16, 12, 0, 0, 0, 1, 136), netcdftime._netcdftime.datetimenoleap(1999, 6, 16, 0, 0, 0, 0, 4, 167), netcdftime._netcdftime.datetimenoleap(1999, 7, 16, 12, 0, 0, 0, 6, 197), netcdftime._netcdftime.datetimenoleap(1999, 8, 16, 12, 0, 0, 0, 2, 228), netcdftime._netcdftime.datetimenoleap(1999, 9, 16, 0, 0, 0, 0, 5, 259), netcdftime._netcdftime.datetimenoleap(1999, 10, 16, 12, 0, 0, 0, 0, 289), netcdftime._netcdftime.datetimenoleap(1999, 11, 16, 0, 0, 0, 0, 3, 320), netcdftime._netcdftime.datetimenoleap(1999, 12, 16, 12, 0, 0, 0, 5, 350), netcdftime._netcdftime.datetimenoleap(2000, 1, 16, 12, 0, 0, 0, 1, 16), netcdftime._netcdftime.datetimenoleap(2000, 2, 15, 0, 0, 0, 0, 3, 46), netcdftime._netcdftime.datetimenoleap(2000, 3, 16, 12, 0, 0, 0, 4, 75), netcdftime._netcdftime.datetimenoleap(2000, 4, 16, 0, 0, 0, 0, 0, 106), netcdftime._netcdftime.datetimenoleap(2000, 5, 16, 12, 0, 0, 0, 2, 136), netcdftime._netcdftime.datetimenoleap(2000, 6, 16, 0, 0, 0, 0, 5, 167), netcdftime._netcdftime.datetimenoleap(2000, 7, 16, 12, 0, 0, 0, 0, 197), netcdftime._netcdftime.datetimenoleap(2000, 8, 16, 12, 0, 0, 0, 3, 228), netcdftime._netcdftime.datetimenoleap(2000, 9, 16, 0, 0, 0, 0, 6, 259), netcdftime._netcdftime.datetimenoleap(2000, 10, 16, 12, 0, 0, 0, 1, 289), netcdftime._netcdftime.datetimenoleap(2000, 11, 16, 0, 0, 0, 0, 4, 320), netcdftime._netcdftime.datetimenoleap(2000, 12, 16, 12, 0, 0, 0, 6, 350), netcdftime._netcdftime.datetimenoleap(2001, 1, 16, 12, 0, 0, 0, 2, 16), netcdftime._netcdftime.datetimenoleap(2001, 2, 15, 0, 0, 0, 0, 4, 46), netcdftime._netcdftime.datetimenoleap(2001, 3, 16, 12, 0, 0, 0, 5, 75), netcdftime._netcdftime.datetimenoleap(2001, 4, 16, 0, 0, 0, 0, 1, 106), netcdftime._netcdftime.datetimenoleap(2001, 5, 16, 12, 0, 0, 0, 3, 136), netcdftime._netcdftime.datetimenoleap(2001, 6, 16, 0, 0, 0, 0, 6, 167), netcdftime._netcdftime.datetimenoleap(2001, 7, 16, 12, 0, 0, 0, 1, 197), netcdftime._netcdftime.datetimenoleap(2001, 8, 16, 12, 0, 0, 0, 4, 228), netcdftime._netcdftime.datetimenoleap(2001, 9, 16, 0, 0, 0, 0, 0, 259), netcdftime._netcdftime.datetimenoleap(2001, 10, 16, 12, 0, 0, 0, 2, 289), netcdftime._netcdftime.datetimenoleap(2001, 11, 16, 0, 0, 0, 0, 5, 320), netcdftime._netcdftime.datetimenoleap(2001, 12, 16, 12, 0, 0, 0, 0, 350), netcdftime._netcdftime.datetimenoleap(2002, 1, 16, 12, 0, 0, 0, 3, 16), netcdftime._netcdftime.datetimenoleap(2002, 2, 15, 0, 0, 0, 0, 5, 46), netcdftime._netcdftime.datetimenoleap(2002, 3, 16, 12, 0, 0, 0, 6, 75), netcdftime._netcdftime.datetimenoleap(2002, 4, 16, 0, 0, 0, 0, 2, 106), netcdftime._netcdftime.datetimenoleap(2002, 5, 16, 12, 0, 0, 0, 4, 136), netcdftime._netcdftime.datetimenoleap(2002, 6, 16, 0, 0, 0, 0, 0, 167), netcdftime._netcdftime.datetimenoleap(2002, 7, 16, 12, 0, 0, 0, 2, 197), netcdftime._netcdftime.datetimenoleap(2002, 8, 16, 12, 0, 0, 0, 5, 228), netcdftime._netcdftime.datetimenoleap(2002, 9, 16, 0, 0, 0, 0, 1, 259), netcdftime._netcdftime.datetimenoleap(2002, 10, 16, 12, 0, 0, 0, 3, 289), netcdftime._netcdftime.datetimenoleap(2002, 11, 16, 0, 0, 0, 0, 6, 320), netcdftime._netcdftime.datetimenoleap(2002, 12, 16, 12, 0, 0, 0, 1, 350), netcdftime._netcdftime.datetimenoleap(2003, 1, 16, 12, 0, 0, 0, 4, 16), netcdftime._netcdftime.datetimenoleap(2003, 2, 15, 0, 0, 0, 0, 6, 46), netcdftime._netcdftime.datetimenoleap(2003, 3, 16, 12, 0, 0, 0, 0, 75), netcdftime._netcdftime.datetimenoleap(2003, 4, 16, 0, 0, 0, 0, 3, 106), netcdftime._netcdftime.datetimenoleap(2003, 5, 16, 12, 0, 0, 0, 5, 136), netcdftime._netcdftime.datetimenoleap(2003, 6, 16, 0, 0, 0, 0, 1, 167), netcdftime._netcdftime.datetimenoleap(2003, 7, 16, 12, 0, 0, 0, 3, 197), netcdftime._netcdftime.datetimenoleap(2003, 8, 16, 12, 0, 0, 0, 6, 228), netcdftime._netcdftime.datetimenoleap(2003, 9, 16, 0, 0, 0, 0, 2, 259), netcdftime._netcdftime.datetimenoleap(2003, 10, 16, 12, 0, 0, 0, 4, 289), netcdftime._netcdftime.datetimenoleap(2003, 11, 16, 0, 0, 0, 0, 0, 320), netcdftime._netcdftime.datetimenoleap(2003, 12, 16, 12, 0, 0, 0, 2, 350), netcdftime._netcdftime.datetimenoleap(2004, 1, 16, 12, 0, 0, 0, 5, 16), netcdftime._netcdftime.datetimenoleap(2004, 2, 15, 0, 0, 0, 0, 0, 46), netcdftime._netcdftime.datetimenoleap(2004, 3, 16, 12, 0, 0, 0, 1, 75), netcdftime._netcdftime.datetimenoleap(2004, 4, 16, 0, 0, 0, 0, 4, 106), netcdftime._netcdftime.datetimenoleap(2004, 5, 16, 12, 0, 0, 0, 6, 136), netcdftime._netcdftime.datetimenoleap(2004, 6, 16, 0, 0, 0, 0, 2, 167), netcdftime._netcdftime.datetimenoleap(2004, 7, 16, 12, 0, 0, 0, 4, 197), netcdftime._netcdftime.datetimenoleap(2004, 8, 16, 12, 0, 0, 0, 0, 228), netcdftime._netcdftime.datetimenoleap(2004, 9, 16, 0, 0, 0, 0, 3, 259), netcdftime._netcdftime.datetimenoleap(2004, 10, 16, 12, 0, 0, 0, 5, 289), netcdftime._netcdftime.datetimenoleap(2004, 11, 16, 0, 0, 0, 0, 1, 320), netcdftime._netcdftime.datetimenoleap(2004, 12, 16, 12, 0, 0, 0, 3, 350), netcdftime._netcdftime.datetimenoleap(2005, 1, 16, 12, 0, 0, 0, 6, 16), netcdftime._netcdftime.datetimenoleap(2005, 2, 15, 0, 0, 0, 0, 1, 46), netcdftime._netcdftime.datetimenoleap(2005, 3, 16, 12, 0, 0, 0, 2, 75), netcdftime._netcdftime.datetimenoleap(2005, 4, 16, 0, 0, 0, 0, 5, 106), netcdftime._netcdftime.datetimenoleap(2005, 5, 16, 12, 0, 0, 0, 0, 136), netcdftime._netcdftime.datetimenoleap(2005, 6, 16, 0, 0, 0, 0, 3, 167), netcdftime._netcdftime.datetimenoleap(2005, 7, 16, 12, 0, 0, 0, 5, 197), netcdftime._netcdftime.datetimenoleap(2005, 8, 16, 12, 0, 0, 0, 1, 228), netcdftime._netcdftime.datetimenoleap(2005, 9, 16, 0, 0, 0, 0, 4, 259), netcdftime._netcdftime.datetimenoleap(2005, 10, 16, 12, 0, 0, 0, 6, 289), netcdftime._netcdftime.datetimenoleap(2005, 11, 16, 0, 0, 0, 0, 2, 320), netcdftime._netcdftime.datetimenoleap(2005, 12, 16, 12, 0, 0, 0, 4, 350), netcdftime._netcdftime.datetimenoleap(2006, 1, 16, 12, 0, 0, 0, 0, 16), netcdftime._netcdftime.datetimenoleap(2006, 2, 15, 0, 0, 0, 0, 2, 46), netcdftime._netcdftime.datetimenoleap(2006, 3, 16, 12, 0, 0, 0, 3, 75), netcdftime._netcdftime.datetimenoleap(2006, 4, 16, 0, 0, 0, 0, 6, 106), netcdftime._netcdftime.datetimenoleap(2006, 5, 16, 12, 0, 0, 0, 1, 136), netcdftime._netcdftime.datetimenoleap(2006, 6, 16, 0, 0, 0, 0, 4, 167), netcdftime._netcdftime.datetimenoleap(2006, 7, 16, 12, 0, 0, 0, 6, 197), netcdftime._netcdftime.datetimenoleap(2006, 8, 16, 12, 0, 0, 0, 2, 228), netcdftime._netcdftime.datetimenoleap(2006, 9, 16, 0, 0, 0, 0, 5, 259), netcdftime._netcdftime.datetimenoleap(2006, 10, 16, 12, 0, 0, 0, 0, 289), netcdftime._netcdftime.datetimenoleap(2006, 11, 16, 0, 0, 0, 0, 3, 320), netcdftime._netcdftime.datetimenoleap(2006, 12, 16, 12, 0, 0, 0, 5, 350), netcdftime._netcdftime.datetimenoleap(2007, 1, 16, 12, 0, 0, 0, 1, 16), netcdftime._netcdftime.datetimenoleap(2007, 2, 15, 0, 0, 0, 0, 3, 46), netcdftime._netcdftime.datetimenoleap(2007, 3, 16, 12, 0, 0, 0, 4, 75), netcdftime._netcdftime.datetimenoleap(2007, 4, 16, 0, 0, 0, 0, 0, 106), netcdftime._netcdftime.datetimenoleap(2007, 5, 16, 12, 0, 0, 0, 2, 136), netcdftime._netcdftime.datetimenoleap(2007, 6, 16, 0, 0, 0, 0, 5, 167), netcdftime._netcdftime.datetimenoleap(2007, 7, 16, 12, 0, 0, 0, 0, 197), netcdftime._netcdftime.datetimenoleap(2007, 8, 16, 12, 0, 0, 0, 3, 228), netcdftime._netcdftime.datetimenoleap(2007, 9, 16, 0, 0, 0, 0, 6, 259), netcdftime._netcdftime.datetimenoleap(2007, 10, 16, 12, 0, 0, 0, 1, 289), netcdftime._netcdftime.datetimenoleap(2007, 11, 16, 0, 0, 0, 0, 4, 320), netcdftime._netcdftime.datetimenoleap(2007, 12, 16, 12, 0, 0, 0, 6, 350), netcdftime._netcdftime.datetimenoleap(2008, 1, 16, 12, 0, 0, 0, 2, 16), netcdftime._netcdftime.datetimenoleap(2008, 2, 15, 0, 0, 0, 0, 4, 46), netcdftime._netcdftime.datetimenoleap(2008, 3, 16, 12, 0, 0, 0, 5, 75), netcdftime._netcdftime.datetimenoleap(2008, 4, 16, 0, 0, 0, 0, 1, 106), netcdftime._netcdftime.datetimenoleap(2008, 5, 16, 12, 0, 0, 0, 3, 136), netcdftime._netcdftime.datetimenoleap(2008, 6, 16, 0, 0, 0, 0, 6, 167), netcdftime._netcdftime.datetimenoleap(2008, 7, 16, 12, 0, 0, 0, 1, 197), netcdftime._netcdftime.datetimenoleap(2008, 8, 16, 12, 0, 0, 0, 4, 228), netcdftime._netcdftime.datetimenoleap(2008, 9, 16, 0, 0, 0, 0, 0, 259), netcdftime._netcdftime.datetimenoleap(2008, 10, 16, 12, 0, 0, 0, 2, 289), netcdftime._netcdftime.datetimenoleap(2008, 11, 16, 0, 0, 0, 0, 5, 320), netcdftime._netcdftime.datetimenoleap(2008, 12, 16, 12, 0, 0, 0, 0, 350), netcdftime._netcdftime.datetimenoleap(2009, 1, 16, 12, 0, 0, 0, 3, 16), netcdftime._netcdftime.datetimenoleap(2009, 2, 15, 0, 0, 0, 0, 5, 46), netcdftime._netcdftime.datetimenoleap(2009, 3, 16, 12, 0, 0, 0, 6, 75), netcdftime._netcdftime.datetimenoleap(2009, 4, 16, 0, 0, 0, 0, 2, 106), netcdftime._netcdftime.datetimenoleap(2009, 5, 16, 12, 0, 0, 0, 4, 136), netcdftime._netcdftime.datetimenoleap(2009, 6, 16, 0, 0, 0, 0, 0, 167), netcdftime._netcdftime.datetimenoleap(2009, 7, 16, 12, 0, 0, 0, 2, 197), netcdftime._netcdftime.datetimenoleap(2009, 8, 16, 12, 0, 0, 0, 5, 228), netcdftime._netcdftime.datetimenoleap(2009, 9, 16, 0, 0, 0, 0, 1, 259), netcdftime._netcdftime.datetimenoleap(2009, 10, 16, 12, 0, 0, 0, 3, 289), netcdftime._netcdftime.datetimenoleap(2009, 11, 16, 0, 0, 0, 0, 6, 320), netcdftime._netcdftime.datetimenoleap(2009, 12, 16, 12, 0, 0, 0, 1, 350)], standard_name=u'time', calendar=u'365_day', long_name=u'time', var_name='time')
and observed data:
dimcoord([datetime.datetime(1901, 1, 16, 0, 0), datetime.datetime(1901, 2, 15, 0, 0), datetime.datetime(1901, 3, 16, 0, 0), ..., datetime.datetime(2015, 10, 16, 0, 0), datetime.datetime(2015, 11, 16, 0, 0), datetime.datetime(2015, 12, 16, 0, 0)], standard_name='time', calendar=u'gregorian', long_name=u'time', var_name='time')
so i’m bit confused why worked yesterday isn’t working today. think might able help?
here simplified version of code running
import matplotlib.pyplot plt import iris import iris.coord_categorisation iriscc import iris.plot iplt import iris.quickplot qplt import iris.analysis.cartography import matplotlib.dates mdates #the first part of code cordex models, second half brings in observed data, , third plots annual temperature in line graph. def main(): #part 1: cordex models #bring in models need , give them name cccma = '/exports/csce/datastore/geos/users/s0xxxx/climate_modelling/afr_44_tas/eraint/1979-2012/tas_afr-44_ecmwf-eraint_evaluation_r1i1p1_cccma-canrcm4_r2_mon_198901-200912.nc' #load 1 cube given file cccma = iris.load_cube(cccma) #remove flat latitude , longitude , use grid latitude , grid longitude make consistent observed data, make sure of longitudes monotonic lats = iris.coords.dimcoord(cccma.coord('latitude').points[:,0], \ standard_name='latitude', units='degrees') lons = cccma.coord('longitude').points[0] in range(len(lons)): if lons[i]>100.: lons[i] = lons[i]-360. lons = iris.coords.dimcoord(lons, \ standard_name='longitude', units='degrees') cccma.remove_coord('latitude') cccma.remove_coord('longitude') cccma.remove_coord('grid_latitude') cccma.remove_coord('grid_longitude') cccma.add_dim_coord(lats, 1) cccma.add_dim_coord(lons, 2) #we interested in latitude , longitude relevant malawi malawi = iris.constraint(longitude=lambda v: 32.5 <= v <= 36., \ latitude=lambda v: -17. <= v <= -9.) cccma = cccma.extract(malawi) #time constraignt make series same iris.future.cell_datetime_objects = true t_constraint = iris.constraint(time=lambda cell: 1989 <= cell.point.year <= 2008) cccma = cccma.extract(t_constraint) #data in kelvin, show in celcius cccma.convert_units('celsius') #we interested in plotting graph time along x ais, need mean of coordinates, i.e. mean temperature across whole country iriscc.add_year(cccma, 'time') cccma = cccma.aggregated_by('year', iris.analysis.mean) cccma.coord('latitude').guess_bounds() cccma.coord('longitude').guess_bounds() cccma_grid_areas = iris.analysis.cartography.area_weights(cccma) cccma_mean = cccma.collapsed(['latitude', 'longitude'], iris.analysis.mean, weights=cccma_grid_areas) #part 2: observed data #bring in files need , give them name cru= '/exports/csce/datastore/geos/users/s0xxxx/climate_modelling/actual_data/cru_ts4.00.1901.2015.tmp.dat.nc' #load 1 cube given file cru = iris.load_cube(cru, 'near-surface temperature') #define latitude , longitude lats = iris.coords.dimcoord(cru.coord('latitude').points, \ standard_name='latitude', units='degrees') lons = cru.coord('longitude').points #we interested in latitude , longitude relevant malawi malawi = iris.constraint(longitude=lambda v: 32.5 <= v <= 36., \ latitude=lambda v: -17. <= v <= -9.) cru = cru.extract(malawi) #time constraignt make series same iris.future.cell_datetime_objects = true t_constraint = iris.constraint(time=lambda cell: 1989 <= cell.point.year <= 2008) cru = cru.extract(t_constraint) #we interested in plotting graph time along x ais, need mean of coordinates, i.e. mean temperature across whole country iriscc.add_year(cru, 'time') cru = cru.aggregated_by('year', iris.analysis.mean) cru.coord('latitude').guess_bounds() cru.coord('longitude').guess_bounds() cru_grid_areas = iris.analysis.cartography.area_weights(cru) cru_mean = cru.collapsed(['latitude', 'longitude'], iris.analysis.mean, weights=cru_grid_areas) #part 3: plot line graph - annual #set major plot indicators x-axis plt.gca().xaxis.set_major_locator(mdates.yearlocator(5)) #assign line colours qplt.plot(cccma_mean, label='canrcm4_eraint', lw=1.5, color='blue') qplt.plot(cru_mean, label='observed', lw=2, color='black') #create legend , set location under graph plt.legend(loc="upper center", bbox_to_anchor=(0.5,-0.05), fancybox=true, shadow=true, ncol=2) #create title plt.title('mean near surface temperature malawi 1989-2008', fontsize=11) #add grid lines plt.grid() #save image of graph , include full legend plt.savefig('eraint_temperature_linegraph_annual', bbox_inches='tight') #show graph in console iplt.show() if __name__ == '__main__': main()
thanks! erika
i don't know what's going on time
coordinate, workaround might plot against year
coordinates:
qplt.plot(cccma_mean.coord('year'), cccma_mean, label='canrcm4_eraint', lw=1.5, color='blue') qplt.plot(cru_mean.coord('year'), cru_mean, label='observed', lw=2, color='black')
Comments
Post a Comment