This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# coding=utf-8 | |
# Python version of Zach Holman's "spark" | |
# https://github.com/holman/spark | |
# by Stefan van der Walt <stefan@sun.ac.za> | |
""" | |
USAGE: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import numpy as np | |
from diff_rot import * | |
# Reading idl files | |
modes = ['allen','howard','sidereal','synodic'] | |
days = np.arange(0,20,.2) | |
i = 0 | |
fig = plt.figure() | |
for mode in modes: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;set time range: | |
timerange = ['2001-04-15','2001-04-16'] | |
cmd_url = hio_form_hfc_query(timerange=timerange,listname='VIEW_AR_HQI') | |
smart_ars = decode_votable(ssw_hio_query(cmd_url,/verb),/quiet) | |
; we should have the url on the database, but it seems it's not there (I'm taking note for that!!) | |
; but we can work around this way: | |
mdimags=mdi_time2file(timerange[0],timerange[1],/stanford) | |
lab = where(smart_ars[0].filename eq ssw_strsplit(mdimags,'/',/tail),num) | |
sock_copy,mdimags[lab],local_file=filename |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SSW path | |
setenv SSW $HOME/ssw/ssw_local | |
# SSW instrument list | |
setenv SSW_INSTR "gen eit hessi secchi stereo" | |
# Set IDL paths; where you have all your wonderful creations that you will use more than once | |
setenv IDL_PATH "~/Work/IDL:+~/Superlib" | |
# set IDL startup options; Do you have any preferred options in IDL that you want them to load at the beginning? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From the master branch I create one to test Steve pull request | |
git checkout -b steve | |
# I fetch all that ehsteve has in his branch | |
git remote add | |
git fetch -v ehsteve | |
# Merge Steve pull request with master | |
git pull ehsteve master | |
# Run the tests | |
py.test sunpy | |
#!!! 3 of them fails! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cc_lamb2disk,eit_map,s_ch | |
;+ | |
; CC_LAMB2DISK | |
; It converts the chain code of ch structures produced by CHARM from Lambert maps to disk | |
; INPUTS: eit_map -> the map used for the detection (normally EIT or AIA) | |
; s_ch -> the structure saved from CHARM | |
; OUTPUT: new_s_ch -> the same structure than s_ch with the CC updated for all the CHs | |
; EXAMPLE: CHARM_DETECTION | |
; updated_s_ch = cc_lamb2disk(euv_map,s_ch) | |
; ; if I want to plot the new ones |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git remote add keith https://github.com/khughitt/sunpy.git | |
git fetch keith | |
git checkout keith/master | |
git checkout -b keithmaster | |
#modify a file | |
git commit -am "testing update of a pulling request" | |
git push main keithmaster | |
and pull request from github to khughitt/sunpy master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/usr/local/lib/python2.7/dist-packages/astropy/config/configuration.py:432: ConfigurationMissingWarning: Configuration defaults will be used, and configuration cannot be saved due to OSError:Could not find unix home directory to search for astropy config dir | |
warn(ConfigurationMissingWarning(msg)) | |
/usr/local/lib/python2.7/dist-packages/astropy/logger.py:490: RuntimeWarning: log file '' could not be opened for writing: Could not find unix home directory to search for astropy config dir | |
'{1}'.format(log_file_path, unicode(e)), RuntimeWarning) | |
Traceback (most recent call last): | |
File "testastropy.py", line 2, in <module> | |
import astropy | |
File "/usr/local/lib/python2.7/dist-packages/astropy/__init__.py", line 153, in <module> | |
config.configuration.update_default_config(__package__, config_dir) | |
File "/usr/local/lib/python2.7/dist-packages/astropy/config/configuration.py", line 688, in update_default_config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from suds.client import Client | |
import random | |
import astropy.constants as const | |
import numpy as np | |
url = 'http://impex-fp7.fmi.fi/impex/IMPExServer.php?wsdl' | |
client = Client(url) | |
print client #Shows all the methods available and their inputs | |
# getDataPointValue_spacecraft example | |
result = client.service.getDataPointValue_spacecraft(ResourceID="impex://FMI/HWA/HYB/venus/run01_nominal_with_cx/O+_ave_hybstate", Spacecraft_name="VenusExpress", StartTime="2007-01-11T00:00:00", StopTime="2007-01-21T00:00:00", Sampling="600") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rebin_stddev, image, new_xsize, new_ysize, image_small = image_small | |
;+ | |
; rebin_stddev | |
; It just works for making the image smaller by a integer factor (as rebin) | |
; | |
;- | |
dimensions = size(image, /dimensions) | |
number_of_pixels_combined = total(dimensions / float([new_xsize, new_ysize])) | |
; Rebin image to a smaller dimenssion | |
image_small = rebin(image, new_xsize, new_ysize) |
OlderNewer