[Python] What is the difference in sea ice fraction between LGM and MODERN and why? [closed]

Discussão em 'Python' iniciado por Stack, Novembro 29, 2024.

  1. Stack

    Stack Membro Participativo

    Use part 2 of the Coursework Background Information document in the Week 09 folder on the SOEE2710 Minerva page to help you indentify the netcdf files containing the annual mean sea ice fraction data files (*clann.nc) for the model experiments run over the LGM and MODERN periods. These files are 'climatology' files.

    Read in the sea ice fraction data and plot three maps of sea ice fraction, one each for the LGM and MODERN periods, and one showing the difference between the two (LGM minus MODERN). If you are able, use a loop to streamline the plotting process, in a similar manner to the solution for Worksheet 8 Question 2(b), although in this case you would loop over the different sea ice data.

    Use the cartopy package and the pcolor matplotlib function to make the plots and add the present-day coastlines to the plots as a black contour.

    The data you read in from the netcdf files will have a shape of (1,1,73,96). The lengths of the latitude and longitude dimensions are 73 and 96 respectively. The 1's represent the time and vertical level dimensions. In this case the data is on a single vertical level (i.e. the surface) and does not change in time. You need to remove these dimensions of length 1 before plotting the data, using the function np.squeeze():

    example_array = np.squeeze(example_array)

    Please note, that due to the way the model data is wrapped round the 0 degree longitude line, cartopy will produce a white stripe at 0 degrees longitude in all map plots. This is not trivial to fix and you will not lose marks for it.

    files1 = glob.glob("../coursework2/coursework/teadv3/climatology/*/clann.nc") files2 = glob.glob("../coursework2/coursework/teada3/climatology//*clann.nc")

    data1 = []

    for n in files1: data1.append(Dataset(n))

    data2 = []

    for n in files2: data2.append(Dataset(n))

    print(data1[0])

    Continue reading...

Compartilhe esta Página