Giter VIP home page Giter VIP logo

pygem's People

Contributors

btobers avatar drounce avatar fmaussion avatar kitrea avatar mrweathers avatar tusharkh 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pygem's Issues

Bugs in the Frontal ablation calibration ( Advanced Test- Tidewater Glaciers)

Hi David,

 I got errors when doing the first step, `python run_calibration.py -option_parallels=0`, of Frontal ablation calibration (Advanced Test- Tidewater Glaciers).  

  Here is the error information:

  `pygem.shop.mbdata: AssertionError occurred during task mb_df_to_gdir on RGI60-01.03622: mb_clim_mwea not a column in mb_df`

   Actually there is no column named mb_clim_mwea in the file **df_pergla_global_20yr-filled.csv**.  I am wondering if `mb_clim_mwea = mb_mwea`, under this situation?    If yes, another condition statement might be needed in the  ~  Line191-196,  Or?


    Besides a typo error, in the manual  "Update datasets and recalibrate model parameters", 

     update the pygem_input.py, might be `hugonnet_fn = ‘df_pergla_global_20yr-filled-facorrected.csv`’ not `hugonnet_fn = ‘df_pergla_global_20yr-filled-FAcorrected.csv’

`

Support for PyGEM climate files added in OGGM

Hi, I've added support for the files you provided me in OGGM/oggm#1031

This creates a netdf file in the glacier directory with all the data you need. (I think). The only differences you might see are:

  • we correct the original precip and provide monthly sums in mm.
  • the time is already cropped to match the hydrological year in both hemispheres.

Here is a code to read and display the data:

rgi_ids = ['RGI60-11.0{}'.format(i) for i in range(3200, 3220)]

# Artesonrau (SH), Hintereisferner (NH)
rgi_ids = ['RGI60-16.02444', 'RGI60-11.00897']

# Locals
import oggm.cfg as cfg
from oggm import utils, workflow

# Initialize OGGM and set up the default run parameters
cfg.initialize(logging_level='WORKFLOW')
cfg.PARAMS['border'] = 10
# Usually we recommend to set dl_verify to True - here it is quite slow
# because of the huge files so we just turn it off.
# Switch it on for real cases!
cfg.PARAMS['dl_verify'] = False
cfg.PATHS['working_dir'] = utils.get_temp_dir('PyGEM_ex')

# Get the pre-processed topography data
from oggm.shop import rgitopo
gdirs = rgitopo.init_glacier_directories_from_rgitopo(rgi_ids)

# Process the ECMWF climate data from David
from oggm.shop import ecmwf
workflow.execute_entity_task(ecmwf.process_ecmwf_data, gdirs, dataset='ERA5dr')

# This creates a "climate_historical.nc" file in each glacier directory with
# the data in it:
fpath = gdirs[0].get_filepath('climate_historical')
print(fpath)

# plots
import xarray as xr
import matplotlib.pyplot as plt

for gdir, name in zip(gdirs, ['Artesonraju', 'Hintereisferner']):
    ds = xr.open_dataset(gdir.get_filepath('climate_historical'))
    f, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2, figsize=(12, 7))
    ds.temp.plot(ax=ax1)
    ds.temp_std.plot(ax=ax2)
    ds.gradient.plot(ax=ax3)
    ds.prcp.plot(ax=ax4)
    plt.suptitle(name + ' - Ref height: {}m'.format(int(ds.ref_hgt)))

Artesonraju

Hintereisferner

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.