Coder Social home page Coder Social logo

santandermetgroup / atlas Goto Github PK

View Code? Open in Web Editor NEW
80.0 80.0 100.0 2.84 GB

Datasets, code and virtual workspace for the Climate Change ATLAS

License: Other

Jupyter Notebook 69.79% R 1.35% Shell 0.32% Dockerfile 0.01% HTML 28.54%
climate-change-atlas climate4r cmip6 cordex ipcc-regions warming-levels

atlas's People

Contributors

cofinoa avatar gutierjm avatar javierdiezsierra avatar jbedia avatar jesusff avatar jorgebanomedina avatar markelg avatar mathause avatar miturbide avatar rmanzanas avatar zequihg50 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

atlas's Issues

Aggregated values

Hi there,

Thanks for all your efforts with the ATLAS. I have a question about how you arrive at the values in your aggregated dataset. I have attempted to reproduce your values from CMIP6 data and don't arrive at the same numbers, it would be great to know if you have any idea why. The script I use is the below, all it does is read the data in (source files taken from the ESGF), then take an area-weighted mean.

import iris
import numpy as np

SHOW_VALS = 5
K_TO_C = 273.15

cmip5_file = "tas_Amon_ACCESS1-0_rcp45_r1i1p1_200601-201012.nc"
print(f"CMIP5 example: {cmip5_file}")

tas = iris.load_cube(cmip5_file)
tas_raw_mean = tas.collapsed(["longitude", "latitude"], iris.analysis.MEAN)
print("raw mean (K): {}".format(tas_raw_mean.data[:SHOW_VALS]))
print("raw mean (degC): {}".format(tas_raw_mean.data[:SHOW_VALS] - K_TO_C))

tas_area_weighted_mean = tas.collapsed(
    ["longitude", "latitude"],
    iris.analysis.MEAN,
    weights=iris.analysis.cartography.area_weights(tas)
)
print("iris areas, area-weighted mean (K): {}".format(tas_area_weighted_mean.data[:SHOW_VALS]))
print("iris areas, area-weighted mean (degC): {}".format(tas_area_weighted_mean.data[:SHOW_VALS] - K_TO_C))

area_weights = iris.load_cube("areacella_fx_ACCESS1-0_rcp45_r0i0p0.nc")
tas_area_weighted_mean = tas.collapsed(
    ["longitude", "latitude"],
    iris.analysis.MEAN,
    weights=np.broadcast_to(area_weights.data, tas.data.shape)
)
print("ACCESS areas, area-weighted mean (K): {}".format(tas_area_weighted_mean.data[:SHOW_VALS]))
print("ACCESS areas, area-weighted mean (degC): {}".format(tas_area_weighted_mean.data[:SHOW_VALS] - K_TO_C))


cmip6_file = "tas_Amon_MIROC-ES2L_ssp126_r1i1p1f2_gn_201501-210012.nc"
print(f"CMIP6 example: {cmip6_file}")
tas = iris.load_cube(cmip6_file)
tas_raw_mean = tas.collapsed(["longitude", "latitude"], iris.analysis.MEAN)
print("raw mean (K): {}".format(tas_raw_mean.data[:SHOW_VALS]))
print("raw mean (degC): {}".format(tas_raw_mean.data[:SHOW_VALS] - K_TO_C))

tas_area_weighted_mean = tas.collapsed(
    ["longitude", "latitude"],
    iris.analysis.MEAN,
    weights=iris.analysis.cartography.area_weights(tas)
)
print("iris areas, area-weighted mean (K): {}".format(tas_area_weighted_mean.data[:SHOW_VALS]))
print("iris areas, area-weighted mean (degC): {}".format(tas_area_weighted_mean.data[:SHOW_VALS] - K_TO_C))

area_weights = iris.load_cube("areacella_fx_MIROC-ES2L_ssp126_r1i1p1f2_gn.nc")
tas_area_weighted_mean = tas.collapsed(
    ["longitude", "latitude"],
    iris.analysis.MEAN,
    weights=np.broadcast_to(area_weights.data, tas.data.shape)
)
print("MIROC-ES2L areas, area-weighted mean (K): {}".format(tas_area_weighted_mean.data[:SHOW_VALS]))
print("MIROC-ES2L areas, area-weighted mean (degC): {}".format(tas_area_weighted_mean.data[:SHOW_VALS] - K_TO_C))

If I run this script, I get

$ python compare_atlas_simple_check.py 
CMIP5 example: tas_Amon_ACCESS1-0_rcp45_r1i1p1_200601-201012.nc

raw mean (K): [276.4684753417969 275.66357421875 275.80029296875 276.8258361816406
 278.55279541015625]
raw mean (degC): [3.3184814453125 2.513580322265625 2.650299072265625 3.67584228515625
 5.402801513671875]

iris areas, area-weighted mean (K): [285.52167953768986 285.6187406669899 286.48461306568055 287.3709760209917
 288.40164308778714]
iris areas, area-weighted mean (degC): [12.371679537689886 12.468740666989902 13.334613065680571
 14.220976020991714 15.251643087787158]

ACCESS areas, area-weighted mean (K): [285.52166748046875 285.61871337890625 286.4845886230469 287.3709411621094
 288.4016418457031]
ACCESS areas, area-weighted mean (degC): [12.371673583984375 12.468719482421875 13.3345947265625 14.220947265625
 15.25164794921875]

CMIP6 example: tas_Amon_MIROC-ES2L_ssp126_r1i1p1f2_gn_201501-210012.nc

raw mean (K): [280.04962158203125 279.3348388671875 279.257568359375 280.63916015625
 282.047607421875]
raw mean (degC): [6.899627685546875 6.184844970703125 6.107574462890625 7.489166259765625
 8.897613525390625]

iris areas, area-weighted mean (K): [287.44583487855414 287.6124896981895 288.3990031516224 289.4096341190363
 290.3122343145591]
iris areas, area-weighted mean (degC): [14.29583487855416 14.462489698189529 15.249003151622446 16.25963411903632
 17.1622343145591]

MIROC-ES2L areas, area-weighted mean (K): [287.44586181640625 287.61248779296875 288.3990173339844 289.4096374511719
 290.312255859375]
MIROC-ES2L areas, area-weighted mean (degC): [14.295867919921875 14.462493896484375 15.2490234375 16.2596435546875
 17.162261962890625]

This output doesn't agree with your datasets and I am puzzled about why. More specifically:

  • 2006-01 value for rcp45 ACCESS1 r1i1p1, I get: 12.372, you report: 13.185
  • 2006-02 value for rcp45 ACCESS1 r1i1p1, I get: 12.469, you report: 13.305

(the CMIP6 differences are much smaller so could be explained by re-gridding differences?)

  • 2015-01 value for ssp126 MIROC-ES2L r1i1p1f2, I get: 14.296, you report: 14.276
  • 2015-02 value for ssp126 MIROC-ES2L r1i1p1f2, I get: 14.462, you report: 14.439

Migrating to Jupyterbook

@jesusff and @miturbide I have created a branch named jupyterbook from changes from David's TFG repo PhantomAurelia/Atlas@adaeb97 and merged changes from devel and main

Then all branches and repos are in sync, but I need from you to review them on jupyterbook branch before make them definitive and merge back to main and devel. The review it's needed because bibliography and cross-references and links to local repo files and notebooks has been refactored. Also existing README.md and repo directories haven renamed and refactored.

Because David's fork was an old fork, then we need to be sure any changes after it's already merged.

Any commit to branch jupyterbook it's been automatically building the book and publishing it at:
https://santandermetgroup.github.io/ATLAS

Also, the notebooks have been connected to the Jupyterhub at GANYMEDE, but some issues exist fetching the ATLAS repos. This needs to be analysed, because the repo probably needs a re-foundation ....

Missing script in datasets-interactive-atlas folder

Description of the problem
grids-bounds-calc.py referenced in datasets-interactive-atlas's readme.md it is missing.

To Reproduce

Write below the steps to reproduce the problem:

  1. Head over to datasets-interactive-atlas
  2. Go to the README
  3. In the last line there is a reference to grid-bounds-calc.py
  4. Press the link.
  5. 404 error.

Expected behavior

Screenshots

Desktop (please complete the following information):

  • OS: Fedora Workstation 36
  • Browser: Firefox
  • Version:
    Captura desde 2022-10-13 10-58-59
    Captura desde 2022-10-13 10-59-17
    Captura desde 2022-10-13 10-59-30
    105.0.2

Additional context

CMIP6 data sources member_id

Just a question about CMIP6 data sources. Please can you explain or point to documentation which explains reasons for ATLAS using a particular member_id for a given source_id and experiment_id?

e.g. why does CMIP6_CESM2_ssp585_r4i1p1f1 use r4i1p1f1 over the other member_id's it has available?

Error!! CRS object has comment, which is lost in output; in tests

Hi!

I am referring to this file ATLAS/notebooks/reference-regions_R.ipynb

I met a problem when executing the command proj4string(refregions), and the warning message is as follows:

Warning message:
In proj4string(refregions) :
  CRS object has comment, which is lost in output; in tests, see
https://cran.r-project.org/web/packages/sp/vignettes/CRS_warnings.html

I am using Rstudio (R version 4.1.2) to do all the things, and everything ran perfectly with previous commands.

Can you let me know what's the problem?

Many thanks in advance.

Broken elements on front page (video & testing survey)

I've also reported at IPCC-WG1#70 (but copying here, as it seems that repo is frozen?)

Description of the problem

There are two videos on the page https://interactive-atlas.ipcc.ch/ which show "This video does not exist". Moreover, there is a survey link greyed out.

To Reproduce

go to https://interactive-atlas.ipcc.ch/

Expected behavior

The landing page should not have broken elements.

Screenshots

image

Desktop (please complete the following information):

  • OS: Linux (Ubuntu 20.04)
  • Browser Firefox 93 and Chromium 95.0

Masking

Another question (sorry for having so many @miturbide!). I wanted to check that I have correctly understood how your masking works.

maskland <- binaryGrid(mask, condition = "GT", threshold = 0.999, values = c(NA, 1))
suggests that any region with a surface land fraction greater than 0.999 is classified as land.
masksea <- binaryGrid(mask, condition = "LT", threshold = 0.001, values = c(NA, 1))
suggests that any region with a surface land fraction less than 0.001 is classified as sea.

Does this mean that any cell with surface land fraction greater than 0.001 and less than 0.999 (about 5% of cells looking at https://github.com/SantanderMetGroup/ATLAS/blob/master/reference-grids/land_sea_mask_1degree.nc4) is not included in either the sea or land calculation? In other words, only cells which are clearly one or the other are included in the masked averages?

Regional mean weighting

Hi there,

Thanks for all your efforts with the ATLAS. I have what I hope is a quick question: after you've interpolated the files onto a common grid, are your regional-means weighted by cell area, or are they simply a mean over all the cells (giving each cell equal weight)? This would be great to know for some analysis I'm doing.

Thanks!

Shapefile polygon holes in between Australian regions

Description of the problem

Holes in the polygons between the CAU, EAU and SAU regions in Australia - issue located around (145.491,-32.908). Verified though QGIS and a geopandas spatial join which yield NULL regions.

To Reproduce

  1. Download shapefile from https://github.com/SantanderMetGroup/ATLAS/blob/main/reference-regions/IPCC-WGI-reference-regions-v4_shapefile.zip\
  2. Import into QGIS as vector

Expected behavior

Expect the Shapefile to have adjoining polygons with no NULL areas inside the wgs 84 epsg:4326 bounds.

Screenshots

Screenshot 2023-04-07 at 16 56 38

Screenshot 2023-04-07 at 16 59 20

Desktop (please complete the following information):

  • OS: MacOS Ventura
  • QGIS 3.22 LTR
  • Python Geopandas

Omitted ocean regions

Hi folks, I am curious if an update has been made to the region map to more clearly delineate the ocean regions so for e.g. the Indian Ocean portion of the Southern Ocean, and ditto for the Atlantic and Pacific. When using these regions and plotting the Indian Ocean for e.g. you omit the entire ocean section south of ~35S, which means you're missing ~30 degrees of the ocean.

Also wondering about the ocean regions omitted in the North Atlantic (around Iceland, between Greenland and Sweden/Norway) and the ocean region between Australia and New Zealand?

@ledm @malininae ping

Land outputs

(And one more...)

I'm trying to reproduce the world, land mask values for CESM2-WACCM r1i1p1f1 ssp585 and am struggling. My script is below

import iris
import numpy as np

tas = iris.load_cube("tas_Amon_CESM2-WACCM_ssp585_r1i1p1f1_gn_201501-210012.nc")
land_frac = iris.load_cube("land_sea_mask_1degree.nc4")

tas_regridded = tas.regrid(land_frac, iris.analysis.Linear())

cosine_latitude_weights = np.cos(np.pi * tas_regridded.coords("latitude")[0].points / 180)
# really stupid way to do to this but fine as a hack
cosine_latitude_weights_lat_lon = []
for i in range(tas_regridded.coords("longitude")[0].shape[0]):
    cosine_latitude_weights_lat_lon.append(cosine_latitude_weights)

cosine_latitude_weights_lat_lon = np.vstack(cosine_latitude_weights_lat_lon).T

tas_regridded_weighted_mean = tas_regridded.collapsed(
    ["longitude", "latitude"],
    iris.analysis.MEAN,
    weights=(land_frac.data > 0.999).astype(int) * np.broadcast_to(cosine_latitude_weights_lat_lon, tas_regridded.shape)
)

tas_regridded_weighted_mean.data[:5]
tas_regridded_weighted_mean.data[:5] - 273.15
# gives 5.454, 5.387, 7.496, 10.090, 12.722

For 2015-01
I get: 5.454 C
You report: -0.106 C

For 2015-02
I get: 5.387 C
You report: -0.364 C

For 2015-05
I get: 12.722 C
You report: 7.01 C

This seems a large difference to put down only to regridding?

typo in variable info for Heating Degree Days

In the information displayed when hovering over the (i) next to Heating Degree Days in the Variable tab, it talks about "CDD". However, reading Spinoni et al. (2015), I believe this should be "HDD" or "HD" instead: "We distinguish between cooling degree-days (CDD), heating degree-days (HDD), and growing degree-days (GDD)."

(This atlas is awesome and I'm nitpicking, thanks for creating this fantastic resource!)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.