Giter VIP home page Giter VIP logo

Comments (8)

fniekiel avatar fniekiel commented on August 16, 2024

Right now I opt for putting it in a try block. The time tag for a simple series has been pretty much my main focus in the past: in situ heating experiments with time dependent processes.

According to the SER spec the tags seem mandatory and would need to have at least the time information. Could you provide me that test file? I would like to make sure that I did not screw up that version dependent length of things to read in. Apart from that I guess its best to put it in a try block and assign nan if the tag information is missing.

from openncem.

fniekiel avatar fniekiel commented on August 16, 2024

Inserted a try block in fileSER.getTag() to return a tag full with nans, if something goes wrong (branch iss4).

Could you test this fix or send me the file?

from openncem.

ercius avatar ercius commented on August 16, 2024

Sorry for the late reply on this. I answered your other questions and forgot about this one. I think the try block is a good idea. Its nice to have the time tags available if the exist.

Ill test this when I get a chance and send you the file I had trouble with by email for future testing. We probably need to add a few test files of different types (1 image, multi-image, spectra, etc.)

from openncem.

ercius avatar ercius commented on August 16, 2024

I uploaded a test data set which triggers the try: block you added. You will receive an email from Google Drive. Let me know if there is a better way to share this data.

I still get an error when trying to read the non-existent tags (im1.getTag(0)) or run writeEMD(). See below:
TypeError: list indices must be integers or slices, not str

The problem is tag creation should be a dict tag{} not a list tag[]. I pushed a fix and now this tests properly on my series file. We can merge this once you try it @fniekiel.

from openncem.

ercius avatar ercius commented on August 16, 2024

I also had to add try/except blocks to all other instances of getTag in the file. Otherwise, writeEMD() did not work properly. I made the except use time[x,y] = 0 in each case. Im not sure if this is how this should be done. Maybe we should make a "fake" time tag of increasing integers.

from openncem.

fniekiel avatar fniekiel commented on August 16, 2024

Thanks for the help. I have merged the fixes from #3 and #4 to keep working on a single branch. For me it is working with the test file you provided.

I decided to remove the try-except blocks around calls to getTag, as I prefer to handle everything inside getTag. Now getTag will return a tag in either case, but its empty if the TagOffsetArray is bad.

In my initial fix (except for the tag{} problem) I did not consider that some of the entries in TagOffsetArray are zero, such that they do not raise an exception during file reading. It is now checking the TagTypeID and compares it to the one in the file header.

Could you try once more with your test? If it runs ok, I would like to merge iss3+4 to development and release them as version 1.1.2.

from openncem.

ercius avatar ercius commented on August 16, 2024

I just tested iss3+4. It works for me on the 01_Si110_5images_1.ser. I think we can merge this.

from openncem.

fniekiel avatar fniekiel commented on August 16, 2024

merged to development

from openncem.

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.