SWDatabase
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
Functions
readmap2D.module_wso_wso_map2D Namespace Reference

Functions

def get_observation_date
 Get the observation date of a WSO file V0 format. More...
 
def decode_datetime
 In a string formatted as 'CTXXXX:int', return the corresponding datetime. More...
 
def decode_ncar
 In a string formatted as 'CTXXXX:int', decode XXXX. More...
 
def decode_longitude
 In a string formatted as 'CTXXXX:int', decode int. More...
 
def read_v0
 Read a WSO/WSO V0 ascii format file from wso.stanford.edu/synoptic database. More...
 
def read_v1
 Read a WSO-V1-Ascii file an return a Map2D object. More...
 
def write_v1
 Write a Map2D object in an ascii file following format V1: More...
 
def correct_data
 

Function Documentation

def readmap2D.module_wso_wso_map2D.correct_data (   data_map2D)
Convert 2D map from grid1: (72 x 30)
Longitude goes from 2.5 to 357.5 with 5 degree step.
Latitude goes from ]asin(-14.5/15)..asin(-14.5/15)[. 
to grid2: (72 x 36)
Longitude goes ]0,360[ with 5 degree step.
Latitude goes ]-90.,90.[. 
def readmap2D.module_wso_wso_map2D.decode_datetime (   string)

In a string formatted as 'CTXXXX:int', return the corresponding datetime.

Returns
datetime.datetime object

Here is the call graph for this function:

Here is the caller graph for this function:

def readmap2D.module_wso_wso_map2D.decode_longitude (   string)

In a string formatted as 'CTXXXX:int', decode int.

Returns
Float

Here is the caller graph for this function:

def readmap2D.module_wso_wso_map2D.decode_ncar (   string)

In a string formatted as 'CTXXXX:int', decode XXXX.

Returns
Int

Here is the caller graph for this function:

def readmap2D.module_wso_wso_map2D.get_observation_date (   filepath)

Get the observation date of a WSO file V0 format.

Use the function decode_datetime.

Returns
Datetime.datetime object

Here is the call graph for this function:

def readmap2D.module_wso_wso_map2D.read_v0 (   filepath)

Read a WSO/WSO V0 ascii format file from wso.stanford.edu/synoptic database.

Returns
module_map2D.Map2D() object.

WSO V0 ascii format is the following:
Header: some lines
CTXXXX:longitude[0] 6f7.3 /n 8f7.3 /n 8f7.3 /n 8f7.3
...
CTXXXX: longitude[i] 6f7.3 /n 8f7.3 /n 8f7.3 /n 8f7.3
...
CTYYYY:longitude[0] 6f7.3 /n 8f7.3 /n 8f7.3 /n 8f7.3

Where XXXX is a Carrington rotation and YYYY is the following one

Here is the call graph for this function:

def readmap2D.module_wso_wso_map2D.read_v1 (   filename)

Read a WSO-V1-Ascii file an return a Map2D object.

Format V1 for WSO is like this:

  • No header.
  • Data: (nlon x nlat) = (72 x 30). Written on 8 columns with fortran indexing (by column). 8(F10.4) format.
  • Longitude goes from 2.5 to 357.5 with 5 degree step.
  • Latitude goes from ]asin(-14.5/15)..asin(+14.5/15)[.

Translated into python from CORFIELD/dir.src/corfield_read_data.f90.

Todo:
Create format WSO-V2-Ascii with 8(F10.4,1x).
def readmap2D.module_wso_wso_map2D.write_v1 (   data_map2D,
  filename 
)

Write a Map2D object in an ascii file following format V1:

  • No header.
  • Data: (nlon x nlat) = (72 x 30). Written on 8 columns with fortran indexing (by column). 8(F10.4) format.