This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #https://stackoverflow.com/questions/1767384/how-can-i-get-a-recursive-full-path-listing-one-line-per-file | |
| SRCEPATH=/g/data/ol01/access-om3-output | |
| DESTPATH=/g/data/ol01/outputs/access-om3 | |
| ln -s ${DESTPATH}/access-om3-025/MC_25km_jra_ryf-1.0-beta-cdfb3543/output018/access-om3.mom6.2d.zossq.1mon.mean.1951.nc ${SRCEPATH}/access-om3-025/MC_25km_jra_ryf-1.0-beta-cdfb3543/output018/access-om3.mom6.2d.zossq.1mon.mean.1951.nc | |
| ln -s ${DESTPATH}/access-om3-025/MC_25km_jra_ryf-1.0-beta-cdfb3543/output018/Vertical_coordinate.nc ${SRCEPATH}/access-om3-025/MC_25km_jra_ryf-1.0-beta-cdfb3543/output018/Vertical_coordinate.nc | |
| ln -s ${DESTPATH}/access-om3-025/MC_25km_jra_ryf-1.0-beta-cdfb3543/output018/access-om3.mom6.2d.sos.1mon.max.1950.nc ${SRCEPATH}/access-om3-025/MC_25km_jra_ryf-1.0-beta-cdfb3543/output018/access-om3.mom6.2d.sos.1mon.max.1950.nc | |
| ln -s ${DESTPATH}/access-om3-025/MC_25km_jra_ryf-1.0-beta-cdfb3543/output018/access-om3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| import csv | |
| # GitHub API URL for the COSIMA organization repositories | |
| url = "https://api.github.com/orgs/cosima/repos" | |
| # Function to fetch all repositories with pagination | |
| def fetch_all_repos(url): | |
| repos = [] | |
| while url: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if paper_case=='20170113_EACnowClimateChange01': | |
| section_description_dict=collections.OrderedDict() | |
| section_description_dict['AB']=[ 60, 61,217,226,0,54,'zonal' ] | |
| section_description_dict['BC']=[ 60, 61,226,303,0,54,'zonal' ] | |
| section_description_dict['GD']=[ 85,128,311,312,0,54,'meridional' ] | |
| section_description_dict['FE']=[127,128,239,247,0,54,'zonal' ] | |
| section_description_dict['ED']=[127,128,247,311,0,54,'zonal' ] | |
| section_description_dict['IH']=[ 46,58 ,212,213,0,54,'meridional' ] | |
| section_description_dict['JK']=[ 85,86 ,224,231,0,54,'zonal' ] | |
| section_description_dict['PQ']=[ 68,80 ,212,213,0,54,'meridional' ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| lg.info("") | |
| lg.info("Running check to see if changes found in "+cfgf+" are now in: "+ofile) | |
| #run quick check to make sure all diff'd parameters were inserted | |
| #(still uses f90nml, so not exactly independent) | |
| with open(ofile) as nml_file: | |
| new_nml = f90nml.read(nml_file) | |
| for top_key in diff[cfgf].keys(): | |
| for bot_key in diff[cfgf][top_key].keys(): | |
| # assert(new_nml[top_key][bot_key]==diff[cfgf][top_key][bot_key]),ofile + " did not get created correctly" | |
| # print(top_key,bot_key,new_nml[top_key][bot_key],diff[cfgf][top_key][bot_key]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # hacked up from: http://www.trondkristiansen.com/?page_id=846 | |
| import os | |
| from netCDF4 import Dataset | |
| import matplotlib.pyplot as plt | |
| import matplotlib.cm | |
| import numpy as np | |
| def LevelColormap(levels, cmap=None): | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function vimnci() | |
| { | |
| if [[ ( $# -eq 0 ) || ( $1 == "--help" ) || ( $1 == "-h" ) ]] ; then | |
| echo "Usage: vimnci PATH_TO." | |
| echo "Purpose: Allows remote editing of files on nci servers..." | |
| echo " " | |
| echo "Mandatory arguments: " | |
| echo "path or file: vim will either edit or open file passed" | |
| echo " " | |
| echo "Example." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| snippet cdo | |
| ########################################################################### | |
| # CDO # | |
| ########################################################################### | |
| #extract a time | |
| cdo seltimestep,1,2,5 cordex24_CURLFX-FLUXFCE_3h_20040101_20041231_grid_U_2D.nc test.nc | |
| #do simple arithmatic | |
| cdo expr,'sum=qsr+qns-qt' cordex24_CURLFX-FLUXFCE_3h_19980101_19981231_grid_T_2D.nc ofile.nc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import matplotlib | |
| import matplotlib.pyplot as plt | |
| #nb requires latex installed on the machine, see http://matplotlib.org/users/usetex.html | |
| from matplotlib import rc | |
| import numpy as np | |
| rc('text', usetex=True) | |
| matplotlib.rcParams['mathtext.fontset'] = 'custom' | |
| matplotlib.rcParams['mathtext.rm'] = 'Bitstream Vera Sans' | |
| matplotlib.rcParams['mathtext.it'] = 'Bitstream Vera Sans:italic' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Combine multiple images into one. | |
| # | |
| # To install the Pillow module on Mac OS X: | |
| # | |
| # $ xcode-select --install | |
| # $ brew install libtiff libjpeg webp little-cms2 | |
| # $ pip install Pillow | |
| # | |
| from __future__ import print_function |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function loadnc() #load netcdf file in python | |
| { | |
| if [[ ( $# -eq 0 ) || ( $1 == "--help" ) || ( $1 == "-h" ) ]] ; then | |
| echo "Usage: loadnc FILENAME_PATHNAME" | |
| echo "Purpose: loads path of file into ipython (creates loadvar.py in your current dir). Prints file info and available variables. 'ifile' is name of netCDF4 object." | |
| echo " " | |
| echo "Requires: python netCDF4" | |
| echo " " | |
| echo "Mandatory arguments: " | |
| echo "FILENAME_PATHNAME: path to netCDF file" |
NewerOlder