<p>Just found out this method in casjobs.Previously I came across one SQL code in Stackexchange in which you have to input one ObjID to get its stokes parameters and isoA and isoB values.In sample codes in DR7, you can edit the line which gives Feild values and coordinates to get Stokes parameters(type q_r,u_r in their place). <a href="https://i.sstatic.net/VxDjj.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/VxDjj.png" alt="enter image description here"></a> </p>

<p>From stokes parametres you get the ellipiticity of the galaxy from this equation (which can be done in python.)</p>

<p><span class="math-container">$e  = 1 - \frac{b}{a} = 1 - \frac{1 - \sqrt{Q^2 + U^2}}{1 + \sqrt{Q^2 + U^2}}.
$</span></p>

<p>Note that if you are downloading the Casjobs query data in CSV or excel format,You need to write python code to read the file and apply the formula
<a href="https://dzone.com/articles/python-101-reading-and-writing" rel="nofollow noreferrer">(to learn how to read csv files in python click here)</a></p>

CC BY-SA 4.0
2019-05-17T12:04:16.083Z
2019-05-17T12:04:16.083Z
Krishna K
<p>How to get ellipticities of a list of random galaxies. I saw few programs written in SQL and they were only giving stokes parameters and isophotes values for ONE galaxy(for which we input the ObjID). I am not familiar with syntax of SQL. Is there any method to put the objid in a loop so that the program generates stoke parameters values for a list of galaxies? </p>

CC BY-SA 4.0
2019-05-05T15:08:38.730Z
This question is technically about SQL usage, but given the number of major astronomical databases with public SQL interfaces these days, I think it's on topic.
Mike G
<galaxy><galaxy-cluster>
How to get ellipticities of galaxies from SDSS using casjobs?
Krishna K
# How to get ellipticities of galaxies from SDSS using casjobs?

(Asked by: username_0 on 2019-05-05)

How to get ellipticities of a list of random galaxies. I saw few programs written in SQL and they were only giving stokes parameters and isophotes values for ONE galaxy(for which we input the ObjID). I am not familiar with syntax of SQL. Is there any method to put the objid in a loop so that the program generates stoke parameters values for a list of galaxies?

**Tags:** galaxy, galaxy-cluster

> **Comments:**
> **username_1**: This question is technically about SQL usage, but given the number of major astronomical databases with public SQL interfaces these days, I think it's on topic.  

---

## 1 answers

### Answer by username_0 on 2019-05-17. Score: 2

Just found out this method in casjobs.Previously I came across one SQL code in Stackexchange in which you have to input one ObjID to get its stokes parameters and isoA and isoB values.In sample codes in DR7, you can edit the line which gives Feild values and coordinates to get Stokes parameters(type q\_r,u\_r in their place). [![enter image description here](https://i.sstatic.net/VxDjj.png)](https://i.sstatic.net/VxDjj.png)

From stokes parametres you get the ellipiticity of the galaxy from this equation (which can be done in python.)

$e = 1 - \frac{b}{a} = 1 - \frac{1 - \sqrt{Q^2 + U^2}}{1 + \sqrt{Q^2 + U^2}}.
$

Note that if you are downloading the Casjobs query data in CSV or excel format,You need to write python code to read the file and apply the formula
[(to learn how to read csv files in python click here)](https://dzone.com/articles/python-101-reading-and-writing)


---

