Python: which module is for reading data from a 2D curve? - python

It is a very difficult problem for me.
For example I have a picture as input file.
Please be noted that I just have this picture and nothing more.
I want to read the data from the blue curve. So that I can eg. input the x and get the y as the result.
As a python beginner, I could also imagine that the module could read the color. So that if I input the x, only the blue y is read.
I would like to know which python module is suitable for such job? Or, if this task is too difficult for python, which programm language is suitble? Thanks for your help!

Related

Can someone please explain librosa.hz_to_svara_h?

I am completely new to this librosa module and also to all this audio editing (Have to learn for assignment).
So my question is that can somebody explain this: librosa.hz_to_svara_h(frequencies, *, Sa, abbr=True, octave=True, unicode=True), I mean I want to know what each parameter stands for if possible in layman's term (if possible). But most importantly, I want to know how to get the frequency from an audio file (.wav format). Is it the same as MFCC or something else.
I read the documentation at https://librosa.org/doc/latest/tutorial.html but couldn't get the entire picture.
Please help.

Breaking Down 3D models up to lines and curves

I'm working on a project to breakdown 3D models but I'm quite lost. I hope you can help me.
I'm getting a 3D model from Autodesk BIM and the format could be native or generic CAD formats (.stp, .igs, .x_t, .stl). Then, I need to "measure" somehow the maximum dimensions to model a raw material body, it will always have the shape of a huge panel. Once I get both bodies, I will get the difference to extract the solids I need to analyze; and, on each of these bodies, I need to extract the faces, and then the lines or curves of each face.
This sounds something really easy to do on a CAD software, but the idea is to automate this process. I was looking into openSCAD, but seems that works only to model geometry and it doesn't handle well imported solids. I'm leaving a picture with the idea of what I need to do in the link below.
So, Any idea how can I do this? which langue and library can help in this project?
I can see this automation possible with a few in between steps:
OpenSCAD can handle differences well, so your "Extract Bodies" seems plausible
1.5 Before going further, you'll have to explain how you "filtered out" the cylinder. Will you do this manually? If you don't, you will have it considered for analysis and have a lot of faces as a result.
I don't think openSCAD provides you a vertex array. However, it can save to .STL, which is kinda easy to parse with the programming language of your choice, you'll have to study .stl file structure a bit (this sounds much more frightening than it is - if you open an stl with an editor you will probably immediately realize what's happening).
Since you've parsed the file, you can now calculate lines with high school math.
This is not an easy, GUI way to do what you ask, but if you have a few skills you'll have your automation, and depending on the amount of your projects it may be worth it.
I have been working in this project, and foundt the library "trimesh" is better to solve this concern. Give it a shot, and save some time.

Making 3d lines with pycollada

I am using QGIS and there is a plugin Qgis2threejs that can accept collada files along with the current map layer and produce three.js output. I am not familiar with collada, but I want to use pycollada to build a set of 3d lines that I can import into the plugin.
I am having a lot of trouble understanding how to do this with pycollada, I don't see many tutorials or examples on the internet, the ones I see are mostly for cubes.
I basically want to know how to build the simplest python script that will create lines if I know the x,y,z coordinates of each point and then write them to the file.
Does anyone know of a tutorial that does this, or something similar.
This lineset test in the repo should give you a good example.
You should also read the Creating A Collada Object section of the docs.

Move data from a MATLAB program to python

I am fairly new to programming, and started programming in python 3. The data I want to analyze have already been processed in a matlab program, and I need to export them. I don't know anything about matlab, and after searching the web I came up with this:
fileID = fopen('VarA.txt','w');
fprintf(fileID,'%.10f \n',data_1(:,1));
fclose(fileID);
fileID = fopen('varB.txt','w');
fprintf(fileID,'%.10f \n',data_1(:,2));
fclose(fileID);
This gives me 2 .txt files with x and y coordinates respectively. I have about 1000 strings (which each contains about 10k datapoints), so this seems like an awful way to do this.
My question is then; how can I export these datasets with an efficient code? For instance: I am writing a dataset to 2 different .txt files which separates the 2 variables, instead of a hash saved in 1 file.
If you are interested in exporting a lot of structured numerical data, i recommend you use the HDF5 functions in matlab to write these, and the corresponding python library to read these.
To simplify the code you showed there, read about dlmwrite in the matlab help.
The way you choose (or via dlmwrite) may sound awful in the beginning, but very often will not really have an impact on the performance.

Using python to analyze a FITS image for a star count

I have several FITS images taken with my telescope and I need help with a python code to analyze the images and obtain a star count for each image. I don't have any code yet because I'm extremely new to python. Any help would be greatly appreciated.
I am not sure how helpful it can be, but the good starting point is
Astropy Docs.
But I think you can just use imstar

Categories

Resources