Code Monkey home page Code Monkey logo

Comments (4)

swharden avatar swharden commented on July 22, 2024 1

Maybe something like

print(myAbf._adcSection.fTelegraphAdditGain[0])

The 0 is the ADC channel, and you may need to try several numbers to get it right

from pyabf.

swharden avatar swharden commented on July 22, 2024 1

this work perfectly

Great to hear! 🚀

do you know if is a value I can change?

Interesting question! I don't think so... that is read when the ABF is first loaded, and all the data is loaded and scaled by that value when the class is initialized, so changing it later probably won't have an effect

pyABF/src/pyabf/abf.py

Lines 466 to 484 in 06247e0

def _loadAndScaleData(self, fb: BufferedReader):
"""Load data from the ABF file and scale it by its scaleFactor."""
# read the data from the ABF file
fb.seek(self.dataByteStart)
raw = np.fromfile(fb, dtype=self._dtype, count=self.dataPointCount)
nRows = self.channelCount
nCols = int(self.dataPointCount/self.channelCount)
raw = np.reshape(raw, (nCols, nRows))
raw = np.transpose(raw)
# if data is int, scale it to float32 so we can scale it
self.data = raw.astype(np.float32)
# if the data was originally an int, it must be scaled
if self._dtype == np.int16:
for i in range(self.channelCount):
self.data[i] = np.multiply(self.data[i], self._dataGain[i])
self.data[i] = np.add(self.data[i], self._dataOffset[i])

However you could probably reach in and modify what's in abf.data[channel] based on your needs, then SetSweep() calls later would returned that modified data.

Good luck!

from pyabf.

swharden avatar swharden commented on July 22, 2024

Hi @Asrilioss, this may be possible! It's a lot of info, but if you inspect the ABF header like this you may find the variable name you're looking for:

https://swharden.com/pyabf/tutorial/#inspect-the-abf-header

It will generate a report like: https://github.com/swharden/pyABF/blob/main/data/headers/2020_07_29_0062.md#adcsection

from pyabf.

Asrilioss avatar Asrilioss commented on July 22, 2024

Yeah I just found that I need to look at header I was looking headerV2 but your faster, thanks you for your answers and a fast one, this work perfectly, do you know if is a value I can change ?
Ty

from pyabf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.