omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Binary files read and write

    Pythonista
    8
    99
    91746
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ManuelU
      ManuelU last edited by

      @webmaster is there an Android or desktop version of Phytonista?

      dgelessus 1 Reply Last reply Reply Quote 0
      • dgelessus
        dgelessus @ManuelU last edited by

        @ManuelU Yes, it's called Python. ;) Of course Pythonista comes with some third-party modules (like numpy and matplotlib) that are not part of the Python standard library, those need to be installed separately. You can do that using the pip command (pip install numpy), or by installing a Python distribution like Anaconda that includes many third-party libraries. Pythonista-specific modules like ui are of course not available on normal computers.

        1 Reply Last reply Reply Quote 0
        • ManuelU
          ManuelU last edited by

          @CCC the rule of thumb I use to assess if SLOW and FAST SPL VALUES have not been swapped in the cleansing process is that the start time should always be an odd number and the end time should always be an even number. I noticed that it could happen when reviewing a file that started with a NAN and when eliminated the next register, a fast measurement , was taken as a slow measurement. This may happen if you read the values in a 1D vector and then you transform in a 2D matrix

          1 Reply Last reply Reply Quote 0
          • ccc
            ccc last edited by ccc

            @ManuelU When you say even and odd, are you talking about zero-based numbering like Python or one-based numbering like TechBasic? If zero-based then the very first element in the binary file is even. If one-based then the very first element in the binary file is odd. Thus the Python programmer and the TechBasic will not agree about even and odd.

            My current code does not reverse the slow and fast values and it does not detect Infs and NaNs and does no data cleansing.

            The code reads in slow,fast pairs into one long two column array. It the writes the first 1/24 th of that array into the 00h_to_01h.bin file (0h00 to 0h59). It writes the second 1/24th of that array into the 01h_to_02h.bin file (1h00 to 1h59).

            If you would like the code to do something different, please open an issue and I will see what I can do.

            1 Reply Last reply Reply Quote 0
            • ManuelU
              ManuelU last edited by

              @ccc it's one based arrays. If Python is zero based then is right and your script works fine and at an incredible speed for an interpreter.
              I just call your attention on this line of code of your script that is not flagged : t_bad=t[(fast<=0) | (slow <= 0)]. As far as I know, negative SPL readings arise when infinites values are recorded and could happen if you have a telephone call in your iPhone while running the App. I only use iPad with no cellular. It seems that in the latest versions of both Apps this bug has been corrected, but I follow the general principle that no programm is bugless. Thank a lot for you nice attention and your work on this topic.

              1 Reply Last reply Reply Quote 0
              • ManuelU
                ManuelU last edited by

                @dgelessus I downloaded and installed Python Anaconda on my Mac mini OSX Yosemite with no problems, but I don't know where to place my SPLnFFT.bin files to acces them from the @ CCC scripts or where are stored the .py script files. It has a nice and colorful GUI, a good surprise for me, because I thought that it only run with console commands. Thanks in advance for your help and advices.

                1 Reply Last reply Reply Quote 0
                • ccc
                  ccc last edited by

                  import os
                  print(os.path.abspath(os.curdir))
                  
                  1 Reply Last reply Reply Quote 0
                  • ManuelU
                    ManuelU last edited by

                    @CCC the FTP SERVER script work well between iOS devices. I tried to connect from my Mac mini with the "Go -> Connect to Server..." menu item from the Finder using all the possible combinatios from the Connect Window, but there is no way to connect . What I'm doing wrong?. Both devices are in the same local Wifi network.

                    1 Reply Last reply Reply Quote 0
                    • ccc
                      ccc last edited by

                      I use Dropbox to move files from iOS to Mac. Is that a possibility for you?

                      1 Reply Last reply Reply Quote 0
                      • ManuelU
                        ManuelU last edited by

                        @CCC, yes I transferred that way so far , but I learned from the forum that you can transfer all the files stored in the Phytonista sandbox with the FTP Transfer script running in your iOS device and the Connect to Server item from the Mac OS X Finder. The trick is that you have tu use the IP Address insted of the name of your iOS device.and connect by pressing the Guest button in the Mac. You don't need to put the username and password when you transfer between iOS devices

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post
                        Powered by NodeBB Forums | Contributors