COSIMA / cosima-recipes

Example recipes for analyzing model output using the cosima-cookbook infrastructure
https://cosima-recipes.readthedocs.io
Apache License 2.0
43 stars 65 forks source link

Intake conversion Model_Agnostic_Analysis #378

Open rbeucher opened 3 weeks ago

rbeucher commented 3 weeks ago

Following the discussion in issue #313, we propose converting the recipes to use Intake, given that the Cookbook is no longer supported and the ACCESS-NRI Intake catalog is now available.

A few months ago, @max-anu began working on this transition. This pull request contains the changes @max-anu made to the notebook specified in the title.

review-notebook-app[bot] commented 3 weeks ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

review-notebook-app[bot] commented 2 days ago

View / edit / reply to this conversation on ReviewNB

lidefi87 commented on 2024-07-01T05:30:42Z ----------------------------------------------------------------

We should add the conda environment that we need to use to run it.


review-notebook-app[bot] commented 2 days ago

View / edit / reply to this conversation on ReviewNB

lidefi87 commented on 2024-07-01T05:30:43Z ----------------------------------------------------------------

I prefer to have a chunk that only loads libraries and any use of functions (line 5) I like to have in a separate chunk.

While trying to run the notebook in Gadi, I got an error in line 5 because I was not a member of project xp65. We should probably add this information to the introduction to make sure users can run the notebook.


review-notebook-app[bot] commented 2 days ago

View / edit / reply to this conversation on ReviewNB

lidefi87 commented on 2024-07-01T05:30:43Z ----------------------------------------------------------------

When this address "tcp://10.6.77.34:8786" is used in the Client() , then the chunk does not run. Is this needed?


review-notebook-app[bot] commented 2 days ago

View / edit / reply to this conversation on ReviewNB

lidefi87 commented on 2024-07-01T05:30:44Z ----------------------------------------------------------------

This description does not appear to match what the chunk below is doing. Are you printing the variables available in the catalog?


review-notebook-app[bot] commented 2 days ago

View / edit / reply to this conversation on ReviewNB

lidefi87 commented on 2024-07-01T05:30:45Z ----------------------------------------------------------------

This chunk does not run because cat_subset is not defined until the next chunk. I would replace with:

experiment = '025deg_jra55_iaf_omip2_cycle6'
cat_subset = catalog[experiment]
sorted(set().union(*cat_subset.df['variable']))

Then the chunk below will look like the following:

variable = 'sst'
var_search = cat_subset.search(variable=variable, frequency='1mon')
darray = var_search.to_dask()
darray = darray[variable]
SST = darray

review-notebook-app[bot] commented 2 days ago

View / edit / reply to this conversation on ReviewNB

lidefi87 commented on 2024-07-01T05:30:45Z ----------------------------------------------------------------

We could probably replace the lines below:

darray = darray[variable]
SST = darray

with the following:

SST = darray[variable]

review-notebook-app[bot] commented 2 days ago

View / edit / reply to this conversation on ReviewNB

lidefi87 commented on 2024-07-01T05:30:46Z ----------------------------------------------------------------

Since the units have not been updated, I would also add a note about the units in the colourbar are not correct.


review-notebook-app[bot] commented 2 days ago

View / edit / reply to this conversation on ReviewNB

lidefi87 commented on 2024-07-01T05:30:47Z ----------------------------------------------------------------

I would update the units after the conversion, so that is before creating the plot.

Also, I do not think this chunk is necessary because the units were already defined in the original dataset.


review-notebook-app[bot] commented 2 days ago

View / edit / reply to this conversation on ReviewNB

lidefi87 commented on 2024-07-01T05:30:47Z ----------------------------------------------------------------

I would update the name of the function from plot_global_temp_in_degrees_celcius to map_mean_temp_in_degrees_celcius because it works with a subset of the data array, not just globally (i.e., I could plot the Southern Ocean only although with a suboptimal projection) and it calculates the mean spatially to create a map (as opposed to mean over time for a time series).


review-notebook-app[bot] commented 2 days ago

View / edit / reply to this conversation on ReviewNB

lidefi87 commented on 2024-07-01T05:30:48Z ----------------------------------------------------------------

This experiment (OM4_025.JRA_RYF) is not available in the catalog, refer to https://github.com/ACCESS-NRI/access-nri-intake-catalog/issues/175.

From this point onwards, the notebook does not run because either the experiments or variables used are not available in the catalogue.


review-notebook-app[bot] commented 2 days ago

View / edit / reply to this conversation on ReviewNB

lidefi87 commented on 2024-07-01T05:30:49Z ----------------------------------------------------------------

This experiment (025deg_jra55v13_iaf_gmredi6) is not available either. The 0.25 degree options available are:

025deg_jra55_iaf_omip2_cycle1
025deg_era5_iaf
025deg_jra55_iaf_omip2_cycle3
025deg_jra55_ryf9091_gadi
025deg_jra55_iaf_omip2_cycle2
025deg_jra55_iaf_omip2_cycle6
025deg_jra55_ryf_era5comparison
025deg_era5_ryf
025deg_jra55_iaf_era5comparison
025deg_jra55_iaf_omip2_cycle5
025deg_jra55_iaf_omip2_cycle4

Note that Tair_m is not available in any of the options above. Needs to be looked into.


review-notebook-app[bot] commented 2 days ago

View / edit / reply to this conversation on ReviewNB

lidefi87 commented on 2024-07-01T05:30:49Z ----------------------------------------------------------------

Line #4.    ice_air_temp = ice_air_temp.assign_coords({'TLON': ice_grid.tlon.pint.to('degrees_E'), 'TLAT': ice_grid.tlat.pint.to('degrees_N')})

This does not work because it is calling ice_air_temp which is not created because the Tair_m variable does not exist in any of the 0.25 degree datasets.