acrg_name package¶
Submodules¶
acrg_name.basis_functions module¶
Created on Sat Jul 25 15:46:31 2015
@author: ag12733
Creat basis functions for domain
-
acrg_name.basis_functions.
basis_bc_all_gradients
(domain, time, species, units='ppb', basis_case='horiz-strat-grad')[source]¶ - Creates five terms for bc basis regions
- offset to shift entire field up and down
- factor to scale the entire field
- scaling of N-S gradient
- scaling of E-W gradient
(5) scaling of stratospheric gradient Technically file is species specific as it calculates the stratosphere based on the vmm but one can assume/hope that the stratosphere doesn’t change by species
Parameters: - domain (str) – String of domain area
- time (str) – Timestamp for basis functions
- species (str) – Species of interest
- units (str, optional) – Units of boundary conditions. Default ppb
- basis_case (str, optional) – Name of basis case. Default ‘horiz-strat-grad’
Returns: None Writes basis boundary condition gradients to netcdf
Example
basis_bc_all_gradients(‘SOUTHASIA’, ‘2012-01-01’, ‘ch4’, units=’ppb’, basis_case=’horiz-strat-grad’)
-
acrg_name.basis_functions.
basis_bc_blocks
(domain, basis_case, time, vertical=1)[source]¶ Creates uniform blocks for boundary conditions in each direction (NESW). Each direction is split into vertical slabs with number specified by input ‘vertical’
Parameters: - domain (str) – String of domain area
- basis_case (str) – Labelling for basis case.
- time (str) – Timestamp for basis functions
- vertical (int, optioanl) – Number of vertical slabs to split boundary conditions into Default = 1
Returns: None Writes basis boundary condition blocks to netcdf
Example
basis_bc_blocks(domain=’SOUTHASIA’, basis_case=’NESW’, time=‘2012-01-01’, vertical = 4)
-
acrg_name.basis_functions.
basis_bc_pca
(domain, time, species, units='ppb', basis_case='pca', numregions=4)[source]¶ breaks the MOZART VMR into the first ‘numregions’ principal components and scales each PC
Parameters: - domain (str) – String of domain area
- time (str) – Timestamp for basis functions
- species (str) – Species of interest
- units (str, optional) – Units of species. Default is ‘ppb’
- basis_case (str) – Labelling for basis case. Default is ‘pca’
- numregions (int) – Number of PCs
Returns: None Writes PCA basis boundary condition to netcdf
Example
basis_bc_pca(“SOUTHASIA”, “2012-01-15”, ‘ch4’, units=’ppb’, basis_case=’pca’, numregions = 4)
-
acrg_name.basis_functions.
basis_bc_uniform
(domain, basis_case, time)[source]¶ Creates creates one uniform scaling for boundary conditions for all directions
Parameters: - domain (str) – String of domain area
- basis_case (str) – Labelling for basis case.
- time (str) – Timestamp for basis functions
Returns: None Writes uniform basis boundary condition to netcdf
Example
basis_bc_uniform(domain=’SOUTHASIA’, basis_case=’uniform’, time=‘2012-01-01’)
-
acrg_name.basis_functions.
basis_blocks
(domain, time, blocksize, basis_case=None)[source]¶ Creates basis functions in square blocks (e.g., 5x5 grid cells per region)
Parameters: - domain (str) – String of domain area
- time (str) – Timestamp for basis functions
- blocksize (int) – Number of grid cells to split into (i.e. blocksize x blocksize)
- basis_case (str, optional) – Labelling for basis case. Default is e.g. ‘5x5’ for blocksize of 5
Returns: None Writes blocked basis functions to netcdf
Example
basis_blocks(domain = “SOUTHASIA”, time = “2012-01-01”, blocksize=25)
-
acrg_name.basis_functions.
basis_transd
(domain, time, basis_case='transd', sub_lon_min=None, sub_lon_max=None, sub_lat_min=None, sub_lat_max=None)[source]¶ Creates basis regions for the “transdimensional inversion”. Creates variable central block based on sub_lat and sub_lon domain and four fixed regions surrounding the central box.
Parameters: - domain (str) – String of domain area
- time (str) – Timestamp for basis functions
- basis_case (str, optional) – Labelling for basis case. Default is “transd” for transdimensional
- sub_lon_min (float) – Minimum longitude of sub domain
- sub_lon_max (float) – Maximum longitude of sub domain
- sub_lat_min (float) – Minimum latitude of sub domain
- sub_lat_max (float) – Maximum latitude of sub domain
Returns: None Writes basis regions to netcdf
Example
- basis_transd(domain = “SOUTHASIA”, time = “2012-01-01”, basis_case = “transd”,
- sub_lon_min = 65, sub_lon_max = 100, sub_lat_min = 5, sub_lat_max = 40)
acrg_name.flux module¶
Created on Thu Nov 26 18:13:48 2015
@author: chxmr
-
acrg_name.flux.
write
(lat, lon, time, flux, species, domain, source, title, prior_info_dict, regridder_used='acrg_grid.regrid.regrid_3D', copy_from_year=None, climatology=False, flux_comments=None, output_directory='/data/shared/NAME/emissions/')[source]¶ Write a flux file for emissions
Parameters: - lat (arr) – 1D array of latitudes
- lon (arr) – 1D array of longitudes
- time (numpy.datetime64) – Either an array (format from xarray) or a datetime index (format from pandas). See ‘Creating datetime64 data’ : http://xarray.pydata.org/en/stable/time-series.html
- flux (array) – 2D array of size [lat x lon]. Should be in mol/m2/s.
- species (str) – Species of interest.
- domain (str) – String of domain area
- source (str) – Sources in file. E.g. ‘ff’ (fossil fuel), ‘agriculture’. source = None if the file contains all sources of a species. If multiple sources: -source- is a chain of sources: ‘waste-and-agriculture’ (with hyphens between words).
- title (str) – Gives more information about what is in the file, e.g. Fossil Fuel CO2.
- prior_info_dict (dict) – {‘NAME_OF_PRIOR’ : [‘VERSION’,’RAW RESOLUTION’, ‘REFERENCE’]}
- regridder_used (str, optional) – regrid function used. Default is ‘acrg_grid.regrid.regrid_3D’.
- copy_from_year (str, optional) – If the data is the same as another year but with a different timestamp give the original year here as a string Default is None
- climatology (bool, optional) – If the data is a climatology set this to True and give detail using flux_comments. Default is False
- flux_comments (str, optional) – Extra comments. Default is None.
- output_directory (str, optional) – Output directory. Default is ‘/data/shared/NAME/emissions/’.
Returns: None Writes flux file to netcdf
Example
- flux.write(lat, lon, time, flux, ‘ch4’, ‘EUROPE’, ‘2012’,
- comments = comments, title=”2012_CH4_emissions_EUROPE”)
Todo
Add some error checking (e.g. check that domain is correct)
acrg_name.name module¶
Created on Mon Nov 10 10:45:51 2014
-
acrg_name.name.
animate
(fp_data, output_directory, lon_range=None, lat_range=None, zoom=False, log_range=[5.0, 9.0], overwrite=True, file_label='fp', framerate=10, delete_png=False, video_os='mac', ffmpeg_only=False, plot_function='plot', time_regular='1H', frame_range=None, dpi=150, interpolate=True)[source]¶ - The time_unique function creates one set of time entries within fp_data (dictionary of datasets)
merging across multiple sites if necessary. Time can also be reindexed to be evenly spaced between the minimum and maximum values if time_regular if specified.
Parameters: - fp_data – Output from footprints_data_merge(). Dictionary of datasets.
- time_regular – Frequency between minumum and maximum to set the time values within fp_data. Set at False to not apply this step (Default = False).
Returns: Time values extracted for this first site within fp_data
Return type: xarray.Dataset
-
acrg_name.name.
basis
(domain, basis_case, basis_directory='/data/shared/NAME/basis_functions/')[source]¶ The basis function reads in the all matching files for the basis case and domain as an xarray Dataset.
- Expect filenames of the form:
- [basis_directory]/domain/”basis_case”_”domain”*.nc e.g. [/data/shared/NAME/basis_functions]/EUROPE/sub_transd_EUROPE_2014.nc
TODO: More info on options for basis functions.
Parameters: - domain (str) – Domain name. The basis files should be sub-categorised by the domain.
- basis_case (str) – Basis case to read in. Examples of basis cases are “voroni”,”sub-transd”, “sub-country_mask”,”INTEM”.
- bc_directory (str) – bc_directory can be specified if files are not in the default directory. Must point to a directory which contains subfolders organized by domain. (optional)
Returns: combined dataset of matching basis functions
Return type: xarray.Dataset
-
acrg_name.name.
basis_boundary_conditions
(domain, basis_case, bc_basis_directory='/data/shared/NAME/bc_basis_functions/')[source]¶ The basis_boundary_conditions function reads in all matching files for the boundary conditions basis case and domain as an xarray Dataset.
- Expect filesnames of the form:
- [bc_basis_directory]/domain/”basis_case”_”domain”*.nc e.g. [/data/shared/NAME/bc_basis_directory]/EUROPE/NESW_EUROPE_2013.nc
TODO: More info on options for basis functions.
Parameters: - domain (str) – Domain name. The basis files should be sub-categorised by the domain.
- basis_case (str) – Basis case to read in. Examples of basis cases are “NESW”,”stratgrad”.
- bc_basis_directory (str) – bc_basis_directory can be specified if files are not in the default directory. Must point to a directory which contains subfolders organized by domain. (optional)
Returns: combined dataset of matching basis functions
Return type: xarray.Datset
-
acrg_name.name.
bc_sensitivity
(fp_and_data, domain, basis_case, bc_basis_directory='/data/shared/NAME/bc_basis_functions/')[source]¶ The bc_sensitivity adds H_bc to the sensitivity matrix, to each site xray dataframe in fp_and_data.
Parameters: - fp_and_data (dict) – Output from footprints_data_merge() function. Dictionary of datasets.
- domain (str) – Domain name. The footprint files should be sub-categorised by the domain.
- basis_case (str) – Basis case to read in. Examples of basis cases are “NESW”,”stratgrad”.
- bc_basis_directory (str) – bc_basis_directory can be specified if files are not in the default directory. Must point to a directory which contains subfolders organized by domain. (optional)
Returns: Same format as fp_and_data with sensitivity matrix added.
Return type: dict (xarray.Dataset)
-
acrg_name.name.
boundary_conditions
(domain, species, bc_directory='/data/shared/NAME/bc/')[source]¶ The boundary_conditions function reads in the files with the global model vmrs at the domain edges to give the boundary conditions as an xarray Dataset.
- Expect filenames of the form:
- [bc_directory]/domain/species.lower()_*.nc e.g. [/data/shared/NAME/bc]/EUROPE/ch4_EUROPE_201301.nc
Parameters: - domain (str) – Domain name. The boundary condition files should be sub-categorised by the domain.
- species (str) – Species name. All species names are defined acrg_species_info.json.
- bc_directory (str) – bc_directory can be specified if files are not in the default directory. Must point to a directory which contains subfolders organized by domain. (optional)
Returns: combined dataset of matching boundary conditions files
Return type: xarray.Dataset
-
acrg_name.name.
combine_datasets
(dsa, dsb, method='ffill', tolerance=None)[source]¶ The combine_datasets function merges two datasets and re-indexes to the FIRST dataset. If “fp” variable is found within the combined dataset, the “time” values where the “lat”,”lon” dimensions didn’t match are removed.
Example
ds = combine_datasets(dsa, dsb)
Parameters: - dsa (xarray.Dataset) – First dataset to merge
- dsb (xarray.Dataset) – Second dataset to merge
- method (str) – One of {None, ‘nearest’, ‘pad’/’ffill’, ‘backfill’/’bfill’} See xarray.DataArray.reindex_like for list of options and meaning.
- tolerance – Maximum allowed tolerance between matches.
Returns: combined dataset indexed to dsa
Return type: xarray.Dataset
-
acrg_name.name.
filenames
(site, domain, start, end, height, fp_directory)[source]¶ The filenames function outputs a list of available footprint file names, for given site, domain, directory and date range.
- Expect filenames of the form:
- [fp_directory]/domain/site*-height*domain*yearmonth*.nc e.g. [/data/shared/NAME/fp]/EUROPE/MHD-10magl_EUROPE_201401.nc
Parameters: - site (str) – Site name. Full list of site names should be defined within acrg_site_info.json
- domain (str) – Domain name. The footprint files should be sub-categorised by the NAME domain name.
- start (str) – Start date in format “YYYY-MM-DD” for range of files to find.
- end (str) – End date in same format as start for range of files to find.
- height (str) – Height related to input data.
- fp_directory (str) – fp_directory can be specified if files are not in the default directory must point to a directory which contains subfolders organized by domain.
Returns: matched filenames
Return type: list (str)
-
acrg_name.name.
filtering
(datasets_in, filters, keep_missing=False)[source]¶ Applies filtering (in time dimension) to entire dataset. Filters supplied in a list and then applied in order. For example if you wanted a daily, daytime average, you could do this:
- datasets_dictionary = filtering(datasets_dictionary,
- [“daytime”, “daily_median”])
The order of the filters reflects the order they are applied, so for instance when applying the “daily_median” filter if you only wanted to look at daytime values the filters list should be [“daytime”,”daily_median”]
Parameters: - datasets_in – Output from footprints_data_merge(). Dictionary of datasets.
- filters (list) –
Which filters to apply to the datasets. All options are:
“daytime” : selects data between 1000 and 1500 UTC “nighttime” : Only b/w 23:00 - 03:00 inclusive “noon” : Only 12:00 fp and obs used “daily_median” : calculates the daily median “pblh_gt_threshold” : “local_influence” : Only keep times when localness is low “six_hr_mean” : “local_lapse” : - keep_missing (bool) – Whether to reindex to retain missing data.
Returns: Datasets with filters applied.
Return type: Same format as datasets_in
-
acrg_name.name.
flux
(domain, species, flux_directory='/data/shared/NAME/emissions/')[source]¶ The flux function reads in all flux files for the domain and species as an xarray Dataset. Note that at present ALL flux data is read in per species per domain or by emissions name. To be consistent with the footprints, fluxes should be in mol/m2/s.
- Expect filenames of the form:
- [flux_directory]/domain/species.lower()_*.nc e.g. [/data/shared/NAME/emissions]/EUROPE/ch4_EUROPE_2013.nc
TODO: This may get slow for very large flux datasets, and we may want to subset.
Parameters: - domain (str) – Domain name. The flux files should be sub-categorised by the domain.
- species (str) – Species name. All species names are defined acrg_species_info.json.
- flux_directory (str) – flux_directory can be specified if files are not in the default directory. Must point to a directory which contains subfolders organized by domain. (optional)
Returns: combined dataset of all matching flux files
Return type: xarray.Dataset
-
acrg_name.name.
footprints
(sitecode_or_filename, fp_directory={'integrated': '/data/shared/NAME/fp/', 'HiTRes': '/data/shared/NAME/fp_high_time_res/'}, flux_directory='/data/shared/NAME/emissions/', bc_directory='/data/shared/NAME/bc/', start=None, end=None, domain=None, height=None, species=None, emissions_name=None, HiTRes=False, interp_vmr_freq=None)[source]¶ The footprints function loads a NAME footprint netCDF files into an xarray Dataset. Flux and boundary conditions are also loaded if species or emissions_name is specified.
- Either specify:
- A file name:
- fp = footprints(filename)
- A site code, domain, and date range:
- fp = footprints(“MHD”,
- start = “2014-01-01”, end = “2014-01-01”, domain = “EUROPE”)
See filenames() function for expected format of files. Note: fp_directory, flux_directory and bc_directory can point to specified directories but if not specified, default directories will be used (set at the top of file).
Parameters: - sitecode_or_filename – Site (e.g. ‘MHD’) or a netCDF filename (*.nc) (str)
- fp_directory (str) – fp_directory can be specified if files are not in the default directory. Must point to a directory which contains subfolders organized by domain. (optional)
- flux_directory (str) – Same sytax as fp_directory (optional)
- bc_directory (str) – Same sytax as bc_directory (optional)
- start (str) – Start date in format “YYYY-MM-DD” for range of files to find.
- end (str) – End date in same format as start for range of files to find.
- domain (str) – Domain name. The footprint files should be sub-categorised by the domain.
- height (str) – Height related to NAME. If the HEIGHT keyword is not specified, the default height from the acrg_site_info.json file is assumed.
- species (str) – Species name. All species names are defined acrg_species_info.json.
- emissions_name (str) – Allows emissions files such as co2nee_EUROPE_2012.nc to be read in. In this case EMISSIONS_NAME would be ‘co2nee’
- HiTRes (bool) – Whether to include high time resolution footprints.
- interp_vmr_freq – Frequency to interpolate vmr time. (float/int)
Returns: combined footprint files
Return type: xarray.Dataset
-
acrg_name.name.
footprints_data_merge
(data, domain, load_flux=True, calc_timeseries=True, calc_bc=True, HiTRes=False, average=None, site_modifier={}, height=None, emissions_name=None, interp_vmr_freq=None, fp_directory={'integrated': '/data/shared/NAME/fp/', 'HiTRes': '/data/shared/NAME/fp_high_time_res/'}, flux_directory='/data/shared/NAME/emissions/', bc_directory='/data/shared/NAME/bc/')[source]¶ Output a dictionary of xray footprint datasets, that correspond to a given dictionary of Pandas dataframes, containing mole fraction time series.
TODO: Add details of load_flux, calc_timeseries, calc_bc, HiTRes options into description and affect on outputs
Parameters: - data (dict) – Input dictionary of dataframes with the sites as the keys. Should match output from acrg_agage.get_obs() function. For example: data = {“MHD”: MHD_dataframe, “TAC”: TAC_dataframe}
- domain (str) – Domain name. The footprint files should be sub-categorised by the domain.
- load_flux (bool) –
- calc_timeseries (bool) –
- calc_bc (bool) –
- HiTRes (bool) –
- average (list) – Averaging period for each dataset (for each site). Number of values for average must match number of sites within data dictionary. Each value should be a string of the form e.g. “2H”, “30min” (should match pandas offset aliases format).
- site_modifier – An optional site modifier dictionary is used that maps the site name in the obs file to the site name in the footprint file, if they are different. This is useful for example if the same site FPs are run with a different met and they are named slightly differently from the obs file. E.g. site_modifier = {“DJI”:”DJI-SAM”} - station called DJI, FPs called DJI-SAM
- height (str) – Height related to input data. Can be found from acrg_sites_info.json
- emissions_name – Allows emissions files such as co2nee_EUROPE_2012.nc to be read in. In this case EMISSIONS_NAME would be ‘co2nee’
- interp_vmr_freq – Frequency to interpolate vmr time. (float/int)
- fp_directory –
fp_directory must be a dictionary of the form fp_directory = {“integrated”:PATH_TO_INTEGRATED_FP,
“HiTRes”:PATH_TO_HIGHTRES_FP}if the high time resolution footprints are used (HiTRes = True) otherwise can be a single string if only integrated FPs are used and non-default.
- flux_directory (str) – flux_directory can be specified if files are not in the default directory. Must point to a directory which contains subfolders organized by domain. (optional)
- bc_directory (str) – Same sytax as flux_directory (optional)
Returns: - MHD_xray_dataset, “TAC”: TAC_xray_dataset}:
combined dataset for each site
Return type: Dictionary of the form {“MHD”
-
acrg_name.name.
fp_sensitivity
(fp_and_data, domain, basis_case, basis_directory='/data/shared/NAME/basis_functions/', HiTRes_flux_name=None, Resid_flux_name=None, flux_directory='/data/shared/NAME/emissions/')[source]¶ The fp_sensitivity function adds a sensitivity matrix, H, to each site xray dataframe in fp_and_data.
Basis function data in an array: lat, lon, no. regions. In each ‘region’ element of array there is a lt lon grid with 1 in region and 0 outside region.
Region numbering must start from 1
Parameters: - fp_and_data (dict) – Output from footprints_data_merge() function. Dictionary of datasets.
- domain (str) – Domain name. The footprint files should be sub-categorised by the domain.
- basis_case (str) – Basis case to read in. Examples of basis cases are “NESW”,”stratgrad”.
- basis_directory (str) – basis_directory can be specified if files are not in the default directory. Must point to a directory which contains subfolders organized by domain. (optional)
- HiTRes_flux_name –
- Resid_flux_name –
- flux_directory (str) – Same format as basis_directory.
Returns: Same format as fp_and_data with sensitivity matrix added.
Return type: dict (xarray.Dataset)
-
acrg_name.name.
interp_time
(bc_ds, vmr_var_names, new_times)[source]¶ The interp_time function interpolates the times of the VMR variable ‘vmr_var_name’ in the xarray.Dataset ‘bc_ds’ to the times specified in ‘interp_times’. The variable must have dimensions (height, lat_or_lon, time) in that order. Note: This function was created to convert MOZART monthly averages into same frequency as NAME footprints.
TODO: Add details for vmr_var_names and new_times
Parameters: - bc_ds (xarray.Dataset) – Output from boundary_conditions() function
- vmr_var_names (iterable) –
???
- new_times –
???
Returns: new dataset with the VMRs recalculated at interpolated times.
Return type: xarray.Dataset
-
acrg_name.name.
merge_sensitivity
(fp_data_H, out_filename=None, remove_nan=True)[source]¶ The merge_sensitivity function outputs y, y_site, y_time in a single array for all sites (as opposed to a dictionary) and H and H_bc if present in dataset.
Parameters: - fp_data_H (dict) – Output from footprints_data_merge() function. Dictionary of datasets.
- out_filename (str) – If specified the output will be writen to this filename. Otherwise values are returned.
- remove_nan (bool) – Whether to remove NaN values in y. Default = True.
Returns: each variable as an array (y, y_error, y_site, y_time [...])
H, H_bc are also returned if present otherwise None is returned in their place. e.g.
(y, y_error, y_site, y_time, H, H_bc) (y, y_error, y_site, y_time, None, H_bc)
Return type: tuple
-
acrg_name.name.
plot
(fp_data, date, out_filename=None, lon_range=None, lat_range=None, log_range=[5.0, 9.0], map_data=None, zoom=False, colormap=<matplotlib.colors.LinearSegmentedColormap object>, tolerance=None, interpolate=False, dpi=None)[source]¶ Plot footprint using pcolormesh.
Parameters: - fp_data – Dictionary of xray datasets containing footprints and other variables
- date – Almost any time format should work (datetime object, string, etc). Footprints from all sites in dictionary that have time indices at that time will be plotted.
- lon_range – list of min and max longitudes [min, max]
- lat_range – list of min and max latitudes [min, max]
- log_range – list of min and max LOG10(footprints) for color scale
- map_data – contains plot_map_setup class (useful if animating, so that entire map does not need to be re-calculated each time)
- zoom – shortcut to zoom in to subset of domain (needs work)
- map_resolution – resolution of map
- map_background – choice of “countryborders”, “shadedrelief”
- colormap – color map to use for contours
- tolerance – Xray doc “Maximum distance between original and new labels for inexact matches.”
- Returns
None
- If out_filename == None:
- produces as interactive plot
- Else:
- saves plot to file
-
acrg_name.name.
plot3d
(fp_data, date, out_filename=None, tolerance=None, log_range=[5.0, 9.0], particle_clevs=[0.0, 0.009, 0.001], particle_direction='nw')[source]¶ date as string “d/m/y H:M” or datetime object datetime.datetime(yyyy,mm,dd,hh,mm)
-
acrg_name.name.
read_netcdfs
(files, dim='time')[source]¶ The read_netcdfs function uses xarray to open sequential netCDF files and and concatenates them along the specified dimension. Note: this function makes sure that file is closed after open_dataset call.
Parameters: - files (list) – List of netCDF filenames.
- dim (str) – Dimension of netCDF to use for concatenating the files. Default= “time”.
Returns: all files open as one concatenated xarray.Dataset object
Return type: xarray.Dataset
-
acrg_name.name.
timeseries
(ds)[source]¶ The timeseries function compute flux * footprint time series.
Example
ts = timeseries(dataset)
TODO: There are almost certainly much more efficient ways of doing this.
Parameters: ds (xarray.Dataset) – Dataset with both the flux and footprint fields present Returns: xarray.Dataset
-
acrg_name.name.
timeseries_HiTRes
(fp_HiTRes_ds, domain, HiTRes_flux_name, Resid_flux_name, output_TS=True, output_fpXflux=True, flux_directory='/data/shared/NAME/emissions/')[source]¶ The timeseries_HiTRes function computes flux * HiTRes footprints.
HiTRes footprints record the footprint at each 2 hour period back in time for the first 24 hours. Need a high time resolution (HiTRes) flux to multiply the first 24 hours back of footprints. Need a residual (Resid) flux to multiply the residual integrated footprint for the remainder of the 20 day period. Can output the timeseries (output_TS = True) and/or the sensitivity map (output_fpXflux = True)
Parameters: - fp_HiTRes_ds (xarray.Dataset) – Dataset of High Time resolution footprint. HiTRes footprints record the footprint at each 2 hour period back in time for the first 24 hours.
- domain (str) – Domain name. The footprint files should be sub-categorised by the domain.
- HiTRes_flux_name –
- Resid_flux_name –
- output_TS –
- output_fpXflux –
- flux_directory (str) – flux_directory can be specified if files are not in the default directory. Must point to a directory which contains subfolders organized by domain. (optional)
Returns: xarray.Dataset / tuple(xarray.Dataset,xarray.Dataset)
- If output_TS is True:
Outputs the timeseries
- If output_fpXflux is True:
Outputs the sensitivity map
acrg_name.process module¶
Created on Thu May 7 10:34:25 2015
To use this script, you will need to have a directory, labeled as: DOMAIN_SITE_HEIGHT (e.g. EUROPE_MHD_10magl), with the following structure:
Met/ Fields_files/ Particle_files/ Processed_Fields_files/ Observations/ (satellite/column footprints only)
Each file in Fields_files/ and Particle_files/ must end with a date string (format YYYYMMDD) which must be present in both folders e.g. fields_file_YYYYMMDD.txt.gz.
To process all files in a folder run:
process_all(“DOMAIN”, “SITE”)
Output netCDF files are created one file per month, per domain, per site in the Processed_Fields_files directory.
@author: chxmr
-
acrg_name.process.
copy_processed
(domain)[source]¶ - Routine to copy files from:
- /dagage2/agage/metoffice/NAME_output/DOMAIN_SITE_HEIGHT/Processed_Fields_files to: air.chm:/data/shared/NAME/fp_netcdf/DOMAIN/
-
acrg_name.process.
define_grid
(header, column_headings, satellite=False)[source]¶ Largely taken from Met Office Python code.
Define output grid using file header information.
For satellite instructions, see satellite_vertical_profile.
-
acrg_name.process.
extract_file_lines
(fname)[source]¶ Determine whether file is zipped or not, and then extract text into file_lines variable.
-
acrg_name.process.
footprint_array
(fields_file, particle_file=None, met=None, satellite=False, time_step=None)[source]¶ Convert text output from a given file files into arrays in an xray dataset.
-
acrg_name.process.
footprint_concatenate
(fields_prefix, particle_prefix=None, datestr='*', met=None, satellite=False, time_step=None)[source]¶ For a given file search string (fields_prefix), find all fields and particle files, read them and concatenate the output arrays.
Returns an xray dataset.
Example:
fp_dataset = footprint_concatenate(“/dagage2/agage/metoffice/NAME_output/MY_FOOTPRINTS_FOLDER/Fields_Files/filename_prefix”)
-
acrg_name.process.
load_NAME
(file_lines, namever)[source]¶ Loads the Met Office’s NAME III grid output files returning headers, column definitions and data arrays as 3 separate lists.
For a technical specification see http://www-hc.metoffice.com/~apdg/nameiii/ModelDocumentation/md2_4_v2%28Output%29.pdf
Inputs to this routine are a list of file text lines (extracted using the extract_file_lines routine), and the NAME version.
Where I’ve modified the original Met Office routine to accept file_lines, rather than the file itself, I’ve put the initials MLR
-
acrg_name.process.
particle_locations
(particle_file, time, lats, lons, levs, heights, id_is_lev=False)[source]¶ Read and process a particle location file.
-
acrg_name.process.
process
(domain, site, height, year, month, base_dir='/dagage2/agage/metoffice/NAME_output/', fields_folder='Fields_files', particles_folder='Particle_files', met_folder='Met', force_met_empty=False, processed_folder='Processed_Fields_files', satellite=False, max_level=None, force_update=False, perturbed_folder=None, vertical_profile=False, transport_model='NAME')[source]¶ Process a single month of footprints for a given domain, site, height, year, month. If you want to process all files for a given domain + site use process_all.
This routine finds all fields files and particle location files which match the timestamp in the file name. The date strings are stored in the datestr variable, and these strings must match exactly for the fields and the particle locations.
At the moment, the entire Met folder is read each time.
Options: force_update: By default, any existing netCDF files are NOT overwritten.
To explicitly over-write a file, set force_update = True- satellite: Read a “column” of footprints. There are very particular rules
- about how the met, footprints and particle location files are stored and named. See extra instructions in satellite_vertical_profile.
- perturbed_folder: Process a subfolder which has all of the required folders
(Fields_files, etc). This is for perturbed parameter ensembles for a particular site. E.g. for EUROPE_BSD_110magl/Perturbed/PARAMETERNAME_VALUE you’d set:
perturbed_folder = “Perturbed/PARAMETERNAME_VALUE”- max_level: specified only for satellite data and indicates the max level to
- process the foorprints. levels above are replaced by the prior profile
- vertical_profile: If set to true will look for vertical potential temperature met file
- and incorporate into footprint file. NB. This is a separate file from the normal met file, and is not mandatory.
- transport_model: Defaults to “NAME”. If “STILT”, reads footprints in the
- ncdf format created by the STILT model. Other values are invalid. Not set up to read satellite column footprints from STILT format.
Outputs: This routine outputs a copy of the xray dataset that is written to file.
-
acrg_name.process.
process_all
(domain, site, heights=None, years_in=None, months_in=None, base_dir='/dagage2/agage/metoffice/NAME_output/', force_update=False, satellite=False, perturbed_folder=None, max_level=None, force_met_empty=False, vertical_profile=False, transport_model='NAME')[source]¶ For a given domain and site, process all available fields files (including multiple heights). If you want to specify a subset of years/months to process, use the years_in or months_in kewords.
Keywords: heights: If you only want to process a subset of heights, OR IF THE HEIGHT
INFORMATION IS NOT CONTAINED IN acrg_site_info.json, specify a list of height strings here.years_in: If you only want to process a subset of years, specify here. months_in: Ditto for months force_update: By default, this routine will not overwrite existing netcdf
files. Set force_update = True to reprocess an existing file- satellite: If a column of footprints needs to be processed, set to true.
- See extra instructions in satellite_vertical_profile.
- perturbed_folder: Process a subfolder which has all of the required folders
(Fields_files, etc). This is for perturbed parameter ensembles for a particular site. E.g. for EUROPE_BSD_110magl/Perturbed/PARAMETERNAME_VALUE you’d set:
perturbed_folder = “Perturbed/PARAMETERNAME_VALUE”
-
acrg_name.process.
process_basic
(fields_folder, outfile)[source]¶ Basic processing with no meteorology or particle files NOT recommended, but helpful for a quick check
-
acrg_name.process.
process_vertical_profile
(vp_fname)[source]¶ Function to process the site specific vertical pressure and temperature gradients. Relies on the process_met function In order to fit into this function the header information needs to be edited in the output files NAME generates. Required structure given in vp_met_dict
- Outputs: xarray dataset containing:
- theta_slope - the potential temperature gradient at each time point slope_error - the error in this calculated gradient
-
acrg_name.process.
read_file
(fname)[source]¶ Read a given fields file and break into header, column_headings and data_arrays
-
acrg_name.process.
read_met
(fnames, met_def_dict=None, vertical_profile=False)[source]¶ For a given list of filenames, extract site meteorology and concatenate into a Pandas dataframe.
A dictionary of output column names and met file header search strings is given in the met_default dictionary at the top of this file.
-
acrg_name.process.
release_point
(nc)[source]¶ Extract the time and location of release from STILT output based on the identifier string. nc should be a netCDF4.Dataset in STILT format.
-
acrg_name.process.
satellite_vertical_profile
(fp, satellite_obs_file, max_level)[source]¶ Do weighted average by satellite averaging kernel and pressure weight. One time point only. Expects xray.dataset with one time point and N vertical levels.
- fp = footprint for ONE time point. N levels in lev dimension
- with footprints and particle locations defined at each level
- satellite_obs_file = NetCDF-format satellite observation file,
- one per time step
- max_level = the maximum vertical level of the retrieval that is included.
- (maximum for GOSAT to include all levels from model is 20). The remaining levels are set equal to the a priori value.
Requirements for running processing satellite footprints
- General file naming: Files/folders need to have a date string of the form
- YYYYMMDD-II at the end of the file/folder name, where II is a two-digit index corresponding to the sequence of footprints throughout the day. This modifies the usual naming convention for surface sites, which are only YYYYMMDD.
- Met: The Met/ folder MUST contain a set of subfolders which are labeled
- with the YYYYMMDD-II time stamp. Each of these subfolders should then contain nLev Met output files, where nLev are the number of vertical levels in the NAME output. This is required so that we know what pressure/temperature each NAME footprint for each vertical level corresponds to. The files can be named in any way, but the file names must be in ascending order when sorted (i.e. blah_01.txt.gz, blah_02.txt.gz).
- Fields files:
- There must be ONE fields file per time stamp, labeled at the end of the file string with YYYYMMDD-II (e.g. blah_YYYYMMDD-II.txt.gz). The fields file must contain exactly nLev columns, one for each vertical level, in ascending order, left to right.
- Particle location files:
- There must be ONE fields file per time stamp, labeled at the end of the file string with YYYYMMDD-II (e.g. blah_YYYYMMDD-II.txt.gz). The ID column in this file must contain nLev values in ascending order specifying the vertical level that each particle belongs to.
-
acrg_name.process.
status_log
(message, directory=None, error_or_warning='status', print_to_screen=True)[source]¶ Write a log of an error or a warning to file. Will append to a file
-
acrg_name.process.
stilt_part
(nc, Id, domain_N, domain_S, domain_E, domain_W, exitfile, append)[source]¶ Extract particle data from STILT output and assign it the given Id. nc should be a netCDF4.Dataset in STILT format; Id should be an integer.
-
acrg_name.process.
stiltfoot_array
(prefix, exitfile=None, met=None, satellite=False, time_step=None)[source]¶ Read data from STILT netcdf output files into arrays in an xray dataset. The corresponding function for NAME output is footprint_array. This function reads multiple files at once because STILT output is stored as a separate file for each release time. To read a month of output, give a prefix like stilt2016x07x. :param prefix: file pattern prefix (including path) for output files to read :param exitfile: file in which to temporarily store particle data :param met: not used to interpret STILT footprints, which are already given
in ppm/(mol/m^2/s), but can be included if available.Parameters: - satellite – not implemented; will produce error if True
- time_step – ignored; not needed to interpret STILT footprints.
Returns: an xray dataset as from footprint_concatenate
Return type: fp
-
acrg_name.process.
test_processed_met
(domain, site, height, base_dir='/dagage2/agage/metoffice/NAME_output/')[source]¶
-
acrg_name.process.
write_netcdf
(fp, lons, lats, levs, time, outfile, temperature=None, pressure=None, wind_speed=None, wind_direction=None, PBLH=None, varname='fp', release_lon=None, release_lat=None, particle_locations=None, particle_heights=None, global_attributes={}, lapse_rate=None, lapse_error=None)[source]¶ This routine writes a netCDF file with footprints, particle locations meteorology, and release locations.
NOTE that netCDF4 is required, as we make use of compression.
acrg_name.process_HiTRes module¶
Created on Mon Feb 19 11:09:53 2018
@author: ew14860
-
acrg_name.process_HiTRes.
process_HiTRes
(domain, site, height, year, month, user_max_hour_back, base_dir='/dagage2/agage/metoffice/NAME_output/', HiTRes_fields_folder='24HrBk_Fields_files', met_folder='Met')[source]¶ domain: string - ‘EUROPE’ site: string - ‘MHD’ height: string in magl - ‘10’ year: string - ‘2014’ month: string - ‘06’ user_max_hour_back: int - 24 base_dir: string, directory where [domain]_[site]_[height]magl folder is containing HiTRes footprints HiTRes_fields_folder: string, name of HiTRes fields folder - ‘24HrBk_Fields_files’ met_folder: string, name of met folder - ‘Met’


Send this confirmation to another email address


Created on : {{vehicle_gate_pass.date_and_time}}
{{vehicle_gate_pass.registration_number}}
{{vehicle_gate_pass.model_name}}
V Gate Pass No
{{vehicle_gate_pass.gate_pass_no}}
{{vehicle_gate_pass.driver_name}} | {{vehicle_gate_pass.driver_mobile_number}}
JO No : {{vehicle_gate_pass.job_card_number}}


[gecode-users] Defining constraint to extract Element from an array of integer holding repeated values
Guido Tack
tack at ps.uni-sb.de
Sun Jan 11 19:03:08 CET 2009
Jeffrey Mak wrote:
> How to defining constraint to extract Element from an array of
> integer holding repeated values?
> Gecode provide ElementUnion function to extract elements from IntSet
> or VarSet.
> How about an integer array in which elements may hold the same values?
>
> Below is a hypothesized problem that needs such capabilities:
>
> Assign n number of students into 3 groups.
> each student is teach by a certain instructor.
>
> I'd like to evenly distributed the students into the groups (assume
> the total no. of student is divisible by the 3 groups.)
> Given an array where the 1st element holds the instructor (in enum)
> of the 1st student and so on...
>
> How should I model the constratint to enforce that:
> for each group, the total no. of distinct instructors are the
> same.
If I understand the problem correctly, the mapping from student to
instructor is given in advance, as an array mapping student id to
instructor id. Then a model for this problem may look as follows:
Use a SetVarArray group, so that group[i] is the set of students in
group i. Now we have to map from students to instructors. For this,
we use the elementsUnion constraint with IntSetArgs. Construct the
IntSetArgs isa such that isa[j] is an IntSet that contains as the
single element the instructor of student number j. Then
elementsUnion(this, isa, group[i], x) will bind x to the set of
instructors of group i. Using cardinality(this, x,y) constrains an
IntVar y to the cardinality of x. So balancing all the y (one for
each group) solves the problem.
Hope this helps,
Guido
More information about the gecode-users
mailing list


| Filter |
|---|
|
Show: |
| Message | Class | Method | Time |
|---|---|---|---|
| Setting up NuBot version : 0.1.5b | com.nubits.nubot.launch.NuBot | execute | Mar 09 2015 21:58:48.030 UTC |
| Init logging system | com.nubits.nubot.launch.NuBot | execute | Mar 09 2015 21:58:48.053 UTC |
| Set up SSL certificates | com.nubits.nubot.launch.NuBot | execute | Mar 09 2015 21:58:48.054 UTC |
| Load options from 1 files : /tmp/tmpVQliFy | com.nubits.nubot.launch.NuBot | execute | Mar 09 2015 21:58:48.055 UTC |
| Wrap the keys into a new ApiKeys object | com.nubits.nubot.launch.NuBot | execute | Mar 09 2015 21:58:48.056 UTC |
| Creating an Exchange object | com.nubits.nubot.launch.NuBot | execute | Mar 09 2015 21:58:48.057 UTC |
| Create e ExchangeLiveData object to accomodate liveData from the exchange | com.nubits.nubot.launch.NuBot | execute | Mar 09 2015 21:58:48.071 UTC |
| Create a new TradeInterface object | com.nubits.nubot.launch.NuBot | execute | Mar 09 2015 21:58:48.072 UTC |
| Swapped pair mode : false | com.nubits.nubot.launch.NuBot | execute | Mar 09 2015 21:58:48.073 UTC |
| CCEDK uses global TX fee, currency pair not supported.now calling getTxFee() | com.nubits.nubot.trading.wrappers.CcedkWrapper | getTxFee | Mar 09 2015 21:58:48.074 UTC |
| Create a TaskManager | com.nubits.nubot.launch.NuBot | execute | Mar 09 2015 21:58:48.075 UTC |
| Starting task : Check connection with exchange | com.nubits.nubot.launch.NuBot | execute | Mar 09 2015 21:58:48.083 UTC |
| Waiting a for the connectionThreads to detect connection | com.nubits.nubot.launch.NuBot | execute | Mar 09 2015 21:58:48.084 UTC |
| Configuring NuBot for Dual-Side strategy | com.nubits.nubot.launch.NuBot | execute | Mar 09 2015 21:58:51.091 UTC |
| Start trading Strategy specific for nbtbtc | com.nubits.nubot.launch.NuBot | execute | Mar 09 2015 21:58:51.098 UTC |
| Options : { dualSide=true submitLiquidity=false executeOrders=true verbose=false sendHipchat=false apiKey=2CQ4QB8AHNKT96QE0G6Y51YI7WOG0H6L2955KWR86TPU4R0KCVJY4LYWHGWLPE74 nubitAddress= rpcUser= nudIp=<IP_ADDRESS> nudPort=9091 priceIncrement=3.0E-4 txFee=0.2 exchangeName=ccedk pair=nbtbtc executeStrategyInterval=41 sendLiquidityInterval=130 sendMails=false mailRecipient=null emergencyTimeoutMinutes 60 keepProceeds=0.0 aggregate=false SecondaryPegOptionsJSON : backupFeedNames [blockchain, coinbase, bitstamp] distanceThreshold 10.0 mainFeed bitfinex spread 0.0 wallchangeThreshold 0.3} |
com.nubits.nubot.launch.NuBot | execute | Mar 09 2015 21:58:51.100 UTC |
| Forcing a 0.9% minimum spread to protect from collisions | com.nubits.nubot.launch.NuBot | execute | Mar 09 2015 21:58:51.113 UTC |
| NuBot will be start running in 69 seconds, to sync with remote NTP and place walls during next wall shift window. | com.nubits.nubot.launch.NuBot | execute | Mar 09 2015 21:58:51.200 UTC |
| Liquidity is not being sent : orders are not yet initialized | com.nubits.nubot.tasks.SubmitLiquidityinfoTask | checkOrders | Mar 09 2015 21:59:30.091 UTC |
| javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target | com.nubits.nubot.pricefeeds.CoinbasePriceFeed | getLastPrice | Mar 09 2015 22:00:00.847 UTC |
| Error while updating BTC price from coinbase | com.nubits.nubot.pricefeeds.PriceFeedManager | getLastPrices | Mar 09 2015 22:00:00.848 UTC |
| CCEDK uses global TX fee, currency pair not supported.now calling getTxFee() | com.nubits.nubot.trading.wrappers.CcedkWrapper | getTxFee | Mar 09 2015 22:00:01.012 UTC |
| Computing USD prices with spread 0.9% : sell @ 1.0065 buy @ 0.9935 | com.nubits.nubot.tasks.strategy.PriceMonitorTriggerTask | initStrategy | Mar 09 2015 22:00:01.014 UTC |
| Converted price (using 1 BTC = 287.83 USD) : sell @ 0.00349686 BTC; buy @ 0.00345169 BTC | com.nubits.nubot.tasks.strategy.PriceMonitorTriggerTask | initStrategy | Mar 09 2015 22:00:01.014 UTC |
| Initializing strategy | com.nubits.nubot.tasks.strategy.StrategySecondaryPegTask | run | Mar 09 2015 22:00:01.015 UTC |
| Frozen funds already in balance (not proceeds) updated : 0.0 Currency{fiat=false, code=BTC, extendedName=Bitcoin} | com.nubits.nubot.utils.FrozenBalancesManager | setBalanceAlreadyThere | Mar 09 2015 22:00:04.081 UTC |
| CCEDK uses global TX fee, currency pair not supported.now calling getTxFee() | com.nubits.nubot.trading.wrappers.CcedkWrapper | getTxFee | Mar 09 2015 22:00:05.007 UTC |
| Strategy - Submit order : SELL side order : SELL 1.5 NBT @ 0.00349686 BTC | com.nubits.nubot.tasks.strategy.StrategySecondaryPegUtils | initOrders | Mar 09 2015 22:00:05.008 UTC |
| Strategy - SELL Response1 = 3186976 | com.nubits.nubot.tasks.strategy.StrategySecondaryPegUtils | initOrders | Mar 09 2015 22:00:05.796 UTC |
| Strategy - Submit order : SELL side order : SELL 1.5 NBT @ 0.00349686 BTC | com.nubits.nubot.tasks.strategy.StrategySecondaryPegUtils | initOrders | Mar 09 2015 22:00:11.286 UTC |
| Strategy : SELL Response2 = 3186979 | com.nubits.nubot.tasks.strategy.StrategySecondaryPegUtils | initOrders | Mar 09 2015 22:00:11.702 UTC |
| Initial walls placed | com.nubits.nubot.tasks.strategy.StrategySecondaryPegUtils | placeInitialWalls | Mar 09 2015 22:00:12.105 UTC |
| Bot shutting down.. | com.nubits.nubot.launch.NuBot | run | Mar 09 2015 22:00:33.217 UTC |
| Clearing out active orders ... | com.nubits.nubot.launch.NuBot | run | Mar 09 2015 22:00:33.219 UTC |


Kadir Amigo Memiş ile röportaj
Dec 21, 2016 in Hayat
Read PostDec 21, 2016 in Hayat
Read PostDec 21, 2016 in Hayat
Read PostDec 12, 2016 in Ekonomi
Read PostDec 8, 2016 in Sponsor
Read PostDec 6, 2016 in Sponsor
Read PostDec 1, 2016 in Sponsor
Read Post


The intermediaries legislation will apply to this engagement where the worker's business (the intermediary) satisfies these specific conditions of liability.
HMRC will stand by the result given unless a compliance check finds the information provided isn't accurate.
HMRC won't stand by results achieved through contrived arrangements designed to get a particular outcome from the service. This would be treated as evidence of deliberate non-compliance with associated higher penalties.
HMRC can review your taxes for up to 20 years.


--- layout: page ---
The lazy mist hangs from the brow of the hill, Concealing the course of the dark-winding rill; How languid the scenes, late so sprightly, appear! As Autumn to Winter resigns the pale year. The forests are leafless, the meadows are brown, And all the gay foppery of summer is flown: Apart let me wander, apart let me muse, How quick Time is flying, how keen Fate pursues! How long I have liv'd-but how much liv'd in vain, How little of life's scanty span may remain, What aspects old Time in his progress has worn, What ties cruel Fate, in my bosom has torn. How foolish, or worse, till our summit is gain'd! And downward, how weaken'd, how darken'd, how pain'd! Life is not worth having with all it can give- For something beyond it poor man sure must live.
Thy braes were bonny, Yarrow stream! When first on them I met my lover; Thy braes how dreary, Yarrow stream! When now thy waves his body cover! For ever now, O Yarrow stream! Thou art to me a stream of sorrow; For never on thy banks shall I Behold my love, the flower of Yarrow. “He promised me a milk-white steed, To bear me to his father’s bowers; He promised me a little page, To ‘squire me to his father’s towers; He promised me a wedding-ring,— The wedding-day was fix’d to-morrow;— Now he is wedded to his grave, Alas, his watery grave, in Yarrow!  No longer walk, thou lovely maid! Alas, thou has no more a brother! No longer seek him east or west, And search no more the forest thorough, For, wandering in the night so dark, He fell a lifeless corse in Yarrow. “The tear shall never leave my cheek, No other youth shall be my marrow; I’ll seek thy body in the sream, And then with thee I’ll sleep in Yarrow.” The tear did never leave her cheek, No other youth became her marrow; She found his body in the stream, And now with him she sleeps in Yarrow.
Let Christian faith and hope dispel The fears of guilt and woe; The Lord Almighty is our friend And who can prove a foe? He who his Son, most dear and lov’d, Gave up for us to die, Shall he not all things freely give That goodness can supply? Behold the best, the greatest gift, Of everlasting love! Behold the pledge of peace below, And perfect bliss above! Where is the judge who can condemn, Since God hath justify’d? Who shall charge those with guilt or crime For whom the Saviour dy’d? The Saviour dy’d, but rose again Triumphant from the grave; And pleads our cause at God’s right hand, Omnipotent to save. Who then can e’er divide us more From Jesus and his love, Or break the sacred chain that binds The earth to heav’n above? Let troubles rise, and terrors frown, And days of darkness fall; Through him all dangers we’ll defy, And more than conquer all. Nor death nor life, nor earth nor hell, Nor times destroying sway, Can e’er efface us from his heart, Or make his love decay. Each future period then will bless, As it has bless’d the past; He lov’d us from the first of time, He loves us to the last.


Comments
-
Greg Hurrell
Thanks for open the ticket, Phil.
If you want to purchase through PayPal then I think this is an issue that you'll have to take up with their tech support, because all I'm doing at this end is providing a link to their site and they do all the rest.
If they can't provide you with a satisfactory response or for any other reason you don't want to pursue it with PayPal, then you can use the other offered payment processor, Kagi.
You don't indicate which product you wanted to purchase a license for, but at least in the case of Synergy, Synergy Advance, and Hextrapolate, there are links for purchasing those products via Kagi:
https://secure.wincent.com/a/products/synergy-classic/purchase/
https://secure.wincent.com/a/products/synergy-advance/purchase/
https://secure.wincent.com/a/products/hextrapolate/purchase/
I hope that PayPal are able to help you with this issue, but as this one is not really in my hands I am going to mark this one as CLOSED.
Add a comment
Comments are now closed for this issue.


Lab 7: JavaScript Demo
Functions implemented using filter, map and reduce array functions:
- sum(arr) <= returns the sum of the elements of the input number array.
- multiply(arr) <= returns the product of the elements of the input number array.
- reverse(str) <= reverses the characters of an input string.
- filterLongWords(arr, len) <= returns an array of strings having length greater than the input length.
Click Run Demo and open console to see sample results of the following functions:.


ENCOURAGE.
EQUIP.
INSPIRE.
CHALLENGE.
PASTOR
ANTHONY
P. RICHARDS
MY MISSION
My mission in life is to passionately live to my potential in Jesus Christ and to equip, encourage, inspire and challenge everybody I meet to do the same. I love Jesus and people and in the face of my own huge faults & inadequacies, I want to cheerlead people on to reach their full potential in life.
MY LIFE
I was born and raised in Sydney, Australia and have lived in Minnesota, USA, since 2005. I worked in Chartered/Public Accounting for nearly 14 years and then moved in to Executive Leadership in various industries. I responded to a call on my life to leave the corporate world and pursue ministry in 2004. I have been married to Mandy since 1998 and have two children, Emma (b 2003) and George (b. 2007).
WHAT MOTIVATES ME ?
Here are five Bible verses that motivate and inspire me to do what I do, and I know they will inspire you too. I have emphasised the words that have always stood out to me.
“I have been crucified with Christ; it is NO LONGER I who live, BUT CHRIST lives in me; and the life which I now live in the flesh I live by faith in the Son of God, who loved me and gave Himself FOR ME.”
Galations 2:20
“Go therefore and MAKE DISCIPLES of all the nations, baptizing them in the name of the Father and of the Son and of the Holy Spirit, TEACHING THEM to observe ALL things that I have commanded you;”
Matthew 28:19-20
“For I DETERMINED not to know anything among you EXCEPT JESUS CHRIST and Him crucified.”
Corinthians 2:2
“BE DILIGENT to present yourself approved to God, a worker who does not need to be ashamed, RIGHTLY DIVIDING the word of truth.”
2 Timothy 2:15
“I can do ALL THINGS through Christ who strengthens me.”
Philippians 4:13
LAST FOUR SERMONS
Here are my last four messages.
To watch more messages, visit my YouTube channel.


Withdrawals
Reference
Total Owed
Total Paid
Pay Method
{% for thisPayment in thisTodaysPaymentsList %}
{{ thisPayment.strReference }}
{{ thisPayment.strAmountToPay }}
{{ thisPayment.strPaidAmount }}
{{ thisPayment.strPayMethod }}
{% endfor %}
Reference
Total Owed
Total Paid
Pay Method


Dotnet query console
As I’ve developed with Rails, the feature I’ve come to appreciate the most is the rails console
.

I’ve grown quite accostomed to the framework and, while I think rails does many things right, I like to poke my head out of the rails world every once in a while to see how other frameworks handle different features.
One of the first things that I struggled with in Asp.net core land was the lack of a console.
Here is a quick overview of the rails console: it is a REPL that loads up your entire codebase and connects to your database via whatever connection strings your development environment would normally use.
At first, I didn’t rely on this repl for much - maybe just checking some logic or syntax interactively - but as I developed more features I found it invaluable for looking at the data.
For example, let’s say you have some Student
model and a Assignment
model referencing the student model.
For some reason, you need to query all of the students who have an average assignment score above 80%.
I may define filter_by_average_score
as Student.find_each {|student| average_score(student) > 0.8 }
where average_score
is defined as student.assignments.map(:score).sum / student.assignments.count
.
So - does this work?
I could write a unit test here, testing whether the average_score
function works, but I probably already have some data in my development environment that would be nice to query and check out.
In the rails console
, that’s exactly what I would do - I would simply run
rails console
> average_score(Student.first) # ignoring namespacing
... 0.6
> filter_by_average_score
... []
Assuming I find an issue with this function, it is super easy to reload the environment and try again1.
So how do I do this in Asp.net core?
Generally, there isn’t an interactive environment for asp.net core like there is for ruby. There are solutions like LinqPad, but after looking (briefly) into these I was not convinced of their ease of integration with an existing asp.net app. Thus I decided to find my own solution.
The requirements for this solution are as follows:
- Able to run commands independent from the rest of the Asp.net jiggamrole.
- Use the exact same database connection & models as the rest of the application.
- No extra changes to existing code.
- Fast.
I ‘solved’ this dillemma by doing the follwing:
First, I created a Scratch
file that would serve as the entrypoint for my 1-off queries.
Second, I wrote the necessary functions to load up the application settings (create database contexts, load connection strings).
Third, I re-wrote the Main
method using Bullseye to look like this:
public static void Main(string[] args)
{
Target("default", () => WebMain(args)); // by default, run the web app
Target("scratch", () => new Scratch().Perform().Wait()); // 'dotnet run scratch' will run the `Scratch` class
RunTargetsAndExit(args);
}
Finally, I can write and run whatever queries I want to test by attaching to a live db context.
Better yet, I can wrap all the calls into a transaction and roll that back so I can test destructive functions without worrying about the consequences.
The entire Scratch
code is show below.
class Scratch
{
private void LoadConfiguration()
{
var builder = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json", optional: false)
.AddEnvironmentVariables();
Configuration = builder.Build();
}
public Scratch()
{
LoadConfiguration();
var contextOptions = new DbContextOptionsBuilder<ApplicationDbContext>()
.UseNpgsql(Configuration.GetConnectionString("DefaultConnection"),
o => o.MigrationsAssembly("SharpListUI"))
.Options;
ContextOptions = contextOptions;
_connection = RelationalOptionsExtension.Extract(ContextOptions).Connection;
}
public async Task Perform()
{
System.Console.WriteLine(Configuration.GetConnectionString("DefaultConnection"));
Context = new ApplicationDbContext(ContextOptions, DummyOptions);
using var transaction = Context.Database.BeginTransaction();
var score = await Context.Students.First().average_score;
Console.WriteLine($"score: {score}");
var students = await Context.StudentsByAverage.ToListAsync();
Console.WriteLine(students.ToJson(pretty: true));
System.Console.WriteLine("Rolling back changes");
}
}
All of this may be over engineered, and if I spent more time developing c# applications I might not feel the need to reach for the familiar interactiveness of ruby. But, while I transition at least, I find this provides with just enough interaction with my application to keep me happy2.


Enter Loan Data:
Amount of the loan ($):
Annual interest (%):
Repayment period (years):
Zipcode (to find lenders):
Approximate Payments:
Calculate
Monthly payments:
$
Total payments:
$
Total interest:
$
Graph
Foreign Exchange


{% extends "pages/website_home.html" %} {% load static %} {% block custom_css %} {% endblock custom_css %} {% block layout_wrapper %}
Your email address has been successfully confirmed.


WITNESS LIST Regulated Industries Committee May 5, 2003-2:00P SB 1261 For: Shields, Chris (Texas Agricultural Aviation Association) Against: Hinkle, Ron (Verizon Wireless) Registering, but not testifying: Against: Ryall, Jean (Cingular Wireless) SB 1280 For: Green, J Kelley (Texas Cotton Ginners' Association) Gully, Rochey (Self) Hoelscher, Harold (Self and St. Lawrence Cotton Growers) Against: Atkins, Lee (Cap Rock Energy Corporation) Baker, Lester (Cap Rock Energy Corporation) Kelly, Tom (Self) Ladd, Jack (Cap Rock Energy Corporation) Lynn, Ronnie (Cap Rock Energy Corporation) Mcbeth, Kelly (Cap Rock Energy Corporation) Warren, Jill (Cap Rock Energy Corporation) Registering, but not testifying: For: Fitzgerald, Amy (Texas Electric Cooperatives) Frysak, Kervin (Self) Fuelberg, Curtis (St. Lawrence Cotton Growers Association) Hoelscher, Ann (Self) Levy, Rick (Texas State Association of Electric Workers) Mayberry, Warren (Texas Farm Bureau) Turner, Bob (St. Lawrence Cotton Growers Association) On: Parsley, Julie (Public Utility Commission of Texas) Totten, Jess (Public Utility Commission of Texas)


Click the button in the top right to "log in". This will reveal a button only visible to authenticated users.
You are authenticated!


Congratulations! Your request for the [[${skillName}]] skill in the [[${projectName}]] project has been approved!
Your request for the [[${skillName}]] skill in the [[${projectName}]] project has been denied.
You can view your progress for the [[${projectName}]] project in the SkillTree dashboard.
Always yours,
-SkillTree Bot


@* * This template is called from the `index` template. This template * handles the rendering of the page header and body tags. It takes * two arguments, a `String` for the title of the page and an `Html` * object to insert into the body of the page. *@ @import models.deliverypoint.DeliveryPoint @import models.deliverypoint.DeliveryPointType @(deliveryPointTypes: List[DeliveryPointType], deliveryPoints:List[DeliveryPoint], deliveryPoint: DeliveryPoint) @main("--> Add delivery point"){
| Add delivery point | DeliveryPoints | ||||||
|---|---|---|---|---|---|---|---|
|
Delivery points that currently work
|


"HALLOWEEN H20" Review By R.L. Strong
Dimension Films presents a Nightfall Production of a Steve Miner film Jamie Lee Curtis HALLOWEEN H20 Michelle Williams Josh Hartnett Adam Arkin Jodi Lyn O'Keefe Adam Hann-Byrd Janet Leigh and LL Cool J Cinematography by Daryn Okada Music by John Ottman Production Designer John Willett Costume Designer Deborah Everton Edited by Patrick Lussier Associate Producer: Malek Akkad Executive Producer: Moustapha Akkad Produced by John Carpenter, Paul Freeman, and Debra Hill Original story by Robert Zappia Screenplay by Robert Zappia and Matt Greenberg Directed by Steve Miner
Well, we knew it was going to happen. When a franchise is doing even remotely well, it behooves the producers to continue running the series into the ground. We've seen this with almost every horror franchise since the original 'Frankenstein'. Now there have been exceptions to the rule. Such films as "New Nightmare" and "The Bride of Frankenstein" have actually been superior to their originators. But the 'Halloween' has not been so lucky. While trying to breath fresh blood into the series, Moustapha Akkad had created an increasingly absurd complex scenario. What makes this entry in the series is two remarkable things. Firstly, the return of Jamie Lee Curtis to the role that started her career, and secondly (and most importantly) a script that disavows the previous sequels.
The film opens on October 29th. 1998. Nurse Marion Chambers (Nancy Stephens, returning from the original film) arrives home to find her home broken into. She gains the assistants of her two teenage neighbors to call the Police. One of the boys investigates the home and finds Nurse Chambers' study ransacked. Returning home, the boys leave Ms. Chambers to wait for the Police. She finds that her study has indeed been vandalized and more importantly that the file of Laurie Stroud has been stolen. Seeing a stranger in the hallway, she narrow escapes to her neighbor's house. There she finds that the two boys have already been murdered. The Shape (AKA: Michael Myers) attacks and kills the nurse as the police arrive.
We are then introduced to Jamie Lee's character Laurie Stroud. She is the Dean of a private school in Northern California. Divorced and suffering from anxiety from her earlier experience, she has taken on a false identity after faking her own death in an attempt to hide from her murderous brother. Well, her son has recently turned 17, the same age Laurie was, when Michael he escaped from the asylum back in '78. Laurie attempts to deal with her fear by irrationally trying to protect her son from danger. Well in due time, Michael finds his siblings, and the battle begins.
Horror films for the most part are very, very predictable. You know all of the set ups by heart. Lights the don't work, cars that refuse to start when danger is near, etc., etc. All of these are in ample supply here. The difference between this film and others of it's ink is Jamie Lee Curtis. Ms. Curtis has always been a fine if not a remarkable actress. her past performances have always been enlivening and enjoyable (think 'True Lies', she was the only shinning light in that ponderous and misogynistic film). Here, Ms. Curtis is center stage, and she carries the film with a strength and determination that is refreshingly honest to the character.
The screenplay by scribes Robert Zappia and Matt Greenberg (with un-credited assistance from Kevin Williamson of 'Scream' fame) is very tight, with a nicely set up premise and credible (for the most part) situations. The inclusion of Janet Leigh as Norma (the maintenance director of the private school) complaining about the drains in the Girls' shower room being clogged is a marvelously funny tribute to 'Psycho' and a smack in the face to every other filmmaker who has ripped off that famous scene. References to other works are remarkable very slight in this film. It's not as jokey as the "Scream" films, in that "Halloween H20" takes itself seriously. While most of the characters are not very deeply written, they don't need to be as these people are recognizable to most of us. What is most refreshing here is that this film does it's best to do away with the body count mentality of most horror films. Situations are set up wherein a character is placed in mortal danger and is not killed. This simple idea leads to a lot more suspense, and identifies the audience with the main characters more intimately. Michael Myers is after one person, he only kills those that get in the way of his goal.
Directed with a sure and steady hand by Steve Miner, Halloween H20 has lots to offer it's audience. Mr. Miner is no stranger to the horror genre having helmed the (arguably) best entry in the 'Friday the 13th' series ("Friday the 13th: 3D"). Having moved onto more mainstream films ('Forever Young' also with Ms. Curtis, and 'My Father is a Hero') Mr. Miner shows a true love for the trappings of the genre, making grand use of lighting and shadow throughout the film. His handling of his actors is fine, with surprising performances put in by relative newcomer Josh Hartnett as John Tate, Laurie Stroud's son. Adam Arkin is fine as school counselor Will Brennan, bringing a light touch of humor to the proceedings.
Halloween H20 is a fine entry in the horror sweepstakes and a fitting end to a series that was starting to wear out it's welcome. There's a lesson to be learned here for Hollywood. It's the writing.. dummies!
On a scale ***** "Halloween H20" rates ***=
Copyright ) 1998 R. L. StrongNothing in this article may be quoted or re-printedwithout the expressed written permission of the author.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Porto.js is a great jQuery plugin for adding customized image or video portfolios to your website. It only supports for the sites that build up with the bootstrap framework. It helps you to display your projects, client logos, photography, or any other pictures or videos of your choice in a much more productive way.
Fully responsive - will adapt to any device
Portfolios can contain images or videos
Captions can be added on to portfolio
Uses CSS transitions for image and video animation
Images and Videos can be viewed in a popup window
Small file size, simple to implement
Browser support: Firefox, Chrome, Opera
Number of customized options
If you read our options page we have provided instructions in step by step to use the various features and functionality of this plugin.
First and most important thing is, that including jQuery library and bootstrap files. Then link the Porto.js CSS and Javascript file.
       <link href="css/bootstrap.min.css" rel="stylesheet" />  <link href="css/jquery.porto.css" rel="stylesheet" />
For each portfolio need to create one

element with

tags inside it as much as you need to display boxes. Inside each of these divs should contain data attributes to hold the information about portfolio as follows. Note that only "data-pf-image"
is necessary and others can be added as your choice. Check the examples for more information about HTML structure.

Call .porto() on

. If you have different class name make sure to call the function with that class.
$(document).ready(function () { $('.porto').porto(); });
Check the examples for more information on customization.


Introduction¶
Software defined radio (SDR) was initially introduced by J.Mitola in 1995 [1]. It can be described as a radio that can change it’s physical equivalance through modifications in software. Since the work of Mitola SDRs has obtained a key role in the development of new radio systems [2] which is in part motivated by the high flexibility and cost effectiveness that a digital solution yields [3]. The main supplier for SDRs today is the Ettus Research and National Instruments company (NI) providing the Universal Software Radio Peripheral (USRP) as the SDR product line [4]. The SDR platform essentially provides a front-end for discretization of the signal as well as a Digital Down Donverter (DDC) chain through the usage of a Field-Programmable Gate Array (FPGA) [5]. The strength and flexibility of the USRP is exposed when combined with software interfaces such as GNU Radio and NI-LabView, providing digital domain signal processing [6].
Studies of microwave spectral emission from different kinds of molecules is fundamental in the fields of Astronomy and Aeronomy. Hydrogen is the most common substance in the Universe thus making the transition at 21 cm of central interest to astronomers, e.g. for studies of galactic spiral arms. Microwave radiation is also abundant from different gases in the atmosphere, both CO, O2, H2O and O3 exhibit rotational transitions below 150 GHz thus providing a way to study the concentration and distribution of these gases in the atmosphere [7]. The technique most commonly used, for these kinds of studies and observations is Dicke-switching, first introduced by physicist Robert H. Dicke. Dicke-switching is a method that eliminates gain variations in receiver systems by rapidly comparing signals, often labelled signal and reference. The reference can be a source of known temperature, another part of the sky or by defining a reference through mixer tuning. The techniques are referred to as load, sky and frequency-switching respectively [8].
This documentation briefly explains how a general purpose Dicke-switched Fast Fourier Transform Spectrometer (FFTS) can be achieved using Software Defined Radio (SDR) platforms, i.e. the Ettus USRP x310 interfaced with the signal processing toolkit GNU Radio. However the main function of this documentation is to act as a informational source and usage manual for employees at Onsala Space Observatory (OSO) using the two GNURadio-FFTSs on the site. For that purpose it is mainly the section “Manual” and “USRP and GNURadio” that is relevant.
Acknowledgements¶
First of all I would like to thank Gunnar Elgered for making this project possible. I would also like to thank Lars Petersson and Peter Forkman for supervising the project and providing me with wonderful insights and supporting me at all times. The SALSA system has been a inspirational source throughout this project and I have Eskil Varenius to thank for that. Mikael Lerner has played a fundemental role in integrating the spectrometer in existing systems and it’s now continous usage would not have happend without him. The spectrometer is fully integrated in his software package BIFROST, providing a truly great interface for Radiometers in Sweden and around the world.
Personal background¶
I am a bachelor student at Chalmers University of Technology in Sweden and have been, part time, developing a new spectrometer solution for Radio Astronomy and Aeronomy. I’m currently pursuing a degree in Master of Wireless and Space Engineering and eventually a Phd.