Posts

R Basics  c- combine c(1,2,3,4) - vector(set) of 4 values help.search('input') help.start() apropos("lm") demo() --demonstration example(graphics) -  example on functions c(2,3,4,5)^c(2,3) -- right c(2,3,4)^c(2,3) --- wrong Integer Division %/% Modulo divistion -- %% Maximum --- max() Minimum --- min() sum of values --sum() production of values -- prod() numeric or not -- mode(variable)
Netcdf clip using lat and longitude import xarray as xr ds =xr.open_dataset("") lat_bnds,lon_bnds  = [20.2,25.2] , [81.2,85.5] ds1=ds.sel()
Radial Guage custom comopnent <RadialGauge    minValue={0}     maxValue={360}     majorTicks={["N","NE","E","SE","S","SW","W","NW","N"]} minorTicks={22} ticksAngle={360}     startAngle={180}     strokeTicks={false}     highlights={false}     colorPlate={"#33a"}     colorMajorTicks={"#f5f5f5"}     colorMinorTicks={"#ddd"}     colorNumbers={"#ccc"}     colorNeedle={"rgba(240, 128, 128, 1)"} colorNeedleEnd={"rgba(255, 160, 122, .9)"}     valueBox={false}     valueTextShadow={false}    colorCircleInner={"#fff"}     colorNeedleCircleOuter={"#ccc"}     needle-circle-size="15"     data-needle-circle-outer="false"     data-animation-rule="linear"     data-needle-type="line"     data-needle-start="75"     data-needle-end="99"     data-ne...
svg creation html file  <svg width="60" height="200"> <defs> <linearGradient id="gradient_3" x1="0%" y1="0%" x2="0%" y2="100%" spreadMethod="pad"> <stop offset="0%" stop-color="#2868F1" stop-opacity="1"></stop> <stop offset="50%" stop-color="white" stop-opacity="1"></stop> <stop offset="100%" stop-color="#D1D3D7" stop-opacity="1"></stop> </linearGradient> </defs> <g><rect x="0" y="0" width="60" height="100%" fill="url(#gradient_3)"></rect></g> <g><line x1="0" y1="0" x2="60" y2="0" stroke-width="3" stroke="black"></line></g> <g><circle radius="10" y="0"/...
React APp  creation using webpack https://www.freecodecamp.org/news/part-1-react-app-from-scratch-using-webpack-4-562b1d231e75/ use babel-loader@7 file-loader for image loading css-loader & style-loader
Installing GDAL in windows https://sandbox.idre.ucla.edu/sandbox/tutorials/installing-gdal-for-windows
NetCDF to PostGIS Script  Script # Import modules import psycopg2, time, datetime from scipy.io import netcdf # Establish connection db1 = psycopg2.connect("host=xxxx dbname=priogrid user=xxxx password=xxxx") cur = db1.cursor() # Create Table in postgis print str(time.ctime())+ " Creating precipud19002008 table." cur.execute("DROP TABLE IF EXISTS precipud19002008;") cur.execute("CREATE TABLE precipud19002008 (gid serial PRIMARY KEY not null, year int, month int, lon decimal, lat decimal, prec decimal);") # Read netcdf file using the netcdf_file class. 'r' for read. f = netcdf.netcdf_file('/mnt/pc258/prio_grid/source/ClimateData/precipud19002008.nc', 'r') # Create lathash. Read the f.variables['lat'].data.tolist() creates a list of lat coodinates. print str(time.ctime())+ " Looping through lat coords." temp = f.variables['lat'].data.tolist() # Create list of lat coords lathash = {} f...