Git Product home page Git Product logo

nenupy's People

Contributors

alanloh avatar cedricdviou avatar coutouly avatar emiliemauduit avatar julienngirard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nenupy's Issues

Option to 'add' SST objects?

Maybe redefine the add attribute of the SST object class.
If one wants to add a SST observation to a previous one (or list) (as they are hourly files).

intru function to calculate the pointing correction

def pointing_correction(beam_coord):
    """ Pointing correction from a given SkyCoord in altaz.
        :param beam_coord:
            SkyCoord object of the pointing in altaz.
        :type beam_coord: :class: ~astropy.coordinates.sky_coordinate.SkyCoord
        :returns: delta_az and delta_alt in deg
        :rtype: :array of float
    """

    if not (beam_coord.name == 'altaz'):
            print("ERROR: this coord need to be in altaz")

    sav_data = readsav('cor_azel.sav')
    delta_alt_data = sav_data['del_cor']
    delta_az_data = sav_data['daz_cor']
    alt_vevctor = np.linspace(15, 90, 76)
    az_vevctor = np.linspace(0, 360, 361)
    delta_alt_func = interpolate.interp2d(az_vevctor, alt_vevctor, delta_alt_data, kind='cubic')
    delta_az_func = interpolate.interp2d(az_vevctor, alt_vevctor, delta_az_data, kind='cubic')
    delta_alt = delta_alt_func(beam_coord.az.deg, beam_coord.alt.deg)
    delta_az = delta_az_func(beam_coord.az.deg, beam_coord.alt.deg)
    return (delta_alt*u.deg/60., delta_az*u.deg/60.)

SEFD and senstivity

Hello,
I am trying to create a 'noise cube',
while doing so I tried and failed to reproduce the outputs of the SEFD and sensitivity functions.
Even if the formulas are 'simple', I can't find where the difference comes from.
Is it a bug or I forget something in the formula?

import nenupy.instru as NenuTele
from astropy import constants as const

freq = 80 * units.MHz
Tsys = NenuTele.instru.inst_temperature(freq=freq) + NenuTele.instru.sky_temperature(freq=freq)
A = NenuTele.instru.effective_area(miniarrays=0)

tint = 100 * units.s
df = 196000 * units.Hz

print( 'sefd : ', (2 * const.k_B * Tsys / A ).to('Jy') )
print( NenuTele.instru.sefd( freq, antennas=None, miniarrays=0) )

print( 'sensitivity : ', ( 2 * const.k_B * Tsys / ( A*np.sqrt( tint*df )  ) ).to('Jy')  )
print( NenuTele.instru.sensitivity(mode='beamforming', freq=freq, miniarrays=0, dt=tint, df=df) )

sefd formula : 32062.404637411935 Jy
nenupy out : 82062.88146091324 Jy
sensitivity formula : 7.242158994011914 Jy
nenupy out : 18.536115483777987 Jy

stdout redirection in hpx_skymodel does not play well with notebook

There is an stdout redirection in Skymodel.get_sky_model(), to kill some too verbose functions I presume, that prevent print() to work as epxected in the notebook after this function is called. I would suggest to store the current stdout before the verbose function call and restore it after.

Correct UV

Kind of 90 deg rotation in the UV coverage. This seems to be compensated by the image computation.

SST obstart / obstop

SST obstart and obstop are defoned for the whole observation rather than a particular file selected by the user.

TESTANT altazA opening

TESTANT analog pointing file altazA does not have the same structure compared to regular observations.
Make AnalogPointing able to read it.

;========================================================================================
; az cor, el cor : method 'mix'
;YYYY-MM-DD HH:NN:SS  ANA      az            el      az cor        el cor      Frq  el a pointer
2020-11-20T14:16:10Z 0000   180.0184      83.4188   180.3685      83.3130     50MHz   83.3130
2020-11-20T15:16:55Z 0000     0.0000      90.0000     0.0000      90.0000     50MHz   90.0000

HpxSky plot title

Since the release of matplotlib 3.3.3, the title does not appear for HpxSky plots (it was OK with matplotlib 3.2.1).

Parset name

If a SST file starts after midnight, while the obs beginning is before, the parset name can't be found

Add an executable to compute the transit times, elevation crossing times, to be displayed on the VCR

IDL:
idl "cmd_idl_J2000_liste_full.pro" -args 30 43200 40 1 2020-09-09 350.85 58.815
-->
2020-09-09T23:57:40Z 359.98987 78.448215 2020-09-09T18:07:40Z 2020-09-10T05:47:40Z 2020-09-09T11:57:40Z 2020-09-10T11:55:40Z

nenuFAR_J2000_liste_Full, dtsec, ahsec, azel_min1, azel_min2, date1, ra1_2000, dec1_2000, date2, ra2_2000, dec2_2000.....

Donc si j'identifie :
dtsec = 30 secondes de résolution
ahsec = 43200 (12 h en secondes)
azelmin1 = 40 degrés
azelmin2 = 1 degré
date1 = 2020-09-09 --> converti en 2020-09-09 00:00:00
ra1_2000 = 350.85 degrés (RA de Cas A)
dec1_2000 = 58.815 degrés (Dec de Cas A)

courbe popup:
idl "cmd_idl_J2000_Elevation_full.pro" -args 30 43200 2020-09-09 350.85 58.815

les arguments de la ligne de commande IDL pour les élévation 1° et 40° sont
60 43200 40 1 2020-09-08 350.85 58.815
le retour est un tableau de plusieurs lignes de la forme
2020-09-08T00:05:31Z 359.99842 78.448417 2020-09-07T18:15:01Z 2020-09-08T05:56:01Z 2020-09-07T12:05:31Z 2020-09-08T12:05:01Z

transit_date transit_azimuth transit_elevation date_start_40deg_cross date_end_40deg_cross date_start_1deg_cross date_end_1deg_cross

Option to set the the optfreq of the beam squint in AnaBeam

Currently AnaBeam correct for the beam squint, but with a fixed optfreq of 30 MHz, which can be quite extreme correction when observing at higher frequency with an higher optfreq. For example for the NCP (ele 47.4 deg), the correction is 41.75 for optfreq=30 and 46.4 for optfreq=60 (which is what we use for your higher frequencies observation).

Mini-Array list

MA list should rely on the analogic setup, not on the whole instrument configuration.

BST.plotBeam() method and ma list from np.arange()

bst.plotBeam() method fails when ma list is generated from np.arange( N )

>>> malist=np.arange(10)
>>> malist
array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
>>> bst=BSTbeam(ma=malist)

	==== WARNING: MA rotations are set by default ===

	==== WARNING: MA positions are set by default ===

	==== WARNING: MA delays are set by default ===
>>> bst.plotBeam()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/nenupy/beam/bstbeam.py", line 247, in plotBeam
    self.getBeam(**kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/nenupy/beam/bstbeam.py", line 236, in getBeam
    mabeam.getBeam()
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/nenupy/beam/sstbeam.py", line 186, in getBeam
    beam  = PhasedArrayBeam(p=self._antPos(), m=model, a=az, e=el)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/nenupy/beam/sstbeam.py", line 240, in _antPos
    if self.marotation is not None:
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/nenupy/beam/sstbeam.py", line 161, in marotation
    return self._marotation[self.ma]
IndexError: invalid index to scalar variable.

SST print

Do not show azana and elana while printing SST

Mock analog real pointing

The FITS file NenuFAR_thph.fits is too large to be stored on Github. Use a mock object to simulate opening of this file (analog_pointing()) in order to test beam and simulation modules.

Redundant MA number in ma list

e.g

bst=BSTbeam(ma=[1,1,1,2,3,4,5],azdig=45,eldig=30,azana=45,elana=30,freq=50)

will compute the array beam with multiple instances of MA N°1.
==> unique()

Write a `get_jones(time, ra, dec)` method

Write a method to get Jones matrices (2, 2) diagonals as the beam is computed as Stokes I. In order to implement that calculation to DDFacet.
Basically: compute the beam (HealPIX?) and then loop over Facets centers and return the coefficients as diagonal matrices.

BSTbeam and ma list as input

BSTbeam returns error when a python list is provided for parameter "ma".

>>> bst=BSTbeam(ma=range(10))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/nenupy/beam/bstbeam.py", line 40, in __init__
    self._evalkwargs(kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/nenupy/beam/bstbeam.py", line 298, in _evalkwargs
    self.ma         = kwargs.get('ma', None)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/nenupy/beam/bstbeam.py", line 114, in ma
    raise TypeError("\n\t=== Attribute 'ma' should be an array ===")
TypeError:
	=== Attribute 'ma' should be an array ===

estimate the size of the pulsar mode files (FOLD, SINGLE, WAVE, WAVEOLAF)

#---------------------------------------------------------------------
#parameters = "FOLD: --TFOLD=10.737 --DEFARADAY --SRC=J0828+53"

##duration in sec
##nchan
##TFOLD in sec (default is 10.737)
##NPOL (default is 4)
##NBIN (default is 2048)

#if (--ONLYI): NPOL=1

#size = (duration/TFOLD ) * nchan * NPOL * 32 * NBIN/8. # Bytes

#---------------------------------------------------------------------

#parameters = "SINGLE: --SEARCH --DSTIME=128 --DEFARADAY --SRC=J0205+6449"
#parameters = "SINGLE: --SEARCH --SRC=B0531+21 --DSTIME=64 --ONLYI"

##NPOL (default is 4)

#if (--ONLYI): NPOL=1
##DSTIME in sample (default is 128)

#size = 32NPOLnchan*(duration/5.12e-6/DSTIME)/8 # Bytes

#---------------------------------------------------------------------

#parameters = "WAVE:"

##nchan
##duration in sec
#size = 84nchan*(duration/5.12e-6)/8 # Bytes

#---------------------------------------------------------------------

#parameters = "WAVEOLAF:"

#size = 451590 * nchan * duration # Bytes

instru.analog_pointing incompatible with astropy < 4

When using astropy 3.2 I have the following issue when calling analog_pointing:

[...]
File "/home/fmertens/nenucal-cd/lib/python3.6/site-packages/nenupy/beam/beam.py", line 376, in beam_values
az, el = analog_pointing(self.azana, el)
File "/home/fmertens/nenucal-cd/lib/python3.6/site-packages/nenupy/instru/instru.py", line 321, in analog_pointing
phi_idx = (azimuth.value/0.05 - 0.5).astype(int)
AttributeError: 'float' object has no attribute 'astype'

The same code works fine with astropy 4. The issue is that azimuth.value is a python native float object in astropy 3, which do not have a method astype, while in astropy 4 it is a numpy float object which then have a method astype.

One fix would be to change the code that check whatever azimuth/elevation is a scalar to check azimuth.value instead of azimuth.

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.