Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
854a99d
Driver file
Jun 21, 2022
6ee4e4f
Updated readme.md
Jun 21, 2022
fe3d273
Added ability to reset sensor remotely
Jun 24, 2022
5dfe04b
Added digital mask method and a new beam test.
Jul 5, 2022
b4e6d1f
digital mask update method
Jul 5, 2022
32cf72f
Completed beam_test.py
Jul 6, 2022
855d8cb
gitignore
Jul 6, 2022
903c889
Made hit visualisation work
Jul 6, 2022
ebf9d5c
Added revisions from code review, fixed bugs
Jul 7, 2022
ad88713
Sorted out injvoltage
Jul 8, 2022
d9eec0d
Final bug fixes
Jul 14, 2022
d5dab18
Fixed bugs and added loglevel setting from command
Jul 14, 2022
befed0c
Final changes to inital version
Jul 14, 2022
1cdfeaa
Bug fixes from start work
Jul 14, 2022
c786c67
fixed logging
Jul 14, 2022
bec6757
More debugged with minor changes to csv output
Jul 15, 2022
a56b558
Fixed logging, documented readme, cleaned files
Jul 15, 2022
2fc2bb5
readme
Jul 15, 2022
331543b
Created voltagescan
Jul 15, 2022
9d40007
Polished logging
Jul 15, 2022
8318db6
Added a blank mask for ease of use
Jul 19, 2022
4bda03d
Updates
Jul 19, 2022
01f064f
Merge branch 'main' of github.com:Narg3000/astropix-python
Jul 19, 2022
c3057e6
synchronising repos
Jul 19, 2022
7f5859f
Search for min 2 idle bytes to separate hits [hf]
Jul 19, 2022
71f0d86
read out shorter buffer
Jul 21, 2022
7c65143
some example masks
Jul 21, 2022
002100b
Fix injection settings; user-supplied values for analog readout colum…
Jul 21, 2022
6d2c4d4
include extra _ delimiter in name for easier readability
Jul 22, 2022
b37136d
add runtime argument for set length of time per run: -M, --maxtime (-…
Jul 22, 2022
08781d6
vthreshold command line argument takes prescedence over dacvals full …
Jul 25, 2022
3b31dd0
change default errormax value to 100 - dont want runs to end while on…
Jul 25, 2022
dc922bb
Fixed Vthresh setting
Jul 25, 2022
482f535
Merge branch 'main' into lab-work
Narg3000 Jul 27, 2022
5a38af1
Merge pull request #1 from Narg3000/lab-work
Narg3000 Jul 27, 2022
3e897b4
Added new methods pulled from upstream
Jul 29, 2022
6d7cec4
Merge branch 'nic-str-main' into devel
Jul 29, 2022
0fc3624
Update README.md
Narg3000 Aug 2, 2022
e71b7b9
Update README.md
Narg3000 Aug 2, 2022
b955dfa
Merge pull request #3 from Narg3000/devel
Narg3000 Aug 5, 2022
42f96d6
Merge branch 'nic-str:main' into main
Narg3000 Aug 8, 2022
48c2f16
Fix stop injection condition [hf]
Aug 8, 2022
eb46c08
fix injection, set injection and analog independent of digital mask [hf]
Aug 8, 2022
fe065b0
simplify code when no maks is provided
Aug 8, 2022
ddefe63
simplify code
Aug 8, 2022
b2e8213
WIP script to loop over indiviual pixels and record digital data, bas…
Aug 8, 2022
9cc5a6d
Finalize example_loop.py to loop over pixels and enable a single one …
Aug 9, 2022
68a9a6f
code to loop through user-defined range for a single defined DAC; run…
Aug 9, 2022
5fddd12
Clarify default injection is 300mV [AS]
Aug 9, 2022
fefef19
fix naming [AS]
Aug 16, 2022
c6161f8
Merge pull request #4 from nic-str/main
c235labtop Aug 16, 2022
709d15d
reflect changes from most recent merge from Nicolas in astropix.py (s…
Aug 16, 2022
88cefbf
fix mask default - initialize empty array with no enabled pixels if n…
Aug 24, 2022
79e08a4
enable injection pixel if no mask is given so less arguments need be …
Aug 24, 2022
d51d5cb
update README to clarify that running with no mask (-m) results in fu…
Aug 24, 2022
2f367a4
Initialize voltage board immediately upon instantiating astropix obje…
Aug 24, 2022
a24d0a9
update default dacs to optimized values for shorter pulse duration [AS]
Sep 1, 2022
0a0729b
Begin to prepare offline decoding of saved raw data [AS]
Sep 1, 2022
ccccb1b
Offline script to decode saved .log files containing hex bitstreams. …
Sep 2, 2022
5088667
Merge branch 'main' of github.com:nic-str/astropix-python into nic-st…
Sep 6, 2022
71db24e
Merge branch 'nic-str-main'
Sep 6, 2022
21cb340
First testing of YAML configuration on bench - seeing weak analog sig…
Sep 29, 2022
b9c4947
Continued bench testing of yaml config - delete depreciated methods i…
Oct 6, 2022
7364d73
add debug statements for config bits
Oct 6, 2022
3afbcf7
update config files to pass proper number of digital bits - now yml c…
Oct 6, 2022
c2f6b8f
Merge remote-tracking branch 'upstream/main'
Oct 7, 2022
5feda07
remove debug print statement
Oct 7, 2022
f7b2755
Update digitalconfig bit allotment values so config works on GSFC ben…
Oct 7, 2022
9df71e5
actually enable pixels in these config test files
Oct 7, 2022
5a271e0
remove masking input requiring txt files - create mask from yml
Oct 7, 2022
21ceed7
Remove option to supply txt file wtih pixel mask and use from yml ins…
Oct 7, 2022
12c9f27
update README to reflect that txt mask is no longer an input option
Oct 7, 2022
5e8cfb8
remove directory of masks - depreciated by yaml config
Oct 17, 2022
76540e9
rename backend dir to core and retain modules dir for extensions
Oct 17, 2022
d5dcbd7
move asic backend functions back into core asic.py script and out of …
Oct 17, 2022
9684afe
update example scripts for yaml config
Oct 17, 2022
0626153
update bias config or dac config appropriately when called in a run s…
Oct 17, 2022
15fb092
Update decoder clock period to agree with firmware
Oct 20, 2022
675b2c7
Update scripts so yaml config files saved in same out dir as data files
Oct 20, 2022
977fa3f
update readme with clarifier about passing arguments to astropix modu…
Oct 31, 2022
0642595
move wait to before autoopen of nexys board
Nov 15, 2022
620f36c
data collection script for threshold scanning of full array
Nov 15, 2022
42a05b7
clarify language in thresholdScan header about script usage
Nov 16, 2022
ce22e19
example script for running an injection scan over a single pixel
Nov 16, 2022
f5c5d3e
remove comment
Nov 16, 2022
98c8505
add output file naming for injection scan
Nov 16, 2022
3b1ecec
Update default config files - testconfig uses defaults set by Nicolas…
Dec 12, 2022
aa1736b
script to take injection data from a single pixel at a time, scanning…
Dec 12, 2022
6d2baf5
merge updates from nicolas - pending bench testing [AS]
Dec 12, 2022
f147437
[AS] first bench test - add telescope dict to yamls, configure/run ch…
Dec 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,15 @@ cython_debug/

#pylint
.pylint.d/


new-sensor-test.py
astropy_validation.py
test.py
testdat.py
beam_test_inj.py
beam_test_old.py
modules/asic.py
archive/
*.csv
beam_test_play.py
87 changes: 87 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,90 @@ Create links to shared lib:

### Mac
See [FTDI Mac OS X Installation Guide](https://www.ftdichip.com/Support/Documents/InstallGuides/Mac_OS_X_Installation_Guide.pdf) D2XX Driver section from page 10.

# How to use the astropix2 module
Astropix-py is a module with the goal of simplifying and unifying all of the diffrent branches and modulles into a single module which can be easily worked with.
The goal is to provide a simple interface where astropix can be configured, initalized, monitored, and iterfaced with without having to modify source files or copy and paste code from various repositories.

Although we aim to maintain compatibility with older branches, that will not be possible in all cases (for example the asic.py module). When this happens the original files will be preserved to maintain backwards compatibility and directions and information for moving over to the new interface.

## Directions for use:
Must go in this order!!

1. Creating the instance
- After import, call astropix2().
- Usage: `astropix2([none required], clock_period_ns: int, inject: bool)`
- optional arguments:
- clock_period_ns, default 10
- inject, default `False`. When true configures the pixels to accept an injection voltage
2. Initializing voltages
- call `astro.init_voltages([none required] slot, vcal, vsupply, vthreshold, [optional] dacvals)`
- slot: Usually 4, tells chip where the board is
- vcal: calibrated voltage. Usually 0.989
- vsupply: voltage to gecco board, usually 2.7
- vthreshold: ToT threshold voltage. Usually 1.075 ish
- optional, dacvals: if you want to configure the dac values, do that here
3. Initalizing the ASIC
- call `astro.asic_init()`
- Usage: `astro.asic_init(yaml:str, [opt] dac_setup: dict, bias_setup: dict, digital_mask: str)`
- Optional arguments:
- yaml: string of name of configuration .yml file in /config/*.yml. If none given command-line, default set to config/testconfig.yml
- dac_setup: dictionary of values which will be used to change the defalt dac settings. Does not need to have a complete dictionary, only values that you want to change. Default None
- bias_setup: dictionary of values which will be used to change the defalt bias settings. Does not need to have a complete dictionary, only values that you want to change. Default None
- digital_mask: text data of 1s and 0s in a 35x35 grid (newline seperated rows) specifying what pixels are on and off. If not specified chip will be in analog mode
4. Initalizing injector board (optional)
- call `astro.init_injection()`
- Has following options and defaults:
- dac_settings:tuple[int, list[float]] = (2, [0.4, 0.0])
- position: int = 3, position in board, same as slot in init_voltages().
- inj_period:int = 100
- clkdiv:int = 400
- initdelay: int = 10000
- cycle: float = 0
- pulseperset: int = 1
5. enable SPI
- `astro.enable_spi()`
- takes no arguments

Useful methods:

astro.hits_present() --> bool. Are thre any hits on the board currently?

astro.get_readout() --> bytearray. Gets bytestream from the chip

astro.decode_readout(readout, [opt] printer) --> list of dictionaries. Printer prints the decoded values to terminal

astro.write_conf_to_yaml(<outputName>) --> write configuration settings to *.yml

astro.start_injection() and astro.stop_injection() are self explainatory

## Usage of beam_test.py

beam_test.py is a rewritten version of beam_test.py which removes the need for asic.py, and moves most configuration to command arguments.
It has the ability to:
- Save csv files
- Plot hits in real time
- Configure threshold and injection voltages
- Enable digital output based on pixel masks

CAUTION : try not to pass arguments to astropix.py as numpy objects - if looping through a numpy array, typecast to int, float, etc for the argument call or features may not work as intended (ie - pixels may not be activated/deactivated as expected)

Options:
| Argument | Usage | Purpose | Default |
| :--- | :--- | :--- | :--- |
| `-n` `--name` | `-n [SOMESTRING]` | Set additional name to be added to the timestamp in file outputs | None |
| `-o` `--outdir`| `-o [DIRECTORY]` | Directory to save all output files to. Will be created if it doesn't exist. | `./` |
| `-y` `--yaml`| `-y [NAME]` | Name of configuration file, assuming config/*.yml where * is passed. If not specified, uses config/testconfig.yml and disables all pixels | `testconfig` |
| `-c` `--saveascsv` | `-c` | Toggle saving csv files on and off | Does not save csv |
| `-s` `--showhits` | `-s` | Display hits in real time | Off |
| `-p` `--plotsave` | `-p` | Saves real time plots as image files. Stored in outdir. | Does not save plots |
| `-t` `--threshold`| `-t [VOLTAGE]`| Sets digital threshold voltage in mV. | `100mV` |
| `-i` `--inject`| `-i [COL]` | Toggles injection on or off at specified column. Injects 300mV unless specified. | Off|
| `-v` `--vinj` | `-v [VOLTAGE]` | Sets voltage of injection in mV. Does not enable injection. | `300mV` |
| `-M` `--maxruns` | `-M [int]` | Sets the maximum number of readouts the code will process before exiting. | No maximum |
| `-E` `--errormax`| `-E [int]` | Amount of index errors encountered in the decode before the program terminates. | `0` |
| `-a` `--analog` | `-a [COL]` | Enable analog output on specified column | `None` |
| `-L` `--loglevel` | `-L [D,I,E,W,C]`| Loglevel to be stored. Applies to both console and file. Options: D - debug, I - info, E - error, W - warning, C - critical | `I` |
| `--timeit` | `--timeit` | Measures the time it took to decode and store a hitstream. | Off |


Loading