.:pbp viewer:home: Difference between revisions

From ADPAA
Jump to navigation Jump to search
No edit summary
 
(17 intermediate revisions by the same user not shown)
Line 4: Line 4:
This program was developed to view and analyze individual particle images produced by airborne probes. This program can theoretically work for any group of particle images as long as the particle file is in a format readable by the program.
This program was developed to view and analyze individual particle images produced by airborne probes. This program can theoretically work for any group of particle images as long as the particle file is in a format readable by the program.


== '''Setup --and Getting Started''' ==
ADPAA and SODA


Individual download can work too. version stored here in this drive. may not be up to date. has sample data though.
== '''Setup''' ==
This program can be accessed via ADPAA, or a copy of the program with premade data lives in this google drive folder https://drive.google.com/drive/folders/1rG3g118HKXCl6g-kCSiHVouZYGq4-ZJS?usp=sharing. The google drive folder may not be consistently updated, so if possible, it's best to access the program through ADPAA so you have access to the most recent version.


Currently works for ... SODA files
To download ADPAA, go to https://sourceforge.net/projects/adpaa/files/. Instructions to set it up are included in the installation (I think, I need to check).
to produce with soda do this
produces .pbp.nc file that can be used


Another important program for the PBP_Viewer is the System for Optical Array Probe Data Analysis (SODA). SODA produces the particle-by-particle files that the PBP_Viewer uses. Expansions to other particle-by-particle file types has not been developed. To download SODA, go to https://github.com/abansemer/soda2. When creating the particle-by-particle file using SODA, make sure to select both the PBP(netCDF) box and the Images(netCDF) box. The "PBP" box creates all the particle attributes, and the "Images" box creates the information needed for individual image files.


== '''How to Use''' ==
== '''Getting Started''' ==
how to run the program
The program can be started multiple ways,
*From an IDE such as Spyder, use the command runfile() in the console panel. E.g. runfile('PBP_Viewer.py', '06222000_232921_HVPS1.pbp.nc')
*The program can also be run from the command line using python,
**If in a directory with the pbp_viewer program file and data file, then you can use ./PBP_Viewer.py 06222000_232921_HVPS1.pbp.nc or python3 PBP_Viewer.py 06222000_232921_HVPS1.pbp.nc
**If ADPAA is installed, you don't need the ./ or python3. The command would look like pbp_viewer.py 06222000_232921_HVPS1.pbp.nc


to get started, you should see a particle images in the bottom left box. to scroll through images, use the << and >>. to exit the program you can click the exit button or the window "X".


To the right of the particle image are three particle attributes. The program initially starts with time, diam, and allin. To change the attributes, click on the "\/" down arrow and you can scroll through the options to pick which attribute you want to see.
Once the program is open, you'll see multiple sections to the gui,


The top left box contains filters. The top dropdown menu allows you to select which particle attribute you want to apply a filter to. The boxes below minimum and maximum are for putting in the minimum value and maximum value for the filter range. eg for time you could do 87510 and 87530 where time is in seconds from midnight and runs over 24 hours/86400 seconds. for something like rejectionflag, you can apply a filter of 0, or 4, etc, or a range from 0 to  4, but you can't do something like 0, 4, and 12, it would have to be 0 through 12. Then click the search button
=== '''Bottom Half of GUI''' ===
    an issue you might run into is that sometimes it's possible to go outside the filter boundaries if the time filter is applied. If this happens, you'll notice a repeating message in the python console that says at max or min boundary. Simply click the arrows in the reverse direction and you will get back to within the filter boundaries.  
*To scroll through images, use the ">>" to move to the next particle and the "<<" button to go to the previous particle.
*The big box on the left is where the particle images are displayed.
*The three dropdown boxes on the right show the particle attributes. To change which attributes are selected, click on the arrow in a dropdown box and scroll until you see the attribute you want displayed and click on it.




The top right box has the particle sorter. I RECOMMEND NOT OPENING IT AT THIS TIME. It has a bug that can mess with the data a bit, so that needs to be fixed before it gets used. The particle sorter allows you to manually create attributes to add to the particle. Once the categories are created, you can load them in and all their data. This makes it possible to flag particles as splatters, or if an image clearly contains two partices, then a flag can be added for that as well. You have to be consistent with category names, so make sure to load them in once they've already been created. This also only supports up to 5 additional categories at this time, make sure not to make more, otherwise the 6th and beyond categories will likely be left out.
=== '''Filter Box''' ===
A 0 means uncategorized, 1 means positively categorized or the particle is true for the category, and 2 means the particle is false for the category and is added as an option if you want to make a distinction between uncategorized and false for the category.
The filter options are in the box in the top left of the window. The first/top dropdown box is to select an attribute to apply a filter to. Once that's selected, the boxes below "Minimum" and "Maximum" are for the lower and upper values for the filter range. If nothing is put in the "Minimum" box, it will default to 0, and if nothing is put in the "Maximum" box, it will default to 99999.
 
Click "Apply Filters" to apply the filters. The program will automatically find the closest particle matching the filter specifications.
 
While the gui remains open, the filters are saved. So, if you apply a time filter of 87510 - 87530, and then apply a diam filter of 2000 - 20000, the program will remember the time filter and make sure to only show particles that meet both the time and diam filter specifications.
 
A current issue: sometimes it is possible to be outside the time filter range. If the console keeps sharing the message "At minimum/maximum filter time boundary", that means you are outside the time filter range. Simply scroll through the particles in the opposite direction to get back into the time filter range and the problem will fix itself.
 
Filter units list,
*time: sfm, e.g. 87510
*diam: um, e.g. 1000
 
=== '''Particle Sorter Box''' ===
The top right section contains the particle sorter.  
 
<span style="font-size:24px;">I RECOMMEND NOT OPENING IT AT THIS TIME</span>
 
The particle sorter has a bug that can mess up it's own data. It's not significant unless it affects a valuable particle, and there's no guarantee it won't. A fix is in progress.
 
The particle sorter allows you to manually create attributes to add to the particles. Once opened, there are multiple things you can do,
 
*add row: When clicked, it will add a row for a new particle category. There is an entry box to add a category name to. The remove and add buttons count down and up, respectively. The initialized 0 will change when these buttons are clicked. The program only allows a 0, 1, and 2. 0 means that the particle is uncategorized. 1 means that the particle is true for the category. 2 means that the particle is false for the category. Up to five rows can be added.
*Loading and Saving Categories: When clicked, the options for saving and loading the categories pop up. Note that this program works with a max of five additional categories.
**To add new categories to the particle-by-particle file, select the "Save Category Names" option. This will initialize the category name in the particle-by-particle file and fill the category with a 0 for every particle.
**To load categories that have already been generated, select the "Load Category Names" option. This will automatically add the rows and fill them in with the category name and the current particle's data (There is an error where the current particle on the screen will be overwritten with 0's for the categories. This will mess up the categorization for the current particle.)
*Toggle Bindings: This turns off the entry boxes with the category names so they can't be typed in, and binds the "12345" and "qwert" keys to the particle sorter. "12345" are linked to the "add" button, and "qwert" are linked to the remove button.  
**Note that typing "12345" or "qwert" in any of the other entry while "Toggle Bindings" is on will erroneously count up or down in the particle sorter.
 




=== '''Frequently Asked Questions (FAQ)''' ===
=== '''Frequently Asked Questions (FAQ)''' ===


'''Questions: Q: How do you ensure that SODA2 create the file used by pbp_viewer?'''
'''Q: How do you ensure that SODA2 create the file used by pbp_viewer?'''
 
Answer: Click on the option to generate a PBP(netCDF) box and the Images(netCDF)
 
'''Q: I downloaded the pbp_viewer file but it won't run?'''
 
Answer: Make sure all the spelling is correct. If the issue persists, try both the ./ and python3 method to run the file. If the issue still persists, type "ls -l" in the directory with the files and verify if the file has excute permissions (an x in the -rwxrwxrwx). If an x isn't there, the use chmod +x PBP_Viewer.py (or whatever the name is if you changed it).
 
'''Q: The program looks weird. Why?'''


Answer: Click the netcdf, then the netcdf image option
Answer: I finished setting up the locations and sizes of everything in the gui on my windows laptop. If running from a linux machine, the graphics are altered a bit and everything is less nicely organized. I'm working on a fix for that.

Latest revision as of 15:43, 18 September 2024

pbp_viewer Graphical Plotting Program

Purpose of Program

This program was developed to view and analyze individual particle images produced by airborne probes. This program can theoretically work for any group of particle images as long as the particle file is in a format readable by the program.


Setup

This program can be accessed via ADPAA, or a copy of the program with premade data lives in this google drive folder https://drive.google.com/drive/folders/1rG3g118HKXCl6g-kCSiHVouZYGq4-ZJS?usp=sharing. The google drive folder may not be consistently updated, so if possible, it's best to access the program through ADPAA so you have access to the most recent version.

To download ADPAA, go to https://sourceforge.net/projects/adpaa/files/. Instructions to set it up are included in the installation (I think, I need to check).

Another important program for the PBP_Viewer is the System for Optical Array Probe Data Analysis (SODA). SODA produces the particle-by-particle files that the PBP_Viewer uses. Expansions to other particle-by-particle file types has not been developed. To download SODA, go to https://github.com/abansemer/soda2. When creating the particle-by-particle file using SODA, make sure to select both the PBP(netCDF) box and the Images(netCDF) box. The "PBP" box creates all the particle attributes, and the "Images" box creates the information needed for individual image files.

Getting Started

The program can be started multiple ways,

  • From an IDE such as Spyder, use the command runfile() in the console panel. E.g. runfile('PBP_Viewer.py', '06222000_232921_HVPS1.pbp.nc')
  • The program can also be run from the command line using python,
    • If in a directory with the pbp_viewer program file and data file, then you can use ./PBP_Viewer.py 06222000_232921_HVPS1.pbp.nc or python3 PBP_Viewer.py 06222000_232921_HVPS1.pbp.nc
    • If ADPAA is installed, you don't need the ./ or python3. The command would look like pbp_viewer.py 06222000_232921_HVPS1.pbp.nc


Once the program is open, you'll see multiple sections to the gui,

Bottom Half of GUI

  • To scroll through images, use the ">>" to move to the next particle and the "<<" button to go to the previous particle.
  • The big box on the left is where the particle images are displayed.
  • The three dropdown boxes on the right show the particle attributes. To change which attributes are selected, click on the arrow in a dropdown box and scroll until you see the attribute you want displayed and click on it.


Filter Box

The filter options are in the box in the top left of the window. The first/top dropdown box is to select an attribute to apply a filter to. Once that's selected, the boxes below "Minimum" and "Maximum" are for the lower and upper values for the filter range. If nothing is put in the "Minimum" box, it will default to 0, and if nothing is put in the "Maximum" box, it will default to 99999.

Click "Apply Filters" to apply the filters. The program will automatically find the closest particle matching the filter specifications.

While the gui remains open, the filters are saved. So, if you apply a time filter of 87510 - 87530, and then apply a diam filter of 2000 - 20000, the program will remember the time filter and make sure to only show particles that meet both the time and diam filter specifications.

A current issue: sometimes it is possible to be outside the time filter range. If the console keeps sharing the message "At minimum/maximum filter time boundary", that means you are outside the time filter range. Simply scroll through the particles in the opposite direction to get back into the time filter range and the problem will fix itself.

Filter units list,

  • time: sfm, e.g. 87510
  • diam: um, e.g. 1000

Particle Sorter Box

The top right section contains the particle sorter.

I RECOMMEND NOT OPENING IT AT THIS TIME

The particle sorter has a bug that can mess up it's own data. It's not significant unless it affects a valuable particle, and there's no guarantee it won't. A fix is in progress.

The particle sorter allows you to manually create attributes to add to the particles. Once opened, there are multiple things you can do,

  • add row: When clicked, it will add a row for a new particle category. There is an entry box to add a category name to. The remove and add buttons count down and up, respectively. The initialized 0 will change when these buttons are clicked. The program only allows a 0, 1, and 2. 0 means that the particle is uncategorized. 1 means that the particle is true for the category. 2 means that the particle is false for the category. Up to five rows can be added.
  • Loading and Saving Categories: When clicked, the options for saving and loading the categories pop up. Note that this program works with a max of five additional categories.
    • To add new categories to the particle-by-particle file, select the "Save Category Names" option. This will initialize the category name in the particle-by-particle file and fill the category with a 0 for every particle.
    • To load categories that have already been generated, select the "Load Category Names" option. This will automatically add the rows and fill them in with the category name and the current particle's data (There is an error where the current particle on the screen will be overwritten with 0's for the categories. This will mess up the categorization for the current particle.)
  • Toggle Bindings: This turns off the entry boxes with the category names so they can't be typed in, and binds the "12345" and "qwert" keys to the particle sorter. "12345" are linked to the "add" button, and "qwert" are linked to the remove button.
    • Note that typing "12345" or "qwert" in any of the other entry while "Toggle Bindings" is on will erroneously count up or down in the particle sorter.


Frequently Asked Questions (FAQ)

Q: How do you ensure that SODA2 create the file used by pbp_viewer?

Answer: Click on the option to generate a PBP(netCDF) box and the Images(netCDF)

Q: I downloaded the pbp_viewer file but it won't run?

Answer: Make sure all the spelling is correct. If the issue persists, try both the ./ and python3 method to run the file. If the issue still persists, type "ls -l" in the directory with the files and verify if the file has excute permissions (an x in the -rwxrwxrwx). If an x isn't there, the use chmod +x PBP_Viewer.py (or whatever the name is if you changed it).

Q: The program looks weird. Why?

Answer: I finished setting up the locations and sizes of everything in the gui on my windows laptop. If running from a linux machine, the graphics are altered a bit and everything is less nicely organized. I'm working on a fix for that.