phockett / epsproc Goto Github PK
View Code? Open in Web Editor NEWPost-processing of ePolyScat calculations
License: GNU General Public License v3.0
Post-processing of ePolyScat calculations
License: GNU General Public License v3.0
For handling matrix elements, esp. for fitting from experimental data, need some proper symmetrization routines. Started this previously, see esp. circa 2016 N2 AF fitting work, code in symm_coeffs_ePS.m
on code distro https://figshare.com/articles/Bootstrapping_to_the_Molecular_Frame_with_Time-domain_Photoionization_Interferometry/4480349
To investigate:
setMatE()
function, 7407ff8 and PEMtk data class a30cc7c101d21329e712baa1bc09a71f3681dc7a - may still need some work and wrapping improvements.Quick additions for QM3
Noticed that xr.copy() isn't deep-copying nested dicts (note xr.copy(deep=True) is default, see https://docs.xarray.dev/en/stable/generated/xarray.DataArray.copy.html).
Fixed for sphRealConvert()
in e2ad5eb, but may need to propagate elsewhere.
E.g.
dataCalc = dataIn.copy() # Works for base attrs dict, but not nested dicts.
dataCalc.attrs = copy.deepcopy(dataIn.attrs) # THIS WORKS ALSO FOR NESTED DICT CASE
TODO: may have also fixed elsewhere? See PEMtk and IO codes for more .attrs handling methods.
TODO: check Xarray versions, tested in 2022.3.0
which is not latest.
See also pydata/xarray#2835
UPDATE: this is an issue in 2022.3.0
, but not in 2022.6.0
.
A few things to do...
To consider, esp. for geomFunc calcs, which are getting a bit overloaded.
Can use Xarray attrs for variables, but these may be dropped during some calcs. What about datasets to consolidate matrix elements and associated properties?
Could also consider a full class to consolidate data + methods.
To do:
geometric_method_dev_low-level_E-fields_200320.ipynb
, plus XeF2 test notebooks & old data processing notebooks.Xarray netCDF functionality: Currently fails with complex data-type issues.
Use HDF5 instead...?
Can also just pickle for now, but not recommended for Xarrays.
Currently have some basics in place, and tried a few methods, for surface plots (see docs, also test local version of notebook).
Data types:
To try/implement:
To revisit/improve:
Things to add...
Currently implemented using Moble's spherical_functions
or Scipy & Sympy.
spherical_functions
(now deprecated) to spherical
package, which supercedes (see https://github.com/moble/spherical).geomFunc.w3jVecMethods
, currently throwing errors in dev env after Numba update (to 0.53.1, although likely just local env inconsistencies - this is for epsdev
on bemo, although pre-update version epsdev-030821
is OK).Add scale-factor propagation to Python code for correct X-sections.
epsproc.classes._IO.matEtoPD()
, which may be missing in some cases too (or use inconsistent settings).Basics now working. Some outstanding todo items:
Method development: see https://trello.com/c/7czxUutK/16-theory-development
Currently using modified Seaborn Clustermap code of lmPlot() routine, looks like this will break for latest Seaborn update (0.10.0) - should look into a better method here.
Currently listed in util.py, but also hard-coded in some functions.
Adding functionality is creating conflicts with dim names, so need to consolidate this and debug.
Propagation of setPolGeoms() labels is also patchy, e.g. missing from wDcalc().
Basics now in place, but a few things still to address...
... and various TODO items in the source.
See 4f53ecb for more.
Failing since last week (Commit: 084227c) for reasons unknown, but seems to be something to do with maths formatting in geomFunc - even though this was working in the prior commit. Build fails at TeX
Edit: actually HTML does seem to be updating, but build is failing at pdflatex stage (even without PDF output set, strangely).
(That makes 100 errors; please try again.) ! ==> Fatal error occurred, no output PDF file produced!
Notes
Issues
Require clearer documentation in the code.
The convention used is as given in Zare's book on angular momentum (http://ca.wiley.com/WileyCDA/WileyTitle/productCd-0471858927.html).
Possibly ongoing issues with checkDims()
and subselectDims()
and Xarray assumptions/versions causing main IO routines to break.
Line 286 in 5cfb04f
Basic interface now in place, see https://epsproc.readthedocs.io/en/dev/demos/ePSdata_download_demo_300720.html
TO do:
Just added EDCS segment support to python code (dev branch).
TO DO:
27/09/19
File IO and data-type support added.
In XR v2022.6 some base IO code is broken, specifically issue(s) with restacking routines (raw data to XR) and/or dropping selected dims?
To do:
(March 2020) adding geomFunc sub-module. This has handling for various output datatypes, which should be consolidated and implemented in older functions (e.g. sphCalc() functions).
Things to do:
For default setting, labels all items on x-axis... which is potentially problematic for new high-res jobs.
Currently using Matplotlib defaults mainly, but setting Seaborn styling for lmPlot(). These are reset at end of routine, although some sticky.
Should decide on this and set globally at init.
For auto-update from sample Jupyter notebooks (so far just used manual HTML output).
Rolling list of things to fix due to changes on back-end libraries:
Some selection routines broken in XR 2022.3.0 (and presumably more recent versions...?).
Issue seems to be with slicing on float indexes, produces key or type errors, but used to work.
For example, slicing ADMs by t-index:
# And for the ADMs...
# SLICE version - was working, but not working July 2022, not sure if it's data types or Xarray version issue? Just get KeyErrors on slice.
# data.selOpts['ADM'] = {} #{'thres': 0.01, 'inds': {'Type':'L', 'Eke':1.1}}
# data.setSubset(dataKey = 'ADM', dataType = 'ADM', sliceParams = {'t':[38, 44, 4]})
#********** HACKS/DEBUG
# Inds/mask version - seems more robust?
# trange=[38, 44] # Set range in ps for calc
# tStep=4 # Set tStep for downsampling
# tMask = (data.data['ADM']['ADM'].t>trange[0]) & (data.data['ADM']['ADM'].t<trange[1])
# data.data[data.subKey]['ADM'] = data.data['ADM']['ADM'][:,tMask][:,::tStep] # Set and update
# print(f"ADMs: Selecting {data.data['subset']['ADM'].t.size} points from {data.data['ADM']['ADM'].t.size}")
Usually due to issues with E points missing in file output (essentially due to text buffer overflow). Needs to be handled in IO functions elegantly - currently just crashes IO.
Some OS/Matlab versions are producing errors at file read for the supplied NO2 demo file (no2_demo_ePS.out). This seems to be an issue with the file encoding leading to cascading read errors, and the exact cause remains to be determined.
Compatibility with recent ePS output files (https://osf.io/psjxt/) seems unaffected.
Handling of degenerate states (it
variable) needs some general though.
Currently:
it
dim working OK in general, but may lead to accidental dropping or neglect of degenerate components.it
>1, resulting in -ve cross-sections (or null values if summed over), although betas seem correct (only tested for N2 orb6/pig case so far). Not yet sure if this is issue in formalism (missing phase or rotation?), assumptions or numerics. Quick fix might be to just set degeneracy factor here?A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.