Giter VIP home page Giter VIP logo

frion's People

Contributors

alecthomson avatar cameron-van-eck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

frion's Issues

Cannot convert due to missing frame information

Hi @Cameron-Van-Eck ,

I'm trying to run the following prediction:

    times, RMs, theta = predict.calculate_modulation(
        start_time=start_time.fits,
        end_time=end_time.fits,
        freq_array=freq.to(u.Hz).value,
        telescope_location=predict.get_telescope_coordinates('ASKAP'),
        ra=field_data['RA_DEG'],
        dec=field_data['DEC_DEG'],
        timestep=300.0,
        ionexPath=os.path.join(outdir, 'IONEXdata')
    )

But, I'm getting the following error:

2021-08-06 06:37:17     WARN    MeasIERS::findTab (file /code/measures/Measures/MeasIERS.cc, line 387)  Requested data table TAI_UTC cannot be found in the searched directories:
2021-08-06 06:37:17     WARN    MeasIERS::findTab (file /code/measures/Measures/MeasIERS.cc, line 387)+ /usr/share/casacore/data/ephemerides/
2021-08-06 06:37:17     WARN    MeasIERS::findTab (file /code/measures/Measures/MeasIERS.cc, line 387)+ /usr/share/casacore/data/geodetic/
2021-08-06 06:37:17     SEVERE  MeasTable::dUTC(Double) (file /code/measures/Measures/MeasTable.cc, line 4281)  Cannot read leap second table TAI_UTC
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-13-133da31bf1e9> in <module>
----> 1 times, RMs, theta = predict.calculate_modulation(
      2     start_time=start_time.fits,
      3     end_time=end_time.fits,
      4     freq_array=freq.to(u.Hz).value,
      5     telescope_location=predict.get_telescope_coordinates('ASKAP'),

/group/askap/athomson/miniconda3/envs/spice/lib/python3.8/site-packages/FRion/predict.py in calculate_modulation(start_time, end_time, freq_array, telescope_location, ra, dec, timestep, ionexPath)
     79 
     80     #Get RMExract to generate it's RM predictions
---> 81     predictions=RME.getRM(ionexPath=ionexPath, radec=np.deg2rad([ra,dec]), 
     82                           timestep=timestep,
     83                           timerange = timerange,

/group/askap/athomson/miniconda3/envs/spice/lib/python3.8/site-packages/RMextract/getRM.py in getRM(MS, server, prefix, ionexPath, earth_rot, timerange, use_azel, ha_limit, use_filter, **kwargs)
    185               flags[station].append(1)
    186             else:
--> 187                az,el = PosTools.getAzEl(pointing,time,position,ha_limit)
    188                if az==-1 and el==-1:
    189                   return

/group/askap/athomson/miniconda3/envs/spice/lib/python3.8/site-packages/RMextract/PosTools.py in getAzEl(pointing, time, position, ha_limit)
    576     if HAS_PYRAP:
    577         if ha_limit==-1000:
--> 578             azel=radec2azel(pointing[0],pointing[1],time=str(time)+'s',pos=position);
    579             az=azel['m0']['value']
    580             el=azel['m1']['value']

/group/askap/athomson/miniconda3/envs/spice/lib/python3.8/site-packages/RMextract/PosTools.py in radec2azel(ra, dec, time, pos)
    401     me.do_frame(p);
    402     #print ("input radec2azel",phasedir,ra,dec,p,t)
--> 403     azel = me.measure(phasedir,'AZELGEO');
    404     return azel;
    405 

/group/askap/athomson/miniconda3/envs/spice/lib/python3.8/site-packages/casacore/measures/__init__.py in measure(self, v, rf, off)
    118                 if dq.is_quantity(v[key]):
    119                     v[key] = v[key].to_dict()
--> 120         return _measures.measure(self, v, rf, off)
    121 
    122     def direction(self, rf='', v0='0..', v1='90..', off=None):

RuntimeError: Cannot convert due to missing frame information

It looks like some data is missing from casacore, which I installed with conda. Any thoughts on what's going wrong here?

Some hard-coded values

Just found some hard-coded values in calculate_modulation - this means the kwargs timestep and ionexPath are ignored. Assuming this is a bug and not intended!

Simplify interface, allow for PSRFITS, easier RMextract install?

Hi, Cameron. Bryan Gaensler pointed me to this module. Thanks for fixing the doc build.

I am trying to get some RM prediction software working. Probably a smaller/simpler use case than what you are doing since it will be applying it to PSRFITS files rather than CASA ms files, so all of that is handled internally. I just want the prediction.

There are 3 broad issues that I am looking into:

  1. RMextract is proving difficult to install on my M1 Mac. I know many compiled modules are difficult. I think it's due to building the various C/Fortran sub-modules. As far as I can tell, the only one I need is the EMM/WMM, but even that is taking hours. There is a newer (almost) pure python WMM library:
    https://github.com/space-physics/wmm2020
    I suggested it to the RMextract people to see if they have the time to replace what is in their module. Not sure if this is a priority for them or not. I likely don't have time to do that (verify geometry/signs/...) but if you do or find any luck with simplifying the installation, I would be interested to know.

I also have been making some tweaks to RMextract to remove print statements and use a single logging interface. Still not done but it works better.

  1. I wanted a very simple interface that would use more astropy for coordinates, sites, times, etc. Some of that is there in your module but it's a little variable. So I'm working on:
    https://github.com/dlakaplan/simpleRM
    as a separate module. Still not ready, but if it's of interest I'd be happy to somehow move some of this simpler functionality to your module.

  2. Instead of basing things on CASA files, this is for the pulsar case with PSRFITS. I'm using:
    https://github.com/mtlam/PyPulse
    for that interface. Again, still not done, but if it's of interest that could also go into your module.

I realize that this is 3+ issues and a log submission, but I thought it was the easiest way to start a conversation. Thanks.

New pre_download functionality breaks usage

Hey @Cameron-Van-Eck,

Just a heads up that the added pre_download stage (with some other changes) has broken usage if pointing to other servers.

I think the fix should be pretty simple, so I'll open an PR shortly.

Also, just to check, RME.getRM already calls the section:

    ionexf=ionex.get_urllib_IONEXfile(time=start_time.value,prefix=prefix,outpath=ionexPath,overwrite = False)

assert (ionexf!=-1),"RMextract fails to recognize IONEX file."

So think this can be omitted. Is that right? Otherwise, it could be moved into _predownload_CDDIS to be self-contained. Happy to go over that detail in the PR as well.

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.