cirada-tools / frion Goto Github PK
View Code? Open in Web Editor NEWIonospheric Faraday rotation correction for Stokes Q/U cubes
License: MIT License
Ionospheric Faraday rotation correction for Stokes Q/U cubes
License: MIT License
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?
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!
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:
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.
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.
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.